Lab 6: Logic
- We're going to play with prolog today.
- There is an online prolog interpretter
here .
- I also used the sytnax from
a prolog wiki .
- Type in queries in the bottom right window (e.g. writeln(hello).)
- Write code in the left window (after create a new program).
- Try canary(tweety).
- You can look at examples too.
- Let's do an animal ontolgy.
- Make some animals, and make an subcategorisation
hierarchy (e.g. dogs are canines and canines mammals).
- Make some queries.
- Use and (the operator).
(I did it using things like adult and puppy).
- Try to add features like feathers and fur.
- Can you use not?
- Can you override inheritence (birds fly, but ostriches don't)?