Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PREDICATES
- hcf(integer, integer, integer)
- CLAUSES
- hcf(X, Y, X):-
- Y mod X = 0.
- hcf(X,Y,Z):-
- S = Y mod X,S<>0, hcf(S, X, Z).
- GOAL
- hcf(5,10,X).
- //FACPTIEAL
- PREDICATES
- factorial(unsigned,real)
- Clauses
- factorial(1,1):-!.
- factorial(N,FactN):-
- M=N-1,
- factorial(M,FactM),
- FactN=N*FactM.
- Goal
- factorial(5,F).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement