Logica fuzzy
Questa è una pagina di introduzione al corso: contiene i turni, le modalità d'insegnamento, alcune informazioni generali ed eventuali giudizi sul corso in questione. Se sei giunto qui passando da un link, puoi tornare indietro e correggerlo in modo che punti direttamente alla voce appropriata. |
Indice
A.A. passati
Information
Course's website
Times and classrooms:
Monday 15:30 - 17:30 - Room 5 (Ground floor - via comelico 39)
Friday 10:30 - 12:30 - Room 5
Lessons' notes
This notes are written in english to help foreign students to follow this course.
Classical Propositional Logic
We are going to describe the classical propositional logic (L.P.C) language.
Syntax
The syntax of a language is the set of rules that specify how the elements of the language are formed regardless their meaning.
Let be the set of the natural numbers and an alphabet of symbols.
The symbols are called respectively "falsum", "verum".
is the set of strings on this alphabet. For example .
We have now to define the set of the "well formed formula" , that is the set of the elements of the L.P.C.
Definition (well formed formulas). is defined with some conditions:
, where | is taken n times. For example:- if , then .
- if , then .
- if , then .
- if , then .
Well formed formulas is often abbreviated with f.b.f.
The strings in condition (2) are called "propositional variables" or "atomic formulas" or "propositional letters" or simply "variables". They are abbreviated with this notation:
(In other books p, q, r, .., are used to refer to variables).
The set of variables is .
Example of well formed formulas:
Instead
In this notes we omit (, ) where it is clear the precedence of the connectives. (Connectives are )
Why don't we use directly or ?
Because it is important that the alphabet is a finited set. Although, in this notes, we use notation.
It is essential, even, that the L.P.C. language is decidable, that is it must exist an algorithm that tell us if a string is or not.
For this reason it is crucial the
Unique readability of well formed formulas. For all one (and only one) of the following sentences must be true:
- or but not both.
- Exists an unique such that .
- Exists an unique such that .
- Exist unique such that .
- Exist unique such that .
- Exist unique such that .
Let's, infact, consider the parser of the algorithm we talked above: When it find, for example, , to decide if the string belongs to FORM, it have to decide (for the unique readability of well formed formulas) if . But how can it do this? Deciding if and . This is what the above theorem tell us. Try to draw the parser tree. It is unique thanks to, again, that theorem.
Formally, a string is a finite sequence of elements:
A substring of is a string in the form , where and .
A subformula is a substring .
For example:
are both substring of but only is a subformula.
With we indicate the set of variables that are subformulas of .
With we denote a formula whose variables are a subset of .
Semantic
The semantic of a language is the relation between the elements of that language and their meaning.
The set {0,1} is called truth values set. 0 means false and 1 means true.
Definition(Assignment). An atomic assignment is any function
.
An assignment (or interpretation) is a function
that extends and respects the following rules for every .
- and
Informally we can say that the variables represent propositions with one verb and one or more complement. For example:
"It rains";
"I go to school".
"I don't go to school"
"It rains and I go to school"
"it rains or I go to school"
"If it rains then I will go to school"
I can choose such as and
Consequently we have
Proposition (Unique extendibility of atomic assignment): Every atomic assignment admits exactly one extension to an assignment
More informally, as you can see in the example above, when we choose the values of the variables we determinate the values of the formulas within those variables.
Definition (truth and falsehood). Let . When we have we say that is true in the interpretation of , or is a model of . Instead, when we have we say that is false in the interpretation of , or is an anti-model of .
In symbols:
when
when .
When is true for every we say that is a tautology. Instead when we have false for every assignment we say that is a contradiction.
When exists a such as we say that is satisfiable; instead when exists a such as we say that is refutable.
In symbols:
tautology
refutable
In these notes we abbreviate
with
and it can be read as "if and only if".
Exercise. Prove that the following formulas are tautologies for all
Hint: use the truth table
- (Excluded middle)
- (Not contradiction)
- (Law of double negation)
- (De Morgan rule I)
- (De Morgan rule II)
- (Ex falso quodlibet)
- (Prelinearity)
Exercise. Prove that exist for those the following formulas aren't tautologies. Which of these are contradiction?
Hint: to prove that a formula isn't a tautology is sufficient an counter-example but to prove that it is a contradiction it isn't sufficient. You can use the truth table again.
Relationship between syntax and semantic
Definition (Axioms of LPC (Classical propositional logic)). For all , let's consider the following formulas.
The formulas between 1 and 12 .
is called set of the axioms of the classical propositional logic.
Why these formulas are axioms and not others? Because they are needed to prove the theorem of completeness that is very important for logic. We will talk about this theorem later..
The cardinality of is because can be other formulas. For example:
Let and substitute in the first axiom; it becomes
It is important to understand that the axioms are defined only through syntax, because we don't speak about values of formulas. Axioms, for definition, are demostrable without demonstration.
Think about syntax and semantic as two different worlds. In "syntax world" there are but even , the set of theorems. So we have
The elements of are the demonstrable formulas.
Definition. We say that a formula is demonstrable (or syntactic consequence), if exist a finite sequence of formulas such that one of the following conditions is true.
- Exist indexes such that is deducible from and through modus ponens.
A sequence of formulas like that is a formal demonstration of .
Definition (modus ponens). Let . We say that is deducible, through modus ponens, if .
For example:
"If it rains then I will stay home" "It rains" "I will stay home".
We know that are true, hence we can say that is true.
The elements of are found in this way through modus ponens starting from elements of .
Modus ponens is one of the inference rules.
Example of demonstration:
We want to prove that .
We start from axioms 1, 4.
1A
4A
(substitution of in A1 (first axiom)
(substitution in A4)
Now we have hence we can conclude that
It is really hard to find theorems in this way: in this course we don't have to learn this, just have to know how a formal syntactic demonstration are made. Thanks to completeness and validity theorem we can prove theorem through an easier way; infact it says that the set of theorems and the set of tautologies coincide. Hence, proving that a formula is a tautology is equals to prove that a formula is a theorem. This is the bridge between Syntax and Semantic.
Theorem of validity and completeness. For all we have
The demonstrable formulas coincide with tautologies.
Example: If I prove that (using truth table or by reduction to absurd or any other way that use the values of the formulas (semantic)) then, it must exist a syntactical demonstration (starting from axioms and going on through modus ponens) to prove that formula.
We can divide the theorem in two part:
- Theorem of validity:
- Theorem of completeness:
It is very difficult to prove the theorem of completeness (in this course it isn't requested), but it is simple to prove the theorem of validity.
Theorem of validity proof: Before prove this theorem we have to prove that modus ponens (MP) preserves tautology:
if are tautologies then is a tautology.
Proof by absurdity:
Let's suppose
We have a contraddiction because
So MP preserves tautologicity.
Now we can face theorem of validity proof:
infact the hypothesis means:
- such that
-
- or (then is a tautology for definition)
- or is proved by modus ponens.
So, thanks to preservation of tautologicy of MP, we have that
When a logic is decidable?
When exists a program that:
Input:
Output: YES, if, else NO.
The classical propositional logic is decidable because, for the theorem of completeness (and validity), we have , so the program can make the truth table of the formula and then check if all the evaluation are 1. Infact, if a formula's truth table have all the entry 1, we can say that and so .
Godel logic
Syntax
The syntax of Godel logic is the same of the syntax of the classical propositional logic, so we have that .
So we can write .
Semantic
The semantic in the Godel logic is polyvalent infact assumes values in .
When:
- we say that is false, or absolutely false;
- we say that is true, or absolutely true;
- we cannot say that is true neither false. Although these values represent difference degrees of truth.
For example:
we can say that is truer then .
Infact let "Matteo is young" and "Matteo is old".
I'm 23 so I can say that I'm not absolutely young and not absolutely old so we can assign a value 0.7 to and 0.3 because I'm more young than old.
Definition(Assignment). An atomic assignment is any function
.
An assignment (or interpretation) is a function
that extends and respects the following rules for every .
- and
This is the sematic of Goedel logic but it is not the only fuzzy logic. There are many fuzzy logic with different semantic. So the question is "why those functions and not others?"
The answer is because the semantic of every fuzzy logic must behave, for assignment in as classical propositional logic.
Even Godel logic satisfy the principle of truth-functionality so the value of depends only from the values assigned to .
Exercise. Let . Prove that the semantic of Goedel logic coincide with semantic of classical propositional logic for the formulas .
Exercise. let . Prove that
-
The negation is semantically definable from implication and "falsum" (). - if and only if
Exercise. Make a plot of every function of Goedel logic. (Some are in 3D).
Here's the graph of graph
It is important to said that evary fuzzy logic assign when infact, without this, MP wouldn't preserve tautology in fuzzy logic and it would be impossible to prove the theorem of completeness in that fuzzy logic.
Definition (truth, not truth, falsehood). Let and . When we have we say that is true in the interpretation of , or is a model of . Instead, when we have we say that is not true in the interpretation of .
In particular we say that is false in the interpretation of when we have .
In symbols:
when
when .
When is true for every we say that is a tautology. Instead when we have false for every assignment we say that is a contradiction.
When exists a such as we say that is satisfiable; instead when exists a such as we say that is refutable.
In symbols:
tautology
refutable
Exercise. Establish which of the following formulas are tautology in Godel Logic and which not.
- (Excluded middle)
- (Not contradiction)
- (Law of double negation)
- (De Morgan rule I)
- (De Morgan rule II)
- (Ex falso quodlibet)
- (Prelinearity)
For example: The law of Excluded middle is not a tautology in Godel Logic, infact for we have that .
It is clear that the semantic of Godel logic is equal to classical logic only for boolean values of the variables. The exercise above shows that some tautology in classical logic aren't tautology in Godel logic. Summing up:
Proposition. If is a tautology is Godel logic then is a tautology is a tautology in classical logic, but the reverse isn't true.
Exercise. Prove the above proposition.
Here's my proof:
where is the set of all the possibile
where is the set of all the possibile
so if the former is true, the latter is true too.
Relationship between syntax and semantic
Definition (Axioms of GL (Godel logic)). For all , let's consider the following formulas.
The formulas between 1 and 10, 12 .
is called set of the axioms of Godel logic.
.
Exercise. Choose some formulas and prove that they are tautology. Note: to prove that a formula isn't a tautology we used a counter-example but now we have to prove that a formula is a tautology. The cardinality of is so we can't try every assignment...The solution is to choose that represents a class of . For example, we want to prove that is a tautology. So we have three cases:
- that represents all the
We have to evaluate the whole formula in these three cases. The evaluation is always true. Hint: the number of cases depends on the number of variables; infact, to prove A1, we have to consider 3 x 3 assignment. This will be clearer when we will face Decidibility of Godel Logic.
Theorem of validity and completeness. For all we have
The demonstrable formulas coincide with tautologies also in Godel Logic.
The demonstration of validity theorem is equal to that of classical logic.
Exercise. Prove that modus ponens preserves tautology in Godel Logic.