# Semantic Web Techniques - jDREW

Internet και Εφαρμογές Web

21 Οκτ 2013 (πριν από 4 χρόνια και 11 μήνες)

110 εμφανίσεις

0

1

Todays Topics

Resolution

top down and bottom up

j
-
DREW BU procedure

Subsumption

change to procedure

Infinite Loops

RuleML input

Prolog output

2

Resolution

Clausal Logic: Syntax

an atom in logic is (syntactically) a relation symbol
followed by its arguments, each of which is a term

a term is either a variable, a constant or a function
symbol followed by its arguments (which are also terms)

brother(‘Harry’, future_king(‘England’))

passes(‘Fang’, cs6999)

each clause is a disjunction of positive or negative atoms

attends(Student, Course)
\
/ ~passes(Student, Course)

Rule Notation: a
\
/ b
\
/ ~c
\
/ ~d becomes a
\
/ b

c /
\

d

a literal is a positive or negative atom

Definite clauses have

one positive literal and any number of negative literals

3

Resolution

Given two clauses, to form the resolvent:

find two literals, one from each clause, that

can be made to match (with assignments to the variables)

differ in sign

construct the disjunction of all literals
except
these two

apply the substitution

Resolve

b(X)
\
/ ~c(X, 3) against c(2, Y)
\
/ ~d(Y, Z)

gives b(2)
\
/ ~d(3, Z)

In rule notation

b(X)

c(X, 3) against c(2, Y)

d(Y, Z)

gives b(2)

d(3, Z)

4

Bottom Up Reasoning

Single literal definite clauses are called facts

passes(‘Fang’, cs6999)

Resolving a fact against a condition in a rule is
called forward reasoning

attends(Student, Course)

passes(Student, Course)

Resolvent: attends(‘Fang’, cs6999)

Usually a derivation tree is viewed with given facts
at the bottom and derived facts at the top

so forward reasoning also called bottom up reasoning

Prolog does top
-
down, backward reasoning

starting from a negative clause, called a query

5

Theorem Prover’s Search Procedure

Priority queue

new facts

Discrimination
trees:

used facts

rules, indexed on

first goal

main loop

select new fact

for each matching rule

resolve

process new result

process new result(C)

if C is rule

for each old fact matching first goal

resolve

process new result

else

6

Preventing Infinite Loops

To prevent infinite loops in the search procedure,

use subsumption (next slides) and either

1a) use ground facts and rules only, or

1b) use no function symbols

Sometimes it helps if the positive literal has no
new variables (that do not already occur in the
body)

7

Subsumption

A clause C subsumes a clause D if there is a
substitution

such that C

D

C is more general than D

Given C you do not need D

We use subsumption between facts (atoms)

Atoms C subsumes atom D if

there exists

such that C

=

D

Subsumption is checked by

first grounding all variables in D to new constants

then trying to unify C with grounded D

8

Forward subsumption

New result is checked against old results to see if
it is more general

We can prevent some infinte loops by checking
subsumption of new fact against old facts

Should this be done when the new fact is derived
or when it is selected?

experience shows that subsumption on selection is
better

9

Theorem Prover’s Search Procedure

Priority queue

new facts

Discrimination
trees:

used facts

rules, indexed on

first goal

main loop

select new fact

if it is not forward subsumed

for each matching rule

resolve

process new result

process new result(C)

if C is rule

for each old fact matching first goal

resolve

process new result

else

10

RuleML

Input to j
-
DREW BU may also
be RuleML

RuleML queries are ignored
currently

<imp>

<atom>

<_opr><rel>discount</rel></_opr>

<var>customer</var>

<var>product</var>

<ind>5.0 percent</ind>

</atom>

<_body>

<and>

<atom>

<var>customer</var>

</atom>

<atom>

<_opr><rel>regular</rel></_opr>

<var>product</var>

</atom>

</and>

</_body>

</imp>

discount(customer,product1,'5.0 percent')

:
-

11

Related Literature

Set of support prover for definite clauses

Facts are supports

Theorem: Completeness preserved when
definite clause resolutions are only between
first negative literal and fact.

Proof: completeness of lock resolution (Boyer’s PhD)

Use standard search procedure to reduce
redundant checking

Unlike OPS/Rete, returns proofs and uses first
order syntax for atoms