Skip to content

Commit bfb12ad

Browse files
committed
rename
1 parent 70fe330 commit bfb12ad

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

clientlib/storage_modeling/data_structures.dl

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
used to index/access it, representing the actual low-level index flowing to `SSTORE`/`SLOAD` stmts.
1010
*/
1111
.type StorageIndex = ConstantIndex {value: Value}
12-
| ConstArrayAccessIndex {parIndex: StorageIndex, arraySize: number, indexVar: Variable}
12+
| StaticArrayAccessIndex {parIndex: StorageIndex, arraySize: number, indexVar: Variable}
1313
| ArrayAccessIndex {parIndex: StorageIndex, indexVar: Variable}
1414
| ArrayDataStartIndex {parIndex: StorageIndex}
1515
| MappingAccessIndex {parIndex: StorageIndex, keyVar: Variable}
@@ -19,7 +19,7 @@
1919
`StorageConstruct` contains the information of `StorageIndex`, stripped of indexing/access vars
2020
*/
2121
.type StorageConstruct = Constant {value: Value}
22-
| ConstArray {parConstruct: StorageConstruct, arraySize: number}
22+
| StaticArray {parConstruct: StorageConstruct, arraySize: number}
2323
| Array {parConstruct: StorageConstruct}
2424
| Mapping {parConstruct: StorageConstruct}
2525
| Offset {parConstruct: StorageConstruct, offset: number}
@@ -187,12 +187,12 @@ Variable_StorageIndex(def, $ArrayAccessIndex(parentIndex, newIndexVar)):-
187187
ADDFix(_, indexVar, minusOneConstVar2, newIndexVar),
188188
Variable_Value(minusOneConstVar2, "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").
189189

190-
Variable_StorageIndex(def, $ConstArrayAccessIndex(parentIndex, arraySize, checkedVar)):-
190+
Variable_StorageIndex(def, $StaticArrayAccessIndex(parentIndex, arraySize, checkedVar)):-
191191
Variable_StorageIndex(var, parentIndex),
192192
ADDFix(_, var, checkedVar, def),
193193
RevertEnforcesEnum(checkedVar, arraySize, _).
194194

