Title: Logics for Data and Knowledge Representation
1Logics for Data and KnowledgeRepresentation
Originally by Alessandro Agostini and Fausto
Giunchiglia Modified by Fausto Giunchiglia, Rui
Zhang and Vincenzo Maltese
2Outline
- Syntax
- Semantics
- Entailment and logical implication
- Reasoning Services
2
3Logical Modeling
Language L
Theory T
Data Knowledge
Interpretation
Modeling
Entailment
World
Mental Model
?
I
Realization
Domain D
Model M
Meaning
SEMANTIC GAP
NOTE the key point is that in logical modeling
we have formal semantics
3
4Language (Syntax)
SYNTAX SEMANTICS ENTAILMENT AND LOGICAL
IMPLICATION REASONING SERVICES
- The first step in setting up a formal language is
to list the symbols of the alphabet
- Auxiliary symbols parentheses ( )
- Defined symbols
- ? (falsehood symbol, false, bottom) ? df P?P
- T (truth symbol, true, top) T df ?
5Formation Rules (FR) well formed formulas
SYNTAX SEMANTICS ENTAILMENT AND LOGICAL
IMPLICATION REASONING SERVICES
- Well formed formulas (wff) in PL can be described
by the following BNF grammar (codifying the
rules) - ltAtomic Formulagt A B ... P Q ...
? ? - ltwffgt ltAtomic Formulagt ltwffgt ltwffgt?
ltwffgt ltwffgt ? ltwffgt - Atomic formulas are also called atomic
propositions - Wff are propositional formulas (or just
propositions) - A formula is correct if and only if it is a wff
- S0 FR define a propositional language
6Propositional Theory
SYNTAX SEMANTICS ENTAILMENT AND LOGICAL
IMPLICATION REASONING SERVICES
- Propositional (or sentential) theory
- A set of propositions
- It is a (propositional) knowledge base (true
facts) - It corresponds to a TBox (terminology) only,
where no meaning is specified yet it is a
syntactic notion
7Semantics formal model
SYNTAX SEMANTICS ENTAILMENT AND LOGICAL
IMPLICATION REASONING SERVICES
- Intensional interpretation
- We must make sure to assign the formal meanings
out of our intended interpretation to the
(symbols of the) language, so that formulas
(propositions) really express what we intended. - The mental model What we have in mind?
- In our mind (mental model) we have a set of
properties that we associate to propositions. We
need to make explicit (as much as possible) what
we mean. - The formal model
- This is done by defining a formal model M.
Technically we have to define a pair (M,?) for
our propositional language - Truth-values
- In PL a sentence A is true (false) iff A denotes
a formal object which satisfies (does not
satisfy) the properties of the object in the real
world.
8Truth-values
SYNTAX SEMANTICS ENTAILMENT AND LOGICAL
IMPLICATION REASONING SERVICES
- Definition a truth valuation on a propositional
language L is a mapping ? assigning to each
formula A of L a truth value ?(A), namely in the
domain D T, F - ?(A) T or F according to the modeler, with A
atomic - ?(A) T iff ?(A) F
- ?(A?B) T iff ?(A) T and ?(B) T
- ?(A?B) T iff ?(A) T or ?(B) T
- ?(?) F (since ?df P?P)
- ?(?) T (since ?df ?)
9Truth Relation (Satisfaction Relation)
SYNTAX SEMANTICS ENTAILMENT AND LOGICAL
IMPLICATION REASONING SERVICES
- Let ? be a truth valuation on language L, we
define the truth-relation (or satisfaction-relatio
n) ? and write - ? ? A
- (read ? satisfies A) iff ?(A) True
- Given a set of propositions G, we define
- ? ? G
- iff if ? ? ? for all formulas ? ? G
10Model, Satisfiability, truth and validity
SYNTAX SEMANTICS ENTAILMENT AND LOGICAL
IMPLICATION REASONING SERVICES
- Let ? be a truth valuation on language L.
- ? is a model of a proposition P (set of
propositions G) iff ? satisfies P (G). - P (G) is satisfiable if there is some (at least
one) truth valuation ? such that ? ? P (? ? G). - Let ? be a truth valuation on language L.
- P is true under ? if ? ? P
- P is valid if ? ? P for all ? (notation ? P).
- P is called a tautology
11Entailment and implication
SYNTAX SEMANTICS ENTAILMENT AND LOGICAL
IMPLICATION REASONING SERVICES
- Propositional entailment ? ? ?
- where ? ?1, ..., ?n is a finite set of
propositions - ? ? ?i for all ?i in ? implies ? ? ?
- Entailment can be seen as the logical implication
- (?1 ? ?2 ? ... ? ?n) ? ?
- to be read ?1 ? ?2 ? ... ? ?n logically implies
? - ? is a new symbol that we add to the language
11
12Implication and equivalence
SYNTAX SEMANTICS ENTAILMENT AND LOGICAL
IMPLICATION REASONING SERVICES
- We extend our alphabet of symbols with the
following defined logical constants?
(implication)? (double implication or
equivalence) - ltAtomic Formulagt A B ... P Q ...
? ? - ltwffgt ltAtomic Formulagt ltwffgt ltwffgt?
ltwffgt ltwffgt? ltwffgt - ltwffgt ? ltwffgt ltwffgt ? ltwffgt
(new rules) - Let propositions ?, ?, and finite set ?1,...,?n
of propositions be given. We define - ? ? ? ? iff ? ? ?
- ? (?1?...??n) ? ? iff ?1,...,?n ? ?
- ? ? ? ? iff ? ? ? and ? ? ?
12
13Reasoning Services
SYNTAX SEMANTICS ENTAILMENT AND LOGICAL
IMPLICATION REASONING SERVICES
- Model Checking (EVAL)
- Is a proposition P true under a truth-valuation
?? Check ? ? P
Satisfiability (SAT) Is there a truth-valuation
? where P is true? find ? such that ? ?
P Unsatisfiability (UnSAT) the impossibility to
find a truth-valuation ?
13
14Reasoning Services
SYNTAX SEMANTICS ENTAILMENT AND LOGICAL
IMPLICATION REASONING SERVICES
Validity (VAL) Is P true according to all
possible truth-valuation ?? Check if ? ? P for
all ?
Entailment (ENT) All ? ? G true in ? (in all ?)
implies ? true in ? (in all ?). check G ? ? in ?
(in all ? ) by checking that given that ? ? ?
for all ? ? G implies ? ? ?
14
15Reasoning Services properties
SYNTAX SEMANTICS ENTAILMENT AND LOGICAL
IMPLICATION REASONING SERVICES
- EVAL is the easiest task. We just test one
assignment. - SAT is NP complete. We need to test in the worst
case all the assignments. We stop when we find
one which is true. - UnSAT is CO-NP. We need to test in the worst case
all the assignments. We stop when we find one
which is true. - VAL is CO-NP. We need to test all the assignments
and verify that they are all true. We stop when
we find one which is false. - ENT is CO-NP. It can be computed using VAL (see
next slide)
15
16Using DPLL for reasoning tasks
SYNTAX SEMANTICS ENTAILMENT AND LOGICAL
IMPLICATION REASONING SERVICES
- DPLL solves the CNFSAT-problem by searching a
truth-assignment that satisfies all clauses ?i in
the input proposition P ?1 ? ? ?n - Model checking Does ? satisfy P? (? ? P?)
- Check if ?(P) true
- Satisfiability Is there any ? such that ? ? P?
- Check that DPLL(P) succeeds and returns a ?
- Unsatisfiability Is it true that there are no ?
satisfying P? - Check that DPLL(P) fails
- Validity Is P a tautology? (true for all ?)
- Check that DPLL(?P) fails
16