Skip to content

Commit 5fbb7ca

Browse files
yzhang90ehildenb
authored andcommitted
remove import ETHEREUM-SIMULATION from SUM-TO-N-SPEC (#451)
* remove import ETHEREUM-SIMULATION from SUM-TO-N-SPEC * tests/specs/sum-to-n: formatting, explicitely require asm.k
1 parent 3ed5f6e commit 5fbb7ca

File tree

1 file changed

+17
-98
lines changed

1 file changed

+17
-98
lines changed

tests/specs/examples/sum-to-n-spec.k

Lines changed: 17 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
2-
3-
4-
5-
6-
7-
8-
9-
1+
requires "asm.k"
102
requires "edsl.k"
113
requires "../lemmas.k"
124

@@ -34,50 +26,9 @@ module VERIFICATION
3426
) [macro]
3527
endmodule
3628

37-
38-
39-
40-
41-
42-
43-
44-
45-
46-
4729
module SUM-TO-N-SPEC
48-
imports ETHEREUM-SIMULATION
4930
imports VERIFICATION
5031

51-
52-
53-
54-
55-
56-
57-
58-
59-
60-
61-
62-
63-
64-
65-
66-
67-
68-
69-
70-
71-
72-
73-
74-
75-
76-
77-
78-
79-
80-
8132
rule <k> #execute ... </k>
8233
<mode> NORMAL </mode>
8334
<schedule> DEFAULT </schedule>
@@ -88,32 +39,14 @@ module SUM-TO-N-SPEC
8839
<program> #asMapOpCodes(#dasmOpCodes(sumToN, DEFAULT)) </program>
8940
<programBytes> sumToN </programBytes>
9041

42+
<pc> 0 => 21 </pc>
43+
<wordStack> N : WS => 0 : N *Int (N +Int 1) /Int 2 : WS </wordStack>
44+
<gas> G => G -Int (52 *Int N +Int 27) </gas>
9145

92-
93-
94-
95-
96-
97-
98-
99-
100-
<pc> 0 => 21 </pc>
101-
<wordStack> N : WS => 0 : N *Int (N +Int 1) /Int 2 : WS </wordStack>
102-
<gas> G => G -Int (52 *Int N +Int 27) </gas>
103-
104-
requires N >=Int 0
105-
andBool N <=Int 340282366920938463463374607431768211455
106-
andBool #sizeWordStack(WS) <Int 1021
107-
andBool G >=Int 52 *Int N +Int 27
108-
109-
110-
111-
112-
113-
114-
115-
116-
46+
requires N >=Int 0
47+
andBool N <=Int 340282366920938463463374607431768211455
48+
andBool #sizeWordStack(WS) <Int 1021
49+
andBool G >=Int 52 *Int N +Int 27
11750

11851
rule <k> #execute ... </k>
11952
<mode> NORMAL </mode>
@@ -125,30 +58,16 @@ module SUM-TO-N-SPEC
12558
<program> #asMapOpCodes(#dasmOpCodes(sumToN, DEFAULT)) </program>
12659
<programBytes> sumToN </programBytes>
12760

61+
<pc> 3 => 21 </pc>
62+
<gas> G => G -Int (52 *Int I +Int 21) </gas>
12863

64+
<wordStack> I : S : WS
65+
=> 0 : S +Int I *Int (I +Int 1) /Int 2 : WS </wordStack>
12966

130-
131-
132-
133-
134-
135-
136-
137-
138-
139-
140-
<pc> 3 => 21 </pc>
141-
<gas> G => G -Int (52 *Int I +Int 21) </gas>
142-
143-
<wordStack> I : S : WS
144-
=> 0 : S +Int I *Int (I +Int 1) /Int 2 : WS </wordStack>
145-
146-
requires I >=Int 0
147-
andBool S >=Int 0
148-
andBool S +Int I *Int (I +Int 1) /Int 2 <Int pow256
149-
andBool #sizeWordStack(WS) <Int 1021
150-
andBool G >=Int 52 *Int I +Int 21
67+
requires I >=Int 0
68+
andBool S >=Int 0
69+
andBool S +Int I *Int (I +Int 1) /Int 2 <Int pow256
70+
andBool #sizeWordStack(WS) <Int 1021
71+
andBool G >=Int 52 *Int I +Int 21
15172

15273
endmodule
153-
154-

0 commit comments

Comments
 (0)