Anda di halaman 1dari 2

SOEN 6481 Software Systems Requirements Specification (Winter 2015/16)

Worksheet #4: Formal Specification and Proof by Resolution


One benefit of formal specification is the ability to (automatically) prove properties of the requirements
document, such as its consistency or compliance with domain properties. Proof by resolution is an important
foundation for automated theorem proving. In this exercise, we will:
1. translate requirements statements into propositional logic
2. formulate a domain property we want to prove based on the RD
3. formally prove the property using the resolution technique
Our requirements statements are
r1 = if the train is moving, the doors are not open
r2 = the train is stopped or the train is moving
We want to formally prove that given these two statements in the specification, the following always holds:
= if the doors are open, the train is stopped
Step 1: Translate the requirements into propositional logic. Suggested abbreviations: TM for train is
moving, TS for train is stopped, and DO for doors are open:
r1 =
r2 =
You now have a formal requirements specification: S = {r1 , r2 } (the comma means and ).
Step 2: Translate the property you want to prove. Now translate the property into propositional
logic:
=
Step 3: Proof by resolution. What we want to prove is that given the specification S, the proposition
always holds: |= S (this means S is a tautology).
Proof by resolution is a refutation proof : This means, you have to show that the negation of our goal
together with the specification S is inconsistent. So, negate the goal:
=
Next you have to bring all propositions into conjunctive normal form (CNF), i.e., a set of conjunctions of
disjunctions, using the equivalence rules of propositional logic (see back of page):
r1 =
r2 =
=
Now you can do the actual proof, showing that S is inconsistent, by repeatedly applying (only) the
resolution rule (see back of page under Inference Rules). Each conjunction becomes a clause in the proof,
and your goal is to derive the empty clause (e.g., from , you can derive the empty clause):
SOEN 6481 Worksheet #4: Resolution Theorem Proving Winter 2015/16

Truth tables for , , and

p q pq p q pq
p p T T T T T T
T F T F F T F T
F T F T F F T T
F F F F F F

Truth tables for and

p q pq p q pq
T T T T T T
T F F T F F
F T F F T T
F F T F F T

Equivalence Rules

Equivalence Rule Name


p p double negation
p q p q implication
(p q) p q De Morgans laws
(p q) p q
pq qp commutativity
pq qp
p (q r) (p q) (p r) distributivity
p (q r) (p q) (p r)
p (q r) (p q) r associativity
p (q r) (p q) r

Inference Rules

Inference Rule Name


)
p
pq conjunction
q
)
p
q modus ponens
pq
)
q
p modus tollens
pq
)
pq
pr chaining
qr
)
pq
qr resolution
p r
pq p simplification
ppq addition

Anda mungkin juga menyukai