diff options
Diffstat (limited to 'lib/drl')
| -rw-r--r-- | lib/drl/ast.ml | 7 | ||||
| -rw-r--r-- | lib/drl/executor.ml | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/drl/ast.ml b/lib/drl/ast.ml index f94965d..2beb010 100644 --- a/lib/drl/ast.ml +++ b/lib/drl/ast.ml @@ -8,6 +8,13 @@ type value = | Bool of bool [@@deriving sexp] +(** Convert an AST value to an AbstractValue.t (Obj.t) via Obj.repr *) +let value_to_abstract : value -> Conventions.AbstractValue.t = function + | Int n -> Obj.repr n + | Float f -> Obj.repr f + | Str s -> Obj.repr s + | Bool b -> Obj.repr b + type direction = Asc | Desc [@@deriving sexp] diff --git a/lib/drl/executor.ml b/lib/drl/executor.ml index 7588b33..27f52c2 100644 --- a/lib/drl/executor.ml +++ b/lib/drl/executor.ml @@ -8,12 +8,7 @@ module Make(Storage : Management.Physical.S) = struct let wrap = Result.map_error (fun e -> AlgebraError e) - (* Convert Ast.value → AbstractValue.t (Obj.t) via Obj.repr *) - let ast_value_to_abstract : Ast.value -> Conventions.AbstractValue.t = function - | Ast.Int n -> Obj.repr n - | Ast.Float f -> Obj.repr f - | Ast.Str s -> Obj.repr s - | Ast.Bool b -> Obj.repr b + let ast_value_to_abstract = Ast.value_to_abstract let rec execute (storage : Storage.t) |
