Commit c1491413 authored by MARCHE Claude's avatar MARCHE Claude
Browse files

redesign mlw interp in progress

parent 4b850225
......@@ -1582,7 +1582,7 @@ let eval const result =
Mlw_interp.eval_global_term e.S.env
th.Theory.th_known t
in
Pp.sprintf "@[<hov 2>%a@]" Pretty.print_term t
Pp.sprintf "@[<hov 2>%a@]" Mlw_interp.print_value t
| _ ->
Pp.sprintf
"Symbol '%s' is not a constant in theory '%s.%s'"
......
......@@ -532,7 +532,7 @@ let do_theory env drv fname tname th glist elist =
match l with
| [] ->
let t = Mlw_interp.eval_global_term env th.th_known t in
printf "@[<hov 2>Evaluation of %s:@ %a@]@." x Pretty.print_term t
printf "@[<hov 2>Evaluation of %s:@ %a@]@." x Mlw_interp.print_value t
| _ ->
eprintf "Symbol '%s' is not a constant in theory '%s'.@." x tname;
exit 1
......
This diff is collapsed.
......@@ -11,7 +11,11 @@
(* WhyML interpretation *)
val eval_global_term: Env.env -> Decl.known_map -> Term.term -> Term.term
type value
val print_value: Format.formatter -> value -> unit
val eval_global_term: Env.env -> Decl.known_map -> Term.term -> value
type result
......
......@@ -145,6 +145,20 @@ module Ref
let run2 () = f 4000000 (* should be 4613732 *)
let g () : int =
for i=1 to 10 do
let x = ref i in
x := !x + 1
done;
42
let rec h n : int =
let x = ref 0 in
x := !x + 1;
if n = 0 then 0 else h (n-1) + !x
let hh () = h 10
end
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment