Like other expert system languages, npl deals with rules and facts. Various facts can make a rule applicable. An applicable rule is then asserted. As an example, a program that applies Newton’s third law of motion to interpersonal relations:
person are thing. mike isa person. sue isa person. loves isa verb. mike loves sue. if: Person1 Verb1 Person2; then: Person2 Verb1 Person1.
The elements are, thing, isa, verb, and if: ... then: ... are primitives of the language. And, with this, npl would conclude that sue loves mike .
|||For clarity, in these examples I have removed a little bit of necessary syntax, that is only needed to allow for more complex developments.|