Commit 5d7a985a authored by Quentin Garchery's avatar Quentin Garchery

hybrid eliminate_if

we continue to use the duplicating version of eliminate_if_term for
atomic formulas but we replace if-then-else with epsilon in Tlet and Tcase
parent b6699186
...@@ -27,8 +27,8 @@ transformation "eliminate_recursion" ...@@ -27,8 +27,8 @@ transformation "eliminate_recursion"
transformation "eliminate_inductive" transformation "eliminate_inductive"
transformation "eliminate_algebraic" transformation "eliminate_algebraic"
transformation "eliminate_literal" transformation "eliminate_literal"
transformation "eliminate_epsilon"
transformation "eliminate_if" transformation "eliminate_if"
transformation "eliminate_epsilon"
transformation "eliminate_let" transformation "eliminate_let"
transformation "split_premise_right" transformation "split_premise_right"
......
...@@ -30,11 +30,11 @@ transformation "eliminate_definition" ...@@ -30,11 +30,11 @@ transformation "eliminate_definition"
transformation "eliminate_inductive" transformation "eliminate_inductive"
transformation "eliminate_algebraic" transformation "eliminate_algebraic"
transformation "eliminate_literal" transformation "eliminate_literal"
transformation "eliminate_epsilon"
(* currently, princess does not support $let and $ite *) (* currently, princess does not support $let and $ite *)
transformation "eliminate_let"
transformation "eliminate_if" transformation "eliminate_if"
transformation "eliminate_epsilon"
transformation "eliminate_let"
transformation "discriminate" transformation "discriminate"
transformation "encoding_smt" transformation "encoding_smt"
......
...@@ -13,6 +13,7 @@ time "why3cpulimit time : %s s" ...@@ -13,6 +13,7 @@ time "why3cpulimit time : %s s"
transformation "inline_trivial" transformation "inline_trivial"
transformation "eliminate_non_struct_recursion" transformation "eliminate_non_struct_recursion"
transformation "eliminate_if" transformation "eliminate_if"
transformation "eliminate_literal"
transformation "eliminate_non_lambda_set_epsilon" transformation "eliminate_non_lambda_set_epsilon"
transformation "eliminate_projections" transformation "eliminate_projections"
transformation "simplify_formula" transformation "simplify_formula"
......
...@@ -17,8 +17,8 @@ transformation "eliminate_definition" ...@@ -17,8 +17,8 @@ transformation "eliminate_definition"
transformation "eliminate_inductive" transformation "eliminate_inductive"
transformation "eliminate_algebraic" transformation "eliminate_algebraic"
transformation "eliminate_literal" transformation "eliminate_literal"
transformation "eliminate_epsilon"
transformation "eliminate_if" transformation "eliminate_if"
transformation "eliminate_epsilon"
transformation "eliminate_let" transformation "eliminate_let"
transformation "simplify_formula" transformation "simplify_formula"
transformation "simplify_unknown_lsymbols" transformation "simplify_unknown_lsymbols"
......
...@@ -7,8 +7,8 @@ fail "\\*\\*\\* \\(.*\\)$" "\\1" ...@@ -7,8 +7,8 @@ fail "\\*\\*\\* \\(.*\\)$" "\\1"
time "why3cpulimit time : %s s" time "why3cpulimit time : %s s"
transformation "eliminate_negative_constants" transformation "eliminate_negative_constants"
transformation "eliminate_epsilon"
transformation "eliminate_if_fmla" transformation "eliminate_if_fmla"
transformation "eliminate_epsilon"
transformation "eliminate_let_fmla" transformation "eliminate_let_fmla"
transformation "simplify_formula" transformation "simplify_formula"
......
...@@ -20,8 +20,8 @@ transformation "eliminate_builtin" ...@@ -20,8 +20,8 @@ transformation "eliminate_builtin"
(*transformation "eliminate_algebraic"*) (*transformation "eliminate_algebraic"*)
(*transformation "eliminate_algebraic_math"*) (*transformation "eliminate_algebraic_math"*)
transformation "eliminate_literal" transformation "eliminate_literal"
transformation "eliminate_epsilon"
(*transformation "eliminate_if"*) (*transformation "eliminate_if"*)
transformation "eliminate_epsilon"
transformation "eliminate_let" transformation "eliminate_let"
(*transformation "split_premise"*) (*transformation "split_premise"*)
......
...@@ -31,8 +31,8 @@ transformation "eliminate_definition" ...@@ -31,8 +31,8 @@ transformation "eliminate_definition"
transformation "eliminate_inductive" transformation "eliminate_inductive"
transformation "eliminate_algebraic" transformation "eliminate_algebraic"
transformation "eliminate_literal" transformation "eliminate_literal"
transformation "eliminate_epsilon"
transformation "eliminate_if" transformation "eliminate_if"
transformation "eliminate_epsilon"
transformation "eliminate_let" transformation "eliminate_let"
transformation "eliminate_negative_constants" (* due to integers, see below *) transformation "eliminate_negative_constants" (* due to integers, see below *)
......
...@@ -19,8 +19,8 @@ transformation "eliminate_definition" ...@@ -19,8 +19,8 @@ transformation "eliminate_definition"
transformation "eliminate_inductive" transformation "eliminate_inductive"
transformation "eliminate_algebraic" transformation "eliminate_algebraic"
transformation "eliminate_literal" transformation "eliminate_literal"
transformation "eliminate_epsilon"
transformation "eliminate_if" transformation "eliminate_if"
transformation "eliminate_epsilon"
transformation "eliminate_let" transformation "eliminate_let"
transformation "simplify_formula" transformation "simplify_formula"
......
...@@ -30,11 +30,11 @@ transformation "eliminate_definition" ...@@ -30,11 +30,11 @@ transformation "eliminate_definition"
transformation "eliminate_inductive" transformation "eliminate_inductive"
transformation "eliminate_algebraic" transformation "eliminate_algebraic"
transformation "eliminate_literal" transformation "eliminate_literal"
transformation "eliminate_epsilon"
(* currently, princess does not support $let and $ite *) (* currently, princess does not support $let and $ite *)
transformation "eliminate_let"
transformation "eliminate_if" transformation "eliminate_if"
transformation "eliminate_epsilon"
transformation "eliminate_let"
transformation "discriminate" transformation "discriminate"
transformation "encoding_smt" transformation "encoding_smt"
......
...@@ -16,8 +16,8 @@ transformation "eliminate_definition" (*_func*) ...@@ -16,8 +16,8 @@ transformation "eliminate_definition" (*_func*)
transformation "eliminate_inductive" transformation "eliminate_inductive"
transformation "eliminate_algebraic" transformation "eliminate_algebraic"
transformation "eliminate_literal" transformation "eliminate_literal"
transformation "eliminate_epsilon"
transformation "eliminate_if" transformation "eliminate_if"
transformation "eliminate_epsilon"
transformation "eliminate_let" transformation "eliminate_let"
transformation "simplify_formula" transformation "simplify_formula"
......
...@@ -22,8 +22,8 @@ transformation "eliminate_definition" ...@@ -22,8 +22,8 @@ transformation "eliminate_definition"
transformation "eliminate_inductive" transformation "eliminate_inductive"
transformation "eliminate_algebraic" transformation "eliminate_algebraic"
transformation "eliminate_literal" transformation "eliminate_literal"
transformation "eliminate_epsilon"
transformation "eliminate_if" transformation "eliminate_if"
transformation "eliminate_epsilon"
transformation "eliminate_let" transformation "eliminate_let"
transformation "discriminate" transformation "discriminate"
......
...@@ -23,8 +23,8 @@ transformation "eliminate_inductive" ...@@ -23,8 +23,8 @@ transformation "eliminate_inductive"
transformation "eliminate_algebraic" transformation "eliminate_algebraic"
transformation "eliminate_literal" transformation "eliminate_literal"
transformation "eliminate_negative_constants" transformation "eliminate_negative_constants"
transformation "eliminate_epsilon"
transformation "eliminate_if" transformation "eliminate_if"
transformation "eliminate_epsilon"
transformation "eliminate_let" transformation "eliminate_let"
transformation "simplify_formula" transformation "simplify_formula"
......
...@@ -10,8 +10,8 @@ transformation "eliminate_definition" ...@@ -10,8 +10,8 @@ transformation "eliminate_definition"
transformation "eliminate_inductive" transformation "eliminate_inductive"
transformation "eliminate_algebraic" transformation "eliminate_algebraic"
transformation "eliminate_literal" transformation "eliminate_literal"
transformation "eliminate_epsilon"
transformation "eliminate_if" transformation "eliminate_if"
transformation "eliminate_epsilon"
transformation "eliminate_let" transformation "eliminate_let"
transformation "discriminate" transformation "discriminate"
......
...@@ -18,8 +18,8 @@ transformation "eliminate_definition" ...@@ -18,8 +18,8 @@ transformation "eliminate_definition"
transformation "eliminate_inductive" transformation "eliminate_inductive"
transformation "eliminate_algebraic" transformation "eliminate_algebraic"
transformation "eliminate_literal" transformation "eliminate_literal"
transformation "eliminate_epsilon"
transformation "eliminate_if" transformation "eliminate_if"
transformation "eliminate_epsilon"
transformation "eliminate_let" transformation "eliminate_let"
transformation "discriminate" transformation "discriminate"
......
...@@ -18,8 +18,8 @@ transformation "eliminate_definition" ...@@ -18,8 +18,8 @@ transformation "eliminate_definition"
transformation "eliminate_inductive" transformation "eliminate_inductive"
transformation "eliminate_algebraic" transformation "eliminate_algebraic"
transformation "eliminate_literal" transformation "eliminate_literal"
transformation "eliminate_epsilon"
transformation "eliminate_if" transformation "eliminate_if"
transformation "eliminate_epsilon"
transformation "eliminate_let" transformation "eliminate_let"
theory BuiltIn theory BuiltIn
......
...@@ -66,11 +66,11 @@ ...@@ -66,11 +66,11 @@
</transf> </transf>
</goal> </goal>
</theory> </theory>
<theory name="Incompleteness"> <theory name="Incompleteness" proved="true">
<goal name="t1"> <goal name="t1" proved="true">
<transf name="destruct_rec" arg1="H"> <transf name="destruct_rec" proved="true" arg1="H">
<goal name="t1.0"> <goal name="t1.0" proved="true">
<proof prover="0" obsolete="true"><result status="valid" time="0.00"/></proof> <proof prover="0"><result status="valid" time="0.00"/></proof>
</goal> </goal>
</transf> </transf>
</goal> </goal>
......
This diff is collapsed.
...@@ -178,6 +178,13 @@ let rec lift_f el acc t0 = ...@@ -178,6 +178,13 @@ let rec lift_f el acc t0 =
(create_param_decl ls :: abst, ax :: axml), t (create_param_decl ls :: abst, ax :: axml), t
in in
acc, t_attr_copy t0 t acc, t_attr_copy t0 t
| Teps _ ->
let vl,tr,t = t_open_lambda t0 in
let acc, t = lift_f el acc t in
let acc, tr = Lists.map_fold_left
(Lists.map_fold_left (lift_f el))
acc tr in
acc, t_attr_copy t0 (t_lambda vl tr t)
| _ -> | _ ->
t_map_fold (lift_f el) acc t0 t_map_fold (lift_f el) acc t0
......
...@@ -43,10 +43,24 @@ let rec elim_t contT t = ...@@ -43,10 +43,24 @@ let rec elim_t contT t =
| _ -> | _ ->
TermTF.t_map_cont elim_t elim_f contT t TermTF.t_map_cont elim_t elim_f contT t
and elim_t_eps t = match t.t_node with
| Tif (f,t1,t2) when t.t_ty <> None ->
let z = create_vsymbol (id_fresh "if_term") (t_type t) in
let tz = t_var z in
let f = elim_f (fun f -> f) f in
let f1 = t_equ tz (elim_t_eps t1) in
let f2 = t_equ tz (elim_t_eps t2) in
t_attr_copy t (t_eps_close z (t_if f f1 f2))
| _ ->
TermTF.t_map elim_t_eps (elim_f (fun f -> f)) t
and elim_f contF f = match f.t_node with and elim_f contF f = match f.t_node with
| Tapp _ | Tlet _ | Tcase _ -> | Tapp _ ->
contF (TermTF.t_map_cont elim_t elim_f (fun f -> f) f) contF (TermTF.t_map_cont elim_t elim_f (fun f -> f) f)
| _ -> TermTF.t_map_cont elim_tr elim_f contF f | Tlet _ | Tcase _ ->
contF (TermTF.t_map elim_t_eps (elim_f (fun f -> f)) f)
| _ ->
TermTF.t_map_cont elim_tr elim_f contF f
(* the only terms we still can meet are the terms in triggers *) (* the only terms we still can meet are the terms in triggers *)
and elim_tr contT t = match t.t_node with and elim_tr contT t = match t.t_node with
......
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