CSE 463/563, Spring 2003

(OPTIONAL) PROGRAMMING PROJECT #3

Ontology for a Knowledge Base

Last Update: 7 April 2003

Note: NEW or UPDATED material is highlighted

For this project, you will define an ontology for genealogy: children, siblings, parents, grandparents, cousins, etc., and, given a knowledge base containing facts that can be expressed using this ontology, you will answer questions about the knowledge base. (This project is adapted from Russell & Norvig.)

You may do this project either in SNePS or else in FOL. If you choose SNePS, you must use the computer and our SNePS implementation, turning in a demo file. If you choose FOL, you may do the project just using "paper and pencil" (well, actually just using a word-processor!). However, there are a couple of implementations of FOL theorem-provers that you could use if you wish, and there's even a different version of SNePS that you could use! (See below.)


  1. Below are informal definitions of several predicates. (The definitions are adapted from the Collins COBUILD dictionary for speakers of English as a second language.)

    Write formal definitions of these predicates in your chosen KR language. Be sure to give the syntax and semantics of all non-logical expressions (primarily terms and predicates).

    Here's an example: "Your sibling is your brother or sister" can be represented in FOL as follows:

    AxAy[Sibling(x,y) <-> Az[Parent(z,x) <-> Parent(z, y)]]

    (I.e., for all x and for all y: x and y are siblings iff, for all z: z is a parent of x iff z is a parent of y.)

    SyntaxSemantics
    Sibling(x,y)x and y are siblings
    Parent(x,y)x is a parent of y

    It can be represented in SNePS as follows:

    (assert forall ($x $y)
            thresh 1
            arg (build rel Sibling object (*x *y))
    	arg (build forall $z
                       thresh 1
                       arg (build rel Parent object1 *z object2 *x)
                       arg (build rel Parent object1 *z object2 *y)))
    

    (Note: For the syntax and semantics of the "thresh" relation in SNePS, see the SNePS User Manual.

    (You would, of course, also need to provide the syntax and semantics of any new case frames that you introduce.)

    And it can be represented in SNePSLOG (see below) as follows:

    all(x,y)(Sibling({x,y}) <=> all(z)(Parent(z,x) <=> Parent(z,y)))
    

    (Here, you could use the same kind of syntax and semantics as for FOL, since there are no (usable) case frames in SNePSLOG!)

    Now, here are the informal definitions that you must represent in your chosen KR language:

    Here are some other hints: You might find it useful to decide which relations are "primitive" (i.e., which ones are "given" and cannot be defined in terms of any others) and then define the rest in terms of these (otherwise, you'll risk having circular definitions). Here is a suggested set of primitives (you may need others):

    [[Female(x)]] = x is female
    [[Male(x)]] = x is male
    [[Child(x,y)]] = x is a child of y
    [[Parent(x,y)]] = x is a parent of y
    [[Spouse(x,y)]] = x and y are spouses (i.e., x and y are married to each other)

  2. Next, consider the following portion of the British royal family tree:

    Here is the syntax and semantics for understanding this tree:

    Now, represent the basic facts depicted in this family tree in your chosen KR language.

  3. Based on all this knowledge, answer the following questions:

    (a) If you are working in SNePS or SNePSLOG, input all the wffs you have represented, and let SNIP answer these questions.

    (b) If you are working in FOL, use Resolution (together with the clause-form algorithm, the refutation strategy, and the unification algorithm) to answer these questions.

As I said at the beginning, there are two on-line implementations of FOL reasoning systems:

  1. One is the "tell/ask" feature of Russell & Norvig's software; instructions for using it (and an example of its use) were included in "HW 4 Answers & Grading Scheme"

  2. The other is Prof. Shapiro's resolution theorem prover. (Also take a look at his "Foundations of Logic & Inference website).

Finally, for those of you using SNePS, you might want to consider using instead SNePSLOG: a logic-oriented version of SNePS, which has its own "tell/ask" interface. Briefly, in SNePSLOG, you enter information in a variety of FOL, but use SNIP to handle inference! To run SNePSLOG, just type (snepslog) instead of (sneps) at the Lisp prompt after loading SNePS. For more information on SNePSLOG, see the SNePS [2.5] User Manual, especially the sections on SNePSLOG and on "The Tell-Ask Interface".

Extra Credit:

Here are some more definitions, leading up to a complex one. Formally define the complex one in your chosen KR language.


As usual, you should turn in a conference-paper-style report (or a report in the style of a section of Brachman & Levesque) discussing what you did, giving the full syntax and semantics of your representations, and providing annotated demos and commented code. Any software you use that you did not write should be fully and correctly cited.

This project is optional in the following sense: You do not have to do it. If, however, you choose to do it, then I will compute your overall project grade by dropping the lowest of the 3 project grades and averaging the remaining 2. If this does not improve your overall project grade (e.g., because your grade on this optional project is lower than your other two project grades), then I will raise that average to the next highest letter grade (e.g., B+ would become A-). So, you can't lose by doing this project. However, only a complete Project 3 is eligible for this treatment; incomplete projects will not be considered.

DUE AT START OF LECTURE, MON., APR. 28

Sinclair, John (ed.) (1987), Collins
COBUILD English Language Dictionary (London: Collins).


Copyright © 2003 by William J. Rapaport (rapaport@cse.buffalo.edu)
file: 563/proj3.2003.04.03.html