User rob simmons - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-20T08:05:30Z http://mathoverflow.net/feeds/user/15328 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/66275/is-forward-chaining-also-a-form-of-focusing/66280#66280 Answer by Rob Simmons for Is forward chaining also a form of focusing? Rob Simmons 2011-05-28T14:22:50Z 2011-05-28T14:51:12Z <p>So the short answer is "yes, the forward chaining calculus is complete." Is forward-chaining still a form of focusing? Well, yes, though giving a logical characterization to <em>saturation</em> in forward-chaining is currently a point of investigation.</p> <p>I think Kaustuv Chaudhuri was the first person to take Andreoli's observations about polarity and formally connect them to forward and backward chaining, though he did so in an unusual way (at least from my perspective, and, based on reading your question, from yours as well). In particular, Chaudhuri works from the perspective of the axioms-down (or <em>inverse method</em>) search for proofs rather than the perspective of build-the-tree-based-on-the-current-goals proof search. This is detailed in <em><a href="http://dx.doi.org/10.1007/s10817-007-9091-0" rel="nofollow">A Logical Characterization of Forward and Backward Chaining in the Inverse Method</a></em>, and a simplified discussion can be found in Chaudhuri's March 2007 ALP newsletter article, <em><a href="http://dtai.cs.kuleuven.be/projects/ALP/newsletter/may07/content/Articles/theoremproving/content.html" rel="nofollow">Polarities in Theorem Proving and Logic Programming</a></em>. Kaustuv might argue that the inverse method is one of the "better ways to formulate forward chaining than with (->L Forward)", though I don't exactly take this view (and don't want to put words in his mouth!)</p> <p>I wrote some notes about this some time ago in a blog post called <em><a href="http://requestforlogic.blogspot.com/2010/09/focusing-and-synthetic-rules.html" rel="nofollow">Focusing and Synthetic Rules</a></em> that tried to re-cast some of Chaudhuri's observations from the perspective of bottom-up proof search. Also, in the (woefully-un-commented) Twelf Wiki <a href="http://twelf.plparty.org/wiki/Weak_focusing" rel="nofollow">article</a> presenting a variant of the completeness-of-focusing proof that I sketched in the previous answer, I actually had some fun using the computational content of the completeness-of-focusing argument to actually <a href="http://twelf.plparty.org/wiki/Weak_focusing#Forward_and_backward_chaining" rel="nofollow">transform proofs into forward-chaining form and backward-chaining form</a>. The commentary at the end, unlike the completeness-of-focusing proof, does include some explanatory text.</p> http://mathoverflow.net/questions/65776/how-establish-conversion-of-cut-free-proof-into-uniform-proof/65854#65854 Answer by Rob Simmons for How establish conversion of cut-free proof into uniform proof? Rob Simmons 2011-05-24T14:32:42Z 2011-05-26T03:03:28Z <p>I think some of the commenters were confused by the notation $\Gamma \vdash A \downarrow B$, which I have only seen written as $\Gamma [ A ] \vdash B$ or $\Gamma \vdash A > B$. The downarrow comes, as you note in a comment, from Andreoli's notation, but that notation is more common in presentations of sequent calculi for classical logics, at least in my experience. The notation I'll use is the one with $>$ instead of $\downarrow$, which comes from Cervesato and Pfenning's "A Linear Spine Calculus."</p> <h2>Two proof systems</h2> <p>So, to restate the goal, we have the following sequent calculus for first-order, minimal logic:</p> <p>$$ {P \in \Gamma \over \Gamma \Rightarrow P}{\it init} \qquad {\Gamma, A \Rightarrow B \over \Gamma \Rightarrow A \supset B}{{\supset}R} \qquad {(A \supset B) \in \Gamma \qquad \Gamma \Rightarrow A \qquad \Gamma, B \Rightarrow C \over \Gamma \Rightarrow C}{{\supset}L} $$</p> <p>$$ {\Gamma \Rightarrow A(\alpha) \over \Gamma \Rightarrow \forall x.A(x)}{{\forall}R^\alpha} \qquad {(\forall x.A(x)) \in \Gamma \qquad \Gamma, A(t) \Rightarrow C \over \Gamma \Rightarrow C}{{\forall}L} $$</p> <p>We want to relate this proof system to the following presentation of "focused" or "uniform" proofs. I would argue that in your presentation above, the description of uniform proofs is missing at least one necessary rule ($\it focus$) and arguably is missing three; I would write the full system of focused (a.k.a. uniform) proofs as follows:</p> <p>$${A \in \Gamma \qquad \Gamma \vdash A > P \over \Gamma \vdash P}{\it focus} \qquad {{} \over \Gamma \vdash P > P}{\it init}$$</p> <p>$${\Gamma, A \vdash B \over \Gamma \vdash A \supset B}{{\supset}R} \qquad {\Gamma \vdash A \qquad \Gamma \vdash B > P \over \Gamma \vdash A \supset B > P}{{\supset}L}$$</p> <p>$${\Gamma \vdash A(\alpha) \over \Gamma \vdash \forall x.A(x)}{{\forall}R^\alpha} \qquad {\Gamma \vdash A(t) > P \over \Gamma \vdash \forall x. A (x) > P}{{\forall}L}$$</p> <p>... where $A$ and $B$ represent arbitrary propositions and $P$ represents an atomic proposition.</p> <h2>Relationship between the proof systems</h2> <p>We, roughly speaking, expect the two proof systems to prove the same things. One direction of this is easy:</p> <p><strong>Theorem 1 (Soundness of focusing)</strong> - If $\Gamma \vdash A$, then $\Gamma \Rightarrow A$, and if $\Gamma \vdash A > C$, then $\Gamma, A \Rightarrow C$.</p> <p><em>Proof:</em> Straightforward induction on focused proofs (+ weakening for the unfocused proofs).</p> <p>The other direction is a bit trickier:</p> <p><strong>Theorem 2 (Completeness of focusing)</strong> - If $\Gamma \Rightarrow A$ then $\Gamma \vdash A$. </p> <p>Before we discuss Theorem 2, the question is, why do we care about the focused proof system and its correspondence to the unfocused proof system at all? One answer is because it lets us prove the following theorem (restated from the original poster):</p> <p><strong>Corollary 1</strong> - If $\Gamma \Rightarrow P$ then there exists $A \in \Gamma$ such that $\Gamma \vdash A > P$. </p> <p><em>Proof:</em> By Theorem 2 and the premise, $\Gamma \vdash P$. By case analysis, the last rule in this derivation must be $\it focus$, and the result follows immediately from the premises of that rule.</p> <h2>The completeness of focusing</h2> <p>There are a number of ways to prove the completeness of focusing; the approach I describe here is not the oldest and I don't claim it's the best, but it'll do; I'd welcome anyone else that wanted to elaborate other, possibly simpler, versions of this proof. Variations of this approach can be found in the following places:</p> <ul> <li><em>Sadly-uncommented Twelf code:</em> Robert J. Simmons, <a href="http://twelf.plparty.org/wiki/Weak_focusing" rel="nofollow">Weak Focusing</a>. The Twelf Wiki.</li> <li><em>The appendices of:</em> Jason Reed and Frank Pfenning, <a href="http://www.cs.cmu.edu/~fp/papers/substruct10.pdf" rel="nofollow">Focus-Preserving Embeddings of Substructural Logics in Intuitionistic Logic</a>.</li> <li><em>Mostly just hinted at:</em> Frank Pfenning and Robert J. Simmons, <a href="http://www.cs.cmu.edu/~fp/papers/lics09.pdf" rel="nofollow">Substructural Operational Semantics as Ordered Logic Programming</a>. LICS 2009.</li> <li><em>In a much more general form:</em> Robert J. Simmons and Frank Pfenning, <a href="http://www.cs.cmu.edu/~rjsimmon/papers/CMU-CS-10-147.pdf" rel="nofollow">Weak Focusing for Ordered Linear Logic</a>. CMU Tech Report.</li> </ul> <p>The basic idea is to prove cut admissibility and identity expansion <em>for the focused system only</em>, and then use that to prove the critical "unfocused admissibility" lemmas, which show that any unfocused inference is valid over focused proofs. One reason that I like this presentation is that it shows how <strong><em>the completeness of focusing is a straightforward consequence of cut admissibility and identity expansion for the focused sequent calculus</em></strong>.</p> <p>Theorem 3 is standard, and Theorem 4 is an equally important theorem that has been frequently neglected:</p> <h3>Part 1: Cut admissibility</h3> <p><strong>Theorem 3 (Cut admissibility)</strong> </p> <ul> <li>If $\Gamma \vdash A$ and $\Gamma \vdash A > C$, then $\Gamma \vdash C$.</li> <li>If $\Gamma \vdash A$ and $\Gamma, A \vdash C$, then $\Gamma \vdash C$.</li> <li>If $\Gamma \vdash A$ and $\Gamma, A \vdash B > C$, then $\Gamma \vdash B > C$. </li> </ul> <p><em>Proof:</em> These three statements are proved simultaneously by lexicographic induction: either the size of the principal formula $A$ gets smaller or the principal formula stays the same size while one of the provided derivations decrease in size (and the other stays the same).</p> <h3>Part 2: Identity expansion</h3> <p><strong>Theorem 4 (Identity expansion)</strong> If there is a proof $$\Gamma \vdash A > P $$ $$\vdots$$ $$\Gamma \vdash P$$ that is <em>parametric</em> in $P$, then $\Gamma \vdash A$. </p> <p><em>Proof:</em> By induction on the structure of $A$. </p> <p><strong>Case $A = P'$</strong>. We are given a derivation parametric in $P$ that has an open leaf $\Gamma \vdash P' > P$ and that proves $\Gamma \vdash P$. By letting $P = P'$, we can show $\Gamma \vdash P' > P'$ by $\it init$, which gives us $\Gamma \vdash P'$, exactly what we needed to show.</p> <p><strong>Case $A = A \supset B$</strong>. We are given a derivation parametric in $P$ that has an open leaf $\Gamma \vdash A \supset B > P$ and that proves $\Gamma \vdash P$.</p> <p>First, note that we can weaken this derivation to a derivation parametric in $P$ that has an open leaf $\Gamma, A \vdash A \supset B > P$ and that proves $\Gamma, A \vdash P$. </p> <p>Second, note that the rule $\it focus$ allows us to create a derivation parametric in $Q$ that has an open leaf $\Gamma, A \vdash A > Q$ and that proves $\Gamma, A \vdash Q$. By the induction hypothesis, we can conclude $\Gamma, A \vdash A$. </p> <p>These two derivations, together with rule ${\supset}L$, allow us to construct a derivation parametric in $P$ that has an open leaf $\Gamma, A \vdash B > P$ and that proves $\Gamma, A \vdash P$. By the induction hypothesis, we can conclude $\Gamma, A \vdash B$, and by rule ${\supset}R$, we can conclude $\Gamma \vdash A \supset B$. </p> <p><strong>Case $A = \forall x. A(x)$</strong>. (Omitted.)</p> <p>This completes the identity expansion lemma which has, as a simple corollary, the identity theorem that for all $A$, $\Gamma, A \vdash A$ (we actually used this corollary in the second case). </p> <h3>Part 3: Unfocused admissibility</h3> <p>Now we can prove "unfocused admissibility" of all of the left rules:</p> <p><strong>Theorem 5 (Unfocused admissibility)</strong> </p> <ul> <li>If $P \in \Gamma$, then $\Gamma \vdash P$.</li> <li>If $(A \supset B) \in \Gamma$, $\Gamma \vdash A$, and $\Gamma, B \vdash C$, then $\Gamma \vdash C$.</li> <li>If $(\forall x.A(x)) \in \Gamma$ and $\Gamma, A(t) \vdash C$, then $\Gamma \vdash C$. </li> </ul> <p>The first statement we can prove immediately by ${\it init}$ followed by ${\it focus}$. </p> <p>For the second statement, we use identity expansion to prove that $\Gamma, A \vdash A$. From this fact, the given fact that $A \supset B \in \Gamma$, and the ${\it focus}$ and ${{\supset}L}$ rules, it is possible to construct a derivation parametric in $P$ that has an open leaf $\Gamma, A \vdash B > P$ and that proves $\Gamma, A \vdash P$. Therefore, by identity expansion, $\Gamma, A \vdash B$. We were given that $\Gamma \vdash A$, so by cut admissibility, $\Gamma \vdash B$. We were also given that $\Gamma, B \vdash C$, so by cut admissibility, $\Gamma \vdash C$.</p> <p>I'll omit again the proof of the third statement.</p> <h3>Part 4: Proving Theorem 2 by straightforward induction</h3> <p>Now that I have the unfocused admissibility theorems, proving the completeness of focusing is just a matter of straightforward induction over the unfocused derivations. Whenever we encounter a right rule we can use the induction hypothesis along with the corresponding rule in the focused sequent calculus. Whenever we encounter another rule we use the appropriate unfocused admissibility theorem.</p> <p><strong>Theorem 2 (Completeness of focusing)</strong> - If $\Gamma \Rightarrow A$ then $\Gamma \vdash A$. </p> <p><em>Proof</em> - By induction on the derivation $\Gamma \Rightarrow A$.</p> <p><strong>Case 1:</strong> $\mathcal D = {P \in \Gamma \over \Gamma \Rightarrow P}{\small \it init}$. </p> <p><em>To show:</em> $\Gamma \vdash P$. </p> <p>Immediate from the assumption $P \in \Gamma$ (premise of ${\it init}$ and unfocused admissibility (part 1).</p> <p><strong>Case 2:</strong> $\mathcal D = {\Gamma, A \Rightarrow B \over \Gamma \Rightarrow A \supset B}{\small {\supset} R}$</p> <p><em>To show:</em> $\Gamma \vdash A \supset B$. </p> <p>By the induction hypothesis, we have $\Gamma, A \vdash B$. Then, by rule ${\supset}R$, we have $\Gamma \vdash A \supset B$, which is what we needed to show.</p> <p><strong>Case 3:</strong> $\mathcal D = {(A \supset B) \in \Gamma \quad \Gamma \Rightarrow A \quad \Gamma, B \Rightarrow C \over \Gamma \Rightarrow C} {\small {\supset} L}$</p> <p><em>To show:</em> $\Gamma \vdash C$.</p> <p>By the induction hypothesis, we have $\Gamma \vdash A$ and $\Gamma, B \vdash C$. Then the result follows from the fact that $(A \supset B) \in \Gamma$ and the unfocused admissibility lemma.</p> <p><strong>Case 4:</strong> (${\forall}R^\alpha$, omitted)</p> <p><strong>Case 5:</strong> (${\forall}L$, omitted) </p> http://mathoverflow.net/questions/65776/how-establish-conversion-of-cut-free-proof-into-uniform-proof/65854#65854 Comment by Rob Simmons Rob Simmons 2011-10-30T15:54:56Z 2011-10-30T15:54:56Z Beautiful question! Yes, you need to generalize the identity expansion property in an interesting and non-obvious way to handle positive propositions. Luckily, I have a paper on arXiv that describes how, which I plan to submit to a journal after a bit more revision: <a href="http://arxiv.org/abs/1109.6273" rel="nofollow">arxiv.org/abs/1109.6273</a> http://mathoverflow.net/questions/69660/could-saturation-of-forward-chaining-be-non-deterministic-in-the-non-propositiona/70091#70091 Comment by Rob Simmons Rob Simmons 2011-07-16T17:19:58Z 2011-07-16T17:19:58Z Sorry: what I meant by &quot;existentially&quot; was precisely those variables that &quot;arise naturally by a backward chaining step,&quot; which is why I said &quot;existentially in the sense of Prolog.&quot; http://mathoverflow.net/questions/69660/could-saturation-of-forward-chaining-be-non-deterministic-in-the-non-propositiona Comment by Rob Simmons Rob Simmons 2011-07-10T14:45:12Z 2011-07-10T14:45:12Z The way you wrote it, it looks like the rule and the relevant facts get removed from the context when you apply &lt;tt&gt;-&gt; Forward&lt;/tt&gt; (reading from the bottom up). This would certainly be non-deterministic, because starting from the sequent &lt;tt&gt;Q1, Q1 -&gt; Q2, Q1 -&gt; Q3 |- A&lt;/tt&gt; only one of the two rules would be able to fire. Presumably that's not what you meant, though. I believe what you're asking to is related to the question of the semi-decidability of Prolog, which only holds if you use an un-Prolog-like breadth first search. http://mathoverflow.net/questions/66275/is-forward-chaining-also-a-form-of-focusing/66280#66280 Comment by Rob Simmons Rob Simmons 2011-05-30T04:23:29Z 2011-05-30T04:23:29Z What you <i>can</i> do is prove that, if you are trying to prove a sequent $\Gamma \vdash P$ where $\Gamma$ contains only Horn clauses and $P$ is atomic, the proof won't contain the ${\supset}R$ rule. This holds in both focused and unfocused systems. If you want, you can see the introduction of the ${\supset}R$ rule as akin to &quot;generalizing the induction hypothesis.&quot; For the strategy I presented, you need a sound and complete logic, even though it contains some rules (${\supset}R$, ${\forall}R$) that you can prove you don't need for your uniform proofs. http://mathoverflow.net/questions/66275/is-forward-chaining-also-a-form-of-focusing/66280#66280 Comment by Rob Simmons Rob Simmons 2011-05-30T04:19:03Z 2011-05-30T04:19:03Z The restriction to Horn clauses is fine as far as it goes, but as you note, a sequent calculus with Horn clauses but without the ${\supset}R$ rule is <i>incomplete</i> - the sequent calculus system doesn't admit the identity property (becuase you can't prove $A \supset B \vdash A \supset B$) and the natural deduction system is unable to do $\eta$-expansion. So what you're claiming as the natural logic of Horn clauses is, I claim, not a well-formed logic. If you want to restrict <i>propositions</i> to the form $P \supset A$ with $P$ atomic, you can get a well-formed logic, but you still need ${\supset}R$ http://mathoverflow.net/questions/66275/is-forward-chaining-also-a-form-of-focusing/66280#66280 Comment by Rob Simmons Rob Simmons 2011-05-29T03:27:30Z 2011-05-29T03:27:30Z In other words: there's already an accepted definition for a &quot;logically permissible macro&quot; - an admissible rule. http://mathoverflow.net/questions/66275/is-forward-chaining-also-a-form-of-focusing/66280#66280 Comment by Rob Simmons Rob Simmons 2011-05-29T03:26:27Z 2011-05-29T03:26:27Z As for the first BTW: certainly ${\supset}L$ is an <i>admissible rule:</i> just as all the unfocused rules were admissible in the focused system, natural deduction inference is admissible in a sequent calculus and vice versa. By &quot;synthetic inference rules&quot;, I mean the observation that we can treat a <i>valid formula as equivalent to an inference rule it gives rise to under focusing</i>. And I wouldn't call it my notion: I got them from Chaudhuri who got them from Andreoli's bipoles, and the idea was around even before that in LF's notion of induction on canonical forms. http://mathoverflow.net/questions/66275/is-forward-chaining-also-a-form-of-focusing/66280#66280 Comment by Rob Simmons Rob Simmons 2011-05-28T14:27:37Z 2011-05-28T14:27:37Z While it may be a bit counterintuitive, you might find more people knowledgeable about this topic at the CSTheory StackExchange!