The solver works ... well at least it compiles
This commit is contained in:
parent
35d0bd817e
commit
8f45228e1d
@ -37,8 +37,9 @@ module Make (T : Utils.Functor) = struct
|
||||
| NErr of 'e
|
||||
| NDo of ('a, 'e) Constraint.t T.t
|
||||
|
||||
let eval : type a e. bool -> env -> (a, e) Constraint.t -> log * env * (a, e) normal_constraint
|
||||
= fun log env0 c0 ->
|
||||
let eval (type a e) ~log (env0 : env) (c0 : (a, e) Constraint.t)
|
||||
: log * env * (a, e) normal_constraint
|
||||
=
|
||||
let add_to_log, get_log =
|
||||
if log then make_logger c0
|
||||
else ignore, (fun _ -> [])
|
||||
@ -90,14 +91,16 @@ module Make (T : Utils.Functor) = struct
|
||||
env := a;
|
||||
add_to_log (!env);
|
||||
NRet (fun _ -> ()) (* We return unit *)
|
||||
| Error(Clash(x,y)) -> NErr (Clash(x,y))
|
||||
| Error(Clash(x,y)) ->
|
||||
let xt,yt = Decode.decode (!env) x, Decode.decode (!env) y in
|
||||
NErr(Clash(xt,yt))
|
||||
| Error(Cycle(x)) -> NErr (Cycle(x))
|
||||
end
|
||||
| Exist(x,s,c) ->
|
||||
env := Unif.Env.add x s !env;
|
||||
add_to_log (!env);
|
||||
evalc c
|
||||
| Decode(v) -> _
|
||||
| Decode(v) -> NRet (fun _ -> Decode.decode (!env) v)
|
||||
| Do(act) -> NDo act
|
||||
in
|
||||
let out = evalc c0 in
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user