Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 0.38 KB | None | 0 0
  1. % Hilfsprädikat peano_to_int(+Peanozahl, -Ausgabe)
  2. peano_to_int(0, Ausgabe) :-
  3. Ausgabe = 0.
  4.  
  5. peano_to_int(s(Peanozahl), Ausgabe) :-
  6. peano_to_int(Peanozahl, Ausgabe2),
  7. Ausgabe is Ausgabe2 + 1.
  8.  
  9. % peano_groesser_gleich(+PeanoZahl1, +PeanoZahl2).
  10.  
  11. peano_groesser_gleich(PeanoZahl1, PeanoZahl2) :-
  12. peano_to_int(PeanoZahl1, Int1),
  13. peano_to_int(PeanoZahl2, Int2),
  14. Int1 >= Int2.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement