Module Smyth.Endpoint
type error
=
|
ParseError of (Parse.context, Parse.problem) Bark.dead_end list
|
TypeError of Lang.exp * Type.error
|
EvalError of string
|
TimedOut of float
|
NoSolutions
|
PartialNotSubsetFull
The given partial assertions are not a subset of the full assertions.
The type of errors that clients might receive.
type 'a response
= ('a, error) Stdlib.result
The response type that clients will receive.
Solve
type solve_result
=
{
hole_fillings : (Lang.hole_name * Lang.exp) list list;
A list of hole fillings that satisfy the constraints of a sketch.
time_taken : float;
The time taken to produce the valid hole fillings.
}
The result of a successful "solve" operation.
val solve : sketch:string -> solve_result response
solve sketch
tries to return asolve_result
that satisfies the assertions insketch
.
Test
type test_result
=
{
}
The result of a successful "test" operation.
val test : specification:string -> sketch:string -> examples:string -> test_result response
test specification sketch examples
synthesizes hole fillings forsketch
usingexamples
, then tests these hole fillings for validity againstspecification
.In typical use,
specification
andexamples
are lists of assertions, andsketch
is a partially-completed program with no assertions.
val test_assertions : specification:string -> sketch:string -> assertions:(Lang.exp * Lang.exp) list -> test_result response
A convenience wrapper for Test that takes in a list of parsed assertions rather than a string.
Assertion Info
val assertion_info : specification:string -> assertions:string -> (bool * Lang.exp list * Lang.exp) list response
assertion_info specification assertions
returns a list consisting of values(included, [x0, ..., xN], y)
for each assertion inspecification
, which should each be of the formf x0 ... xN == y
.included
is true if and only if the corresponding assertion is also inassertions
.