home *** CD-ROM | disk | FTP | other *** search
Prolog Source | 1986-10-07 | 292 b | 19 lines |
- /* Program 10 */
- /*
- Goals to enter are on page 42 of the manual.
- */
-
- domains
- n, f = real
-
- predicates
- factorial(n,f)
-
- clauses
- factorial(1,1).
- factorial(N,Res) if
- N > 0 and
- N1 = N-1 and
- factorial(N1,FacN1) and
- Res = N*FacN1.