File size: 426 Bytes
557a17a
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# Grammars

* List Prolog supports grammars, for example:

* Grammars may be recursive (see test 9 in <a href="https://github.com/luciangreen/listprologinterpreter/blob/master/lpiverify4.pl">lpiverify4.pl</a>), i.e. they may repeat until triggering the base case:

test(9,`[[n,grammar1],["aaa"]]`,
[
`[[n,grammar1],[[v,s]],":-",[[[n,noun],[[v,s],""]]]]`,
`[[n,noun],"->",[""]]`,
`[[n,noun],"->",["a",[[n,noun]]]]`
],
`[[]]`).