(************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) (* string; rewind : int -> int; goals : unit -> goals; status : unit -> string; inloadpath : string -> bool; mkcases : string -> string list list; } let abstract_eval_call handler explain_exn c = try let res = match c with | Interp (r,b,s) -> Obj.magic (handler.interp (r,b,s)) | Rewind i -> Obj.magic (handler.rewind i) | Goals -> Obj.magic (handler.goals ()) | Status -> Obj.magic (handler.status ()) | InLoadPath s -> Obj.magic (handler.inloadpath s) | MkCases s -> Obj.magic (handler.mkcases s) in Good res with e -> let (l,str) = explain_exn e in Fail (l,str) (** * Debug printing *) let pr_call = function | Interp (r,b,s) -> let raw = if r then "RAW" else "" in let verb = if b then "" else "SILENT" in "INTERP"^raw^verb^" ["^s^"]" | Rewind i -> "REWIND "^(string_of_int i) | Goals -> "GOALS" | Status -> "STATUS" | InLoadPath s -> "INLOADPATH "^s | MkCases s -> "MKCASES "^s let pr_value_gen pr = function | Good v -> "GOOD " ^ pr v | Fail (_,str) -> "FAIL ["^str^"]" let pr_value v = pr_value_gen (fun _ -> "") v let pr_string s = "["^s^"]" let pr_bool b = if b then "true" else "false" let pr_full_value call value = match call with | Interp _ -> pr_value_gen pr_string (Obj.magic value) | Rewind i -> pr_value_gen string_of_int (Obj.magic value) | Goals -> pr_value value (* TODO *) | Status -> pr_value_gen pr_string (Obj.magic value) | InLoadPath s -> pr_value_gen pr_bool (Obj.magic value) | MkCases s -> pr_value value (* TODO *)