195-
Variable_StorageIndex(def, $ConstArrayAccessIndex(parentIndex, arraySize, checkedVarDiv)):-
195+
Variable_StorageIndex(def, $StaticArrayAccessIndex(parentIndex, arraySize, checkedVarDiv)):-
196196
Variable_StorageIndex(var, parentIndex),
197197
ADDFix(_, var, checkedVarDiv, def),
198198
DIV(_, checkedVar, const, checkedVarDiv),
@@ -218,8 +218,8 @@ StorageIndex_StorageConstruct($OffsetIndex(parentIndex, offset), $Offset(parentC
218218
ActualStorageIndex($OffsetIndex(parentIndex, offset)), offset != 0,
219219
StorageIndex_StorageConstruct(parentIndex, parentCons).
220220

221-
StorageIndex_StorageConstruct($ConstArrayAccessIndex(parentIndex, arraySize, indexVar), $ConstArray(parentCons, arraySize)):-
222-
ActualStorageIndex($ConstArrayAccessIndex(parentIndex, arraySize, indexVar)),
221+
StorageIndex_StorageConstruct($StaticArrayAccessIndex(parentIndex, arraySize, indexVar), $StaticArray(parentCons, arraySize)):-
222+
ActualStorageIndex($StaticArrayAccessIndex(parentIndex, arraySize, indexVar)),
223223
StorageIndex_StorageConstruct(parentIndex, parentCons).
224224

225225
/**
@@ -244,7 +244,7 @@ StorageIndex_ParentIndex(index, parentIndex):-
244244
(
245245
(index = $ArrayAccessIndex(parentIndex, indexVar), indexVar = indexVar); // suppress warning
246246
(index = $ArrayDataStartIndex(parentIndex));
247-
(index = $ConstArrayAccessIndex(parentIndex, arraySize, indexVar), indexVar = indexVar, arraySize = arraySize); // suppress warning
247+
(index = $StaticArrayAccessIndex(parentIndex, arraySize, indexVar), indexVar = indexVar, arraySize = arraySize); // suppress warning
248248
(index = $MappingAccessIndex(parentIndex, indexVar), indexVar = indexVar); // suppress warning
249249
(index = $OffsetIndex(parentIndex, offset), offset = offset) // suppress warning
250250
).
@@ -254,7 +254,7 @@ StorageIndex_ParentIndexExclOffset(index, parentIndex):-
254254
(
255255
(index = $ArrayAccessIndex(parentIndex, indexVar), indexVar = indexVar); // suppress warning
256256
(index = $ArrayDataStartIndex(parentIndex));
257-
(index = $ConstArrayAccessIndex(parentIndex, arraySize, indexVar), indexVar = indexVar, arraySize = arraySize); // suppress warning
257+
(index = $StaticArrayAccessIndex(parentIndex, arraySize, indexVar), indexVar = indexVar, arraySize = arraySize); // suppress warning
258258
(index = $MappingAccessIndex(parentIndex, indexVar), indexVar = indexVar) // suppress warning
259259
// commenting this out for now, helps some cases but is not right
260260
// ;(index = $OffsetIndex(parentIndex, offset), offset > 0) // suppress warning
@@ -289,13 +289,13 @@ ActualStorageIndex(parentIndex):-
289289

290290
StorageIndex_HighLevelUses(index, accessVar, 0, 0, 1):-
291291
ActualStorageIndex(index),
292-
(index = $ArrayAccessIndex($ConstantIndex(const), accessVar); (index = $ConstArrayAccessIndex($ConstantIndex(const), arraySize, accessVar), arraySize=arraySize); index = $MappingAccessIndex($ConstantIndex(const), accessVar)),
292+
(index = $ArrayAccessIndex($ConstantIndex(const), accessVar); (index = $StaticArrayAccessIndex($ConstantIndex(const), arraySize, accessVar), arraySize=arraySize); index = $MappingAccessIndex($ConstantIndex(const), accessVar)),
293293
const = const.
294294

295295
StorageIndex_HighLevelUses(index, otherVar, prevOffset, i, prevNestedness + 1),
296296
StorageIndex_HighLevelUses(index, accessVar, 0, prevNestedness, prevNestedness + 1):-
297297
ActualStorageIndex(index),
298-
(index = $ArrayAccessIndex(parIndex, accessVar); (index = $ConstArrayAccessIndex(parIndex, arraySize, accessVar), arraySize=arraySize); index = $MappingAccessIndex(parIndex, accessVar)),
298+
(index = $ArrayAccessIndex(parIndex, accessVar); (index = $StaticArrayAccessIndex(parIndex, arraySize, accessVar), arraySize=arraySize); index = $MappingAccessIndex(parIndex, accessVar)),
299299
StorageIndex_HighLevelUses(parIndex, otherVar, prevOffset, i, prevNestedness).
300300

301301
StorageIndex_HighLevelUses($OffsetIndex(parentIndex, offset), accessVar, prevOffset, i, prevNestedness):-
@@ -331,19 +331,19 @@ IsStorageConstruct(cons),
331331
IsDataStructureConstruct(cons):-
332332
ActualStorageIndex(index),
333333
StorageIndex_StorageConstruct(index, cons),
334-
(cons = $Array(parentCons); cons = $Mapping(parentCons); (cons = $ConstArray(parentCons, arraySize), arraySize=arraySize)), // filter intermediate constructs
334+
(cons = $Array(parentCons); cons = $Mapping(parentCons); (cons = $StaticArray(parentCons, arraySize), arraySize=arraySize)), // filter intermediate constructs
335335
parentCons = parentCons. // suppress warning
336336

337337
StorageConstruct_ParentAndOffset(cons, paparentCons, offset):-
338338
IsStorageConstruct(cons),
339-
(cons = $Array(parentCons); cons = $Mapping(parentCons); (cons = $ConstArray(parentCons, arraySize), arraySize=arraySize); cons = $Variable(parentCons)),
339+
(cons = $Array(parentCons); cons = $Mapping(parentCons); (cons = $StaticArray(parentCons, arraySize), arraySize=arraySize); cons = $Variable(parentCons)),
340340
parentCons = $Offset(paparentCons, offset),
341341
offset = offset. // suppress warning
342342

343343
StorageConstruct_ParentAndOffset(cons, parentCons, 0):-
344344
IsStorageConstruct(cons),
345-
(cons = $Array(parentCons); cons = $Mapping(parentCons); (cons = $ConstArray(parentCons, arraySize), arraySize=arraySize); cons = $Variable(parentCons)),
346-
(parentCons = $Array(paparentCons) ; parentCons = $Mapping(paparentCons); (parentCons = $ConstArray(paparentCons, arraySize2), arraySize2=arraySize2); parentCons = $Variable(paparentCons)),
345+
(cons = $Array(parentCons); cons = $Mapping(parentCons); (cons = $StaticArray(parentCons, arraySize), arraySize=arraySize); cons = $Variable(parentCons)),
346+
(parentCons = $Array(paparentCons) ; parentCons = $Mapping(paparentCons); (parentCons = $StaticArray(paparentCons, arraySize2), arraySize2=arraySize2); parentCons = $Variable(paparentCons)),
347347
paparentCons = paparentCons. // suppress warning
348348

349349
DataStructure_ElemNum(cons, elemNum):-
@@ -448,8 +448,8 @@ DataStructure_Type($Array(parentCons), "string"):-
448448
IsDataStructureConstruct($Array(parentCons)),
449449
BytesOrStringLengthV2($Array(parentCons), _).
450450

451-
DataStructure_Type($ConstArray(parentCons, arraySize), cat(type, cat("[", cat(to_string(arraySize), "]")))):-
452-
DataStructure_ValueOrElementType($ConstArray(parentCons, arraySize), type).
451+
DataStructure_Type($StaticArray(parentCons, arraySize), cat(type, cat("[", cat(to_string(arraySize), "]")))):-
452+
DataStructure_ValueOrElementType($StaticArray(parentCons, arraySize), type).
453453

454454
// // Disable general rule for now
455455
// StorageStmtToIndexAndConstruct(stmt, "ACCESS", index, $Variable(cons)):-
@@ -520,7 +520,7 @@ StorageStmtToIndexAndConstruct(store, "ACCESS", index, $TightlyPackedVariable(co
520520

521521
StorageOffset_Type(offset, type):-
522522
DataStructure_Type(cons, type),
523-
(cons = $Array(parentCons); cons = $Mapping(parentCons); (cons = $ConstArray(parentCons, arraySize), arraySize=arraySize)),
523+
(cons = $Array(parentCons); cons = $Mapping(parentCons); (cons = $StaticArray(parentCons, arraySize), arraySize=arraySize)),
524524
parentCons = $Constant(offset).
525525

526526

@@ -673,7 +673,7 @@ DEBUG_OUTPUT(IsPackedArray)
673673
IsPackedArray(cons, byteWidth):-
674674
SLOAD(_, sindexVar, loadedVar),
675675
Variable_StorageIndex(sindexVar, sindex),
676-
((sindex = $ConstArrayAccessIndex(parIndex, arraySize, indexVar), arraySize=arraySize);
676+
((sindex = $StaticArrayAccessIndex(parIndex, arraySize, indexVar), arraySize=arraySize);
677677
sindex = $ArrayAccessIndex(parIndex, indexVar)),
678678
parIndex=parIndex,
679679
StorageIndex_StorageConstruct(sindex, cons),
@@ -690,7 +690,7 @@ IsPackedArray(cons, byteWidth):-
690690
IsPackedArray(cons, @hex_to_number(@div_256("0x20", const))):-
691691
SLOAD(_, sindexVar, loadedVar),
692692
Variable_StorageIndex(sindexVar, sindex),
693-
((sindex = $ConstArrayAccessIndex(parIndex, arraySize, indexVar), arraySize=arraySize);
693+
((sindex = $StaticArrayAccessIndex(parIndex, arraySize, indexVar), arraySize=arraySize);
694694
sindex = $ArrayAccessIndex(parIndex, indexVar)),
695695
parIndex=parIndex,
696696
StorageIndex_StorageConstruct(sindex, cons),

0 commit comments

Comments
 (0)