Bidir.Interpret
Defines the concrete forwards and backwards interpretation of Types.bidir
.
val lens_of_expr :
Types.expr ->
(Types.state -> Types.value) option
* (Types.value ->
Types.state ->
Types.state)
Constructs an accessor and setter pair for the given expression (i.e., an explicit lens).
The getter may be None
if the expression contains a Types.expr.EWildcard
; wildcard expressions cannot be loaded.
Returned getters and setters may throw. For example, a getter might throw if a required variable is undefined. A setter might throw if its given value does not match the required tuple structure.
val run_bidir :
intr:('a, Types.value) Intrinsics.intrinsic_impl ->
dir:Intrinsics.dir ->
Types.value Lang.Common.StringMap.t ->
'a Types.bidir ->
Types.value Lang.Common.StringMap.t
Executes the given bidirectional program with the given initial state and intrinsic implementation. The program will be executed in forwards or reverse order depending on the specified direction.