Skip to content

Instantly share code, notes, and snippets.

@locks
Created April 9, 2010 09:53
Show Gist options
  • Save locks/361027 to your computer and use it in GitHub Desktop.
Save locks/361027 to your computer and use it in GitHub Desktop.
resoluções para a cadeira de iarti
frase --> sn, sv.
sn --> artigo, nome.
sn --> nome.
sv --> verbo, sn.
sv --> verbo.
artigo --> [o].
artigo --> [a].
artigo --> [os].
artigo --> [as].
nome --> ['Pedro'].
nome --> ['Maria'].
nome --> [criancas].
nome --> [rapazes].
nome --> [cartas].
nome --> [futebol].
verbo --> [joga].
verbo --> [jogam].
verbo --> [conhece].
verbo --> [e].
verbo --> [sao].
frase --> sn(NUM), sv(NUM).
sn(N) --> artigo(N,G) , nome(N,G).
sn(N) --> nome(N,G).
sv(N) --> verbo(N), sn(_).
sv(N) --> verbo(N).
artigo(s,m) --> [o].
artigo(s,f) --> [a].
artigo(p,m) --> [os].
artigo(p,f) --> [as].
nome(s,m) --> ['Pedro'].
nome(s,f) --> ['Maria'].
nome(p,f) --> [criancas].
nome(p,m) --> [rapazes].
nome(p,f) --> [cartas].
nome(s,m) --> [futebol].
verbo(s) --> [joga].
verbo(p) --> [jogam].
verbo(s) --> [conhece].
verbo(s) --> [e].
verbo(p) --> [sao].
frase(L1,LR) :-
sn(NUM,L1,LaSN) , sv(NUM,LaSN,LR).
sn(NUM,L,LR) :- artigo(NUM,GEN,L,LA) , nome(NUM,GEN,LA,LR).
sn(NUM,L,LR) :- nome(NUM,GEN,L,LR).
sv(NUM,L,LR) :- verbo(NUM,L,LaV) , sn(_,LaV,LR).
sv(NUM,L,LR) :- verbo(NUM,L,LR).
artigo(s,f,[a|L],L).
artigo(p,f,[as|L],L).
artigo(s,m,[o|L],L).
artigo(p,m,[os|L],L).
nome(s,m,['Pedro'|L],L).
nome(s,f,['Maria'|L],L).
nome(p,f,[criancas|L],L).
nome(s,m,[rapazes|L],L).
nome(p,f,[cartas|L],L).
nome(s,m,[futebol|L],L).
verbo(s,[joga|L],L).
verbo(p,[jogam|L],L).
verbo(s,[conhece|L],L).
verbo(s,[e|L],L).
verbo(p,[sao|L],L).
@locks
Copy link
Author

locks commented Apr 9, 2010

iarti -> disciplina

fxxaxxvxx

f -> ficha
a -> alínea
v -> versao (opcional)
xx -> número de 2 digitos (01,02,10,11,etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment