



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
A tutorial on satisfiability and resolution for Informatics 1 - Computation & Logic. It includes information on entailment, state transitions for a traffic light system, and modifications to the ATM PIN-checking section. Students are expected to attempt the homework and bring their work to the tutorial.
What you will learn
Typology: Schemes and Mind Maps
1 / 5
This page cannot be seen from the preview
Don't miss anything!
Please attempt the entire worksheet in advance of the tutorial, and bring all work with you. Tutorials cannot function properly unless you study the material in advance. Attendance at tutorials is obligatory; please let the ITO know if you cannot attend. You may work with others, indeed you should do so; but you must develop your own understanding; you can’t phone a friend during the exam. If you do not master the coursework you are unlikely to pass the exams.
We say that Γ |= ∆ iff every state that satisfies every expression in Γ satisfies at least one expression in ∆. In particular, |= ∆ (the LHS is empty) iff
∆ is a tautology, and Σ |= (the RHS is empty) iff Σ is not satisfiable. We represent a state as (the conjunction of) the set V of literals true in that state. For any formula φ either V |= φ or V |= ¬φ — as V makes φ either true or false.
So, Γ |= ∆ iff for all states V. ( (for all ϕ ∈ Γ. V |= ϕ) ⇒ (for some ψ ∈ ∆. V |= ψ)
Γ 6 |= ∆ iff there is a counterexample V such that (for all ϕ ∈ Γ. V |= ϕ) and, (for all ψ ∈ ∆. V |= ¬ψ)
(a) Γ |= ∆, ϕ iff Γ, ¬ϕ |= ∆ (b) Γ |= ∆, ¬ϕ iff Γ, ϕ |= ∆ (c) Γ |= ∆, ϕ ∧ ψ iff Γ |= ∆, ϕ, ψ (d) Γ |= ∆, ϕ ∨ ψ iff Γ |= ∆, ϕ, ψ (e) Γ, ϕ ∨ ψ |= ∆ iff Γ, ϕ, ψ |= ∆ (f) Γ, ϕ ∧ ψ |= ∆ iff Γ, ϕ, ψ |= ∆
You should have found that 1(a) is true: Γ |= ∆, ϕ iff Γ, ¬ϕ |= ∆. For example (in this example ∆ = ∅),
D → (A ∨ B), E ∨ (C? ¬A : B), (B? E → D : C ∨ E) |= (D ∧ C) → (B ∨ E) iff D → (A ∨ B), E ∨ (C? ¬A : B), (B? E → D : C ∨ E), ¬
In general, if we write ∆¬^ for {¬ψ | ψ ∈ ∆}, Γ |= ∆ iff Γ, ∆¬^ |= This means that, Γ |= ∆ iff Γ, ∆¬^ is inconsistent.
Resolution is a procedure used to search for a state that satisfies a given set of constraints, Σ. If there is no state satisfying Σ — which means that Σ is inconsistent — then resolution will produce the empty clause.
So, we can test whether Γ |= ∆ by converting Σ = Γ, ∆¬^ to CNF and then using resolution. If resolution of Σ produces the empty clause then the entailment is valid; otherwise a satisfying valuation for Σ provides a counterexample to the entailment.
In the examples below there is only one conclusion — ∆ is a singleton.
A → (B ∨ C), ¬D → ¬(B ∧ C) |= A → D
(a) First convert each assumption and the negation of each conclusion to clausal form. i. A → (B ∨ C) ii. ¬D → ¬(B ∧ C) iii. ¬(A → D) (b) Check whether this set of constraints is consistent:
Entailment
Γ |= ∆ iff for all states V. ( (for all ϕ ∈ Γ. V |= ϕ) ⇒ (for some ψ ∈ ∆. V |= ψ)
Γ 6 |= ∆ iff there is a counterexample V such that (for all ϕ ∈ Γ. V |= ϕ) and, (for all ψ ∈ ∆. V |= ¬ψ)
We will normally omit the set-brackets {}, and other set-notation, when writing entailments. For example, if ϕ, ψ, θ are expressions, we write
Γ |= ϕ for Γ |= {ϕ} Γ, θ |= ϕ, ψ for Γ ∪ {θ} |= {ϕ, ψ}
Now consider what this definition of |= means in some special cases.
Γ of all expressions in Γ is contradictory.
∆ of all expressions in ∆ is a tautology.
Γ makes ϕ true.
Tutorial Activity
(a) Assume that the lights cycle through the proper sequence, and that cars always obey the traffic regulations, draw a diagram of the legal state tran- sitions. Give a logical description of the legal transitions. (b) Can you remove some transitions to describe a system in which the lights will not change to green unless there is a car waiting? Give a logical description of the transitions you allow. (c) How might you model an intersection with two pairs of lights? What should be the states of this system? What conditions on the states and transitions do we need to specify a safe and efficient system?
current
next
R A G R^0 A^0 G^0 5
A
D
B
C
current
next
A B C D B C D A
ATM
£
ok? yes
choose a/c
balance
withdraw
insert card
wrong PIN PIN ok
take money amount no
return card
return card
4
withdraw
This tutorial exercise sheet was written by Dave Cochran and Michael Fourman, draw- ing on material from an earlier tutorials produced by Paolo Besana, Thomas French, and Areti Manataki. Send comments to Michael.Fourman@ed.ac.uk