Introduction:
Preliminaries

  1. Preliminaries:

    Conventions, key to definitions and other nomenclature.

  2. Overview:

    A brief overview of the organization of the PAPPI system.


Contents

Conventions
Reference Manual and Implementation Notes:
The Reference Manual Page
Implementation Notes


Conventions

In general, this manual makes use of typical Prolog naming conventions. Here is a brief summary:

Constants
Compound Terms
Examples: compl, case(Case), and a(+)

Features are often encoded using constants, e.g. compl for complement position, and compound terms, e.g. case(Case) for an (uninstantiated) abstract Case slot. Compound terms may either contain variables as in the Case slot example or be fully instantiated, e.g. a(+) for anaphoric.

Lists Examples: [], [X|L], [[1,3],[sg,m],[]] and [[vp,i1,i2,c1],[]]

[] names the empty list. In [X|L], X and L name the first element and the list consisting of all but the first element, respectively. Prolog lists are also used as a general device to represent linguistic concepts. For example, lists are used to represent agreement features: [[1,3],[sg,m],[]] indicates 1st or 3rd person singular or mass. Similarly, [[vp,i1,i2,c1],[]] is used to represent the (up + down) path for constituent movement from within a VP to [Spec,CP].

Logical variables Examples: X, X', and Adjunct

To differentiate themselves from constants, only variable names begin with an uppercase character.

Constituents Examples: [NP John], NPt[1], [C...], and [VP completely [VP lost his mind]]

Where appropriate, the manual may also make use of (nested) bracketed representations for constituents, generally of the form [X ...] where X is the category label. Occasionally the brackets themselves are omitted in the case of empty categories. For example, NPt[1] or NPt-A-P[1] where just the label (NP) in conjunction with identifying features may be used, e.g. t for trace, -A for non-anaphoric, and [1] for index 1.

Note that the bracketed representation is used in PAPPI for display purposes only. In particular, you cannot specify constituents in the code in this fashion.

Predicates Examples: adjoined(+X,-Adjunct,-X'), adjoined/{2,3}, and X has_feature gamma(+)

adjoined(+X,-Adjunct,-X') specifies a 3-arity predicate adjoined, sometimes written as adjoined/3. Its three parameters are: (1) some adjunction structure X, (2) the adjunct attached to X, namely Adjunct, and (3) the lower segment of X, namely X'. The prefixes + and - are used to indicate that adjoined must be called with the first parameter instantiated to a constituent. (See the Reference Manual Page section below for an explanation of mode prefixes.)

In general, a a call to a predicate will result in either success, failure or an error. If X is an adjunction structure, the call will succeed and Adjunct and X' will be bound to the expected constituents. If X is a constituent but not an adjunction structure, the call will fail and neither output parameter will be instantiated. On the other hand, if X is uninstantiated or bound to a non-constituent, the call will result in an error and Prolog execution will come to a halt.

adjoined/{2,3} indicates that there are two versions of the predicate adjoined - one with three, the other with two arguments.

Sometimes, for readability, predicates are also declared to be infix (or distfix) operators. For example, this allows us to specify a call to has_feature/2 using either the infix form X has_feature gamma(+), or the more cumbersome standard prefix form has_feature(X,gamma(+)).

For more information on either Prolog syntax or semantics, the reader is urged to consult a Prolog programming manual or textbook.


Reference Manual and Implementation Notes

There are two kinds of pages available to the reader: (1) general documentation of constructs and primitives that will be of interest to the grammar writer, and (2) optional implementation notes describing PAPPI at the sub-primitive level.

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, an Adjunct and the lower segment X'.

For convenience, adjoined/2 and adjoined/1 may be substituted in place of adjoined/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 with X bound to constituent (a) will instantiate Adjunct and X' to be constituents (b) and (c), respectively:

(a) (b) (c)

The goal adjoined/1 with X bound to (a) will succeed, but fail when X is bound to either (b) or (c).

(Note the goal X has_feature adjunct may be used to test whether X is an adjunct.)

Finally, hypertext pointers to other related predicates are given:

References: adjoin / Implementation Notes


Implementation Notes

Sometimes, implementation notes, shown in blue, are also available. These pages describe PAPPI internals at a sub-primitive level. There should be no need for grammar writers to reference these pages except, perhaps, during detailed debugging. Documentation here assumes detailed knowledge of Prolog coding and is much more terse - sometimes just consisting of excerpts of the source code. For example:

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 ...