![]() ![]() ![]() |
|
Conventions |
Reference Manual and Implementation Notes: |
|
For more information on either Prolog syntax or semantics, the reader is urged to consult a Prolog programming manual or textbook.
The Reference Manual Page
Typically, the documentation for a given PAPPI primitive is given in
the following format. First, there is a capsule definition listing the
formal parameters for the predicate. For example, here is the
definition for adjoined
:
Adjunction
adjoined(+X,-Adjunct,-X')
adjoined(+X,-Adjunct)
adjoined(+X)Constituent X
has two immediate subconstituents, anAdjunct
and the lower segmentX'
.For convenience,
adjoined/2
andadjoined/1
may be substituted in place ofadjoined/3
when either the third or last two parameters are not required.
The left side of the capsule specifies the possible modes of usage of
the predicate. Here, adjoined
may take one to three
formal parameters, the first of which, namely X
,
must be instantiated to a constituent when the predicate is
called. This is indicated by the plus symbol prefix
(+
). In general, we have:
Prefix | Meaning |
---|---|
+ |
Input variable, must be instantiated at predicate call-time. |
- |
Output variable, holds the output resulting from the predicate call. May or may not be instantiated at call-time. |
None | No restriction. Can be either an input or an output variable. Typically seen on formal parameters from predicates that have multiple modes of usage. |
+- |
Input variable that may be further instantiated after the predicate call. Typically seen on formal parameters from predicates that further specify or restrict features of an input constituent. |
The right side of the capsule contains a brief description of the parameters and the function of the predicate. Any notes will immediately follow the capsule.
Next, examples of use are given. For instance:
Examples: The goal
adjoined/3
withX
bound to constituent (a) will instantiateAdjunct
andX'
to be constituents (b) and (c), respectively:
(a) (b) (c) The goal
adjoined/1
withX
bound to (a) will succeed, but fail whenX
is bound to either (b) or (c).(Note the goal
X has_feature adjunct
may be used to test whetherX
is an adjunct.)
Finally, hypertext pointers to other related predicates are given:
References: adjoin
/ Implementation Notes
Adjunction Constructors
adjoin(Dir,Adjunct,X,X')
must not only create the larger constituent, but also set the internal positional features of the new constituent (Pn
) as well as setting the attachment features of the adjunct and original phrase:adjoin(left,A,X,[c(C,Fs,7,_,_),A,X]) :- % proj:1 adjoined:1 head:1 X = [c(C,Fs,_,1,_)|_], % lseg:1 adjunct:0 ... setPosDInfo(0,1,0,0,0,0,A). % lseg:0 adjunct:1 ... adjoin(right,A,X,[c(C,Fs,3,_,_),X,A]) :- % proj:1 adjoined:1 head:0 X = [c(C,Fs,_,1,_)|_], % lseg:1 adjunct:0 ... setPosDInfo(0,1,0,0,0,0,A). % lseg:0 adjunct:1 ...
![]() ![]() ![]() |