Page Numbers: Yes First Page: 1
Heading:
April 28, 1979 1:25 PM[IVY]<KRL>document>match-seek-formal
# Seek
self: A Program with
inputs = {My initialDescription, My specifier}
outputs =
{Using My specifier
’Primary => My primaryDescription
’Pointer => My pointer
’Identity => My primaryDescription}
result =
Using My specifier
’Primary =>
Using My derivedDescriptions
HasMember(A PrimaryDescription) => ’Succeed
Otherwise => ’Fail
’Identity =>
Using My derivedDescriptions
HasMember(A PrimaryDescription
An IdentityDescription) => ’Succeed
Otherwise => ’Fail
’Pointer =>
Using My derivedDescriptions
HasMember(A PrimaryDescription
A PointerEquivalentDesc) => ’Succeed
Otherwise => ’Fail
specifier: Or(’Primary, ’Pointer, ’Identity)
initialDescription: A Description
derivedDescriptions:
SetOf(A Description with
referent = The referent from My initialDescription)
HasMember(My initialDescription)
primaryDescription:
A PrimaryDescription
MemberOf(My derivedDescriptions)
pointer: A DataStructure
The EquivalentPointer from My primaryDescription
# Describe
self: A Program with
inputs = {My initialDescription, My newDescription,
My worlds, My mode}
outputs = {The resultingDescription from My changePrimary}
result =
Using The result from My findPrimary
’Fail => ’Fail
’Succeed => The result from My CheckConsistency
mode: Or(’Describe, ’ReDescribe, ’Augment)
initialDescription: A Description
newDescription: A Description
worlds: SetOf(A WorldDescriptor)
primaryDescription:
A PrimaryDescription
A Description with referent = The referent from My initialDescription
A LongTermDescription
findPrimary:
A Seek with
initialDescription = My initialDescription
specifier = ’Primary
primaryDescription = My primaryDescription
checkConsistency:
A↑1 MatchDescription with
pattern = My newDescription
datum = My primaryDescription
mode = ’Possible
1: Comment("We need some way to specify effort -- in this case, only the
simplest forms of conflict are looked for. We need to decide
whether this should include categories")
changePrimary:
Using My mode
’Describe =>
A ChangeLongTermDescription with
description = My primaryDescription
newDescription = My newDescription
’ReDescribe =>
A ReplaceLongTermDescription with
description = My primaryDescription
newDescription = My newDescription
’Augment =>
An AugmentSetDescription with
set = My primaryDescription
newElementDesc = My newDescription
# Match
mode: Or(’Known, ’Possible)
patternType:↑1 Or (’Description, ’Referent)
1: Comment ("If the patternType is ’Referent, then it is assumed that the
pattern description has a referent, which is found (using
Seek) and checked to see if it is the same as the referent of
the datum. If the patternType is ’Description, then it is
assumed that the pattern is to be tested as a possible
description of the referent of the datum. In both cases, the
datum is assumed to have a referent. In those cases where
the datum represents an arbitrary entity fitting its
description, the input datum should be (explicitly) a
PrimaryDescription.")
pattern: A Description
datum: A Description
# MatchReferent↑1 1: FurtherSpecified(Match)
Comment ("Assumes there are referents for both
descriptions, and checks to see if they
are the same")
self: A Program with
result =
Using The content from My derivedDescriptions
HasMember
(A CoReference with
entities = {The referent from My datum,
The referent from My pattern}) => ’Match
HasMember
(A NonCoReference with
entities = {The referent from My datum,
The referent from My pattern}) => ’NoMatch
Otherwise =>
Using My mode
’Known => ’Unknown
’Possible => ’Match
patternType: ’Referent
patternPrimary: The primaryDescription from My findPatPrim
datumPrimary: The primaryDescription from My findDatPrim
findPatPrim: A Seek with
specifier = ’Primary
initialDescription = My pattern
findDatPrim: A Seek with
specifier = ’Primary
initialDescription = My datum
derivedDescriptions:
SetOf(A Description)
DerivationFrom(The longTermDescriptions from
a DescriptionState thatIs
The initialState from My self
viewedAs an Operation}))
# MatchDescription↑1
1: FurtherSpecified(Match)
Comment ("Assumes that there is a referent for the datum, and checks to see
if the pattern is a description of it. If the mode is ’Known,
then the pattern description must be derivable from other
available description. If it is ’Possible, then only lack of
incompatibility must be shown. If mode is ’DescDesc, then
it makes up a referent with no other properties")
self: A Program with
result =
Using The content from My hypotheticallyDerivedDescriptions
WhichIs Inconsistent => ’NoMatch
otherwise =>
Using My mode
’Known =>
Using The content from My derivedDescriptions
SupersetOf(My hypothesizedContent) => ’Match
otherwise => ’Unknown
’Possible => ’Match
patternType: ’Description
datumPrimary: The primaryDescription from My findDatPrim
findDatPrim: A Seek with
specifier = ’Primary
initialDescription = My datum
hypothesizedContent:
Substitution(The meaning from My pattern,
<The referent from My datum,
The referent from My patttern>)
hypothesizedDescription:
A DescriptionSet with content = My hypothesizedContent
derivedDescriptions:
SetOf(A Description)
DerivationFrom(The longTermDescriptions from
a DescriptionState thatIs
The initialState from My self
viewedAs an Operation}))
hypotheticallyDerivedDescriptions:
SetOf(A Description)
DerivationFrom(SetUnion({My hypothesizedDescription,
The longTermDescriptions from
a DescriptionState thatIs
The initialState from My self
viewedAs an Operation}))
# ChangeLongTermDescription↑1
1: Comment ("triggering of demons is included here")
self: An EventSource with events = My trapEvents
A DataModification
Using The worlds from My newDescription
The worlds from My description =>
Using My newDescription
A UnitPerspective => An AddPerspective with
oldDescription = My description
perspective = My newDescription
A SlotPerspective => An AddSlotPerspective with
oldDescription = My description
perspective = My newDescription
A Linkage => An AddLinkage with
oldDescription = My description
linkage = My newDescription
otherwise => A AddContingentDescription with
oldDescription = My description
newDescription = My newDescription
description: A LongTermDescription
newDescription: A Description with
referent = The referent from My description
oldForm: The form from My description
newForm: A DescriptionForm
The form from a Description with
referent = The referent from My description
worlds = The worlds from My description
meaning = SetUnion({The meaning from My description,
My meaning from My newDescription})
trapEvents: AppendOrAdd
({A DescriptionAdded with
oldDescription = My oldDescription
newDescription = My newDescription,
Using My newDescription
Or(A PrimaryDescription, A Pointer, A UnitLinkage) =>
A DescriptionFilled with
oldDescription = My oldDescription
newDescription = My newDescription})
# ReplaceLongTermDescription↑1
1: Comment ("triggering of demons needs to get included here somewhere")
self: An EventSource with events = My trapEvents
A DataModification
A ReDescribe with
initialDescription = My description
newDescription =
Eval(\A Description with
compiledForm = CompiledForms(My newDescription)
descriptionForm= DescriptionForm(My newDescription))
description: A LongTermDescription
newDescription: A Description with
referent = The referent from My description
trapEvents: AppendOrAdd
({Using The worlds from My description
A CurrentWorld =>
A WorldUpdated with
oldDescription = My oldDescription
newDescription = My newDescription
otherwise =>
A DescriptionReplaced with
oldDescription = My oldDescription
newDescription = My newDescription,
Using My newDescription
Or(A PrimaryDescription, A Pointer, A UnitLinkage) =>
A DescriptionFilled with
oldDescription = My oldDescription
newDescription = My newDescription})
# AddPerspective
self: A DataModification
An EventSource with events = My newInstantiation
An OperationSequence with
operations = AddOrAppend(My addPerspectiveForm,
My addRecord,
My addFillers)
oldDescription: A Description
perspective: A UnitPerspective
unit: The templateUnit from My perspective
header: A CompilationHeader; The header from My unit
destinationPerspective:
A UnitPerspectiveForm with templateUnit = My Unit
Using The descriptionForm from My oldDescription
My oldPerspectiveForm => My oldDescription
[An ImplicitAndForm
Which HasMember
(My oldPerspectiveForm)] => My oldPerspectiveForm
otherwise => NewStructure(A UnitPerspective with
templateUnit = My unit)
oldPerspectiveForm:↑1 A UnitPerspectiveForm with templateUnit = My unit
oldRecord:↑1 A CompiledRecord with template = My unit
1: A SlotForBinding
destinationRecord:
A CompiledRecord with
template = My unit
header = The header from My unit
Using My unit
WhichIs Declared =>
Using The compiledForm from My oldDescription
HasMember([A CompiledRecord with
header = My header
My oldRecord]) => My oldRecord
HasMember([A CompiledRecord with
template = My unit
header = Not(My header)
My oldRecord])
=> UpdateRecordForm(My oldRecord)
otherwise => NewRecordForm(My unit)
addRecord:
Using My unit
WhichIs Declared =>
Using My destinationRecord
My oldRecord => Nil
UpdateRecordForm(My oldRecord) =>
A ReplaceRecord with
description = My oldDescription
newRecord = My destinationRecord
oldRecord = My oldRecord
otherwise => An AddRecord with
description = My oldDescription
record = My destinationRecord
addPerspectiveForm:
Using My destinationPerspective
A NewStructure =>
Using The descriptionForm from My oldDescription
An ImplicitAnd => An AddElementToAnd with
oldDescriptor = My oldDescription
newElement =
My destinationPerspective
otherwise => A DisplaceDescriptorWithAnd with
oldDescriptor = My oldDescription
newElement = My destinationPerspective
otherwise => Nil
addFillers: MapSet(The fillerPairs from My perspective,
\An AddFiller with
record = My destinationRecord
oldPerspective = My destinationPerspective
fillerPair = This element
top = My oldDescription)
newInstantiation:
Using My oldDescription
[A PrimaryDescription;
Not(Which IncludesBelief
(A Mapping with
template = My unit
instance = My referent))]
=> A PrototypeKnown with
context = My oldDescription
unit = My unit
instance = My oldDescription
# AddFiller
self: A DataModification
An EventSource with events = My triggerEvents
fillerPair: A fillerPair
unit: A Unit
declaration: A CompilerSlotDeclaration with
slot = My slot
slot: The slot from My fillerPair
record: A CompiledRecord with unit = My unit
oldPerspectiveForm: A UnitPerspectiveForm with templateUnit = My unit
oldPair: A PairForm with slotName = The slotName from My slot
MemberOf(The Pairs from My oldPerspectiveForm)
top:↑1 A Description1: Comment("This is used to determine if the pair is being
added to a top-level perspective in a
primary description, and therefore should
cause triggering")
addDescription:
Using My unit
WhichIs Declared =>
Using My slot
HasDeclaration(My declaration) =>
Using The filler From My fillerPair
FitsDeclaration(My declaration) =>
A FillField with
record = My record
slot = My slot
filler = My filler
otherwise =>
Using The fillerPairs from My oldPerspectiveForm
HasMember(My oldPair) =>
An AddDescToFiller with
pair = My oldPair
filler = My filler
otherwise => OperationSequence
(<An AddNewPairToPerspectiveForm with
perspective = My oldPerspectiveForm
slot = My slot
pair = My oldPair,
An AddDescToFiller with
pair = My oldPair
filler = My filler>)
triggerEvents:
Using My top
A PrimaryDescription =>
AppendOrAdd
({A DescriptionAddedToFiller with
context = My top
newDescription = My filler
unit = My unit
slot = My slot,
Using My filler
Or(A PrimaryDescription, A Pointer, A UnitLinkage) =>
A FillerKnown with
context = My top
newDescription = My filler
unit = My unit
slot = My slot})
# AddSlotPerspective
self: A DataModification
oldDescription: A Description
perspective: A SlotPerspective
# AddLinkage
self: A DataModification
oldDescription: A Description
linkage: A Linkage
# AddContingentDescription
self: A DataModification
oldDescription: A Description
newDescription: A Description with
worlds = Not(The worlds from My oldDescription)
# FillField
self: A DataModification
record: A CompiledRecord
slot: A Slot; SlotOf(The templateUnit from My record)
filler: A Description
# AddNewPairToPerspectiveForm
self: A DataModification
A Describe with
initialDescription = \The pairs from My perspective
newForm = HasMember(A Pair with
slotName = The name from My slot)
perspective: A PerspectiveForm
slot: A Slot; SlotOf(The templateUnit from My perspective)
pair: A pairForm
# AddDescToFiller
self: A DataModification
pair: A PairForm
filler: A Description