% gram.pl
% -------------------
% Luiz Arthur Pagani
% arthur@ufpr.br

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Gramática para implementação %
% de analisadores gramaticais  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Operadores
% -----------
% Aplicação funcional
:- op(500, xfx, @).
% Relação entre classe e interpretação
:- op(600, xfx, :).

% Regras gramaticais
% -------------------
% S --> SN SV
regra(s:SV@SN, [sn:SN, sv:SV]).
% SN --> Det N
regra(sn:Det@N, [det:Det, n:N]).
% SN --> SN SP
regra(sn:SP@SN, [sn:SN, sp:SP]).
% SV --> V SN
regra(sv:V@SN, [v:V, sn:SN]).
% SV --> SV SP
regra(sv:SP@SV, [sv:SV, sp:SP]).
% SP --> P SN
regra(sp:P@SN, [p:P, sn:SN]).
% Det --> 0 (para determinante nulo)
regra(det:'Indef', []).

% Carrega o léxico
:- [lex].
