A cat has 1 mouse. Felix is a cat. How many mice does Felix have? |
You can do this in one of two ways:
1 ?- ['file1', 'file2'].
)
The plural of mouse is mice. |
Carmen is a cat. A cat is an animal. A cat has 1 tail. A cat has 9 lives. Is Carmen a cat? Is Carmen an animal? How many tails does Carmen have? How many lives does Carmen have? Elijah is a prophet. A prophet is a person. A person has 1 life. Is Elijah a prophet? Is Elijah a person? Is Elijah a cat? How many lives does Elijah have? A redtail is a hawk. A hawk is a bird. A bird is a vertebrate. A vertebrate is an animal. An animal has 2 parents. Red is a redtail. How many parents does Red have? |
If you want to show off any other cool things you did, show them off after you run this basic set of input.
emacs
brings up a good editor. You can select
a region of text by holding down the left mouse button and dragging.
Paste by clicking the middle mouse button.)
ppanel
brings up a print dialog.)
sanjuan% prolog Welcome to SWI-Prolog (Version 2.9.5) Copyright (c) 1993-1997 University of Amsterdam. All rights reserved. For help, use ?- help(Topic). or ?- apropos(Word). 1 ?- consult('read.pl'). [WARNING: (/homes/iws/jpower/read.pl:8) Singleton variables: W] [WARNING: (/homes/iws/jpower/read.pl:21) Singleton variables: C] [WARNING: (/homes/iws/jpower/read.pl:74) Singleton variables: S, P, C] [WARNING: (/homes/iws/jpower/read.pl:105) Singleton variables: Num] read.pl compiled, 0.00 sec, 14,552 bytes. Yes 2 ?- talk. |: Carmen is a cat. [carmen, is, a, cat, .] ok |: A cat is an animal. [a, cat, is, an, animal, .] ok |: The plural of tail is tails. [the, plural, of, tail, is, tails, .] ok |: A cat has 1 tail. [a, cat, has, 1, tail, .] ok ok |: A cat has 9 lives. [a, cat, has, 9, lives, .] ok |: Is Carmen a cat? [is, carmen, a, cat, ?] yes |: Is Carmen an animal? [is, carmen, an, animal, ?] yes |: How many tails does Carmen have? [how, many, tails, does, carmen, have, ?] 1 |: How many lives does Carmen have? [how, many, lives, does, carmen, have, ?] 9 |: Elijah is a prophet. [elijah, is, a, prophet, .] ok |: A prophet is a person. [a, prophet, is, a, person, .] ok |: The plural of life is lives. [the, plural, of, life, is, lives, .] ok |: A person has 1 life. [a, person, has, 1, life, .] ok |: Is Elijah a prophet? [is, elijah, a, prophet, ?] yes |: Is Elijah a person? [is, elijah, a, person, ?] yes |: Is Elijah a cat? [is, elijah, a, cat, ?] unknown |: Is Carmen a prophet? [is, carmen, a, prophet, ?] unknown |: How many lives does Elijah have? [how, many, lives, does, elijah, have, ?] 1 |: A redtail is a hawk. [a, redtail, is, a, hawk, .] ok |: A hawk is a bird. [a, hawk, is, a, bird, .] ok |: A bird is a vertebrate. [a, bird, is, a, vertebrate, .] ok |: A vertebrate is an animal. [a, vertebrate, is, an, animal, .] ok |: An animal has 2 parents. [an, animal, has, 2, parents, .] ok |: Red is a redtail. [red, is, a, redtail, .] ok |: How many parents does Red have? [how, many, parents, does, red, have, ?] 2 |: quit. [quit, .] Yes