Metatheory - University of Cambridge
Metatheory - University of Cambridge
Metatheory - University of Cambridge
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
6. Completeness 52<br />
Step 1. Start a TFL-pro<strong>of</strong>, with ∆ as your assumptions.<br />
Step 2. For each sentence D among ∆, apply the algorithm which finds a<br />
CNF-sentence D ∗ such that D ∗ ⊢ D. This will leave you with a single<br />
TFL-pro<strong>of</strong> where each D ∗ appears on some line.<br />
Step 3: Now apply ∧E as <strong>of</strong>ten as you can to lines <strong>of</strong> your TFL-pro<strong>of</strong> that<br />
are in CNF, until any further application <strong>of</strong> ∧E would yield a sentence<br />
already on your pro<strong>of</strong>.<br />
Step 4: Expand the first disjunction in CNF which you have not yet expanded.<br />
More precisely: let (A ∨B) be the first disjunction in CNF that you have<br />
not yet expanded and let l be any line in your pro<strong>of</strong>-skeleton that is both<br />
beneath the line on which the disjunction occurs; and which depends<br />
upon (at least) the assumptions on which the disjunction occurs. Then,<br />
beneath line l, introduce two new assumptions – A and B – separately,<br />
and with an empty line beneath both. At this point, we say that the<br />
disjunction ‘(A ∨ B)’ has been expanded.<br />
Repeat this step until every disjunction in CNF has been expanded.<br />
Step 5: Go through every open line and check to see whether ⊥I can be applied.<br />
If so, apply it (filling in line numbers).<br />
Step 6: Go through every open line and check to see whether ∨E can be applied<br />
(allowing you to generate a line with ‘⊥’ on it). If so, apply it (filling in<br />
line numbers). Repeat this step until ∨E cannot be applied any further.<br />
Step 7: Output the pro<strong>of</strong> or pro<strong>of</strong>-skeleton. This terminates SimpleSearch.<br />
This is the algorithm SimpleSearch.<br />
Proving that SimpleSearch behaves as required<br />
⊢<br />
I now want to prove that SimpleSearch has the properties (a1) and (a2),<br />
which I advertised for it.<br />
The very first thing I need to do is to make sure that, when we run<br />
SimpleSearch, there is no chance <strong>of</strong> our getting trapped in an infinite loop.<br />
That is, we need a guarantee that SimpleSearch will output something in the<br />
end, regardless <strong>of</strong> the inputs we feed it.<br />
Lemma 6.4. SimpleSearch is guaranteed to terminate, on any inputs.<br />
Pro<strong>of</strong> sketch. Step 1 is guaranteed to terminate eventually, since it just involves<br />
writing down finitely many sentences.<br />
Step 2 is similarly guaranteed to terminate, since it only ever takes finitely<br />
many steps to generate a CNF equivalent from each <strong>of</strong> the finitely many assumptions.<br />
Step 3 is guaranteed to terminate, since are only finitely many conjunction<br />
signs among the CNF sentences you have written down, and so you only need<br />
to apply ∧E finitely many times.<br />
Step 4 is the tricky step. The worry is that, in expanding a disjunction (in<br />
CNF), you may have to introduce many new assumptions; and if one <strong>of</strong> the disjuncts<br />
is itself a disjunction, this can increase the total number <strong>of</strong> unexpanded<br />
disjunctions. 3 However, when we expand a disjunction, each <strong>of</strong> the disjuncts<br />
3 To see this in action, see what happens when your initial assumptions are ‘(A ∨ B)’ and<br />
‘((C ∨ D) ∨ (D ∨ E))’.