YAP 7.1.0
Grammar Rules

Grammar rules in Prolog are both a convenient way to express definite clause grammars and an extension of the well known context-free grammars. More...

Detailed Description

Grammar rules in Prolog are both a convenient way to express definite clause grammars and an extension of the well known context-free grammars.

A grammar rule is of the form:

-->

where both head and body are sequences of one or more items linked by the standard conjunction operator ,

Items can be:

Grammar related built-in predicates:


Class Documentation

◆ phrase/2

class phrase/2

phrase(+ P, L)

This predicate succeeds when L is a phrase of type P The same as phrase(P,L,[])

Both this predicate and the previous are used as a convenient way to start execution of grammar rules

◆ phrase/3

class phrase/3

phrase(+ P, L, R)

This predicate succeeds when the difference list _L_- _R_ is a phrase of type P