cse-291: ontologies in data & process integration department of computer science &...

24
CSE-291: Ontologies in Data & Process Integration Department of Computer Science & Engineering Department of Computer Science & Engineering University of California, San Diego University of California, San Diego CSE-291: Ontologies in Data CSE-291: Ontologies in Data Integration Integration Spring 2004 Spring 2004 Bertram Lud Bertram Lud ä ä scher scher [email protected] [email protected]

Upload: valentine-cox

Post on 13-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

CSE-291: Ontologies in Data & Process Integration

Department of Computer Science & Engineering Department of Computer Science & Engineering University of California, San DiegoUniversity of California, San Diego

CSE-291: Ontologies in Data IntegrationCSE-291: Ontologies in Data IntegrationSpring 2004Spring 2004

Bertram LudBertram Ludää[email protected]@SDSC.EDU

CSE-291: Ontologies in Data & Process Integration

Introduction to Reasoning inIntroduction to Reasoning inFirst-order [Predicate] LogicFirst-order [Predicate] Logic

and Description Logic(s)and Description Logic(s)

• Introduction to FO (aka PL)Introduction to FO (aka PL)– Syntax, Semantics

– Two decidable fragments: • propositional logic

• description logic(s)

– Reasoning w/ Tableaux

• Description Logic ReasoningDescription Logic Reasoning– …

• Discussion of Topics / AssignmentsDiscussion of Topics / Assignments

CSE-291: Ontologies in Data & Process Integration

Syntax vs SemanticsSyntax vs Semantics

• Syntax Syntax – a.k.a. “formation rules”; “grammar”; …

– prescribes what a well-formed formula is (syntactically)

• SemanticsSemantics– the “meaning” of well-formed formulas

– defined via a mapping called interpretation

CSE-291: Ontologies in Data & Process Integration

Propositional Logic: SyntaxPropositional Logic: Syntax

• Logical symbols:Logical symbols:– conjunction: , disjunction: , negation: , – implication: , equivalence: , parentheses:

• Non-logical symbols:Non-logical symbols:– propositional variables p, q, r, ... – signature: set of propositional variables = {p, q, r, ...}

• Formation rules for well-formed formulas (wff)Formation rules for well-formed formulas (wff)– an atomic formula (propositional variable) is a formula– if F, G are formulas, so are:

• FG, F G, F, FG , FG, F

propositional logic<logic> (or "propositional calculus") A system of symbolic logic using symbols to stand for whole propositions and logical connectives. Propositional logic only considers whether a proposition is true or false. In contrast to predicate logic, it does not consider the internal structure of propositions. http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?propositional+logic

CSE-291: Ontologies in Data & Process Integration

Propositional Logic: SemanticsPropositional Logic: Semantics

• PropositionsPropositions can be assigned a can be assigned a truth-valuetruth-value: : – either true or false (classical 2-valued logic: tertium non

datur)

– other propositional logics exist: 3-valued, 4-valued, temporal, … (modal logics), …, fuzzy logic

• An An interpretationinterpretation I I over a signature over a signature is a mapping is a mapping– I: {true, false} , associating a truth value to every

propositional variable

• Truth tablesTruth tables describe how to extend describe how to extend I I from atomic to from atomic to composite formulas (Boolean Algebra):composite formulas (Boolean Algebra):– FG, F G, F, FG , FG

CSE-291: Ontologies in Data & Process Integration

Boolean Algebra, Truth TablesBoolean Algebra, Truth Tables

http://wombat.doc.ic.ac.uk/foldoc/foldoc.cgi?two-valued+logic

CSE-291: Ontologies in Data & Process Integration

Different Logical BasesDifferent Logical Bases

• Often: Often: , ,

• Alternatively:Alternatively: , , – NAND

– NOR

– XOR

– What about: ite(A,B,C) … if A then B else C ?

CSE-291: Ontologies in Data & Process Integration

Reasoning in Propositional LogicReasoning in Propositional Logic

• A formula F is … A formula F is … – valid if it is true for all interpretations I

– satisfiable if it is true for some interpretation I

– unsatisfiable if it is true for no interpretation I

• Try these:Try these:1. p q

2. p p

3. p p

4. p p

5. p p

6. p p

CSE-291: Ontologies in Data & Process Integration

Reasoning in Propositional LogicReasoning in Propositional Logic

• Def. “models” relationship “|=”: Def. “models” relationship “|=”: – If a formula F evaluates to true for an interpretation I then

I is called a model of F; written I |= F – I is a model of {F1,…, Fk}, written I |= {F1,…, Fk},if I is a

model of each Fj

• Automated deduction setting: Automated deduction setting: – Show that A1,,…, An (axioms) imply T (theorem), that is,

every model of the axioms is also a model of the theorem:– That is: if I |= {A1,,…, An } then I |= T– Short: {A1,,…, An } |= T– Often: Show that A1 … An T is unsatisfiable

• We need a procedure / reasoning algorithm:We need a procedure / reasoning algorithm:– Predicate Calculus (in fact calculi: resolution, tableaux, …)

