vstte12_tree_reconstruction: simplified variant

parent 600c68b7
......@@ -76,26 +76,13 @@ module TreeReconstruction
use export Tree
use import list.Length
use import relations.WellFounded
(* termination of build_rec (below) requires a lexicographic order *)
predicate lex (x1 x2: (list int, int)) =
let s1, d1 = x1 in
let s2, d2 = x2 in
length s1 < length s2 ||
length s1 = length s2 &&
match s1, s2 with
| Cons h1 _, Cons h2 _ -> d2 < d1 <= h1 = h2
| _ -> false
end
axiom wflex: well_founded lex
use import list.HdTlNoOpt
exception Failure
(* used to signal the algorithm's failure i.e. there is no tree *)
let rec build_rec (d: int) (s: list int) : (tree, list int)
variant { (s, d) with lex }
variant { length s, hd s - d }
returns { t, s' -> s = depths d t ++ s' }
raises { Failure -> forall t: tree, s' : list int. depths d t ++ s' <> s }
= match s with
......
......@@ -3,9 +3,8 @@
"http://why3.lri.fr/why3session.dtd">
<why3session shape_version="4">
<prover id="0" name="Alt-Ergo" version="2.0.0" timelimit="1" steplimit="0" memlimit="1000"/>
<prover id="1" name="Coq" version="8.7.2" timelimit="5" steplimit="0" memlimit="1000"/>
<prover id="4" name="CVC4" version="1.5" timelimit="5" steplimit="0" memlimit="1000"/>
<prover id="5" name="Coq" version="8.7.1" timelimit="29" steplimit="0" memlimit="0"/>
<prover id="5" name="Coq" version="8.7.1" timelimit="5" steplimit="0" memlimit="1000"/>
<prover id="7" name="Eprover" version="1.8-001" timelimit="5" steplimit="0" memlimit="1000"/>
<prover id="8" name="Z3" version="4.4.1" timelimit="5" steplimit="0" memlimit="1000"/>
<file name="../vstte12_tree_reconstruction.mlw" proved="true">
......@@ -45,28 +44,28 @@
<goal name="VC build_rec" expl="VC for build_rec" proved="true">
<transf name="split_goal_right" proved="true" >
<goal name="VC build_rec.0" expl="exceptional postcondition" proved="true">
<proof prover="0"><result status="valid" time="0.01" steps="12"/></proof>
<proof prover="0"><result status="valid" time="0.01" steps="11"/></proof>
</goal>
<goal name="VC build_rec.1" expl="exceptional postcondition" proved="true">
<proof prover="4"><result status="valid" time="0.06"/></proof>
</goal>
<goal name="VC build_rec.2" expl="postcondition" proved="true">
<proof prover="0"><result status="valid" time="0.01" steps="29"/></proof>
<proof prover="0"><result status="valid" time="0.01" steps="32"/></proof>
</goal>
<goal name="VC build_rec.3" expl="variant decrease" proved="true">
<proof prover="0"><result status="valid" time="0.03" steps="59"/></proof>
<proof prover="0"><result status="valid" time="0.02" steps="9"/></proof>
</goal>
<goal name="VC build_rec.4" expl="variant decrease" proved="true">
<proof prover="0"><result status="valid" time="0.02" steps="71"/></proof>
<proof prover="0"><result status="valid" time="0.03" steps="61"/></proof>
</goal>
<goal name="VC build_rec.5" expl="postcondition" proved="true">
<proof prover="0"><result status="valid" time="0.01" steps="18"/></proof>
<proof prover="0"><result status="valid" time="0.01" steps="17"/></proof>
</goal>
<goal name="VC build_rec.6" expl="exceptional postcondition" proved="true">
<proof prover="1" edited="vstte12_tree_reconstruction_TreeReconstruction_VC_build_rec_1.v"><result status="valid" time="0.48"/></proof>
<proof prover="5" edited="vstte12_tree_reconstruction_TreeReconstruction_VC_build_rec_1.v"><result status="valid" time="0.48"/></proof>
</goal>
<goal name="VC build_rec.7" expl="exceptional postcondition" proved="true">
<proof prover="1" edited="vstte12_tree_reconstruction_TreeReconstruction_VC_build_rec_2.v"><result status="valid" time="0.36"/></proof>
<proof prover="5" edited="vstte12_tree_reconstruction_TreeReconstruction_VC_build_rec_2.v"><result status="valid" time="0.36"/></proof>
</goal>
</transf>
</goal>
......@@ -78,15 +77,15 @@
<goal name="VC harness" expl="VC for harness" proved="true">
<transf name="split_goal_right" proved="true" >
<goal name="VC harness.0" expl="postcondition" proved="true">
<proof prover="1" edited="vstte12_tree_reconstruction_Harness_VC_harness_1.v"><result status="valid" time="0.33"/></proof>
<proof prover="5" edited="vstte12_tree_reconstruction_Harness_VC_harness_1.v"><result status="valid" time="0.33"/></proof>
</goal>
<goal name="VC harness.1" expl="exceptional postcondition" proved="true">
<proof prover="1" edited="vstte12_tree_reconstruction_Harness_VC_harness_2.v"><result status="valid" time="0.35"/></proof>
<proof prover="5" edited="vstte12_tree_reconstruction_Harness_VC_harness_2.v"><result status="valid" time="0.35"/></proof>
</goal>
</transf>
</goal>
<goal name="VC harness2" expl="VC for harness2" proved="true">
<proof prover="1" edited="vstte12_tree_reconstruction_Harness_VC_harness2_1.v"><result status="valid" time="0.49"/></proof>
<proof prover="5" edited="vstte12_tree_reconstruction_Harness_VC_harness2_1.v"><result status="valid" time="0.49"/></proof>
</goal>
</theory>
<theory name="ZipperBasedTermination" proved="true">
......@@ -96,7 +95,7 @@
</theory>
<theory name="ZipperBased" proved="true">
<goal name="forest_depths_append" proved="true">
<proof prover="5" timelimit="10" edited="vstte12_tree_reconstruction_WP_ZipperBased_forest_depths_append_1.v"><result status="valid" time="0.30"/></proof>
<proof prover="5" timelimit="10" memlimit="0" edited="vstte12_tree_reconstruction_WP_ZipperBased_forest_depths_append_1.v"><result status="valid" time="0.30"/></proof>
</goal>
<goal name="g_append" proved="true">
<transf name="induction_ty_lex" proved="true" >
......@@ -127,10 +126,10 @@
</transf>
</goal>
<goal name="key_lemma" proved="true">
<proof prover="5" timelimit="5" memlimit="1000" edited="vstte12_tree_reconstruction_ZipperBased_key_lemma_2.v"><result status="valid" time="0.71"/></proof>
<proof prover="5" edited="vstte12_tree_reconstruction_ZipperBased_key_lemma_2.v"><result status="valid" time="0.71"/></proof>
</goal>
<goal name="right_nil" proved="true">
<proof prover="5" edited="vstte12_tree_reconstruction_WP_ZipperBased_right_nil_1.v"><result status="valid" time="0.42"/></proof>
<proof prover="5" timelimit="29" memlimit="0" edited="vstte12_tree_reconstruction_WP_ZipperBased_right_nil_1.v"><result status="valid" time="0.42"/></proof>
</goal>
<goal name="main_lemma" proved="true">
<proof prover="4" timelimit="1"><result status="valid" time="0.07"/></proof>
......
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