Using Definite Knowledge - PowerPoint PPT Presentation

About This Presentation
Title:

Using Definite Knowledge

Description:

Department of Computer Science and Engineering. Using ... recursive definitions of ... Each relation is defined in terms of instances that are lower in ... – PowerPoint PPT presentation

Number of Views:37
Avg rating:3.0/5.0
Slides: 14
Provided by: MarcoVa
Learn more at: https://www.cse.sc.edu
Category:

less

Transcript and Presenter's Notes

Title: Using Definite Knowledge


1
Using Definite Knowledge
  • Notes for Ch.3 of Poole et al.
  • CSCE 580
  • Marco Valtorta

2
Databases and Recursion
  • Datalog can be used to define relational algebra
  • Datalog is more powerful than relational algebra
  • It has variables
  • It allows recursive definitions of relations
  • Therefore, e.g., datalog allows the definition of
    the transitive closure of a relation.
  • Datalog has no function symbols it is a subset
    of definite clause logic.

3
Relational DB Operations
  • A relational db is a kb of ground facts
  • datalog rules can define relational algebra
    database operations
  • The examples refer to the database in course.pl

4
Selection
  • Selection
  • cs_course(X) lt- department(X, comp_science).
  • math_course(X) lt- department(X, math).

5
Union
  • Union multiple rules with the same head
  • cs_or_math_course(X) lt- cs_course(X).
  • cs_or_math_course(X) lt- math_course(X).
  • In the example, the cs_or_math_course relation is
    the union of the two relations defined by the
    rules above.

6
Join
  • Join the join is on the shared variables, e.g.
  • ?enrolled(S,C) department(C,D).
  • One must find instances of the relations such
    that the values assigned to the same variables
    unify
  • in a DB, unification simply means that the same
    variables have the same value!

7
Projection
  • When there are variables in the body of a clause
    that dont appear in the head, you say that the
    relation is projected onto the variables in the
    head, e.g.
  • in_dept(S,D) lt- enrolled(S,C)
    department(C,D).
  • In the example, the relation in_dept is the
    projection of the join of the enrolled and
    department relations.

8
Recursion
  • Define a predicate in terms of simpler instances
    of itself
  • Simpler means easier to prove
  • Examples
  • west in west.pl
  • live in elect.pl
  • Recursion is a way to view mathematical
    induction top-down.

9
Well-founded Ordering
  • Each relation is defined in terms of instances
    that are lower in a well-founded ordering, a
    one-to-one correspondence between the relation
    instances and the non-negative integers.
  • Examples
  • west induction on the number of doors to the
    west---imm_west is the base case, with n1.
  • live number of steps away from the
    outside---live(outside) is the base case.

10
Verification of Logic Programs
  • Verifiability of logic programs is the prime
    motivation behind using semantics!
  • If g is false in the intended interpretation and
    g is proved from the KB,
  • Find the clause used to prove g
  • If some atom in the body of the clause is false
    in the intended interpretation, then debug it
  • Else return the clause as the buggy clause
    instance

11
Verifiability II
  • Also need to show that all cases are covered if
    an instance of a predicate is true in the
    intended interpretation, then one of the clauses
    is applicable to prove the predicate.
  • Also need to show termination---this is in
    general impossible, due to semidicidability
    results, but it is possible in many practical
    situations.

12
Limitations
  • No notion of complete knowledge!
  • Cannot conclude that something is false.
  • Cannot conclude something from lack of knowledge.
    Example
  • The relation empty_course(X) with the obvious
    intended interpretation cannot be defined from
    enrolled(S,C) relation.
  • The Closed World Assumption (CWA) allows
    reasoning from lack of knowledge.

13
Case Study University Rules
  • univ.pl
  • DB of student records
  • DB of relations about the university
  • Rules about satisfying degree requirements.
Write a Comment
User Comments (0)
About PowerShow.com