Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- implement main
- open core, console
- class predicates
- fact : (real, real [out]).
- clauses
- fact(N, 0) :-
- N < 1,
- !.
- fact(N, R) :-
- N1 = N - 1,
- fact(N1, R1),
- R = R1 + 1 / N.
- run() :-
- console::init(),
- fact(read(), R),
- write(R),
- nl.
- end implement main
- goal
- mainExe::run(main::run).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement