Advertisement
Guest User

ex3

a guest
Dec 5th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.53 KB | None | 0 0
  1. aluno(joao, calculo).
  2. aluno(maria, calculo).
  3. aluno(joel, programacao).
  4. aluno(joel, estrutura).
  5. frequenta(joao, puc).
  6. frequenta(maria, puc).
  7. frequenta(joel, ufrj).
  8. professor(carlos, calculo).
  9. professor(ana_paula, estrutura).
  10. professor(pedro, programacao).
  11. funcionario(pedro, ufrj).
  12. funcionario(ana_paula, puc).
  13. funcionario(carlos, puc).
  14.  
  15. aluno_professor(X, Y) :- aluno(X, M), professor(Y, M), funcionario(Y, U), frequenta(X, U).
  16. associado(Y, U) :- funcionario(Y, U); frequenta(Y, U).
  17.  
  18. aluno_professor(X, Y)
  19. associado(Y, U)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement