@@ -23,6 +23,7 @@ module SearchConfigToInfo {
2323 import opened DynamoDbEncryptionUtil
2424 import opened TermLoc
2525 import opened StandardLibrary. String
26+ import opened MemoryMath
2627 import MaterialProviders
2728 import SortedSets
2829
@@ -757,14 +758,14 @@ module SearchConfigToInfo {
757758 function method MakeDefaultConstructor (
758759 parts : seq <CB .BeaconPart>,
759760 ghost allParts : seq <CB .BeaconPart>,
760- ghost numNon : nat ,
761+ ghost numNon : uint64 ,
761762 converted : seq <CB .ConstructorPart> := []
762763 )
763764 : (ret : Result< seq < CB. Constructor> , Error> )
764765 requires 0 < |parts| + |converted|
765766 requires |allParts| == |parts| + |converted|
766767 requires parts == allParts[|converted|.. ]
767- requires numNon <= |allParts|
768+ requires numNon as nat <= |allParts|
768769 requires CB. OrderedParts (allParts, numNon)
769770 requires forall i | 0 <= i < |converted| ::
770771 && converted[i]. part == allParts[i]
@@ -887,12 +888,12 @@ module SearchConfigToInfo {
887888 constructors : Option <ConstructorList >,
888889 name : string ,
889890 parts : seq <CB .BeaconPart>,
890- ghost numSigned : nat
891+ ghost numSigned : uint64
891892 )
892893 : (ret : Result< seq < CB. Constructor> , Error> )
893894 requires 0 < |parts|
894895 requires constructors. Some? ==> 0 < |constructors. value|
895- requires numSigned <= |parts|
896+ requires numSigned as nat <= |parts|
896897 requires CB. OrderedParts (parts, numSigned)
897898 ensures ret. Success? ==>
898899 && (constructors. None? ==> |ret. value| == 1)
@@ -1065,7 +1066,8 @@ module SearchConfigToInfo {
10651066 :- Need (beacon.constructors.Some? || |signedParts| != 0 || |encryptedParts| != 0,
10661067 E("Compound beacon " + beacon.name + " defines no constructors, and also no local parts. Cannot make a default constructor from global parts."));
10671068
1068- var numNon := |signed|;
1069+ SequenceIsSafeBecauseItIsInMemory (signed);
1070+ var numNon := |signed| as uint64;
10691071 assert CB. OrderedParts (signed, numNon);
10701072 var allParts := signed + encrypted;
10711073 assert CB. OrderedParts (allParts, numNon);
0 commit comments