3 - Principaux Formalismes - en
3 - Principaux Formalismes - en
Master WIA
Main formalisms
Pr Hafed Zarzour 1
Logical representation
●
Logical representation is a fundamental method of
communicating knowledge to machines through a well-
defined syntax with precise rules.
●
This syntax should be unambiguous and able to handle
prepositions, making it an ideal way to represent facts.
2
Logical representation
●
It consists of precisely defined syntax and semantics which
supports the sound inference.
●
Each sentence can be translated into logics using syntax
and semantics.
3
Logical representation
Syntax
●
Syntaxes are the rules which decide how we can construct legal
sentences in the logic.
●
It determines which symbol we can use in knowledge
representation.
●
How to write those symbols.
4
Logical representation
Semantics
●
Semantics are the rules by which we can interpret the
sentence in the logic.
●
Semantic also involves assigning a meaning to each
sentence.
5
Logical representation
Logical representation can be categorized into mainly two
logics:
●
Propositional logic
●
Predicate logic
6
Propositional Logic
●
Propositional logic is a very simple logic that deals with the relationships
between propositions, which are statements that are either true or false.
●
The truth value of a complex statement can be determined by the truth
values of its component statements and the logical connectives that are
used to combine them.
For example, the statement "If it is raining and the ground is wet, then it
is raining" is true if and only if the statement "It is raining and the ground
is wet" is true.
7
Propositional Logic
Examples of statements :
●
The Earth is round. (True)
●
2 + 2 = 4. (True)
●
All men are mortal. (True)
●
Ali is a student. (Unknown; the truth value of this statement depends on whether Ali is actually a student)
●
The cat is on the mat. (Unknown; the truth value of this statement depends on whether the cat is actually
on the mat)
●
It is raining outside. (Unknown; the truth value of this statement depends on the current weather
conditions)
●
I am hungry. (Unknown; the truth value of this statement depends on whether I am actually hungry)
●
The sky is blue. (True, on a clear day)
●
Water boils at 100 degrees Celsius. (True, at sea level)
●
The capital of Algeria is Algiers. (True)
●
The Mona Lisa is a painting by Leonardo da Vinci. (True)
●
The theory of gravity was developed by Isaac Newton. (True) 8
Propositional Logic
Facts about propositional logic:
●
Propositional logic is also called Boolean logic as it works
on 0 and 1.
●
In propositional logic, we use symbolic variables to
represent the logic, and we can use any symbol for a
representing a proposition, such A, B, C, P, Q, R, etc.
●
Propositions can be either true or false, but it cannot be
both.
●
Propositional logic consists of an object, relations or
function, and logical connectives. 9
Propositional Logic
Facts about propositional logic:
●
These connectives are also called logical operators.
●
The propositions and connectives are the basic elements
of the propositional logic.
●
Connectives can be said as a logical operator which
connects two sentences.
10
Propositional Logic
Facts about the propositional logic:
●
A proposition formula which is always true is called
tautology, and it is also called a valid sentence.
●
A proposition formula which is always false is called
Contradiction.
●
Statements which are questions, commands, or opinions
are not propositions such as "Where is Ali", "How are you",
"What is your name", are not propositions.
11
Propositional Logic
Syntax
●
The syntax of propositional logic defines the allowable
sentences.
●
The atomic sentences consist of a single proposition symbol.
●
Each such symbol stands for a proposition that can be true or
false. We use symbols that start with an uppercase letter and
may contain other letters or subscripts, for example: P, Q ,R ,Z
and FacingEast.
●
The names are arbitrary but are often chosen to have some
mnemonic value. 12
Propositional Logic
Syntax
●
There are two proposition symbols with fixed meanings:
True is the always-true proposition and False is the
always-false proposition.
●
Complex sentences are constructed from simpler
sentences, using parentheses and operators called logical
connectives.
13
Propositional Logic
There are five connectives in common use:
●
Negation: A sentence such as ¬ P (not P) is called negation of P. A literal can be either
Positive literal or negative literal.
●
Conjunction: A sentence which has ∧ connective such as, P ∧ Q is called a
conjunction.
Example: Ali is intelligent and hardworking. It can be written as,
P=Ali is intelligent,
Q= Ali is hardworking. → P∧ Q.
●
Disjunction: A sentence which has ∨ connective, such as P ∨ Q. is called disjunction,
where P and Q are the propositions.
Example: "Ali is a doctor or Engineer",
Here P= Ali is Doctor. Q= Ali is Doctor, so we can write it as P ∨ Q. 14
Propositional Logic
There are five connectives in common use:
●
Implication: A sentence such as P → Q , is called an implication. Implications are also
known as if-then rules. It can be represented as
If it is raining, then the street is wet.
Let P= It is raining, and Q= Street is wet, so it is represented as P → Q
●
Biconditional: A sentence such as P⇔ Q is a Biconditional sentence (⇔: if and only
if), example If I am breathing, then I am alive
P= I am breathing, Q= I am alive, it can be represented as P ⇔ Q.
15
Propositional Logic
Summarized table for the propositional Logic
connectives:
16
Propositional Logic
Summarized table for the propositional Logic
connectives:
17
Propositional Logic
Let A be “It is sunny” and B be “it is cold”
●
A ∧ B: It is sunny and cold
●
A ∨ B: It is either sunny or cold
●
A → B: If it is sunny, then it is cold
●
A : It is not sunny
---> Now we can combine these operations to make longer
formulas: A ∧ ¬ B ∨ ¬ C→ A
– If it is either sunny and not cold or not snowing, then it
is sunny. 18
Propositional Logic
A formal grammar of propositional logic
●
19
Propositional Logic
Operator precedence:
●
Negation (¬)
●
Conjunction (∧)
●
Disjunction (∨)
●
Implication (→)
●
Equivalence (↔)
20
Propositional Logic
Operator precedence:
We can also use parentheses to override the default
operator precedence.
For example, the expression (P ∧ Q) → R is evaluated as
(P ∧ Q) → R, not P ∧ (Q → R).
21
Propositional Logic
Properties of operators:
●
Commutativity:
P∧ Q= Q ∧ P, or
P ∨ Q = Q ∨ P.
●
Associativity:
(P ∧ Q) ∧ R= P ∧ (Q ∧ R),
(P ∨ Q) ∨ R= P ∨ (Q ∨ R)
●
Identity element:
P ∧ True = P,
P ∨ True= True.
●
Distributive:
P∧ (Q ∨ R) = (P ∧ Q) ∨ (P ∧ R).
P ∨ (Q ∧ R) = (P ∨ Q) ∧ (P ∨ R). 22
Propositional Logic
Properties of operators:
●
De Morgan's Law:
¬ (P ∧ Q) = (¬P) ∨ (¬Q)
¬ (P ∨ Q) = (¬ P) ∧ (¬Q).
●
Double-negation elimination:
¬ (¬P) = P.
23
Propositional Logic
Truth table
A truth table is a tabular representation used in
propositional logic and Boolean algebra to show all
possible combinations of truth values (true or false) for a
given logical expression. It demonstrates how the truth
value of the compound statement depends on the truth
values of its individual components (propositions) and the
logical operations applied.
24
Propositional Logic
Truth table
25
Propositional Logic
Limitations of propositional logic
●
Propositional logic sufficed to illustrate the basic concepts of logic, inference, and
knowledge-based agents. Unfortunately, propositional logic is limited in what it can
say.
●
We cannot represent relations like ALL, some, or none with propositional logic.
Example: All the students are intelligent.
Some apples are sweet.
●
Propositional logic has limited expressive power.
●
In propositional logic, we cannot describe statements in terms of their properties
or logical relationships.
26
Predicate logic
●
Predicate logic is a formal language used to represent and
reason about statements that involve variables.
●
Predicate logic is also called First-order logic and first-
order predicate calculus; it may be abbreviated as FOL
or FOPC.
27
Predicate logic
●
It is a more powerful language than propositional logic,
which deals only with statements that are either true or
false.
●
Predicate logic can be used to express more complex
statements.
28
Predicate logic
29
Predicate logic
Predicate logic is based on the following concepts:
●
Predicates
●
Variables
●
Quantifiers
30
Predicate logic
Predicates: Predicates are statements that can be true or
false depending on the values of the variables they
contain.
For example, the predicate "is mortal" is true for all human
beings and false for all other things.
31
Predicate logic
Variables: Variables represent objects in the world.
For example, the variable "x" can represent any human
being.
32
Predicate logic
Quantifiers: Quantifiers allow us to make statements
about all or some members of a set.
The two most common quantifiers are the universal
quantifier "∀" (for all) and the existential quantifier "∃" (there
exists….).
33
Predicate logic
Universal quantification (∀)
●
The universal quantifier is usually pronounced “For all ”
●
Example:
“All kings are persons”, is written in first-order logic as
∀x King(x) ⇒ Person(x).
Thus, the sentence says, “For all x , if x is a king, then x is a
person.
34
Predicate logic
Existential quantification (∃)
●
Existential quantifier is usually pronounced "There exists
an x such that.. " or " For some x..".
●
∃x P says that P is true for at least one object x.
●
Example:
“There exists a number greater than 0 but less than 20”, is
written in first-order logic as
∃x(x > 0 ∧ x < 20)
35
Predicate logic
Nested Quantifiers:
●
We will often want to express more complex sentences using
multiple quantifiers.
●
The simplest case is where the quantifiers are of the same type.
●
Example:
“Brothers are siblings” can be written as
∀x ∀y Brother(x,y) ⇒ Sibling(x,y) .
36
Predicate logic
37
Description logic
●
Description Logic (DL) is a family of formal knowledge
representation languages specifically designed for
expressing and reasoning about the conceptual knowledge
of an application domain.
38
Description logic
●
DLs are particularly well-suited for representing
taxonomies and ontologies, which are hierarchical
structures that organize concepts and their relationships.
●
They provide a means to define concepts, their properties,
and the relationships between different concepts.
●
This makes them useful for a wide range of applications,
including semantic web, knowledge management, and
artificial intelligence.
39
Description logic
Key components of description logics:
●
Concepts: Concepts represent the basic building blocks of DLs.
They represent categories or classes of individuals, such as
"Person," "Animal," or "Car."
●
Roles: Roles, also known as relationships, represent
connections between individuals. They specify how individuals
are related to each other, such as "is parent of," "has part," or "is
located in."
●
Axioms: Axioms are statements that define the properties of
concepts and roles. They provide a formal way to capture the
meaning of these elements. 40
Description logic
Key components of description logics:
●
Individuals: Individuals represent specific entities within
the domain of knowledge. They are the instances of
concepts and can participate in roles.
●
Reasoners: Reasoners are algorithms that can
automatically deduce new knowledge from the axioms and
individuals defined in a DL knowledge base. They are
essential for performing inferencing and answering
queries.
41
Description logic
Notation:
●
Let C and D be concepts, a and b be individuals, and R be
a role.
●
If a is R-related to b, then b is called an R-successor of a.
42
Description logic
43
Description logic
TBox and ABox are two fundamental components of
description logic (DL) knowledge bases.
●
TBox (Terminological Box):
The TBox, also known as the terminological component,
defines the vocabulary and structure of the domain of
interest. It consists of a set of axioms that specify the
relationships between concepts and roles. These axioms
capture the general and abstract knowledge about the
domain, such as taxonomic relationships, property
restrictions, and concept definitions.
44
Description logic
●
ABox (Assertional Box):
The ABox, also known as the assertional component,
contains assertions about individuals in the domain of
interest. It consists of a set of statements that relate
individuals to concepts and roles. These statements
represent specific and concrete facts about the world, such
as which individuals belong to which concepts and how
they are related to each other.
45
Description logic
●
A terminology (TBox) with concepts about family
relationships
46
Description logic
●
The expansion of the Family TBox
47
Description logic
48
Description logic
●
A world description (ABox)
49
Conceptual graphs
●
Conceptual graph (CG) representation is a visual method
for organizing and presenting knowledge in the form of
graphs.
●
It combines the advantages of semantic networks and
existential graphs.
●
CGs are a type of graph-based knowledge representation
that can be used to represent a variety of concepts,
relationships, and inferences.
50
Conceptual graphs
●
CG display form for “John is going to Boston by bus”
51
Conceptual graphs
●
The conceptual graph in Figure 1 represents a typed or
sorted version of logic.
●
Each of the four concepts has a type label, which
represents the type of entity the concept refers to: Person,
Go, Boston, or Bus.
●
Two of the concepts have names, which identify the
referent: John or Boston.
●
Each of the three conceptual relations has a type label that
represents the type of relation: agent (Agnt), destination
(Dest), or instrument (Inst). 52
Conceptual graphs
●
The CG as a whole indicates that:
the person John is the agent of some instance of going,
the city Boston is the destination, and a bus is the
instrument.
●
Figure 1 can be translated to the following formula:
53
Conceptual graphs
●
Existential graph (EG) and a CG for the sentence “If a
farmer owns a donkey, then he beats it”.
54
Conceptual graphs
●
The CG in this Figure shows a representation that treats
events and states as entities linked to their participants by
case relations or thematic roles.
●
●
CG with case relations shown explicitly
● 55
Conceptual graphs
●
The type labels If and Then in this Figure are defined as
synonyms for negated contexts. The state of owning is
linked to its participants by the relations experiencer
(Expr) and theme (Thme), and the act of beating by the
relations agent (Agnt) and patient (Ptnt).
56
References
●
TBA
Thank you for your attention !