The design of j-DREW: a deductive reasoning engine for the web Bruce Spencer National Research...
-
Upload
barnaby-horn -
Category
Documents
-
view
217 -
download
4
Transcript of The design of j-DREW: a deductive reasoning engine for the web Bruce Spencer National Research...
The design of j-DREW: a deductive reasoning engine
for the web
Bruce SpencerNational Research Council Canada
and University of New Brunswick
Fredericton, Canada
20-Sep-0220-Sep-02 2
NRC – A National Institution
NRC Institute / Innovation Centre
IRAP Office
Virtual Innovation Centres
20-Sep-0220-Sep-02 4
Motivation• Started as a bet: Can I teach deduction and advanced
internet systems in one course?– Students understand recursive search– basic propositional top-down prover
• Teaching a course at UNB on building Internet applications that employ deduction(in conjunction with Harold Boley, formerly DFKI)– Semantic web ontologies have rules– XML is declarative, so deduction is a basic operation
• Students have trouble building systems (variables)– unification, composition of substitutions
unbinding on backtracking• Specialized Prolog implementation courses focus on vars
– Warren and Meier: Computing with Logic (1988)• Can we hide the hard parts?
20-Sep-0220-Sep-02 5
Requirements on deduction system used in the course (and on web?)• First order logic with function symbols• Easily configured
– Forward or backward search or backward and iterative deepening
– Search strategy to be modified by student• Embeddable
– Supports calls to and from rest of system– Easy to add new primitives (iterators)
• Written in 100% Java– Access to libraries for networking,
cryptography, XML parsers, RDF, XSLT, …
20-Sep-0220-Sep-02 6
Propositional Proverinitially proofTree has an open Goalloop if(proofTree.hasNoOpenGoal()) halt('success'); else Goal g = proofTree.selectOpenGoal(); g.createMatchingClauseList(); if(g.hasMoreMatchingClauses()) DefiniteClause c = g.nextClause();
g.attachClause(c); choicePoints.push(g); else chronologicalBacktrack();
Java Iterator
chronologicalBacktrack while(choicePoints.nonEmpty()) Goal g = choicePoints.pop(); g.removeAttachedClause(); if(g.hasMoreClauses()) return; halt('failure')
Create bindings
Remove bindings
20-Sep-0220-Sep-02 7
Tree with initial goal p(Z)
p(X) :- q(X), r(X).q(g(X)).q(k).r(g(h))
p(Y1) :- q(Y1), r(Y1)
?:-p(Z)
a
a ChoicePoints
b
Z/Y1
q(g(Y2) r(g(h)b c
c
Y1/f(Y2)
Y2/hq(g(Y2)
q(k) Y1/k
b’
20-Sep-0220-Sep-02 8
Hiding the hard parts: Top-Down
• A Goal creates its list of matching clauses and maintains pointer to current selection– Java iterator
• Attaching a clause head to a Goal– imposes variable bindings across tree
• Removing the clause – relaxes variable bindings
• The tree provides access to all open Goals
20-Sep-0220-Sep-02 9
Deployed and Planned Prototypes
• Basic Prolog Engine– Negation as failure– RuleML input
• Iterative deepening search– Search complete, unlike Prolog– Dynamic additions to clause set
• allowed between depth limits (synchronous)
• Possible student exercises – delay selecting deferred goals– Negation of ground goals– Backtracking to deeper choicepoint
• Bottomup
} deployed
} planned
20-Sep-0220-Sep-02 10
Deduction Example: Semantic Web
• Semantics = meaning• Ontology
– hierarchy of terms (subset)– logic conditions on their usage
• Terms in a web page can be linked to their meanings in some ontology– Search with greater accuracy
20-Sep-0220-Sep-02 11
20-Sep-0220-Sep-02 12
•SmokedSalmon is the intersection of Smoked and Salmon
Smoked Salmon
20-Sep-0220-Sep-02 13
•Gravalax is the intersection of Cured and Salmon, but not Smoked
•SmokedSalmon is the intersection of Smoked and Salmon
Smoked Salmon
Gravalax
20-Sep-0220-Sep-02 14
•Lox is Smoked, Cured Salmon
•Gravalax is the intersection of Cured and Salmon, but not Smoked
•SmokedSalmon is the intersection of Smoked and Salmon
Smoked Salmon
Gravalax
Lox
20-Sep-0220-Sep-02 15
• A search for keywords
Salmon and Cured should return pages that mention Gravalax, even if they don’t mention Salmon and Cured
• A search for Salmon and Smoked will return pages with smoked salmon, should also return pages with Lox, but not Gravalax
Smoked Salmon
LoxGravalax
The Semantic Web vision is to make information on the web “understood” by computers, for searching,categorizing, …
20-Sep-0220-Sep-02 16
Smoked Salmon
LoxGravalax
20-Sep-0220-Sep-02 17
One possible encoding
Search criteria:retrieve(P) :-
mentions(P, cured),mentions(P, salmon).
Ontology:mentions(P, cured) :- mentions(P, gravalax).mentions(P, salmon) :- mentions(P, gravalax).
A search for keywords Salmon and Cured should return pages that mention Gravalax, even if they don’t mention Salmon and Cured.
mentions(p1 gravalax).
retrieve(p1) succeeds
20-Sep-0220-Sep-02 18
retrieve(P) :- mentions(P, smoked),mentions(P, salmon).
mentions(P, cured) :- mentions(P, lox).mentions(P, salmon) :- mentions(P, lox).mentions(P, smoked) :- mentions(P, lox).mentions(P, cured) :- mentions(P, gravalax).mentions(P, salmon) :- mentions(P, gravalax).
A search for Salmon and Smoked will return pages with smoked salmon, should also return pages with Lox, but not Gravalax.
mentions(p1 gravalax).mentions(p2, lox).
retrieve(p1) failsretrieve(p2) succeeds
20-Sep-0220-Sep-02 19
Bottom-Up / Forward Chaining• 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 (next)• Unlike OPS/Rete, returns proofs and uses first
order syntax for atoms
20-Sep-0220-Sep-02 20
Theorem Prover’s Search Procedure
• 3 Definite Clause Lists:– new facts
(priority queue)– old facts– rules
• 2 Discrimination trees: – used facts – rules, indexed on
first goal
loop select new fact for each matching rule resolve process new result add to used facts
process new result(C) if C is rule for each old fact matching first resolve process new result add C to rules else add C to new facts
20-Sep-0220-Sep-02 21
Summary• Teaching building deduction systems not hard
– use of abstractions to hide variable handling• Semantic Web needs deduction
– access to proof data structure (trust)• j-DREW deployed systems can use
– forward / backward / other searches– small footprint, 100% Java
• Take home messages:– not clear what form Semantic Web systems
will take, so flexibility is key– implementers should provide API’s
20-Sep-0220-Sep-02 22
References
• CS6999 Semantic Web Techniques http://www.cs.unb.ca/~bspencer/CS6999
• RuleML http://www.dfki.de/ruleml
• j-DREW open source?– Not yet