% File: a.p % grammar for a shapes micro-world :- ['process.p']. sentence --> cmmnd. sentence --> query. sentence --> []. cmmnd --> [place], indefArticle, color, [square], [at], number, number, [with], [side], number, ['.']. cmmnd --> [place], indefArticle, color, [rectangle], [at], number, number, [of], [height], number, [and], [width], number, ['.']. cmmnd --> [place], indefArticle, color, [circle], [at], number, number, [of], [radius], number, ['.']. cmmnd --> [stop], ['.']. query --> [what], shapes, [are], [there], ['?']. query --> [what], [color], shapes, [are], [present], ['?']. query --> [are], [there], [any], color, shapes, [present], ['?']. query --> [how], [big], [is], defArticle, shape, [at], number, number, ['?']. defArticle --> [the]. indefArticle --> [a]. indefArticle --> [an]. color --> [red]. color --> [blue]. color --> [green]. number --> [N], { number(N) }. shape --> [square]. shape --> [rectangle]. shape --> [circle]. shape --> [shape]. shapes --> [squares]. shapes --> [rectangles]. shapes --> [circles]. shapes --> [shapes].