Page Numbers: Yes First Page: 1
Heading:
October 3, 1977 4:49 PM[IFS]<KRL>code>signals.bravo
Status: first pass
Type declarations and Signal documentation for the KRL-1 matcher
# # # # # # # # # # # # # # #
Types for DECLTRAN
I am assuming that the classes will be divided up into files named ACTIONTYPE, GOALTYPE, DESCRIPTORTYPE, and RESULTTYPE with appropriate FNS lists.
Action - a record
ActionMessage - (FMEMB DATUM ’(EXPAND BEFORE DO WHEN))
ActionType - (FMEMB DATUM ACTIONTYPEFNS)
Anchor - (EQ (KrlType DATUM) ’Anchor)
BindingPair - a record
Context - a record
CountSpec
- a recordDescriptor - (EQ (TypeK DATUM) ’Descriptor)
DescriptorMessage - (FMEMB DATUM ’(SETUP ADDLINK TRY))
DHandle - (FMEMB (TypeK DATUM) ’(Anchor Descriptor))
FLAG T (* used only to check for NIL and non-NIL)
FullContext - a record
Goal ← a dataType
GoalMessage - (FMEMB DATUM ’(SETUP STARTUP NEWDESCRIPTOR
NEWLINK AFTERFIRST DESCRIBE))
GoalType - (FMEMB DATUM GOALTYPEFNS))
Irrelevant - T (* used to indicate that a RETURN value is not useable for anything)
Link - a record
LST - (OR (NULL DATUM)(LISTP DATUM)))
MapDescriptor - (EQ (KrlType DATUM) ’MapDescriptor))
MatchTable - is this a record type?
Result - a record
ResultMessage (FMEMB DATUM ’(SUCCEEDED FAILED ABORTED COMPLETED
PARTIALLY-SUCCEEDED))
ResultType - (FMEMB DATUM RESULTTYPEFNS))
SlotAnchor - (AND (EQ (KrlType DATUM) ’ANCHOR) (FetchMem DATUM Named))
TrapType - (FMEMB DATUM TRAPTYPES)
TriggerType - (FMEMB DATUM TRIGGERTYPES)
# # # # # # # # # # # # # # #
Signals
The following is a partial list of the signals generated in the Align code. There are many missing, especially those associated with triggers. It reflects the current state of align.bravo and classes.bravo, but cannot be trusted as they evolve.
AllGoalsSuspended
generated in: RunGoal
reason: There are active goals, but they are all suspended.
relevant variables: all of the FullAlign free variables, esp. activeGoals
responses:
OK -> unsuspend all suspended goals and go on
SUCCEED -> the Align succeeds with the usual signals
FAIL -> the Align fails with the ususal signals
else -> the alignment goes on, the response having unsuspended something on activeGoals or added a new unsuspended goal
CompletedTopGoalResult
generated in: SuccessfulResults
reason: The top level goal succeeded with one or more results. The go-ahead was given (via response to FoundTopGoalResult) to do the actions for newResult. They have been done, and newResult has been pushed on oldResults.
relevant variables: newResult oldResults pendingResults alignValue
responses:
STOP -> the Align succeeds immediately, with resultValue or bindings for this result added to alignValue
OK -> the result is added to alignValue and the process goes on
else -> ignore this result and go on
ConvertingReflexiveInDatum
generated in: Reflexive/TRY
reason: A reflexive has been found in the datum (most likely in a description inherited from a prototype). A corresponding map descriptor will be produced (actually building memory structure in a scratch space) and used.
relevant variables: self goal
responses:
OK -> do it
else -> don’t
CreatingInstanceForMapLink
generated in: FindInstance
reason: An anchor is being created for the self filler of a map descriptor in order to provide the instance for the context of a link.
relevant variables: mapD prototype anchor
responses:
OK -> create the anchor and use it for the link
SKIP -> the variable anchor has been set to the appropriate instance to use in the link
else -> don’t create the link
FollowingCoreference
generated in: Coreference/ADDLINK
reason: A coreference appears in the datum. The anchor it points to will be used to get more datum descriptors. At the time of this signal, the link is being added, not followed.
relevant variables: self goal fullContext
responses:
OK -> add a link to the goal
else -> don’t
FollowingCoreferenceInPattern
generated in: AlignCoreference/AFTERFIRST
reason: A non-primary coreference in the pattern didn’t match immediately. Try to find a post for it (using full-scale Find) then match that post against the datum.
relevant variables: self
responses:
OK -> look for the post
else -> don’t
FollowingMapLink
generated in: MapDescriptor/ADDLINK
reason: this looks in the slots of the mapD to see if they can be inverted. e.g. if the mapD is \The x from a y thatIs z/ then it looks in anchor z for \a y with x = .../ and creates a link to the x filler anchor. Not currently implemented
relevant variables: self
responses:
OK -> look for the linked anchor
else -> don’t
FoundTopGoalResult
generated in: SuccessfulResults
reason: The top level goal succeeded with one or more results. There may be still others to be found, but at least one batch has arrived. newResult is on neither oldResults nor pendingResults. The actions for the result have not been taken. This is the place to stick in a PRODUCE if you want Align to act as a generator.
relevant variables: newResult oldResults pendingResults alignValue
responses:
STOP -> the Align succeeds immediately, nothing new added to alignValue
OK -> the result is processed for actions
else -> ignore this result and go on
ImplicitDescribe
generated in: FullAlign
reason: To set the value of variable describe used to decide whether to satisfy a goal by adding the pattern descriptors to the datum.
relevant variables:
responses:
OK -> do a describe
else -> don’t
LinkingToPrototype
generated in: MapDescriptor/ADDLINK
reason: The datum includes a map descriptor. A link is made (with appropriate context) to the prototype slot for its focus slot.
relevant variables: self goal fullContext
responses:
OK -> put in the link
else -> don’t
LinkingToPrototypeSelf
generated in: MapDescriptor/ADDLINK
reason: The datum includes a map descriptor with focus slot a self slot. A link is made (with appropriate context) to the prototype slot.
relevant variables: self goal fullContext
responses:
OK -> put in the link
else -> don’t
NotEnoughItemsFound
generated in: SetUpFind
reason: A find of nth element was tried on a set or sequence with fewer than n elements
relevant variables: candidates count immediateBindings
responses:
OK -> ignore the binding and go on with the match
else -> cause a failure for the goal trying the binding
NothingHappened
generated in: RunGoal
reason: There are active goals, but on a complete cycle, nothing happened.
relevant variables: all of the FullAlign free variables, esp. activeGoals
responses:
OK -> unsuspend all suspended goals and go on
SUCCEED -> the Align succeeds with the usual signals
FAIL -> the Align fails with the ususal signals
else -> the alignment goes on, the response having changed something so something will happen
NothingToDo
generated in: RunGoal
reason: There are no active goals.
relevant variables: all of the FullAlign free variables, esp. activeGoals, alignValue
responses:
SUCCEED -> the Align succeeds with the usual signals
FAIL -> the Align fails with the ususal signals
else -> the alignment goes on, the response having put something on activeGoals
PartialResultFound
generated in: GoalPartiallySucceeded
reason: One set of results were returned for a goal. others are potentially available.
relevant variables: goal results
responses:
STOP -> suspend the goal (and its descendants)
else -> don’t
SimpleCanMatch
generated in: FullAlign
reason: To set the value of variable canMatch used to decide whether to pursue a goal or simply pass up the value INCOMPLETE if it doesn’t fail immediately.
relevant variables:
responses:
OK -> do a simple structural can-match
else -> don’t
StructuralMatch
generated in: FullAlign
reason: To set the value of variable structuralMatch used to decide whether to pursue a goal or simply pass up the value FAIL if it doesn’t succeed immediately.
relevant variables:
responses:
OK -> do a structural match
else -> don’t
SuspendAfterResult
generated in: CheckDisjunctCompletion
reason: A disjunction succeeded with one set of results.
relevant variables: goal
responses:
OK -> Suspend all of the other alternatives
else -> go on
UngroundedAction
generated in: SetUpAction
reason: The pattern specifies an action to be taken, but it would not be taken on a part of the original datum.
relevant variables: doArg anchorPath
responses:
OK -> Ignore this action and go on
else -> Alignment is aborted
UnknownActionType
generated in: DoActions
reason: A Do functional contains an unknown first element (action type). This happens after the match has succeeded and actions ar being done.
relevant variables: action
responses:
whatever -> Go on assuming user has put in right type. This needs to be improved.
UnknownBindingType
generated in: SetUpAnchorMatch
reason: A Pattern element has a metadescriptor which is not a Do functional.
relevant variables: anchorGoal meta metaDescriptor
responses:
OK -> Ignore this metadescriptor and go on (action can modify the goal)
else -> Alignment of the anchor fails
UnknownInterpretedMapDInDatum
generated in: InterpretedMapD/TRY
reason: A datum element is an interpreted map descriptor which is not recognized, and the match is not a structural match. It is being tried on some goal.
relevant variables: self goal fullContext
responses:
whatever -> go ahead. if you want the descriptor use, make calls to the functions which use it (e.g. TryDescriptor..., AddLink...). If you want the match to succeed or fail, do it directly (e.g. GoalDone... AlignCompleted...)
UnknownInterpretedMapDInPattern
generated in: InterpretedMapD/SETUP
reason: A Pattern element is an interpreted map descriptor which is not recognized, and the match is not a structural match. A goal has been set up with goalType blank
relevant variables: self goal
responses:
OK -> go ahead (the goal record has been fixed up)
SUCCEED -> the goal for this descriptor succeeds
FAIL -> the goal for this descriptor fails
else -> Abort the alignment
UnknownMetaOnPatternAnchor
generated in: AlignAnchor/SETUP
reason: A Pattern element has a metadescriptor which is not a Do functional.
relevant variables: self meta metaDescriptor
responses:
OK -> Ignore this metadescriptor and go on (action can modify the goal)
else -> Alignment of the anchor fails
UsingCategoriesForPatternCoreference
generated in: AlignCoreference/STARTUP, AlignPost/STARTUP
reason: A coreference didn’t match immediately, so we can use categories from the anchor it points to to try to make match fail.
relevant variables: self
responses:
OK -> get the categories
else -> don’t
UsingTrap
generated in: DoTraps
reason: An applicable trap has been found.
relevant variables: ANCHOR WORLD type trap
responses:
OK -> go ahead and evaluate the trap form (the variable trap can be reset)
else -> don’t
UsingTrigger
generated in: DoTriggers
reason: An applicable trap has been found.
relevant variables: SLOT PROPTYPE INSTANCE WORLD type trigger
responses:
OK -> go ahead and evaluate the trigger form (the variable trigger can be reset)
else -> don’t
ValueForAbortedAlign
generated in: AbortAlign
reason: function AbortAlign was called anywhere in alignment process, or top level goal was aborted.
relevant variables: alignValue
responses:
OK -> return value of alignValue for value of fn FullAlign
else -> return NIL
ValueForAlign
generated in: AlignCompleted
reason: The FullAlign was completed successfully. The value returned from FullAlign will be the value of the free variable alignValue.
relevant variables: alignValue
responses:
OK -> return value of alignValue for value of fn FullAlign
else -> error
ValueForAlignFailed
generated in: AlignCompleted
reason: The FullAlign was completed because of failure. The value returned from FullAlign will be the value of the free variable alignValue.
relevant variables: alignValue
responses:
OK -> return value of alignValue for value of fn FullAlign
else -> error
WrongTypeForBinding
generated in: GetPost
reason: the binding type argument didn’t agree with the post descriptor. e.g. a Primary was asked for and a LispPointer found.
relevant variables: descriptor bindingType
responses:
value returned by signal is returned as value of GetPost