Comments on FC00 paper
Chip Morningstar
chip@communities.com
Tue, 2 Nov 1999 15:12:36 -0800 (PST)
MarcS proposes:
>I have this suspicion this is a trick question. But here is a quicky
>implementation, attached at the bottom.
>
>#Elmer-formatted
>
>? // Sealed Box Maker, with sealer and unsealer
>? // This minimal version holds one item in the box,
>? // and that item is whichever item was put in most recently,
>? // it can only be retrieved once (to prevent forwarding of
>? // a modified version of the item if the item is mutable);
>? // once the seal is broken, the box is empty
>? def sealedBoxMaker new() : any {
>> def boxContent := null
>> def sealer seal(message) {boxContent := message}
>> def unsealer unseal() : any {
>> def unsealedContent := boxContent
>> boxContent := null
>> unsealedContent
>> }
>> def sealedBox {
>> to getSealer : any {sealer}
>> to getUnsealer : any {unsealer}
>> }
>> }
This doesn't quite work:
-- To match the sealer/unsealer semantics, it needs to be impossible to get
the sealer given the sealed box alone.
-- It must be impossible to change the contents of the box after it has been
sealed (and it must be similarly impossible to create an "unsealed" box
that is uncommited as to what is in it until you decide later what to
put in it).
-- You must be able to seal multiple messages with the same sealer and be
able to unseal them all later with the same unsealer.
It's a good puzzle for testing one's understanding of the idea...
I'm sure version 2 will be completely debugged ;-)