@@ -23,6 +23,7 @@ module SearchConfigToInfo {
23
23
import opened DynamoDbEncryptionUtil
24
24
import opened TermLoc
25
25
import opened StandardLibrary. String
26
+ import opened MemoryMath
26
27
import MaterialProviders
27
28
import SortedSets
28
29
@@ -757,14 +758,14 @@ module SearchConfigToInfo {
757
758
function method MakeDefaultConstructor (
758
759
parts : seq <CB .BeaconPart>,
759
760
ghost allParts : seq <CB .BeaconPart>,
760
- ghost numNon : nat ,
761
+ ghost numNon : uint64 ,
761
762
converted : seq <CB .ConstructorPart> := []
762
763
)
763
764
: (ret : Result< seq < CB. Constructor> , Error> )
764
765
requires 0 < |parts| + |converted|
765
766
requires |allParts| == |parts| + |converted|
766
767
requires parts == allParts[|converted|.. ]
767
- requires numNon <= |allParts|
768
+ requires numNon as nat <= |allParts|
768
769
requires CB. OrderedParts (allParts, numNon)
769
770
requires forall i | 0 <= i < |converted| ::
770
771
&& converted[i]. part == allParts[i]
@@ -887,12 +888,12 @@ module SearchConfigToInfo {
887
888
constructors : Option <ConstructorList >,
888
889
name : string ,
889
890
parts : seq <CB .BeaconPart>,
890
- ghost numSigned : nat
891
+ ghost numSigned : uint64
891
892
)
892
893
: (ret : Result< seq < CB. Constructor> , Error> )
893
894
requires 0 < |parts|
894
895
requires constructors. Some? ==> 0 < |constructors. value|
895
- requires numSigned <= |parts|
896
+ requires numSigned as nat <= |parts|
896
897
requires CB. OrderedParts (parts, numSigned)
897
898
ensures ret. Success? ==>
898
899
&& (constructors. None? ==> |ret. value| == 1)
@@ -1065,7 +1066,8 @@ module SearchConfigToInfo {
1065
1066
:- Need (beacon.constructors.Some? || |signedParts| != 0 || |encryptedParts| != 0,
1066
1067
E("Compound beacon " + beacon.name + " defines no constructors, and also no local parts. Cannot make a default constructor from global parts."));
1067
1068
1068
- var numNon := |signed|;
1069
+ SequenceIsSafeBecauseItIsInMemory (signed);
1070
+ var numNon := |signed| as uint64;
1069
1071
assert CB. OrderedParts (signed, numNon);
1070
1072
var allParts := signed + encrypted;
1071
1073
assert CB. OrderedParts (allParts, numNon);
0 commit comments