Skip to content

Commit 38c9233

Browse files
committed
m
1 parent 20dcb61 commit 38c9233

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

DynamoDbEncryption/dafny/DynamoDbEncryption/src/FilterExpr.dfy

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,14 +1223,17 @@ module DynamoDBFilterExpr {
12231223
}
12241224

12251225
// 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
12271229
{
1228-
if |list| == 0 then
1230+
SequenceIsSafeBecauseItIsInMemory(list);
1231+
if |list| as uint64 == pos then
12291232
false
1230-
else if GetStr(list[0]) == target then
1233+
else if GetStr(list[pos]) == target then
12311234
true
12321235
else
1233-
is_in(target, list[1..])
1236+
is_in(target, list, pos + 1)
12341237
}
12351238

12361239
// return string version of attribute

0 commit comments

Comments
 (0)