CSE-291: Ontologies in Data & Process Integration

ExampleExample

• {p, p {p, p q } |= q q } |= q– Truth table

– Resolution

– Tableaux

CSE-291: Ontologies in Data & Process Integration

Example: Reasoning with Binary Decision TreesExample: Reasoning with Binary Decision Trees(see also: Binary Decision Diagrams, or BDDs)(see also: Binary Decision Diagrams, or BDDs)

0

A

1 0

A

1

0

B

1

0

A

0

B

1

if-false if-true

false true

AA … … BB A A B B

0

A

1

0

B

1

A

… … BB A A B B

0

B

1

11

A

0

if-false if-true

AA

true false

CSE-291: Ontologies in Data & Process Integration

Syntax of First-Order Logic (FO)Syntax of First-Order Logic (FO)

• Logical symbols:Logical symbols: , , , , , , (“for all”), (“exists”), ...

• Non-logical symbols: A FO Non-logical symbols: A FO signature signature consists of consists of– constant symbols: a,b,c, ...

– function symbols: f, g, ...

– predicate (relation) symbols: p,q,r, ....

function and predicate symbols have an associated arity;

– we can write, e.g., p/3, f/2 to denote the ternary predicate p and the function f with two arguments

• First-order First-order variablesvariables: x, y, ...: x, y, ...

• Formation rules for Formation rules for termsterms::– constants and variables are terms

– if t1,…,tk are terms and f is a k-ary function symbols then f(t1,...,tk) is a term

CSE-291: Ontologies in Data & Process Integration

Syntax of First-Order Logic (FO)Syntax of First-Order Logic (FO)

• Formation rules for Formation rules for formulasformulas::– if t1,…, tk are terms and p/k is a predicate symbol (of arity k)

then p(t1, …, tk) is an atomic formula (short: atom)

• all variable occurrences in p(t1, …, tk) are free

– if F,G are formulas and x is a variable, then the following are formulas:

– FG, F G, F, FG , FG, F , x: F (“for all x: F(x,...) is true”) x: F (“there exists x such that F(x,...) is true”)

– the occurrences of a variable x within the scope of a quantifier are called bound occurrences.

CSE-291: Ontologies in Data & Process Integration

ExamplesExamples

x man(x) x man(x) person(x). person(x).

man(bill).man(bill).

child(marriage(bill,hillary),chelsea).child(marriage(bill,hillary),chelsea).

Variable: xVariable: x

Constants (0-ary function symbols): bill/0, hillary/0, chelsea/0Constants (0-ary function symbols): bill/0, hillary/0, chelsea/0

Function symbols: marriage/2Function symbols: marriage/2

Predicate symbols: man/1, person/1, child/2Predicate symbols: man/1, person/1, child/2

CSE-291: Ontologies in Data & Process Integration

Semantics of Predicate LogicSemantics of Predicate Logic• Let Let DD be a non-empty be a non-empty domaindomain (a.k.a. (a.k.a. universe of discourseuniverse of discourse). A ). A structurestructure is a is a

pair pair II = (= (DD,I), with an ,I), with an interpretationinterpretation I that maps ... I that maps ...– each constant symbols c to an element I(c) D– each predicate symbol p/k to a k-ary relation I(p) Dk,– each function symbol f/k to a k-ary function I(f): DkD

• Let Let II be a structurebe a structure, , : : VarsVars D D a a variable assignmentvariable assignment. A valuation . A valuation valvalI,I,

maps maps TermTerm to to D D and and FmlFml to {to {truetrue, , falsefalse}}– valI, (x) = (x) ; for x Vars– valI, (f(t1,...,tk)) = I(f)( valI, (t1),..., valI, (tk) ) ; for f(t1,...,tk) Term – valI, (p(t1,...,tk)) = I(p)( valI, (t1),..., valI, (tk) ) ; for p(t1,...,tk) At – valI, (F G) = valI, (F) and valI, (G) are true ; for F,G Fml

– valI, (F G) = valI, (F) or valI, (G) is true ; for F,G Fml

– valI, ( F) = true (false) if valI, (F) is false (true) ; for FFml– valI, ( x F) = valI,[x/t] (F) is true for some t D ; for FFml

– valI, ( x F) = valI,[x/t] (F) is true for all t D ; for FFml

CSE-291: Ontologies in Data & Process Integration

ExampleExample

Formula F = Formula F = x man(x) x man(x) person(x). person(x).

Domain D = {b, h, c, d, e}Domain D = {b, h, c, d, e}

Let’sLet’s pick an interpretation I: pick an interpretation I: I(bill) = b, I(hillary) = h, I(chelsea) = c

I(person) = {b, h, c}

I(man) = {b}

Under this I, the formula F evaluates to Under this I, the formula F evaluates to truetrue..

• If we choose IIf we choose I’ like I but I’(man) = {b,d}, then F evaluates to ’ like I but I’(man) = {b,d}, then F evaluates to falsefalse

• Thus, I is a Thus, I is a model model of F, while I’ is not:of F, while I’ is not:– I |= F I’ |=/= F

