@@ -16,7 +16,8 @@ Definition findKey: val :=
16
16
then
17
17
"found" <-[uint64T] "k";;
18
18
"ok" <-[boolT] #true
19
- else #()));;
19
+ else #());;
20
+ #());;
20
21
(![uint64T] "found", ![boolT] "ok").
21
22
Theorem findKey_t: ⊢ findKey : (mapT (struct.t unit) -> (uint64T * boolT)).
22
23
Proof . typecheck. Qed .
@@ -631,7 +632,8 @@ Definition LoopStruct__forLoopWait: val :=
631
632
then Break
632
633
else
633
634
struct .get LoopStruct "loopNext" "ls" <-[uint64T] ![uint64T] (struct .get LoopStruct "loopNext" "ls") + #1;;
634
- Continue)).
635
+ Continue));;
636
+ #().
635
637
Theorem LoopStruct__forLoopWait_t: ⊢ LoopStruct__forLoopWait : (struct.t LoopStruct -> uint64T -> unitT).
636
638
Proof . typecheck. Qed .
637
639
Hint Resolve LoopStruct__forLoopWait_t : types.
@@ -684,7 +686,9 @@ Definition testBreakFromLoopNoContinue: val :=
684
686
then
685
687
"i" <-[uint64T] ![uint64T] "i" + #1;;
686
688
Break
687
- else "i" <-[uint64T] ![uint64T] "i" + #2));;
689
+ else
690
+ "i" <-[uint64T] ![uint64T] "i" + #2;;
691
+ Continue));;
688
692
(![uint64T] "i" = #1).
689
693
Theorem testBreakFromLoopNoContinue_t: ⊢ testBreakFromLoopNoContinue : (unitT -> boolT).
690
694
Proof . typecheck. Qed .
@@ -701,7 +705,8 @@ Definition failing_testBreakFromLoopNoContinueDouble: val :=
701
705
Break
702
706
else
703
707
"i" <-[uint64T] ![uint64T] "i" + #2;;
704
- "i" <-[uint64T] ![uint64T] "i" + #2));;
708
+ "i" <-[uint64T] ![uint64T] "i" + #2;;
709
+ Continue));;
705
710
(![uint64T] "i" = #4).
706
711
Theorem failing_testBreakFromLoopNoContinueDouble_t: ⊢ failing_testBreakFromLoopNoContinueDouble : (unitT -> boolT).
707
712
Proof . typecheck. Qed .
@@ -1100,9 +1105,7 @@ Definition testOrCompare: val :=
1100
1105
rec: "testOrCompare" <> :=
1101
1106
let : "ok" := ref_to boolT #true in
1102
1107
(if : ~ (#3 > #4) || (#4 > #3)
1103
- then
1104
- "ok" <-[boolT] #false;;
1105
- #()
1108
+ then "ok" <-[boolT] #false
1106
1109
else #());;
1107
1110
(if : (#4 < #3) || (#2 > #3)
1108
1111
then "ok" <-[boolT] #false
@@ -1116,9 +1119,7 @@ Definition testAndCompare: val :=
1116
1119
rec: "testAndCompare" <> :=
1117
1120
let : "ok" := ref_to boolT #true in
1118
1121
(if : (#3 > #4) && (#4 > #3)
1119
- then
1120
- "ok" <-[boolT] #false;;
1121
- #()
1122
+ then "ok" <-[boolT] #false
1122
1123
else #());;
1123
1124
(if : (#4 > #3) || (#2 < #3)
1124
1125
then #()
@@ -1248,7 +1249,8 @@ Definition ArrayEditor__Advance: val :=
1248
1249
SliceSet uint64T "arr" #0 (SliceGet uint64T "arr" #0 + #1);;
1249
1250
SliceSet uint64T (struct .loadF ArrayEditor "s" "ae") #0 (struct .loadF ArrayEditor "next_val" "ae");;
1250
1251
struct .storeF ArrayEditor "next_val" "ae" "next";;
1251
- struct .storeF ArrayEditor "s" "ae" (SliceSkip uint64T (struct .loadF ArrayEditor "s" "ae") #1).
1252
+ struct .storeF ArrayEditor "s" "ae" (SliceSkip uint64T (struct .loadF ArrayEditor "s" "ae") #1);;
1253
+ #().
1252
1254
Theorem ArrayEditor__Advance_t: ⊢ ArrayEditor__Advance : (struct.ptrT ArrayEditor -> slice.T uint64T -> uint64T -> unitT).
1253
1255
Proof . typecheck. Qed .
1254
1256
Hint Resolve ArrayEditor__Advance_t : types.
@@ -1360,14 +1362,16 @@ Definition Foo := struct.decl [
1360
1362
Definition Bar__mutate: val :=
1361
1363
rec: "Bar__mutate" "bar" :=
1362
1364
struct .storeF Bar "a" "bar" #2;;
1363
- struct .storeF Bar "b" "bar" #3.
1365
+ struct .storeF Bar "b" "bar" #3;;
1366
+ #().
1364
1367
Theorem Bar__mutate_t: ⊢ Bar__mutate : (struct.ptrT Bar -> unitT).
1365
1368
Proof . typecheck. Qed .
1366
1369
Hint Resolve Bar__mutate_t : types.
1367
1370
1368
1371
Definition Foo__mutateBar: val :=
1369
1372
rec: "Foo__mutateBar" "foo" :=
1370
- Bar__mutate (struct .loadF Foo "bar" "foo").
1373
+ Bar__mutate (struct .loadF Foo "bar" "foo");;
1374
+ #().
1371
1375
Theorem Foo__mutateBar_t: ⊢ Foo__mutateBar : (struct.ptrT Foo -> unitT).
1372
1376
Proof . typecheck. Qed .
1373
1377
Hint Resolve Foo__mutateBar_t : types.
@@ -1436,14 +1440,16 @@ Hint Resolve S__readBVal_t : types.
1436
1440
1437
1441
Definition S__updateBValX: val :=
1438
1442
rec: "S__updateBValX" "s" "i" :=
1439
- struct .storeF TwoInts "x" (struct .fieldRef S "b" "s") "i".
1443
+ struct .storeF TwoInts "x" (struct .fieldRef S "b" "s") "i";;
1444
+ #().
1440
1445
Theorem S__updateBValX_t: ⊢ S__updateBValX : (struct.ptrT S -> uint64T -> unitT).
1441
1446
Proof . typecheck. Qed .
1442
1447
Hint Resolve S__updateBValX_t : types.
1443
1448
1444
1449
Definition S__negateC: val :=
1445
1450
rec: "S__negateC" "s" :=
1446
- struct .storeF S "c" "s" (~ (struct .loadF S "c" "s")).
1451
+ struct .storeF S "c" "s" (~ (struct .loadF S "c" "s"));;
1452
+ #().
1447
1453
Theorem S__negateC_t: ⊢ S__negateC : (struct.ptrT S -> unitT).
1448
1454
Proof . typecheck. Qed .
1449
1455
Hint Resolve S__negateC_t : types.
@@ -1649,9 +1655,7 @@ Definition New: val :=
1649
1655
let : "d" := disk.Get #() in
1650
1656
let : "diskSize" := disk.Size #() in
1651
1657
(if : "diskSize" ≤ logLength
1652
- then
1653
- Panic ("disk is too small to host log");;
1654
- #()
1658
+ then Panic ("disk is too small to host log")
1655
1659
else #());;
1656
1660
let : "cache" := NewMap disk.blockT in
1657
1661
let : "header" := intToBlock #0 in
@@ -1671,14 +1675,16 @@ Hint Resolve New_t : types.
1671
1675
1672
1676
Definition Log__lock: val :=
1673
1677
rec: "Log__lock" "l" :=
1674
- lock.acquire (struct .get Log "l" "l").
1678
+ lock.acquire (struct .get Log "l" "l");;
1679
+ #().
1675
1680
Theorem Log__lock_t: ⊢ Log__lock : (struct.t Log -> unitT).
1676
1681
Proof . typecheck. Qed .
1677
1682
Hint Resolve Log__lock_t : types.
1678
1683
1679
1684
Definition Log__unlock: val :=
1680
1685
rec: "Log__unlock" "l" :=
1681
- lock.release (struct .get Log "l" "l").
1686
+ lock.release (struct .get Log "l" "l");;
1687
+ #().
1682
1688
Theorem Log__unlock_t: ⊢ Log__unlock : (struct.t Log -> unitT).
1683
1689
Proof . typecheck. Qed .
1684
1690
Hint Resolve Log__unlock_t : types.
@@ -1734,17 +1740,16 @@ Definition Log__Write: val :=
1734
1740
Log__lock "l";;
1735
1741
let : "length" := ![uint64T] (struct.get Log "length" "l") in
1736
1742
(if : "length" ≥ MaxTxnWrites
1737
- then
1738
- Panic ("transaction is at capacity");;
1739
- #()
1743
+ then Panic ("transaction is at capacity")
1740
1744
else #());;
1741
1745
let : "aBlock" := intToBlock "a" in
1742
1746
let : "nextAddr" := #1 + #2 * "length" in
1743
1747
disk.Write "nextAddr" "aBlock";;
1744
1748
disk.Write ("nextAddr" + #1) "v";;
1745
1749
MapInsert (struct .get Log "cache" "l") "a" "v";;
1746
1750
struct .get Log "length" "l" <-[uint64T] "length" + #1;;
1747
- Log__unlock "l".
1751
+ Log__unlock "l";;
1752
+ #().
1748
1753
Theorem Log__Write_t: ⊢ Log__Write : (struct.t Log -> uint64T -> disk.blockT -> unitT).
1749
1754
Proof . typecheck. Qed .
1750
1755
Hint Resolve Log__Write_t : types.
@@ -1756,7 +1761,8 @@ Definition Log__Commit: val :=
1756
1761
let : "length" := ![uint64T] (struct.get Log "length" "l") in
1757
1762
Log__unlock "l";;
1758
1763
let : "header" := intToBlock "length" in
1759
- disk.Write #0 "header".
1764
+ disk.Write #0 "header";;
1765
+ #().
1760
1766
Theorem Log__Commit_t: ⊢ Log__Commit : (struct.t Log -> unitT).
1761
1767
Proof . typecheck. Qed .
1762
1768
Hint Resolve Log__Commit_t : types.
@@ -1783,15 +1789,17 @@ Definition applyLog: val :=
1783
1789
disk.Write (logLength + "a") "v";;
1784
1790
"i" <-[uint64T] ![uint64T] "i" + #1;;
1785
1791
Continue
1786
- else Break)).
1792
+ else Break));;
1793
+ #().
1787
1794
Theorem applyLog_t: ⊢ applyLog : (disk.Disk -> uint64T -> unitT).
1788
1795
Proof . typecheck. Qed .
1789
1796
Hint Resolve applyLog_t : types.
1790
1797
1791
1798
Definition clearLog: val :=
1792
1799
rec: "clearLog" "d" :=
1793
1800
let : "header" := intToBlock #0 in
1794
- disk.Write #0 "header".
1801
+ disk.Write #0 "header";;
1802
+ #().
1795
1803
Theorem clearLog_t: ⊢ clearLog : (disk.Disk -> unitT).
1796
1804
Proof . typecheck. Qed .
1797
1805
Hint Resolve clearLog_t : types.
@@ -1806,7 +1814,8 @@ Definition Log__Apply: val :=
1806
1814
applyLog (struct .get Log "d" "l") "length";;
1807
1815
clearLog (struct .get Log "d" "l");;
1808
1816
struct .get Log "length" "l" <-[uint64T] #0;;
1809
- Log__unlock "l".
1817
+ Log__unlock "l";;
1818
+ #().
1810
1819
Theorem Log__Apply_t: ⊢ Log__Apply : (struct.t Log -> unitT).
1811
1820
Proof . typecheck. Qed .
1812
1821
Hint Resolve Log__Apply_t : types.
@@ -1839,9 +1848,7 @@ Definition disabled_testWal: val :=
1839
1848
let : "ok" := ref_to boolT #true in
1840
1849
let : "lg" := New #() in
1841
1850
(if : Log__BeginTxn "lg"
1842
- then
1843
- Log__Write "lg" #2 (intToBlock #11);;
1844
- #()
1851
+ then Log__Write "lg" #2 (intToBlock #11)
1845
1852
else #());;
1846
1853
"ok" <-[boolT] (![boolT] "ok") && (blockToInt (Log__Read "lg" #2) = #11);;
1847
1854
"ok" <-[boolT] (![boolT] "ok") && (blockToInt (disk.Read #0) = #0);;
0 commit comments