Applying Logical Knowledge
Projects
Property Lists
- [wheels = 3, color = blue, weight = 150]
- get_pl(Attr, Val, List) :- member( Attr = Val, List).
- add_pl(Attr, Val, ListIn, ListOut) :- ...
- change_pl(Attr, Val, ListIn, ListOut) :- ...
- query_pl( QueryList, PropList) for example:
?- query_pl( [color = X, wheels > 2], [wheels = 3, color = blue,
weight = 150] ).
X = blue
yes
- allow multi-valued attribute values in lists; allow query elements that
work with them.
Frames
- frame(gus, [class=hampster, color=brown] ).
- query_fr( QueryList, FrameName ) - finds a frame that matches the query
- get_fr(FrameName, Attr, Val) :- gets the value of an attribute for a frame
Ontology
- frames for words
- word(pizza, [a_kind_of = food] ).
word(pepperoni_pizza, [a_kind_of = pizza, topping = pepperoni] ).
word(pepperoni, [a_kind_of = food] ).
- make a_kind_of a transitive property, so that a query
get_word(Word, a_kind_of, food) will find pepperoni_pizza.
Rules
- frames for rules.
- slot for conditions
- slot for values
- reason from rule to rule to basic frames
DO THE EXERCISES in FRAMES folder:
- pizzas.pro - the pattern matching application - run it first to see how
it works
- engine.pro - the engine, but with much of the code stubbed out. the exercises
are to fill in the stubs.
- engine2.pro - the full code with the answers, exclude it from your project
while doing the exercises, refer to it when you get stuck.