Commit 520e0f12 authored by MARCHE Claude's avatar MARCHE Claude

prover example: fixed all warnings (sometimes with wrong variants...)

parent 46e48687
......@@ -847,8 +847,7 @@ module Impl
use import Firstorder_formula_spec.Spec
use import Types
use import Logic
let rec bind_var_symbol_in_fo_formula "W:diverges:N"
(t:nl_fo_formula int int) (x:int)
let rec bind_var_symbol_in_fo_formula (t:nl_fo_formula int int) (x:int)
(i:int) (ghost fr0:func int (symbol 'b0))
(ghost bnd0:func int (symbol 'b0)) (ghost fr1:func int (fo_term 'b0 'b1))
(ghost bnd1:func int (fo_term 'b0 'b1)) : nl_fo_formula int int
......@@ -1031,8 +1030,7 @@ module Impl
((rename_subst_fo_term bnd1 identity identity)))
end
with bind_var_fo_term_in_fo_formula "W:diverges:N"
(t:nl_fo_formula int int) (x:int)
with bind_var_fo_term_in_fo_formula (t:nl_fo_formula int int) (x:int)
(i:int) (ghost fr0:func int (symbol 'b0))
(ghost bnd0:func int (symbol 'b0)) (ghost fr1:func int (fo_term 'b0 'b1))
(ghost bnd1:func int (fo_term 'b0 'b1)) : nl_fo_formula int int
......@@ -1248,8 +1246,7 @@ module Impl
((rename_subst_fo_term bnd1 identity identity)))
end
let rec unbind_var_symbol_in_fo_formula "W:diverges:N"
(t:nl_fo_formula int int) (i:int)
let rec unbind_var_symbol_in_fo_formula (t:nl_fo_formula int int) (i:int)
(x:nl_symbol int) (ghost fr0:func int (symbol 'b0))
(ghost bnd10:func int (symbol 'b0))
(ghost fr1:func int (fo_term 'b0 'b1))
......@@ -1510,8 +1507,7 @@ module Impl
((rename_subst_symbol bnd20 identity)))
end
with unbind_var_fo_term_in_fo_formula "W:diverges:N"
(t:nl_fo_formula int int) (i:int)
with unbind_var_fo_term_in_fo_formula (t:nl_fo_formula int int) (i:int)
(x:nl_fo_term int int) (ghost fr0:func int (symbol 'b0))
(ghost bnd10:func int (symbol 'b0))
(ghost fr1:func int (fo_term 'b0 'b1))
......
......@@ -367,8 +367,7 @@ module Impl
use import Firstorder_formula_list_spec.Spec
use import Types
use import Logic
let rec bind_var_symbol_in_fo_formula_list "W:diverges:N"
(t:nl_fo_formula_list int int)
let rec bind_var_symbol_in_fo_formula_list (t:nl_fo_formula_list int int)
(x:int) (i:int) (ghost fr0:func int (symbol 'b0))
(ghost bnd0:func int (symbol 'b0)) (ghost fr1:func int (fo_term 'b0 'b1))
(ghost bnd1:func int (fo_term 'b0 'b1)) : nl_fo_formula_list int int
......@@ -421,8 +420,7 @@ module Impl
((rename_subst_fo_term bnd1 identity identity)))
end
with bind_var_fo_term_in_fo_formula_list "W:diverges:N"
(t:nl_fo_formula_list int int)
with bind_var_fo_term_in_fo_formula_list (t:nl_fo_formula_list int int)
(x:int) (i:int) (ghost fr0:func int (symbol 'b0))
(ghost bnd0:func int (symbol 'b0)) (ghost fr1:func int (fo_term 'b0 'b1))
(ghost bnd1:func int (fo_term 'b0 'b1)) : nl_fo_formula_list int int
......@@ -481,8 +479,7 @@ module Impl
((rename_subst_fo_term bnd1 identity identity)))
end
let rec unbind_var_symbol_in_fo_formula_list "W:diverges:N"
(t:nl_fo_formula_list int int)
let rec unbind_var_symbol_in_fo_formula_list (t:nl_fo_formula_list int int)
(i:int) (x:nl_symbol int) (ghost fr0:func int (symbol 'b0))
(ghost bnd10:func int (symbol 'b0))
(ghost fr1:func int (fo_term 'b0 'b1))
......@@ -557,8 +554,7 @@ module Impl
((rename_subst_symbol bnd20 identity)))
end
with unbind_var_fo_term_in_fo_formula_list "W:diverges:N"
(t:nl_fo_formula_list int int)
with unbind_var_fo_term_in_fo_formula_list (t:nl_fo_formula_list int int)
(i:int) (x:nl_fo_term int int) (ghost fr0:func int (symbol 'b0))
(ghost bnd10:func int (symbol 'b0))
(ghost fr1:func int (fo_term 'b0 'b1))
......@@ -657,8 +653,7 @@ module Impl
((rename_subst_fo_term bnd21 identity identity)))
end
let rec subst_base_symbol_in_fo_formula_list "W:diverges:N"
(t:nl_fo_formula_list int int)
let rec subst_base_symbol_in_fo_formula_list (t:nl_fo_formula_list int int)
(x:int) (u:nl_symbol int) (ghost fr0:func int (symbol 'b0))
(ghost bnd10:func int (symbol 'b0))
(ghost fr1:func int (fo_term 'b0 'b1))
......@@ -733,8 +728,7 @@ module Impl
((rename_subst_symbol bnd20 identity)))
end
with subst_base_fo_term_in_fo_formula_list "W:diverges:N"
(t:nl_fo_formula_list int int)
with subst_base_fo_term_in_fo_formula_list (t:nl_fo_formula_list int int)
(x:int) (u:nl_fo_term int int) (ghost fr0:func int (symbol 'b0))
(ghost bnd10:func int (symbol 'b0))
(ghost fr1:func int (fo_term 'b0 'b1))
......
......@@ -156,8 +156,10 @@ module Impl
use import Logic
let rec bind_var_symbol_in_symbol (t:nl_symbol int) (x:int) (i:int)
(ghost fr0:func int (symbol 'b0)) (ghost bnd0:func int (symbol 'b0)) :
nl_symbol int requires { correct_indexes_symbol t }
nl_symbol int
requires { correct_indexes_symbol t }
requires { bound_depth_of_symbol_in_symbol t <= i }
variant { nlsize_symbol t }
ensures { bound_depth_of_symbol_in_symbol result <= i + 1 }
ensures { correct_indexes_symbol result }
ensures { nlmodel_symbol result fr0 bnd0 =
......@@ -172,10 +174,13 @@ module Impl
let rec unbind_var_symbol_in_symbol (t:nl_symbol int) (i:int)
(x:nl_symbol int) (ghost fr0:func int (symbol 'b0))
(ghost bnd10:func int (symbol 'b0)) (ghost bnd20:func int (symbol 'b0)) :
nl_symbol int requires { i >= 0 } requires { correct_indexes_symbol t }
nl_symbol int
requires { i >= 0 }
requires { correct_indexes_symbol t }
requires { bound_depth_of_symbol_in_symbol t <= i + 1 }
requires { correct_indexes_symbol x }
requires { bound_depth_of_symbol_in_symbol x = 0 }
variant { nlsize_symbol t }
ensures { correct_indexes_symbol result }
ensures { bound_depth_of_symbol_in_symbol result <= i }
ensures { nlmodel_symbol result fr0 bnd10 =
......@@ -190,7 +195,8 @@ module Impl
let subst_base_symbol_in_symbol (t:nl_symbol int) (x:int)
(u:nl_symbol int) (ghost fr0:func int (symbol 'b0))
(ghost bnd10:func int (symbol 'b0)) (ghost bnd20:func int (symbol 'b0)) :
nl_symbol int requires { correct_indexes_symbol t }
nl_symbol int
requires { correct_indexes_symbol t }
requires { correct_indexes_symbol u }
requires { bound_depth_of_symbol_in_symbol u = 0 }
ensures { correct_indexes_symbol result }
......
......@@ -576,6 +576,7 @@ module Impl
requires { bound_depth_of_symbol_in_tableau t <= i + 1 }
requires { correct_indexes_symbol x }
requires { bound_depth_of_symbol_in_symbol x = 0 }
variant { nlsize_tableau t }
ensures { correct_indexes_tableau result }
ensures { bound_depth_of_symbol_in_tableau result <= i }
ensures { bound_depth_of_fo_term_in_tableau result =
......@@ -677,6 +678,7 @@ module Impl
requires { correct_indexes_fo_term x }
requires { bound_depth_of_symbol_in_fo_term x = 0 }
requires { bound_depth_of_fo_term_in_fo_term x = 0 }
variant { nlsize_tableau t }
ensures { correct_indexes_tableau result }
ensures { bound_depth_of_fo_term_in_tableau result <= i }
ensures { bound_depth_of_symbol_in_tableau result =
......@@ -808,6 +810,7 @@ module Impl
requires { correct_indexes_tableau t }
requires { correct_indexes_symbol u }
requires { bound_depth_of_symbol_in_symbol u = 0 }
variant { nlsize_tableau t }
ensures { correct_indexes_tableau result }
ensures { bound_depth_of_symbol_in_tableau result =
bound_depth_of_symbol_in_tableau t }
......@@ -909,6 +912,7 @@ module Impl
requires { correct_indexes_fo_term u }
requires { bound_depth_of_symbol_in_fo_term u = 0 }
requires { bound_depth_of_fo_term_in_fo_term u = 0 }
variant { nlsize_tableau t }
ensures { correct_indexes_tableau result }
ensures { bound_depth_of_symbol_in_tableau result =
bound_depth_of_symbol_in_tableau t }
......
......@@ -604,8 +604,7 @@ module Impl
use import Firstorder_term_spec.Spec
use import Types
use import Logic
let rec bind_var_symbol_in_fo_term_list "W:diverges:N"
(t:nl_fo_term_list int int) (x:int)
let rec bind_var_symbol_in_fo_term_list (t:nl_fo_term_list int int) (x:int)
(i:int) (ghost fr0:func int (symbol 'b0))
(ghost bnd0:func int (symbol 'b0)) (ghost fr3:func int (fo_term 'b0 'b3))
(ghost bnd3:func int (fo_term 'b0 'b3)) : nl_fo_term_list int int
......@@ -658,8 +657,7 @@ module Impl
((rename_subst_fo_term bnd3 identity identity)))
end
with bind_var_fo_term_in_fo_term_list "W:diverges:N"
(t:nl_fo_term_list int int) (x:int)
with bind_var_fo_term_in_fo_term_list (t:nl_fo_term_list int int) (x:int)
(i:int) (ghost fr0:func int (symbol 'b0))
(ghost bnd0:func int (symbol 'b0)) (ghost fr3:func int (fo_term 'b0 'b3))
(ghost bnd3:func int (fo_term 'b0 'b3)) : nl_fo_term_list int int
......@@ -718,8 +716,7 @@ module Impl
((rename_subst_fo_term bnd3 identity identity)))
end
with bind_var_symbol_in_fo_term "W:diverges:N"
(t:nl_fo_term int int) (x:int) (i:int)
with bind_var_symbol_in_fo_term (t:nl_fo_term int int) (x:int) (i:int)
(ghost fr0:func int (symbol 'b0)) (ghost bnd0:func int (symbol 'b0))
(ghost fr3:func int (fo_term 'b0 'b3))
(ghost bnd3:func int (fo_term 'b0 'b3)) : nl_fo_term int int
......@@ -771,8 +768,7 @@ module Impl
((rename_subst_fo_term bnd3 identity identity)))
end
with bind_var_fo_term_in_fo_term "W:diverges:N"
(t:nl_fo_term int int) (x:int) (i:int)
with bind_var_fo_term_in_fo_term (t:nl_fo_term int int) (x:int) (i:int)
(ghost fr0:func int (symbol 'b0)) (ghost bnd0:func int (symbol 'b0))
(ghost fr3:func int (fo_term 'b0 'b3))
(ghost bnd3:func int (fo_term 'b0 'b3)) : nl_fo_term int int
......@@ -814,8 +810,7 @@ module Impl
((rename_subst_fo_term bnd3 identity identity)))
end
let rec unbind_var_symbol_in_fo_term_list "W:diverges:N"
(t:nl_fo_term_list int int)
let rec unbind_var_symbol_in_fo_term_list (t:nl_fo_term_list int int)
(i:int) (x:nl_symbol int) (ghost fr0:func int (symbol 'b0))
(ghost bnd10:func int (symbol 'b0))
(ghost fr3:func int (fo_term 'b0 'b3))
......@@ -890,8 +885,7 @@ module Impl
((rename_subst_symbol bnd20 identity)))
end
with unbind_var_fo_term_in_fo_term_list "W:diverges:N"
(t:nl_fo_term_list int int) (i:int)
with unbind_var_fo_term_in_fo_term_list (t:nl_fo_term_list int int) (i:int)
(x:nl_fo_term int int) (ghost fr0:func int (symbol 'b0))
(ghost bnd10:func int (symbol 'b0))
(ghost fr3:func int (fo_term 'b0 'b3))
......@@ -990,8 +984,7 @@ module Impl
((rename_subst_fo_term bnd23 identity identity)))
end
with unbind_var_symbol_in_fo_term "W:diverges:N"
(t:nl_fo_term int int) (i:int)
with unbind_var_symbol_in_fo_term (t:nl_fo_term int int) (i:int)
(x:nl_symbol int) (ghost fr0:func int (symbol 'b0))
(ghost bnd10:func int (symbol 'b0))
(ghost fr3:func int (fo_term 'b0 'b3))
......@@ -1065,8 +1058,7 @@ module Impl
((rename_subst_symbol bnd20 identity)))
end
with unbind_var_fo_term_in_fo_term "W:diverges:N"
(t:nl_fo_term int int) (i:int)
with unbind_var_fo_term_in_fo_term (t:nl_fo_term int int) (i:int)
(x:nl_fo_term int int) (ghost fr0:func int (symbol 'b0))
(ghost bnd10:func int (symbol 'b0))
(ghost fr3:func int (fo_term 'b0 'b3))
......
......@@ -1283,6 +1283,7 @@ module Impl
requires { is_nnf_list l.model_fo_formula_list_field }
requires { is_simpl phi0.model_fo_formula_field }
requires { is_nnf phi0.model_fo_formula_field }
variant { 0 }
ensures { nlimpl_fo_formula_ok result.form }
ensures { is_simpl result.form.model_fo_formula_field }
ensures { is_nnf result.form.model_fo_formula_field }
......@@ -1327,6 +1328,7 @@ module Impl
requires { is_simpl_list l.model_fo_formula_list_field }
requires { is_nnf_list l.model_fo_formula_list_field }
requires { no_existential_list l.model_fo_formula_list_field }
variant { 0 }
ensures { forall m:model int 'st,rho:func int 'st.
formula_list_conj_semantic result.forms.model_fo_formula_list_field m rho
<-> (formula_semantic phi.model_fo_formula_field m rho /\
......@@ -1463,4 +1465,3 @@ module Impl
model_transf = skr.model_transformer_l }*)
end
......@@ -459,7 +459,7 @@ module Impl
formula_semantic phi0.model_fo_formula_field m rhos \/
formula_list_disj_semantic clause.model_fo_formula_list_field m rhos \/
formula_list_disj_semantic remaining.model_fo_formula_list_field m rhos }
diverges
ensures { forall m:model int 'st,rho:func int 'st.
let rhos = semantic_subst result.contradictory_assignment m rho in
not(formula_list_conj_semantic base.model_fo_formula_list_field m rhos) }
......@@ -605,6 +605,7 @@ module Impl
formula_list_disj_semantic clause.model_fo_formula_list_field m rhos \/
formula_list_disj_semantic remaining.model_fo_formula_list_field m rhos }
diverges
ensures { forall m:model int 'st,rho:func int 'st.
let rhos = semantic_subst result.contradictory_assignment m rho in
not(formula_list_conj_semantic base.model_fo_formula_list_field m rhos) }
......@@ -751,6 +752,7 @@ module Impl
formula_list_disj_semantic clsem m rhos <->
formula_list_disj_semantic phil.model_fo_formula_list_field m rhos \/
formula_list_disj_semantic phiacc.model_fo_formula_list_field m rhos }
diverges
ensures { forall m:model int 'st,rho:func int 'st.
let rhos = semantic_subst result.contradictory_assignment m rho in
not(formula_list_conj_semantic base.model_fo_formula_list_field m rhos) }
......@@ -954,6 +956,7 @@ module Impl
let rhos = semantic_subst result.contradictory_assignment m rho in
not(formula_list_conj_semantic base.model_fo_formula_list_field m rhos) }
ensures { precede (old unifb) unifb /\ correct unifb }
diverges
raises { Failure -> precede (old unifb) unifb /\ correct unifb }
=
let basem = base.model_fo_formula_list_field in
......@@ -1120,6 +1123,7 @@ module Impl
let rhos = semantic_subst result.contradictory_assignment m rho in
not(formula_list_conj_semantic base.model_fo_formula_list_field m rhos) }
ensures { precede (old unifb) unifb /\ correct unifb }
diverges
raises { Failure -> precede (old unifb) unifb /\ correct unifb }
=
let tabm = tab.model_tableau_field in
......@@ -1245,6 +1249,7 @@ module Impl
let rhos = semantic_subst result.contradictory_assignment m rho in
not(formula_list_conj_semantic base.model_fo_formula_list_field m rhos) }
ensures { precede (old unifb) unifb /\ correct unifb }
diverges
raises { Failure -> precede (old unifb) unifb /\ correct unifb }
=
let tab0m = tab0.model_tableau_field in
......@@ -1452,6 +1457,7 @@ module Impl
let rhos = semantic_subst result.contradictory_assignment m rho in
not(formula_list_conj_semantic base.model_fo_formula_list_field m rhos) }
ensures { precede (old unifb) unifb /\ correct unifb }
diverges
raises { Failure -> precede (old unifb) unifb /\ correct unifb }
=
let tab0m = tab0.model_tableau_field in
......@@ -1631,6 +1637,7 @@ module Impl
let rhos = semantic_subst result.contradictory_assignment m rho in
not(formula_list_conj_semantic base.model_fo_formula_list_field m rhos) }
ensures { precede (old unifb) unifb /\ correct unifb }
diverges
raises { Failure -> precede (old unifb) unifb /\ correct unifb }
=
if number = 0
......@@ -1655,5 +1662,3 @@ module Impl
end
end
......@@ -41,6 +41,7 @@ module Impl
let main (base:nlimpl_fo_formula_list) (gnum:int) : unit
requires { nlimpl_fo_formula_list_ok base }
diverges
ensures { forall m:model int 'st,rho:func int 'st.
not(formula_list_conj_semantic base.model_fo_formula_list_field m rho) }
raises { Sat -> forall m:model int 'st,rho:func int 'st.
......@@ -53,6 +54,7 @@ module Impl
assert { root.model_tableau_field = Root } ;
let gnum = phip.final_goals_number in
let rec aux (n:int) : prover_return
diverges
returns { { contradictory_assignment = s } ->
forall m:model int 'st,rho:func int 'st.
let rhos = semantic_subst s m rho in
......@@ -90,5 +92,3 @@ module Impl
end
end
......@@ -60,7 +60,7 @@ module Impl
let c0 = construct_symbol (NLCVar_symbol 0) in (* c0 *)
let c1 = construct_symbol (NLCVar_symbol 1) in (* e *)
let neutral = construct_fo_term (NLC_App c1 fotnil) in
let rec aux (v1 v2 v3:nlimpl_fo_term) : nlimpl_fo_formula
let aux (v1 v2 v3:nlimpl_fo_term) : nlimpl_fo_formula
requires { nlimpl_fo_term_ok v1 }
requires { nlimpl_fo_term_ok v2 }
requires { nlimpl_fo_term_ok v3 }
......@@ -325,6 +325,7 @@ module Impl
use import FormulaTransformations.Impl as F
let test () : unit
diverges
raises { F.Sat -> true }
=
(*let fonil = construct_fo_formula_list NLC_FOFNil in
......@@ -353,4 +354,3 @@ module Impl
()
end
......@@ -291,11 +291,12 @@ module Impl
(*requires { it >= 0 }*)
requires { forall y:int. is_fo_term_free_var_in_fo_term y
t.model_fo_term_field -> y >= 0 }
variant { 0 }
(*variant { it , size_fo_term t.model_fo_term_field }*)
ensures { not(is_fo_term_free_var_in_fo_term x
(st t.model_fo_term_field rho.unifier)) }
raises { UnificationFailure (*->
is_fo_term_free_var_in_fo_term x (st t.model_fo_term_field rho.unifier)*) }
(*variant { it , size_fo_term t.model_fo_term_field }*)
=
let tm = t.model_fo_term_field in
let rho0 = rho.unifier in
......@@ -340,12 +341,13 @@ module Impl
(*requires { it >= 0 }*)
requires { forall y:int. is_fo_term_free_var_in_fo_term_list y
t.model_fo_term_list_field -> y >= 0 }
variant { 0 }
(*variant { it , size_fo_term_list t.model_fo_term_list_field }*)
ensures { not(is_fo_term_free_var_in_fo_term_list x
(stl t.model_fo_term_list_field rho.unifier)) }
raises { UnificationFailure (*->
is_fo_term_free_var_in_fo_term_list x
(stl t.model_fo_term_list_field rho.unifier)*) }
(*variant { it , size_fo_term_list t.model_fo_term_list_field }*)
=
let tm = t.model_fo_term_list_field in
let rho0 = rho.unifier in
......@@ -869,6 +871,7 @@ module Impl
(*-> forall s:func int (fo_term int int).
let s' = sc rho.unifier s in
st t1.model_fo_term_field s' <> st t2.model_fo_term_field s'*) }
variant { 0 }
(*variant { S.cardinal s , it1 + it2 ,
size_fo_term t1.model_fo_term_field +
size_fo_term t2.model_fo_term_field }*)
......@@ -1073,6 +1076,7 @@ module Impl
let s' = sc rho.unifier s in
stl t1.model_fo_term_list_field s' <>
stl t2.model_fo_term_list_field s'*) }
variant { 0 }
(*variant { S.cardinal s , it1 + it2 ,
size_fo_term_list t1.model_fo_term_list_field +
size_fo_term_list t2.model_fo_term_list_field }*)
......@@ -1402,4 +1406,3 @@ module Impl
*)
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