File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
DynamoDbEncryption/dafny/DynamoDbEncryption/src Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1223,14 +1223,17 @@ module DynamoDBFilterExpr {
1223
1223
}
1224
1224
1225
1225
// true if target in list
1226
- predicate method is_in (target : DDB .AttributeValue, list : seq <StackValue >)
1226
+ predicate method is_in (target : DDB .AttributeValue, list : seq <StackValue >, pos : uint64 := 0)
1227
+ requires pos as nat <= |list|
1228
+ decreases |list| - pos as nat
1227
1229
{
1228
- if |list| == 0 then
1230
+ SequenceIsSafeBecauseItIsInMemory (list);
1231
+ if |list| as uint64 == pos then
1229
1232
false
1230
- else if GetStr (list[0 ]) == target then
1233
+ else if GetStr (list[pos ]) == target then
1231
1234
true
1232
1235
else
1233
- is_in (target, list[1..] )
1236
+ is_in (target, list, pos + 1 )
1234
1237
}
1235
1238
1236
1239
// return string version of attribute
You can’t perform that action at this time.
0 commit comments