updated proof sessions

parent f868ab16
add_list.mlw
arm.mlw
bag.mlw
balance.mlw
bellman_ford.mlw
bignum.mlw
bitcount.mlw
......@@ -12,11 +11,8 @@ bubble_sort.mlw
coincidence_count_list.mlw
conjugate.mlw
counting_sort.mlw
cubic_root.mlw
cursor.mlw
defunctionalization.mlw
dfa_example.mlw
dfs.mlw
dijkstra.mlw
division.mlw
dyck.mlw
......@@ -68,7 +64,6 @@ sum_of_digits.mlw
there_and_back_again.mlw
topological_sorting.mlw
tortoise_and_hare.mlw
toy_compiler.mlw
tree_height.mlw
unraveling_a_card_trick.mlw
vacid_0_build_maze.mlw
......@@ -87,4 +82,3 @@ vstte12_bfs.mlw
vstte12_combinators.mlw
vstte12_ring_buffer.mlw
vstte12_tree_reconstruction.mlw
warshall_algorithm.mlw
......@@ -2,87 +2,21 @@
<!DOCTYPE why3session PUBLIC "-//Why3//proof session v5//EN"
"http://why3.lri.fr/why3session.dtd">
<why3session shape_version="4">
<prover id="1" name="Alt-Ergo" version="0.95.2" timelimit="5" steplimit="0" memlimit="1000"/>
<prover id="2" name="CVC4" version="1.3" timelimit="6" steplimit="0" memlimit="1000"/>
<prover id="3" name="Alt-Ergo" version="0.99.1" timelimit="10" steplimit="0" memlimit="1000"/>
<prover id="0" name="Alt-Ergo" version="1.30" timelimit="5" steplimit="0" memlimit="1000"/>
<file name="../balance.mlw" expanded="true">
<theory name="Roberval" sum="d41d8cd98f00b204e9800998ecf8427e">
</theory>
<theory name="Puzzle8" sum="0ad930ca8d47b3b42120af6c485ef656">
<goal name="WP_parameter solve3" expl="VC for solve3">
<proof prover="1"><result status="valid" time="0.01" steps="41"/></proof>
<proof prover="3"><result status="valid" time="0.02" steps="52"/></proof>
<theory name="Puzzle8" sum="7f1652cea09568acdaad41372734bf8e">
<goal name="VC solve3" expl="VC for solve3">
<proof prover="0"><result status="valid" time="0.02" steps="43"/></proof>
</goal>
<goal name="WP_parameter solve8" expl="VC for solve8">
<transf name="split_goal_wp">
<goal name="WP_parameter solve8.1" expl="1. index in array bounds">
<proof prover="1"><result status="valid" time="0.01" steps="7"/></proof>
<proof prover="3"><result status="valid" time="0.02" steps="7"/></proof>
</goal>
<goal name="WP_parameter solve8.2" expl="2. index in array bounds">
<proof prover="1"><result status="valid" time="0.01" steps="5"/></proof>
<proof prover="3"><result status="valid" time="0.01" steps="5"/></proof>
</goal>
<goal name="WP_parameter solve8.3" expl="3. index in array bounds">
<proof prover="1"><result status="valid" time="0.01" steps="7"/></proof>
<proof prover="3"><result status="valid" time="0.01" steps="7"/></proof>
</goal>
<goal name="WP_parameter solve8.4" expl="4. index in array bounds">
<proof prover="1"><result status="valid" time="0.01" steps="9"/></proof>
<proof prover="3"><result status="valid" time="0.01" steps="9"/></proof>
</goal>
<goal name="WP_parameter solve8.5" expl="5. index in array bounds">
<proof prover="1"><result status="valid" time="0.00" steps="11"/></proof>
<proof prover="3"><result status="valid" time="0.03" steps="11"/></proof>
</goal>
<goal name="WP_parameter solve8.6" expl="6. index in array bounds">
<proof prover="1"><result status="valid" time="0.00" steps="13"/></proof>
<proof prover="3"><result status="valid" time="0.00" steps="13"/></proof>
</goal>
<goal name="WP_parameter solve8.7" expl="7. precondition">
<proof prover="1" timelimit="6"><result status="valid" time="0.03" steps="15"/></proof>
</goal>
<goal name="WP_parameter solve8.8" expl="8. precondition">
<proof prover="1"><result status="valid" time="0.01" steps="18"/></proof>
<proof prover="3"><result status="valid" time="0.01" steps="18"/></proof>
</goal>
<goal name="WP_parameter solve8.9" expl="9. precondition">
<proof prover="1"><result status="valid" time="0.14" steps="78"/></proof>
<proof prover="3"><result status="valid" time="0.02" steps="70"/></proof>
</goal>
<goal name="WP_parameter solve8.10" expl="10. precondition">
<proof prover="1"><result status="valid" time="0.10" steps="18"/></proof>
<proof prover="3"><result status="valid" time="0.04" steps="18"/></proof>
</goal>
<goal name="WP_parameter solve8.11" expl="11. precondition">
<proof prover="1"><result status="valid" time="0.05" steps="97"/></proof>
<proof prover="3"><result status="valid" time="0.16" steps="102"/></proof>
</goal>
<goal name="WP_parameter solve8.12" expl="12. index in array bounds">
<proof prover="1"><result status="valid" time="0.01" steps="21"/></proof>
<proof prover="3"><result status="valid" time="0.01" steps="21"/></proof>
</goal>
<goal name="WP_parameter solve8.13" expl="13. index in array bounds">
<proof prover="1"><result status="valid" time="0.02" steps="20"/></proof>
<proof prover="3"><result status="valid" time="0.02" steps="20"/></proof>
</goal>
<goal name="WP_parameter solve8.14" expl="14. precondition">
<proof prover="1" timelimit="6"><result status="valid" time="0.02" steps="22"/></proof>
</goal>
<goal name="WP_parameter solve8.15" expl="15. postcondition">
<proof prover="1"><result status="valid" time="0.08" steps="82"/></proof>
<proof prover="3"><result status="valid" time="0.13" steps="87"/></proof>
</goal>
<goal name="WP_parameter solve8.16" expl="16. postcondition">
<proof prover="1"><result status="valid" time="0.17" steps="143"/></proof>
<proof prover="3"><result status="valid" time="0.15" steps="155"/></proof>
</goal>
</transf>
<goal name="VC solve8" expl="VC for solve8">
<proof prover="0"><result status="valid" time="0.13" steps="316"/></proof>
</goal>
</theory>
<theory name="Puzzle12" sum="f3b2913c1ab437445d05eb9fa817bcfb" expanded="true">
<goal name="WP_parameter solve12" expl="VC for solve12" expanded="true">
<proof prover="2"><result status="valid" time="0.31"/></proof>
<theory name="Puzzle12" sum="7e2be45b211202222f782659a4a62c5b" expanded="true">
<goal name="VC solve12" expl="VC for solve12" expanded="true">
<proof prover="0"><result status="valid" time="0.53" steps="1365"/></proof>
</goal>
</theory>
</file>
......
......@@ -2,36 +2,34 @@
<!DOCTYPE why3session PUBLIC "-//Why3//proof session v5//EN"
"http://why3.lri.fr/why3session.dtd">
<why3session shape_version="4">
<prover id="0" name="CVC4" version="1.4" timelimit="6" steplimit="0" memlimit="1000"/>
<prover id="1" name="Alt-Ergo" version="1.01" timelimit="6" steplimit="0" memlimit="1000"/>
<prover id="2" name="Z3" version="4.4.0" timelimit="6" steplimit="0" memlimit="1000"/>
<prover id="3" name="Alt-Ergo" version="1.30" timelimit="5" steplimit="0" memlimit="1000"/>
<file name="../cubic_root.mlw" expanded="true">
<theory name="CubicRoot" sum="7ca1d5866200b8590943317a70148ff0" expanded="true">
<goal name="WP_parameter cubic_root" expl="VC for cubic_root" expanded="true">
<theory name="CubicRoot" sum="8ab136846cb3da7a7afcbaae95dbe091" expanded="true">
<goal name="VC cubic_root" expl="VC for cubic_root" expanded="true">
<transf name="split_goal_wp" expanded="true">
<goal name="WP_parameter cubic_root.1" expl="1. loop invariant init" expanded="true">
<proof prover="1"><result status="valid" time="0.00" steps="2"/></proof>
<goal name="VC cubic_root.1" expl="1. loop invariant init">
<proof prover="3"><result status="valid" time="0.00" steps="3"/></proof>
</goal>
<goal name="WP_parameter cubic_root.2" expl="2. loop invariant init" expanded="true">
<proof prover="1"><result status="valid" time="0.01" steps="2"/></proof>
<goal name="VC cubic_root.2" expl="2. loop invariant init">
<proof prover="3"><result status="valid" time="0.00" steps="3"/></proof>
</goal>
<goal name="WP_parameter cubic_root.3" expl="3. loop invariant init" expanded="true">
<proof prover="1"><result status="valid" time="0.00" steps="1"/></proof>
<goal name="VC cubic_root.3" expl="3. loop invariant init">
<proof prover="3"><result status="valid" time="0.00" steps="2"/></proof>
</goal>
<goal name="WP_parameter cubic_root.4" expl="4. loop invariant preservation" expanded="true">
<proof prover="1"><result status="valid" time="0.01" steps="8"/></proof>
<goal name="VC cubic_root.4" expl="4. loop variant decrease">
<proof prover="3"><result status="valid" time="0.00" steps="9"/></proof>
</goal>
<goal name="WP_parameter cubic_root.5" expl="5. loop invariant preservation" expanded="true">
<proof prover="0"><result status="valid" time="0.01"/></proof>
<goal name="VC cubic_root.5" expl="5. loop invariant preservation">
<proof prover="3"><result status="valid" time="0.00" steps="9"/></proof>
</goal>
<goal name="WP_parameter cubic_root.6" expl="6. loop invariant preservation" expanded="true">
<proof prover="0"><result status="valid" time="0.01"/></proof>
<goal name="VC cubic_root.6" expl="6. loop invariant preservation">
<proof prover="3"><result status="valid" time="0.00" steps="11"/></proof>
</goal>
<goal name="WP_parameter cubic_root.7" expl="7. loop variant decrease" expanded="true">
<proof prover="2"><result status="valid" time="0.03"/></proof>
<goal name="VC cubic_root.7" expl="7. loop invariant preservation">
<proof prover="3"><result status="valid" time="0.00" steps="9"/></proof>
</goal>
<goal name="WP_parameter cubic_root.8" expl="8. postcondition" expanded="true">
<proof prover="1"><result status="valid" time="0.00" steps="5"/></proof>
<goal name="VC cubic_root.8" expl="8. postcondition">
<proof prover="3"><result status="valid" time="0.00" steps="6"/></proof>
</goal>
</transf>
</goal>
......
......@@ -2,107 +2,45 @@
<!DOCTYPE why3session PUBLIC "-//Why3//proof session v5//EN"
"http://why3.lri.fr/why3session.dtd">
<why3session shape_version="4">
<prover id="0" name="Alt-Ergo" version="1.30" timelimit="5" steplimit="0" memlimit="1000"/>
<prover id="13" name="Alt-Ergo" version="0.99.1" timelimit="6" steplimit="0" memlimit="1000"/>
<prover id="18" name="Z3" version="4.3.2" timelimit="15" steplimit="0" memlimit="1000"/>
<file name="../dfs.mlw" expanded="true">
<theory name="DFS" sum="f30cfdc8f980d8ec0f281573e7aff648" expanded="true">
<goal name="WP_parameter dfs" expl="VC for dfs">
<transf name="split_goal_wp">
<goal name="WP_parameter dfs.1" expl="1. precondition">
<proof prover="13"><result status="valid" time="0.01" steps="14"/></proof>
</goal>
<goal name="WP_parameter dfs.2" expl="2. precondition">
<proof prover="13"><result status="valid" time="0.01" steps="11"/></proof>
</goal>
<goal name="WP_parameter dfs.3" expl="3. precondition">
<proof prover="13"><result status="valid" time="0.00" steps="10"/></proof>
</goal>
<goal name="WP_parameter dfs.4" expl="4. precondition">
<proof prover="13"><result status="valid" time="0.02" steps="12"/></proof>
</goal>
<goal name="WP_parameter dfs.5" expl="5. precondition">
<proof prover="13"><result status="valid" time="0.01" steps="12"/></proof>
</goal>
<goal name="WP_parameter dfs.6" expl="6. precondition">
<proof prover="13"><result status="valid" time="0.02" steps="20"/></proof>
</goal>
<goal name="WP_parameter dfs.7" expl="7. postcondition">
<proof prover="13"><result status="valid" time="0.08" steps="140"/></proof>
</goal>
<goal name="WP_parameter dfs.8" expl="8. postcondition">
<proof prover="13"><result status="valid" time="0.02" steps="22"/></proof>
</goal>
<goal name="WP_parameter dfs.9" expl="9. postcondition">
<proof prover="13"><result status="valid" time="0.01" steps="20"/></proof>
</goal>
<goal name="WP_parameter dfs.10" expl="10. postcondition">
<proof prover="13"><result status="valid" time="0.01" steps="21"/></proof>
</goal>
<goal name="WP_parameter dfs.11" expl="11. postcondition">
<proof prover="13"><result status="valid" time="0.01" steps="16"/></proof>
</goal>
<goal name="WP_parameter dfs.12" expl="12. postcondition">
<proof prover="13"><result status="valid" time="0.01" steps="5"/></proof>
</goal>
<goal name="WP_parameter dfs.13" expl="13. postcondition">
<proof prover="13"><result status="valid" time="0.00" steps="5"/></proof>
</goal>
<goal name="WP_parameter dfs.14" expl="14. postcondition">
<proof prover="13"><result status="valid" time="0.01" steps="5"/></proof>
</goal>
<goal name="WP_parameter dfs.15" expl="15. postcondition">
<proof prover="13"><result status="valid" time="0.01" steps="4"/></proof>
</goal>
<goal name="WP_parameter dfs.16" expl="16. postcondition">
<proof prover="13"><result status="valid" time="0.01" steps="4"/></proof>
</goal>
<goal name="WP_parameter dfs.17" expl="17. postcondition">
<proof prover="13"><result status="valid" time="0.01" steps="4"/></proof>
</goal>
</transf>
<theory name="DFS" sum="cdb9707509e7905f47e21dafd737aaf0" expanded="true">
<goal name="VC null" expl="VC for null" expanded="true">
<proof prover="0"><result status="valid" time="0.00" steps="3"/></proof>
</goal>
<goal name="VC root" expl="VC for root" expanded="true">
<proof prover="0"><result status="valid" time="0.00" steps="3"/></proof>
</goal>
<goal name="VC set" expl="VC for set" expanded="true">
<proof prover="0"><result status="valid" time="0.00" steps="14"/></proof>
</goal>
<goal name="VC dfs" expl="VC for dfs" expanded="true">
<proof prover="0"><result status="valid" time="0.36" steps="1459"/></proof>
</goal>
<goal name="reformulation">
<transf name="induction_pr">
<goal name="reformulation.1" expl="1.">
<transf name="simplify_trivial_quantification">
<goal name="reformulation.1.1" expl="1.">
<proof prover="13"><result status="valid" time="0.00" steps="3"/></proof>
<proof prover="0"><result status="valid" time="0.00" steps="6"/></proof>
<proof prover="13" obsolete="true"><result status="valid" time="0.00" steps="3"/></proof>
</goal>
</transf>
</goal>
<goal name="reformulation.2" expl="2.">
<transf name="simplify_trivial_quantification">
<goal name="reformulation.2.1" expl="1.">
<proof prover="18"><result status="valid" time="0.00"/></proof>
<proof prover="0"><result status="valid" time="0.00" steps="13"/></proof>
<proof prover="18" obsolete="true"><result status="valid" time="0.00"/></proof>
</goal>
</transf>
</goal>
</transf>
</goal>
<goal name="WP_parameter traverse" expl="VC for traverse">
<transf name="split_goal_wp">
<goal name="WP_parameter traverse.1" expl="1. assertion">
<proof prover="13"><result status="valid" time="0.01" steps="8"/></proof>
</goal>
<goal name="WP_parameter traverse.2" expl="2. precondition">
<proof prover="13"><result status="valid" time="0.01" steps="1"/></proof>
</goal>
<goal name="WP_parameter traverse.3" expl="3. precondition">
<proof prover="13"><result status="valid" time="0.01" steps="5"/></proof>
</goal>
<goal name="WP_parameter traverse.4" expl="4. precondition">
<proof prover="13"><result status="valid" time="0.01" steps="2"/></proof>
</goal>
<goal name="WP_parameter traverse.5" expl="5. postcondition">
<proof prover="13"><result status="valid" time="0.01" steps="5"/></proof>
</goal>
<goal name="WP_parameter traverse.6" expl="6. postcondition">
<proof prover="13"><result status="valid" time="0.01" steps="28"/></proof>
</goal>
<goal name="WP_parameter traverse.7" expl="7. postcondition">
<proof prover="13"><result status="valid" time="0.00" steps="10"/></proof>
</goal>
</transf>
<goal name="VC traverse" expl="VC for traverse" expanded="true">
<proof prover="0"><result status="valid" time="0.01" steps="57"/></proof>
</goal>
</theory>
</file>
......
......@@ -2,86 +2,53 @@
<!DOCTYPE why3session PUBLIC "-//Why3//proof session v5//EN"
"http://why3.lri.fr/why3session.dtd">
<why3session shape_version="4">
<prover id="0" name="CVC3" version="2.4.1" timelimit="3" steplimit="0" memlimit="1000"/>
<prover id="2" name="Z3" version="3.2" timelimit="3" steplimit="0" memlimit="1000"/>
<prover id="5" name="Alt-Ergo" version="0.99.1" timelimit="3" steplimit="0" memlimit="1000"/>
<prover id="6" name="CVC4" version="1.4" timelimit="3" steplimit="0" memlimit="1000"/>
<prover id="7" name="Z3" version="4.3.2" timelimit="3" steplimit="0" memlimit="1000"/>
<prover id="1" name="Alt-Ergo" version="1.30" timelimit="5" steplimit="0" memlimit="1000"/>
<prover id="6" name="CVC4" version="1.4" timelimit="5" steplimit="0" memlimit="1000"/>
<file name="../toy_compiler.mlw" expanded="true">
<theory name="Expr" sum="d41d8cd98f00b204e9800998ecf8427e" expanded="true">
</theory>
<theory name="StackMachine" sum="d41d8cd98f00b204e9800998ecf8427e">
</theory>
<theory name="Compiler" sum="1141ac4b4db1758507a7060c9a16a1f7" expanded="true">
<goal name="WP_parameter soundness_gen" expl="VC for soundness_gen" expanded="true">
<theory name="Compiler" sum="65bd9692788b2d7b85dce88ed46c15fa" expanded="true">
<goal name="VC soundness_gen" expl="VC for soundness_gen" expanded="true">
<transf name="split_goal_wp" expanded="true">
<goal name="WP_parameter soundness_gen.1" expl="1. assertion">
<proof prover="0"><result status="valid" time="0.02"/></proof>
<proof prover="2"><result status="valid" time="0.51"/></proof>
<proof prover="5"><result status="valid" time="0.02" steps="45"/></proof>
<proof prover="6"><result status="valid" time="0.05"/></proof>
<goal name="VC soundness_gen.1" expl="1. assertion">
<proof prover="1"><result status="valid" time="0.01" steps="37"/></proof>
</goal>
<goal name="WP_parameter soundness_gen.2" expl="2. postcondition">
<proof prover="6"><result status="valid" time="0.12"/></proof>
<goal name="VC soundness_gen.2" expl="2. variant decrease">
<proof prover="1"><result status="valid" time="0.01" steps="38"/></proof>
</goal>
<goal name="WP_parameter soundness_gen.3" expl="3. variant decrease">
<proof prover="0"><result status="valid" time="0.02"/></proof>
<proof prover="2"><result status="valid" time="0.02"/></proof>
<proof prover="5"><result status="valid" time="0.03" steps="40"/></proof>
<proof prover="6"><result status="valid" time="0.07"/></proof>
<proof prover="7"><result status="valid" time="0.01"/></proof>
<goal name="VC soundness_gen.3" expl="3. variant decrease">
<proof prover="1"><result status="valid" time="0.02" steps="75"/></proof>
</goal>
<goal name="WP_parameter soundness_gen.4" expl="4. variant decrease">
<proof prover="0"><result status="valid" time="0.03"/></proof>
<proof prover="2"><result status="valid" time="0.03"/></proof>
<proof prover="5"><result status="valid" time="0.02" steps="44"/></proof>
<proof prover="6"><result status="valid" time="0.04"/></proof>
<proof prover="7"><result status="valid" time="0.01"/></proof>
<goal name="VC soundness_gen.4" expl="4. variant decrease">
<proof prover="1"><result status="valid" time="0.01" steps="38"/></proof>
</goal>
<goal name="WP_parameter soundness_gen.5" expl="5. postcondition">
<proof prover="5"><result status="valid" time="0.09" steps="125"/></proof>
<goal name="VC soundness_gen.5" expl="5. variant decrease">
<proof prover="1"><result status="valid" time="0.02" steps="75"/></proof>
</goal>
<goal name="WP_parameter soundness_gen.6" expl="6. variant decrease">
<proof prover="0"><result status="valid" time="0.02"/></proof>
<proof prover="2"><result status="valid" time="0.02"/></proof>
<proof prover="5"><result status="valid" time="0.03" steps="40"/></proof>
<proof prover="6"><result status="valid" time="0.04"/></proof>
<proof prover="7"><result status="valid" time="0.01"/></proof>
<goal name="VC soundness_gen.6" expl="6. variant decrease">
<proof prover="1"><result status="valid" time="0.01" steps="38"/></proof>
</goal>
<goal name="WP_parameter soundness_gen.7" expl="7. variant decrease">
<proof prover="0"><result status="valid" time="0.03"/></proof>
<proof prover="2"><result status="valid" time="0.02"/></proof>
<proof prover="5"><result status="valid" time="0.02" steps="44"/></proof>
<proof prover="6"><result status="valid" time="0.04"/></proof>
<proof prover="7"><result status="valid" time="0.01"/></proof>
<goal name="VC soundness_gen.7" expl="7. variant decrease">
<proof prover="1"><result status="valid" time="0.02" steps="75"/></proof>
</goal>
<goal name="WP_parameter soundness_gen.8" expl="8. postcondition">
<proof prover="5"><result status="valid" time="0.12" steps="157"/></proof>
<goal name="VC soundness_gen.8" expl="8. postcondition">
<proof prover="6"><result status="valid" time="0.10"/></proof>
</goal>
<goal name="WP_parameter soundness_gen.9" expl="9. variant decrease">
<proof prover="0"><result status="valid" time="0.03"/></proof>
<proof prover="2"><result status="valid" time="0.03"/></proof>
<proof prover="5"><result status="valid" time="0.04" steps="40"/></proof>
<proof prover="6"><result status="valid" time="0.04"/></proof>
<proof prover="7"><result status="valid" time="0.02"/></proof>
<goal name="VC soundness_gen.9" expl="9. postcondition">
<proof prover="1"><result status="valid" time="0.02" steps="118"/></proof>
</goal>
<goal name="WP_parameter soundness_gen.10" expl="10. variant decrease">
<proof prover="0"><result status="valid" time="0.02"/></proof>
<proof prover="2"><result status="valid" time="0.02"/></proof>
<proof prover="5"><result status="valid" time="0.02" steps="44"/></proof>
<proof prover="6"><result status="valid" time="0.04"/></proof>
<proof prover="7"><result status="valid" time="0.01"/></proof>
<goal name="VC soundness_gen.10" expl="10. postcondition">
<proof prover="1"><result status="valid" time="0.04" steps="156"/></proof>
</goal>
<goal name="WP_parameter soundness_gen.11" expl="11. postcondition">
<proof prover="5"><result status="valid" time="0.22" steps="124"/></proof>
<goal name="VC soundness_gen.11" expl="11. postcondition">
<proof prover="1"><result status="valid" time="0.03" steps="118"/></proof>
</goal>
</transf>
</goal>
<goal name="WP_parameter soundness" expl="VC for soundness" expanded="true">
<proof prover="0"><result status="valid" time="0.03"/></proof>
<proof prover="2"><result status="valid" time="0.13"/></proof>
<proof prover="5"><result status="valid" time="0.03" steps="15"/></proof>
<proof prover="6"><result status="valid" time="0.06"/></proof>
<goal name="VC soundness" expl="VC for soundness" expanded="true">
<proof prover="1"><result status="valid" time="0.00" steps="16"/></proof>
</goal>
</theory>
</file>
......
......@@ -2,77 +2,38 @@
(* Beware! Only edit allowed sections below *)
Require Import BuiltIn.
Require BuiltIn.
Require HighOrd.
Require int.Int.
Require map.Map.
(* Why3 assumption *)
Definition unit := unit.
Axiom qtmark : Type.
Parameter qtmark_WhyType : WhyType qtmark.
Existing Instance qtmark_WhyType.
(* Why3 assumption *)
Inductive matrix
(a:Type) :=
| mk_matrix : Z -> Z -> (map.Map.map Z (map.Map.map Z a)) -> matrix a.
Axiom matrix_WhyType : forall (a:Type) {a_WT:WhyType a}, WhyType (matrix a).
Axiom matrix : forall (a:Type), Type.
Parameter matrix_WhyType : forall (a:Type) {a_WT:WhyType a},
WhyType (matrix a).
Existing Instance matrix_WhyType.
Implicit Arguments mk_matrix [[a]].
(* Why3 assumption *)
Definition elts {a:Type} {a_WT:WhyType a} (v:(matrix a)): (map.Map.map Z
(map.Map.map Z a)) := match v with
| (mk_matrix x x1 x2) => x2
end.
(* Why3 assumption *)
Definition columns {a:Type} {a_WT:WhyType a} (v:(matrix a)): Z :=
match v with
| (mk_matrix x x1 x2) => x1
end.
(* Why3 assumption *)
Definition rows {a:Type} {a_WT:WhyType a} (v:(matrix a)): Z :=
match v with
| (mk_matrix x x1 x2) => x
end.
(* Why3 assumption *)
Definition index := (Z* Z)%type.
Parameter elts: forall {a:Type} {a_WT:WhyType a}, (matrix a) -> (Z -> (Z ->
a)).
(* Why3 assumption *)
Definition get {a:Type} {a_WT:WhyType a} (a1:(matrix a)) (i:(Z*
Z)%type): a :=
match i with
| (r, c) => (map.Map.get (map.Map.get (elts a1) r) c)
end.
Parameter rows: forall {a:Type} {a_WT:WhyType a}, (matrix a) -> Z.
(* Why3 assumption *)
Definition set {a:Type} {a_WT:WhyType a} (a1:(matrix a)) (i:(Z* Z)%type)
(v:a): (matrix a) :=
match i with
| (r, c) => (mk_matrix (rows a1) (columns a1) (map.Map.set (elts a1) r
(map.Map.set (map.Map.get (elts a1) r) c v)))
end.
Parameter columns: forall {a:Type} {a_WT:WhyType a}, (matrix a) -> Z.
(* Why3 assumption *)
Definition valid_index {a:Type} {a_WT:WhyType a} (a1:(matrix a)) (i:(Z*
Z)%type): Prop :=
match i with
| (r, c) => ((0%Z <= r)%Z /\ (r < (rows a1))%Z) /\ ((0%Z <= c)%Z /\
(c < (columns a1))%Z)
end.
Axiom matrix'invariant : forall {a:Type} {a_WT:WhyType a},
forall (self:(matrix a)), (0%Z <= (rows self))%Z /\
(0%Z <= (columns self))%Z.
(* Why3 assumption *)
Definition make {a:Type} {a_WT:WhyType a} (r:Z) (c:Z) (v:a): (matrix a) :=
(mk_matrix r c (map.Map.const (map.Map.const v: (map.Map.map Z
a)): (map.Map.map Z (map.Map.map Z a)))).
Definition valid_index {a:Type} {a_WT:WhyType a} (a1:(matrix a)) (r:Z)
(c:Z): Prop := ((0%Z <= r)%Z /\ (r < (rows a1))%Z) /\ ((0%Z <= c)%Z /\
(c < (columns a1))%Z).
(* Why3 assumption *)
Inductive path: (matrix bool) -> Z -> Z -> Z -> Prop :=
| Path_empty : forall (m:(matrix bool)) (i:Z) (j:Z) (k:Z), ((get m (i,
j)) = true) -> (path m i j k)
| Path_empty : forall (m:(matrix bool)) (i:Z) (j:Z) (k:Z), ((((elts m) i)
j) = true) -> (path m i j k)
| Path_cons : forall (m:(matrix bool)) (i:Z) (x:Z) (j:Z) (k:Z),
((0%Z <= x)%Z /\ (x < k)%Z) -> ((path m i x k) -> ((path m x j k) ->
(path m i j k))).
......
This diff is collapsed.
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