CSE-291: Ontologies in Data & Process Integration

FO Semantics (cont’d)FO Semantics (cont’d)

• F F entailsentails G (G is a G (G is a logical consequencelogical consequence of F) if every model of F) if every model of F is also a model of G: F |= Gof F is also a model of G: F |= G

• F is F is consistent consistent or or satisfiablesatisfiable if it has at least one model if it has at least one model

• F is F is valid valid or a or a tautology tautology if every interpretation of F is a model if every interpretation of F is a model

Proof TheoryProof Theory: :

Let F,G, ... be FO Let F,G, ... be FO sentences sentences (no free variables). (no free variables).

Then the following are equivalent:Then the following are equivalent:

1.1. F_1, ..., F_k |= GF_1, ..., F_k |= G

2.2. F_1 F_1 ... ... F_k F_k G is valid G is valid

3.3. F_1 F_1 ... ... F_k F_k G is unsatisfiable (inconsistent) G is unsatisfiable (inconsistent)

CSE-291: Ontologies in Data & Process Integration

Proof TheoryProof Theory

• A A calculus calculus is formal proof system to establish is formal proof system to establish – F1,…, Fk |= T

• via formal (syntactic) via formal (syntactic) derivationsderivations – F1,…, Fk |– ... |– T, where the “|–” denotes allowed proof steps

• Examples: Examples: – Hilbert Calculus, Gentzen Calculus, Tableaux Calculus, Natural

Deduction, Resolution, ...

• First-order logic is “semi-decidable”:First-order logic is “semi-decidable”:– the set of valid sentences is recursively enumerable, but not recursive

(decidable)

• Some inference engines:Some inference engines:– http://www.semanticweb.org/inference.html

CSE-291: Ontologies in Data & Process Integration

Querying vs. ReasoningQuerying vs. Reasoning

• Querying: Querying: – given a DB instance I (= logic interpretation), evaluate a query

expression (e.g. SQL, FO formula, Prolog program, ...)– boolean query: check if I |= (i.e., if I is a model of ) – (ternary) query: { (X, Y, Z) | I |= (X,Y,Z) } => check happyFathers in a given database

• Reasoning:Reasoning:– check if I |= implies I |= for all databases I, – i.e., if => – undecidable for FO, F-logic, etc.– Descriptions Logics are decidable fragments concept subsumption, concept hierarchy, classification semantic tableaux, resolution, specialized algorithms

CSE-291: Ontologies in Data & Process Integration

Reasoning ExampleReasoning Example

• (1) p(0)(1) p(0)• (2) (2) x p(x) x p(x) p(s(x)) p(s(x))

• (3) p(s(s(0))). (3) p(s(s(0))).

• We want to show that (1) & ... & (2) implies (3)We want to show that (1) & ... & (2) implies (3)• Approach: assume Approach: assume negationnegation of (3) and show that it of (3) and show that it

leads to a contradiction with {(1), (2)}leads to a contradiction with {(1), (2)}– Question: Why is this sound?

CSE-291: Ontologies in Data & Process Integration

““Types” of FormulasTypes” of Formulas

(() rule for ) rule for F = F = x: A(X,...)x: A(X,...)substitute a -variable X withan arbitrary term t

(() rule for F = ) rule for F = A A B B(and other conjunctions)(and other conjunctions)

(() rule for F = ) rule for F = A A B B(and other disjunctions)(and other disjunctions)

(() rules for F = ) rules for F = x: A(X,...) x: A(X,...) substitute a -variable X with a new constant c

CSE-291: Ontologies in Data & Process Integration

(Semantic) Tableaux Rules(Semantic) Tableaux Rules

• A A branch is closedbranch is closed if it contains complementary formulas if it contains complementary formulas

• A A tableaux is closed tableaux is closed if every branch is closedif every branch is closed

t arbitraryc new

• (() rule for F = ) rule for F = A A B B• (() rule for F = ) rule for F = A A B B • (() rule for ) rule for F = F = x: A(X,...)x: A(X,...)

– substitute a -variable X with an arbitrary term t

• (() rules for F = ) rules for F = x: A(X,...) x: A(X,...) – substitute a -variable X with a new

constant c

CSE-291: Ontologies in Data & Process Integration

FO Tableaux CalculusFO Tableaux Calculus

TheoremTheorem (Soundness, Completeness of Tableaux (Soundness, Completeness of Tableaux calculus):calculus):

Let ALet A11,..., A,..., Akk and F be first-order logic and F be first-order logic sentences.sentences.

(Recall: a sentence is a closed formula, i.e., has no free variables)

Then the following are equivalent:Then the following are equivalent:

1.1. AA11, ..., A, ..., Akk |= F |= F

2.2. AA11 ... ... A Akk F is unsatisfiable (inconsistent) F is unsatisfiable (inconsistent)

3.3. There is a closed tableaux for {AThere is a closed tableaux for {A11, ..., A, ..., Akk , , F} F}

CSE-291: Ontologies in Data & Process Integration

Reasoning with DLsReasoning with DLs(Shawn Bowers)(Shawn Bowers)