This preview shows page 1. Sign up to view the full content.
Unformatted text preview: Jess> (modify ?id (location dining-room)) <Fact-2> Jess> (facts) f-0 (MAIN::initial-fact) f-2 (MAIN::box (location dining-room) (contents spatula sponge frying-pan)) For a total of 2 facts in module MAIN. The optional extends clause of the deftemplate construct lets you define one template in terms of another. For example, you could define a used-auto as a kind of automobile with more data: Jess> (deftemplate used-auto extends automobile (slot mileage) (slot blue-book-value) (multislot owners)) TRUE A used-auto fact would now have all the slots of an automobile, in the same order, plus three more. As we'll see later, this inheritance relationship will let you act on all automobiles (used or not) when you so desire, or only on the used ones. 5.3. Shadow facts: reasoning about Java objects...
View Full Document
This note was uploaded on 03/02/2010 for the course COMP 102 taught by Professor Smith during the Spring '10 term at California State University , Monterey Bay.
- Spring '10