Tutorial 10. Many-valued logics
Exercise sheet
K3-Sat Solving
In class, we’ve implemented a counter-model searcher for K3 inferences using SQL in db-fiddle . Use the machinery to check whether the following inferences are K3 valid or not:
- (RAIN
(RAIN
SUN))
SUN - SUN
RAIN
RAIN - SUN,
SUN
RAIN - RAIN
SUN
(
RAIN
SUN) - WIND
(RAIN
RAIN) - RAIN
RAIN
RAIN
Solution
The following db-fiddle contains queries for each of the above inferences. The ones that return non-empty tables have countermodels, which are given by the return values. The annotations explain how to interpret the tables.
K3-Laws
In fact, you can use a similar method to verify the laws of Kleene algebra using SQL.
Here are, for example, the queries to verify the commutativity of OR and AND:
|
|
Verify the remaining Kleene laws like this.
Note that for the laws with 3 variables, you need to create a table ValueTriples for the method to work.
Solution
The following db-fiddle contains code that verifies all laws. There are three queries, one for the laws with one variables, one for laws with two variables, and one for laws with three variables. The queries are structured such that it would return a valuation iff at least one of the laws fails. They don’t return anything so the laws hold.
Łukasiewicz conditionals
In K3, we’ve defined a semantics for conditionals by saying that
B) = (NOT A) OR BThis gives rise to the Kleene logic K3. But interestingly, in this logic,
it’s not a logical law that RAIN
RAIN—there are countermodels,
where this statement isn’t true.
But there’s an alternative system of 3-valued logic, which is defined just like Kleene logic, except that it uses the following truth-table to interpret the conditional:
That is, in this system,
B) = A Ł BThis logic is called Łukasiewicz logic, Ł.
-
Verify that there exists a K3 model, where RAIN
RAIN is not true. -
Verify that there RAIN
RAIN is true in all Ł models. -
Is MP valid in Ł-logic?
Solution
-
Consider the K3-model where v(RAIN) = ω. In this model, we have
v(RAIN
RAIN) = (NOT v(RAIN)) OR v(RAIN) = (NOT ω) OR ω = ωAnd since ω ≠ 1, this is a model where the formula isn’t true.
-
we have that v(RAIN
RAIN) = v(RAIN) Ł v(RAIN). That is,
we’re dealing with an expression of the form X Ł X. If we go to the table for Ł, we note that for identical inputs, the values (on the diagonal) are always1. In other words, the formula is true in all models. -
Suppose that v(A) = 1 and v(A
B) = 1. Inspecting the table for
Ł, we can see that there is one and only one configuration of values
that makes this possible, namely the one where v(B) = 1.
Fuzzy Predicates
Suppose we’ve got a language with predicates Fast¹ and Slow¹, which
describe the speed of a car and apply to terms for speed (like 10
km/h).
-
Describe a model for these predicates by means of a diagram, in which there is a “gray area” between fast and slow.
-
Add to the language two fuzzy constants
breakandaccelerate. Formulate a system of fuzzy rules that keep the car in the gray area between fast and slow, while avoiding breaking and accelerating simultaneously.
Solution
-
There are different ways of interpreting “gray area”.
-
Here’s an interpretation, according to which “gray area” means that there’s an area where the car is both fully not slow and fully not fast:
-
Here’s an interpretation, where “gray area” means that there’s an area where the car is both half-way fast and half-way slow:
These are, of course, other models, but these two will do.
-
-
How such rules could look like highly depends on the model we chose to interpret
FastandSlow:-
In our first model, the following rules will do:
Fast x
break
Slow x
accelerate
In this model, our car will never break and accelerate at the same time.
-
In our second model, the same rules will lead to situations where we’re breaking and accelerating at the same time: if we pick an
xwhere, we’ll have
Slow x
=
Fast x
= 0.5. But they will keep the car in the “gray area”.
break
=
accelerate
= 0.5
-
Fuzzy Logic
In class, we’ve seen that in fuzzy logic, disjunctive syllogism fails: there are formulas A,B, such that
A, A
B
BModify the example to show that in fuzzy logic, also the principle of explosion fails, that is there are formulas A,B, such that
A
BSolution
Let’s take for A a statement which, in a suitable model, is both “half-true”,
that is, has value 0.5. For example, Fast 45km/h could be such that
. It follows by the semantics
for
Fast 45km/h
= 0.5
that also
. That means that
Fast 45km/h
= 0.5
min(
Fast 45km/h
,
Fast 45km/h
) = 0.5
If we then take a statement for B, which is certainly false, such as Fast 0kmh, meaning
, we have a clear countermodel:
Fast 0km/h
= 0
min(
Fast 45km/h
,
Fast 45km/h
) = 0.5 ≥ 0 =
Fast 0km/h
So the inference
A
B