home *** CD-ROM | disk | FTP | other *** search
Prolog Source | 1990-03-26 | 653 b | 31 lines |
- /*
- Copyright (c) 1986, 90 by Prolog Development Center
- */
-
- domains
- person = p(name, age, telno, job)
- age = integer
- telno, name, job = string
-
- predicates
- readperson(person)
- run
-
- goal
- run.
-
- clauses
- readperson(p(Name, Age, Telno, Job)) :-
- write("Which name ? "), readln(Name),
- write("Job ?"), readln(Job),
- write("Age ?"), readint(Age),
- write("Telephone no ?"), readln(Telno).
-
- run :-
- readperson(P), nl, write(P), nl, nl,
- write("Is this compound object OK (y/n)"),
- readchar(Ch), Ch='y'.
-
- run :-
- nl, nl, write("Alright, try again"), nl, nl, run.