Advertisement
Jater

Simple tasks_2

Oct 20th, 2013
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.76 KB | None | 0 0
  1. implement main
  2.     open core,stdio
  3.  
  4. constants
  5.     className = "main".
  6.     classVersion = "".
  7.    
  8. class predicates
  9.     group:(string,integer,string) nondeterm anyflow.
  10.     ranee:().
  11.     rock:().
  12.    
  13. clauses
  14.     classInfo(className, classVersion).
  15.    
  16.     group("KiSH",1988,"rock").
  17.     group("Justin Bieber",2009,"pop").
  18.     group("DDT",1980,"rock").
  19.     group("Kirkorov",1890,"65what").
  20.    
  21.     ranee():-
  22.         group(X,Y,_), if Y<2000 then write(X, ", ") else end if, fail.
  23.     ranee().
  24.    
  25.     rock():-
  26.         group(Z,_,"rock"), write(Z,", "),fail.
  27.     rock().
  28.  
  29. clauses
  30.     run():-
  31.         console::init(),
  32.         ranee(), nl, rock(),
  33.         succeed(). % place your own code here
  34. end implement main
  35.  
  36. goal
  37.     mainExe::run(main::run).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement