Skip to content
Snippets Groups Projects
Commit 5a50bfc2 authored by François Bobot's avatar François Bobot
Browse files

[Quant] Keep the substitution during skolemization

parent c43a52f2
No related branches found
No related tags found
No related merge requests found
...@@ -28,3 +28,8 @@ build: [ ...@@ -28,3 +28,8 @@ build: [
] ]
] ]
dev-repo: "git+https://git.frama-c.com/bobot/colibrics.git" dev-repo: "git+https://git.frama-c.com/bobot/colibrics.git"
pin-depends: [
[ "dolmen.0.5~dev" "git+https://github.com/bobot/dolmen.git#for_colibri2" ]
[ "dolmen_type.0.5~dev" "git+https://github.com/bobot/dolmen.git#for_colibri2" ]
[ "dolmen_loop.0.5~dev" "git+https://github.com/bobot/dolmen.git#for_colibri2" ]
]
pin-depends: [
[ "dolmen.0.5~dev" "git+https://github.com/bobot/dolmen.git#for_colibri2" ]
[ "dolmen_type.0.5~dev" "git+https://github.com/bobot/dolmen.git#for_colibri2" ]
[ "dolmen_loop.0.5~dev" "git+https://github.com/bobot/dolmen.git#for_colibri2" ]
]
...@@ -144,7 +144,7 @@ let rec convert ?(subst=Subst.empty) (t : Expr.Term.t) = ...@@ -144,7 +144,7 @@ let rec convert ?(subst=Subst.empty) (t : Expr.Term.t) =
match t.descr with match t.descr with
| Var v -> | Var v ->
begin match Expr.Term.Var.M.find v subst.term with begin match Expr.Term.Var.M.find v subst.term with
| exception Not_found -> invalid_arg "Not_ground" | exception Not_found -> invalid_arg (Fmt.str "Not_ground: %a" Expr.Term.Var.pp v)
| n -> n | n -> n
end end
| App (f, tyargs, args) -> | App (f, tyargs, args) ->
......
(rule (action (with-stdout-to oracle (echo "unsat\n")))) (rule (action (with-stdout-to oracle (echo "unsat\n"))))
(rule (action (with-stdout-to exists.smt2.res (run %{bin:colibri2} --max-step 1300 %{dep:exists.smt2})))) (rule (action (with-stdout-to exists.smt2.res (run %{bin:colibri2} --max-step 1300 %{dep:exists.smt2}))))
(rule (alias runtest) (action (diff oracle exists.smt2.res))) (rule (alias runtest) (action (diff oracle exists.smt2.res)))
(rule (action (with-stdout-to exists2.smt2.res (run %{bin:colibri2} --max-step 1300 %{dep:exists2.smt2}))))
(rule (alias runtest) (action (diff oracle exists2.smt2.res)))
(rule (action (with-stdout-to forall0.smt2.res (run %{bin:colibri2} --max-step 1300 %{dep:forall0.smt2})))) (rule (action (with-stdout-to forall0.smt2.res (run %{bin:colibri2} --max-step 1300 %{dep:forall0.smt2}))))
(rule (alias runtest) (action (diff oracle forall0.smt2.res))) (rule (alias runtest) (action (diff oracle forall0.smt2.res)))
(rule (action (with-stdout-to forall1.smt2.res (run %{bin:colibri2} --max-step 1300 %{dep:forall1.smt2})))) (rule (action (with-stdout-to forall1.smt2.res (run %{bin:colibri2} --max-step 1300 %{dep:forall1.smt2}))))
......
(set-logic ALL)
(assert (not
(forall ((x Real))
(=> (= x 1.0) (forall ((y Real)) (= y (* y x)))))))
(check-sat)
...@@ -159,20 +159,16 @@ let skolemize d (e : Ground.ClosedQuantifier.t) = ...@@ -159,20 +159,16 @@ let skolemize d (e : Ground.ClosedQuantifier.t) =
if not (Base.List.is_empty e.ty_vars) then if not (Base.List.is_empty e.ty_vars) then
invalid_arg "False type quantification"; invalid_arg "False type quantification";
let subst_term = let subst_term =
List.map List.fold_left
(fun v -> (fun acc v ->
let id = Expr.Term.Const.mk v.Expr.name [] [] v.ty in let id = Expr.Term.Const.mk v.Expr.name [] [] v.ty in
let t = Expr.Term.apply id [] [] in let t = Expr.Term.apply id [] [] in
(v, Ground.convert t)) Expr.Term.Var.M.add v (Ground.convert t) acc)
e.term_vars e.subst.term e.term_vars
in in
let n = let n =
Ground.convert Ground.convert
~subst: ~subst:{ Ground.Subst.ty = e.subst.ty; term = subst_term }
{
Ground.Subst.ty = Expr.Ty.Var.M.empty;
term = Expr.Term.Var.M.of_list subst_term;
}
e.body e.body
in in
Egraph.register d n; Egraph.register d n;
......
...@@ -19,14 +19,7 @@ module Divisible ...@@ -19,14 +19,7 @@ module Divisible
let d = a /. m in let d = a /. m in
let t = floor d in let t = floor d in
let f = from_int t in let f = from_int t in
assert { f <=. d <. from_int (t + 1) }; assert { f <=. d <. from_int (t + 1) }
assert { f <=. d <. f +. 1. };
assert { (a /. m) -. 1. <. f <=. a /. m };
assert { ((a /. m) -. 1.) *. m <. f *. m <=. (a /. m) *. m };
assert { ((a /. m) *. m) -. m <. f *. m };
assert { a -. m <. f *. m <=. a };
assert { -. a <=. -. f *. m <. -. a +. m };
assert { 0. <=. a -. f *. m <. m }
predicate ddivisible_using (a b:real) (d:int) = predicate ddivisible_using (a b:real) (d:int) =
a = (from_int d) *. b a = (from_int d) *. b
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment