gallery: more proofs of termination

parent 7ee0bf01
......@@ -43,9 +43,10 @@ module Decrease1
let rec search_rec (a: array int) (i : int)
requires { decrease1 a /\ 0 <= i }
ensures {
(result = -1 /\ forall j: int. i <= j < length a -> a[j] <> 0)
\/ (i <= result < length a /\ a[result] = 0 /\
forall j: int. i <= j < result -> a[j] <> 0) }
(result = -1 /\ forall j: int. i <= j < length a -> a[j] <> 0)
\/ (i <= result < length a /\ a[result] = 0 /\
forall j: int. i <= j < result -> a[j] <> 0) }
variant { length a - i }
= if i < length a then
if a[i] = 0 then i
else if a[i] > 0 then search_rec a (i + a[i])
......
......@@ -775,10 +775,10 @@
locfile="../decrease1.mlw"
loclnum="43" loccnumb="10" loccnume="20"
expl="VC for search_rec"
sum="c5b279e4b45fc745609c63cfbc40f369"
sum="ad97f613a7c2d553262d772436d41a58"
proved="true"
expanded="true"
shape="iNainfix =agetV1V5c0Iainfix &lt;V5V4Aainfix &lt;=V2V5FAainfix =agetV1V4c0Aainfix &lt;V4V0Aainfix &lt;=V2V4ONainfix =agetV1V6c0Iainfix &lt;V6V0Aainfix &lt;=V2V6FAainfix =V4aprefix -c1Laprefix -c1iiNainfix =agetV1V9c0Iainfix &lt;V9V8Aainfix &lt;=V2V9FAainfix =agetV1V8c0Aainfix &lt;V8V0Aainfix &lt;=V2V8ONainfix =agetV1V10c0Iainfix &lt;V10V0Aainfix &lt;=V2V10FAainfix =V8aprefix -c1INainfix =agetV1V11c0Iainfix &lt;V11V8Aainfix &lt;=V7V11FAainfix =agetV1V8c0Aainfix &lt;V8V0Aainfix &lt;=V7V8ONainfix =agetV1V12c0Iainfix &lt;V12V0Aainfix &lt;=V7V12FAainfix =V8aprefix -c1FAainfix &lt;=c0V7Aadecrease1V3Lainfix +V2c1Nainfix =agetV1V15c0Iainfix &lt;V15V14Aainfix &lt;=V2V15FAainfix =agetV1V14c0Aainfix &lt;V14V0Aainfix &lt;=V2V14ONainfix =agetV1V16c0Iainfix &lt;V16V0Aainfix &lt;=V2V16FAainfix =V14aprefix -c1INainfix =agetV1V17c0Iainfix &lt;V17V14Aainfix &lt;=V13V17FAainfix =agetV1V14c0Aainfix &lt;V14V0Aainfix &lt;=V13V14ONainfix =agetV1V18c0Iainfix &lt;V18V0Aainfix &lt;=V13V18FAainfix =V14aprefix -c1FAainfix &lt;=c0V13Aadecrease1V3Lainfix +V2agetV1V2Aainfix &lt;V2V0Aainfix &lt;=c0V2ainfix &gt;agetV1V2c0Aainfix &lt;V2V0Aainfix &lt;=c0V2Nainfix =agetV1V19c0Iainfix &lt;V19V2Aainfix &lt;=V2V19FAainfix =agetV1V2c0Aainfix &lt;V2V0Aainfix &lt;=V2V2ONainfix =agetV1V20c0Iainfix &lt;V20V0Aainfix &lt;=V2V20FAainfix =V2aprefix -c1ainfix =agetV1V2c0Aainfix &lt;V2V0Aainfix &lt;=c0V2ainfix &lt;V2V0Iainfix &lt;=c0V2Aadecrease1V3Aainfix &lt;=c0V0Lamk arrayV0V1F">
shape="iNainfix =agetV1V5c0Iainfix &lt;V5V4Aainfix &lt;=V2V5FAainfix =agetV1V4c0Aainfix &lt;V4V0Aainfix &lt;=V2V4ONainfix =agetV1V6c0Iainfix &lt;V6V0Aainfix &lt;=V2V6FAainfix =V4aprefix -c1Laprefix -c1iiNainfix =agetV1V9c0Iainfix &lt;V9V8Aainfix &lt;=V2V9FAainfix =agetV1V8c0Aainfix &lt;V8V0Aainfix &lt;=V2V8ONainfix =agetV1V10c0Iainfix &lt;V10V0Aainfix &lt;=V2V10FAainfix =V8aprefix -c1INainfix =agetV1V11c0Iainfix &lt;V11V8Aainfix &lt;=V7V11FAainfix =agetV1V8c0Aainfix &lt;V8V0Aainfix &lt;=V7V8ONainfix =agetV1V12c0Iainfix &lt;V12V0Aainfix &lt;=V7V12FAainfix =V8aprefix -c1FAainfix &lt;=c0V7Aadecrease1V3Aainfix &lt;ainfix -V0V7ainfix -V0V2Aainfix &lt;=c0ainfix -V0V2Lainfix +V2c1Nainfix =agetV1V15c0Iainfix &lt;V15V14Aainfix &lt;=V2V15FAainfix =agetV1V14c0Aainfix &lt;V14V0Aainfix &lt;=V2V14ONainfix =agetV1V16c0Iainfix &lt;V16V0Aainfix &lt;=V2V16FAainfix =V14aprefix -c1INainfix =agetV1V17c0Iainfix &lt;V17V14Aainfix &lt;=V13V17FAainfix =agetV1V14c0Aainfix &lt;V14V0Aainfix &lt;=V13V14ONainfix =agetV1V18c0Iainfix &lt;V18V0Aainfix &lt;=V13V18FAainfix =V14aprefix -c1FAainfix &lt;=c0V13Aadecrease1V3Aainfix &lt;ainfix -V0V13ainfix -V0V2Aainfix &lt;=c0ainfix -V0V2Lainfix +V2agetV1V2Aainfix &lt;V2V0Aainfix &lt;=c0V2ainfix &gt;agetV1V2c0Aainfix &lt;V2V0Aainfix &lt;=c0V2Nainfix =agetV1V19c0Iainfix &lt;V19V2Aainfix &lt;=V2V19FAainfix =agetV1V2c0Aainfix &lt;V2V0Aainfix &lt;=V2V2ONainfix =agetV1V20c0Iainfix &lt;V20V0Aainfix &lt;=V2V20FAainfix =V2aprefix -c1ainfix =agetV1V2c0Aainfix &lt;V2V0Aainfix &lt;=c0V2ainfix &lt;V2V0Iainfix &lt;=c0V2Aadecrease1V3Aainfix &lt;=c0V0Lamk arrayV0V1F">
<label
name="expl:VC for search_rec"/>
<transf
......@@ -1029,7 +1029,27 @@
name="WP_parameter search_rec.5"
locfile="../decrease1.mlw"
loclnum="43" loccnumb="10" loccnume="20"
expl="5. precondition"
expl="5. variant decrease"
sum="b5131befd85b22706515bd0d2689a059"
proved="true"
expanded="false"
shape="variant decreaseainfix &lt;ainfix -V0V4ainfix -V0V2Aainfix &lt;=c0ainfix -V0V2Lainfix +V2agetV1V2Iainfix &lt;V2V0Aainfix &lt;=c0V2Iainfix &gt;agetV1V2c0Iainfix &lt;V2V0Aainfix &lt;=c0V2INainfix =agetV1V2c0Iainfix &lt;V2V0Aainfix &lt;=c0V2Iainfix &lt;V2V0Iainfix &lt;=c0V2Aadecrease1V3Aainfix &lt;=c0V0Lamk arrayV0V1F">
<label
name="expl:VC for search_rec"/>
<proof
prover="0"
timelimit="5"
memlimit="1000"
obsolete="false"
archived="false">
<result status="valid" time="0.02"/>
</proof>
</goal>
<goal
name="WP_parameter search_rec.6"
locfile="../decrease1.mlw"
loclnum="43" loccnumb="10" loccnume="20"
expl="6. precondition"
sum="49cb200e3d38d866eede7c04a237013e"
proved="true"
expanded="true"
......@@ -1086,10 +1106,10 @@
</proof>
</goal>
<goal
name="WP_parameter search_rec.6"
name="WP_parameter search_rec.7"
locfile="../decrease1.mlw"
loclnum="43" loccnumb="10" loccnume="20"
expl="6. postcondition"
expl="7. postcondition"
sum="8ccca0adf6640e7a56856af8755eb27d"
proved="true"
expanded="true"
......@@ -1114,10 +1134,30 @@
</proof>
</goal>
<goal
name="WP_parameter search_rec.7"
name="WP_parameter search_rec.8"
locfile="../decrease1.mlw"
loclnum="43" loccnumb="10" loccnume="20"
expl="8. variant decrease"
sum="284631f46e41cb304e4fcd1c1cc7ae95"
proved="true"
expanded="false"
shape="variant decreaseainfix &lt;ainfix -V0V4ainfix -V0V2Aainfix &lt;=c0ainfix -V0V2Lainfix +V2c1INainfix &gt;agetV1V2c0Iainfix &lt;V2V0Aainfix &lt;=c0V2INainfix =agetV1V2c0Iainfix &lt;V2V0Aainfix &lt;=c0V2Iainfix &lt;V2V0Iainfix &lt;=c0V2Aadecrease1V3Aainfix &lt;=c0V0Lamk arrayV0V1F">
<label
name="expl:VC for search_rec"/>
<proof
prover="0"
timelimit="5"
memlimit="1000"
obsolete="false"
archived="false">
<result status="valid" time="0.03"/>
</proof>
</goal>
<goal
name="WP_parameter search_rec.9"
locfile="../decrease1.mlw"
loclnum="43" loccnumb="10" loccnume="20"
expl="7. precondition"
expl="9. precondition"
sum="1a8d0b567aa4c9e7efaca8e11d30a666"
proved="true"
expanded="true"
......@@ -1174,10 +1214,10 @@
</proof>
</goal>
<goal
name="WP_parameter search_rec.8"
name="WP_parameter search_rec.10"
locfile="../decrease1.mlw"
loclnum="43" loccnumb="10" loccnume="20"
expl="8. postcondition"
expl="10. postcondition"
sum="18732f65b93109ce7b7b5d7b597c1a90"
proved="true"
expanded="true"
......@@ -1218,10 +1258,10 @@
</proof>
</goal>
<goal
name="WP_parameter search_rec.9"
name="WP_parameter search_rec.11"
locfile="../decrease1.mlw"
loclnum="43" loccnumb="10" loccnume="20"
expl="9. postcondition"
expl="11. postcondition"
sum="33bcb0b94113c30d6858c47de53395c9"
proved="true"
expanded="true"
......
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