Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- predicates
- bigger(symbol,symbol)
- clauses
- bigger(elephant,horse).
- bigger(horse,donkey).
- bigger(donkey,dog).
- bigger(donkey,monkey).
- Files Edit Run Compile Options Setup
- +---------------------- Editor ----------------------++-------- Dialog --------+
- ¦ Line 8 Col 1 D:\1080P\ELEPHA~1.PRO Indent¦¦Goal: bigger(monkey,elep¦
- ¦predicates ¦¦hant) ¦
- ¦ bigger(symbol,symbol) ¦¦No ¦
- ¦clauses ¦¦Goal: bigger(elephant,ho¦
- ¦ bigger(elephant,horse). ¦¦rse) ¦
- ¦ bigger(horse,donkey). ¦¦Yes ¦
- ¦ bigger(donkey,dog). ¦¦Goal: bigger(elephant, m¦
- ¦ bigger(donkey,monkey). ¦¦onkey) ¦
- ¦ ¦¦No ¦
- ¦ ¦¦Goal: ¦
- predicates
- bigger(symbol,symbol)
- is_bigger(symbol,symbol)
- clauses
- is_bigger(X, Y) :- bigger(X, Y).
- is_bigger(X, Y) :- bigger(X, Z), is_bigger(Z, Y).
- bigger(elephant,horse).
- bigger(horse,donkey).
- bigger(donkey,dog).
- bigger(donkey,monkey).
- Files Edit Run Compile Options Setup
- +---------------------- Editor ----------------------++-------- Dialog --------+
- ¦ Line 5 Col 1 D:\1080P\ELEP2.PRO Indent I¦¦Goal: bigger(monkey,elep¦
- ¦predicates ¦¦hant) ¦
- ¦ bigger(symbol,symbol) ¦¦No ¦
- ¦ is_bigger(symbol,symbol) ¦¦Goal: bigger(elephant,ho¦
- ¦clauses ¦¦rse) ¦
- ¦ is_bigger(X, Y) :- bigger(X, Y). ¦¦Yes ¦
- ¦ is_bigger(X, Y) :- bigger(X, Z), is_bigger(Z, Y¦¦Goal: bigger(elephant, m¦
- ¦ ¦¦onkey) ¦
- ¦ bigger(elephant,horse). ¦¦No ¦
- ¦ bigger(horse,donkey). ¦¦Goal: is_bigger(elephant¦
- ¦ bigger(donkey,dog). ¦¦,monkey) ¦
- ¦ bigger(donkey,monkey). ¦¦Yes ¦
- ¦ ¦¦Goal: ¦
- predicates
- location(string,string)
- go
- clauses
- go:-
- writef("%-10 %5 \n" ,"CITY", "STATE"),
- fail.
- go:-
- location(City,State),
- writef("%-10 %2\n", City,State),
- fail.
- location("jackson","MS").
- location("washington","dc").
- location("Raliegh", "NC").
- Files Edit Run Compile Options Setup
- ┌────────────────────── Editor ──────────────────────┐╔════════ Dialog ════════╗
- │ Line 1 Col 1 D:\1080P\ELEPHA~2.PRO Indent│║rse) ║
- │predicates │║Yes ║
- │location(string,string) │║Goal: bigger(elephant, m║
- │go │║onkey) ║
- │ │║No ║
- │clauses │║Goal: is_bigger(elephant║
- │go:- │║,monkey) ║
- │writef("%-10 %5 \n" ,"CITY", "STATE"), │║Yes ║
- │fail. │║Goal: go ║
- │go:- │║CITY STATE ║
- │location(City,State), │║jackson MS ║
- │writef("%-10 %2\n", City,State), │║washington dc ║
- │fail. │║Raliegh NC ║
- │ │║No ║
- │location("jackson","MS"). │║Goal: ║
Advertisement
Add Comment
Please, Sign In to add comment