Commit fb63f8ba authored by MARCHE Claude's avatar MARCHE Claude

[compute] (in progress) make the maximal number of steps as a parameter

parent bde193f5
......@@ -21,6 +21,13 @@ let meta_rewrite = Theory.register_meta "rewrite" [Theory.MTprsymbol]
let meta_rewrite_def = Theory.register_meta "rewrite_def" [Theory.MTlsymbol]
~desc:"Declares@ the@ definition@ of@ the@ symbol@ as@ as@ rewrite@ rule."
let meta_compute_max_steps = Theory.register_meta "compute_max_steps"
[Theory.MTint]
~desc:"Maximal@ number@ of@ reduction@ steps@ done@ by@ compute@ \
transformation"
let compute_max_steps = ref 1000
(* not yet used
let meta_begin_compute_context =
Theory.register_meta "begin_compute_context" []
......@@ -57,7 +64,7 @@ let normalize_goal p env (prs : Decl.Spr.t) task =
task_known = km;
} ->
let engine = collect_rules p env km prs task in
let f = normalize engine f in
let f = normalize ~limit:!compute_max_steps engine f in
begin match f.t_node with
| Ttrue -> []
| _ ->
......
......@@ -925,7 +925,7 @@ let rec reconstruct c =
(** iterated reductions *)
let normalize ?(limit=1000) engine t0 =
let normalize ~limit engine t0 =
let rec many_steps c n =
match c.value_stack, c.cont_stack with
| [Term t], [] -> t
......
......@@ -105,11 +105,11 @@ val add_rule : Term.term -> engine -> engine
*)
val normalize : ?limit:int -> engine -> Term.term -> Term.term
val normalize : limit:int -> engine -> Term.term -> Term.term
(** [normalize e t] normalizes the term [t] with respect to the engine
[e]
Optional parameter [limit] provides a maximum number of steps for execution.
(default 1000). When limit is reached, the partially reduced term is returned.
parameter [limit] provides a maximum number of steps for execution.
When limit is reached, the partially reduced term is returned.
*)
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