@@ -403,31 +403,31 @@ module SearchConfigToInfo {
403403 Some (badSeq[0])
404404 }
405405
406- function method IsValidTwin (converted : I .BeaconMap, name : string , length : B .BeaconLength, twin : string )
406+ function method IsValidShare (converted : I .BeaconMap, name : string , length : B .BeaconLength, share : string )
407407 : (ret : Result< bool , Error> )
408408 ensures ret. Success? ==>
409- && twin in converted
410- && converted[twin ]. Standard?
411- && converted[twin ]. std. length == length
409+ && share in converted
410+ && converted[share ]. Standard?
411+ && converted[share ]. std. length == length
412412 {
413- if twin in converted then
414- var tb := converted[twin ];
413+ if share in converted then
414+ var tb := converted[share ];
415415 if tb. Standard? then
416- if tb. std. twin . Some? then
417- if name == twin then
418- Failure (E("Beacon " + name + " is twinned to itself."))
416+ if tb. std. share . Some? then
417+ if name == share then
418+ Failure (E("Beacon " + name + " is shared to itself."))
419419 else
420- Failure (E("Beacon " + name + " is twinned to " + twin + " which is in turn twinned to " + tb.std.twin .value
421- + ". Twin chains are not allowed."))
420+ Failure (E("Beacon " + name + " is shared to " + share + " which is in turn shared to " + tb.std.share .value
421+ + ". Share chains are not allowed."))
422422 else if tb. std. length == length then
423423 Success (true)
424424 else
425- Failure (E("Beacon " + name + " is twinned to " + twin + " but " + name + " has length " + Base10Int2String(length as int)
426- + " and " + twin + " has length " + Base10Int2String (tb.std.length as int) + ". "))
425+ Failure (E("Beacon " + name + " is shared to " + share + " but " + name + " has length " + Base10Int2String(length as int)
426+ + " and " + share + " has length " + Base10Int2String (tb.std.length as int) + ". "))
427427 else
428- Failure (E("Beacon " + name + " is twinned to " + twin + " but " + twin + " is a compound beacon."))
428+ Failure (E("Beacon " + name + " is shared to " + share + " but " + share + " is a compound beacon."))
429429 else
430- Failure (E("Beacon " + name + " is twinned to " + twin + " which is not defined."))
430+ Failure (E("Beacon " + name + " is shared to " + share + " which is not defined."))
431431 }
432432
433433 // convert configured StandardBeacons to internal Beacons
@@ -482,20 +482,20 @@ module SearchConfigToInfo {
482482 var locString := GetLocStr (beacons[0].name, beacons[0].loc);
483483 var isPartOnly := false ;
484484 var isAsSet := false ;
485- var twin : Option< string > := None;
485+ var share : Option< string > := None;
486486 if beacons[0]. style. Some? {
487487 match beacons[0]. style. value {
488488 case partOnly (t) => isPartOnly := true ;
489- case twinned (t) => twin := Some (t.other);
489+ case shared (t) => share := Some (t.other);
490490 case asSet (t) => isAsSet := true ;
491- // = specification/searchable-encryption/beacons.md#twinnedset -initialization
492- // # A TwinnedSet Beacon MUST behave both as [Twinned ](#twinned -initialization) and [AsSet](#asset-initialization).
493- case twinnedSet (t) => twin := Some (t.other); isAsSet := true ;
491+ // = specification/searchable-encryption/beacons.md#sharedset -initialization
492+ // # A SharedSet Beacon MUST behave both as [Shared ](#shared -initialization) and [AsSet](#asset-initialization).
493+ case sharedSet (t) => share := Some (t.other); isAsSet := true ;
494494 }
495495
496496 }
497497 var newBeacon :- B. MakeStandardBeacon (client, beacons[0].name, beacons[0].length as B.BeaconLength, locString,
498- isPartOnly, isAsSet, twin );
498+ isPartOnly, isAsSet, share );
499499
500500 // = specification/searchable-encryption/search-config.md#beacon-version-initialization
501501 // # Initialization MUST fail if the [terminal location](virtual.md#terminal-location)
@@ -1070,27 +1070,28 @@ module SearchConfigToInfo {
10701070 // # Initialization MUST fail if the configuration does not use a PartOnly in a [compound beacon](#compound-beacon).
10711071 ensures |names| != 0 && I. IsPartOnly (data[names[0]]) && ! ExistsInCompound (allNames, names[0], data) ==> ret. Failure?
10721072
1073- ensures ret. Success? && 0 < |names| && data[names[0]]. Standard? && data[names[0]]. std. twin . Some? ==>
1074- && var twin := data[names[0]]. std. twin . value;
1075- && IsValidTwin (data, names[0], data[names[0]].std.length, twin ). Success?
1076- // = specification/searchable-encryption/beacons.md#twinned -initialization
1073+ ensures ret. Success? && 0 < |names| && data[names[0]]. Standard? && data[names[0]]. std. share . Some? ==>
1074+ && var share := data[names[0]]. std. share . value;
1075+ && IsValidShare (data, names[0], data[names[0]].std.length, share ). Success?
1076+ // = specification/searchable-encryption/beacons.md#shared -initialization
10771077 // = type=implication
10781078 // # This name MUST be the name of a previously defined Standard Beacon.
1079- && twin in data
1080- && data[twin ]. Standard?
1081- // = specification/searchable-encryption/beacons.md#twinned -initialization
1079+ && share in data
1080+ && data[share ]. Standard?
1081+ // = specification/searchable-encryption/beacons.md#shared -initialization
10821082 // = type=implication
10831083 // # This beacon's [length](#beacon-length) MUST be equal to the `other` beacon's [length](#beacon-length).
1084- && data[twin ]. std. length == data[names[0]]. std. length
1084+ && data[share ]. std. length == data[names[0]]. std. length
10851085 {
10861086 if |names| == 0 then
10871087 Success (true)
10881088 else
10891089 var b := data[names[0]];
10901090 if I. IsPartOnly (b) && ! ExistsInCompound (allNames, names[0], data) then
10911091 Failure (E("PartOnly beacon " + names[0] + " MUST be used in a compound beacon."))
1092- else if b. Standard? && b. std. twin. Some? then
1093- IsValidTwin (data, names[0], b.std.length, b.std.twin.value)
1092+ else if b. Standard? && b. std. share. Some? then
1093+ var _ :- IsValidShare (data, names[0], b.std.length, b.std.share.value);
1094+ CheckAllBeacons (names[1..], allNames, data)
10941095 else
10951096 CheckAllBeacons (names[1..], allNames, data)
10961097 }
0 commit comments