a prolog t ec hnology theorem pro v er mark stic k el jar
play

A Prolog T ec hnology Theorem Pro v er | Mark Stic k el - PDF document

A Prolog T ec hnology Theorem Pro v er | Mark Stic k el (JAR 1988) 1 Mark E. Stic k el A Prolog T ec hnology Theorem Pro v er: Implemen tation b y an Extended Prolog Compiler Journal of Automated Reasoning


  1. A Prolog T ec hnology Theorem Pro v er | Mark Stic k el (JAR 1988) 1 Mark E. Stic k el A Prolog T ec hnology Theorem Pro v er: Implemen tation b y an Extended Prolog Compiler Journal of Automated Reasoning v ol. 4, pp. 353-380, 1988 Discussion led b y John Harrison Univ ersit y of Cam bridge � PTTP: history and its place in A TP � Horn clauses and Prolog � F rom Prolog to PTTP � Re�nemen ts John Harrison Univ ersit y of Cam bridge, 26 June 1997

  2. A Prolog T ec hnology Theorem Pro v er | Mark Stic k el (JAR 1988) 2 Mo del elimination The deductiv e pro cedure underlying PTTP is Donald Lo v eland's MESON mo del elimination metho d, whic h w as in v en ted in the sixties. Mo del elimination is describ ed b y Lo v eland in JA CM v ol. 15 (1968), pp. 236-251 and MESON is describ ed in his 1978 b o ok: `Automated Theorem Pro ving: A Logical Basis' (North-Holland). ME w as dev elop ed b efore Lo v eland had heard of resolution. Lo v eland's later dev elopmen t of linear resolution w as quite separate. ME is a general pro of metho d for �rst order logic, and do es not (directly) supp ort equalit y reasoning, arithmetic etc. John Harrison Univ ersit y of Cam bridge, 26 June 1997

  3. A Prolog T ec hnology Theorem Pro v er | Mark Stic k el (JAR 1988) 3 PTTP The idea underlying Stic k el's PTTP w as to implemen t the MESON pro cedure using `Prolog T ec hnology'. That is, he made just a few small mo di�cations to a standard Prolog system (details later) and obtained a system complete for �rst order logic. It's probably thanks to PTTP that mo del elimination didn't disapp ear completely against the bac kground of the in tense in terest in resolution. SETHEO (from Munic h), winner of the 1996 CADE theorem pro ving comp etition, is basically a w ell-engineered v ersion of PTTP . The second-placed system, Otter, is the curren t resolution �agship. There are implemen tations of similar algorithms in Isab elle ( meson_tac ) and in HOL ( MESON_TAC ), though here clauses are interpr ete d not c ompile d . John Harrison Univ ersit y of Cam bridge, 26 June 1997

  4. A Prolog T ec hnology Theorem Pro v er | Mark Stic k el (JAR 1988) 4 Where ME b elongs W e can divide the standard �rst order theorem pro ving metho ds in to t w o main groups: � The b ottom-up, `lo cal' metho ds, e.g. resolution (Robinson, JA CM 1965) and the in v erse metho d (Maslo v, Dok. Ak ad. Nauk 1964). � The top-do wn, `global' metho ds, e.g. mo del elimination and tableaux. In some sense, al l these can b e seen as searc h for a pro of in cut-free sequen t calculus, using uni�cation to disco v er instan tiations for quan ti�ers. The b ottom-up metho ds start at the assumptions and deduce an ev er-increasing set of facts till they reac h the conclusion. T op-do wn metho d w ork bac kw ards from the conclusion, breaking it do wn to subproblems un til the assumptions are reac hed. John Harrison Univ ersit y of Cam bridge, 26 June 1997

  5. A Prolog T ec hnology Theorem Pro v er | Mark Stic k el (JAR 1988) 5 T op-do wn vs. b ottom-up The b ottom-up metho ds ha v e sev eral adv an tages. E�ectiv ely they p erform pro of at the meta-lev el: w e can regard free v ariables as implicitly univ ersally quan ti�ed. Therefore it is p ossible to apply subsumption to the curren t set of facts, and a v oid pro ving the same lemma t wice. By con trast, in top-do wn (`global') metho ds, the free v ariables in di�eren t subgoals need to b e correlated. Ho w ev er, top-do wn metho ds are more goal-directed: w e don't just gro w a big set of facts and hop e w e reac h the conclusion. Moreo v er, they are m uc h more economical to implemen t, since w e only need to store the curren t subgoals. In fact, they are al l v ery Prolog-lik e: apart from the PTTP implemen tation of MESON, there is a complete tableau pro v er called A lean T P that requires only 5 lines of Prolog. John Harrison Univ ersit y of Cam bridge, 26 June 1997

  6. A Prolog T ec hnology Theorem Pro v er | Mark Stic k el (JAR 1988) 6 A lean T P This is due to Bec k ert and P osegga; see the Journal of Automated Reasoning, v ol. 15, pp. 339-358, 1995. prove((E,F),A,B,C,D) :- !,prove(E,[F|A],B,C,D). prove((E;F),A,B,C,D) :- !,prove(E,A,B,C,D), prove(F,A,B,C,D). prove(all(I,J),A,B,C,D) :- !, \+length(C,D),copy_term((I,J,C),(G,F, C)), append(A,[all(I,J)],E),prove(F,E,B,[G |C],D) . prove(A,_,[C|D],_,_) :- ((A= -(B);-(A)=B) -> (unify(B,C);prove(A,[],D,_,_))). prove(A,[E|F],B,C,D) :- prove(E,F,[A|B],C,D). This sort of naiv e tableau pro v er is the core of Isab elle's fast_tac and HOL's TAB_TAC . John Harrison Univ ersit y of Cam bridge, 26 June 1997

  7. A Prolog T ec hnology Theorem Pro v er | Mark Stic k el (JAR 1988) 7 Horn clauses and Prolog A clause is a disjunction of literals, where a literal is either an atomic form ula or its negation: L _ � � � _ L 1 n W e sa y it is a Horn clause if it has at most one unnegated literal. In this case w e can write it as � L ^ � � � ^ � L ^ � L ^ � � � ^ � L = ) L 1 k � 1 k +1 n k or simply ` L ' if n = 1. These are the clauses 1 that are allo w ed in a Prolog database. The Prolog syn tax for the protot ypical Horn clause is: L :- � L ; : : : ; � L ; � L ; : : : ; � L k 1 k � 1 k +1 n Prolog allo ws us to deduce an atomic form ula from suc h a database b y bac k c haining through the rules, using uni�cation to instan tiate v ariables (written in upp er case in Prolog). John Harrison Univ ersit y of Cam bridge, 26 June 1997

  8. A Prolog T ec hnology Theorem Pro v er | Mark Stic k el (JAR 1988) 8 Wh y is Prolog inadequate? Prolog certainly has a limited abilit y to pro v e theorems. Ho w ev er it is inadequate as a general �rst order pro v er for three reasons: � Most Prolog implemen tations ha v e unsound uni�cation � Prolog is limited to Horn clauses � Prolog's depth-�rst searc h strategy is incomplete. W e arriv e at PTTP b y �xing eac h of these problems. W e will consider them in turn. John Harrison Univ ersit y of Cam bridge, 26 June 1997

  9. A Prolog T ec hnology Theorem Pro v er | Mark Stic k el (JAR 1988) 9 Unsound uni�cation It has long b een usual for Prolog implemen tations to omit the so-called `o ccurs c hec k', e.g. allo wing X and f ( X ) to b e uni�ed. This is either for (probably b ogus) e�ciency reasons, or b ecause circular data structures are sometimes considered useful. Ho w ev er it's disastrous for theorem pro ving, e.g. it w ould allo w us to deduce SUC(Y) < Y from X < SUC(X) . The �x is easy: just do uni�cation prop erly . John Harrison Univ ersit y of Cam bridge, 26 June 1997

  10. A Prolog T ec hnology Theorem Pro v er | Mark Stic k el (JAR 1988) 10 Limitation to Horn clauses It is not alw a ys p ossible to reduce theorem pro ving problems to Horn clause sets acceptable to Prolog. F or example, w e migh t w an t to use the facts A _ B and A = ) B to deduce B . Ho w ev er there is no equiv alen t in terms of Horn clauses. The solution adopted in PTTP is to extend the notion of `Horn clause': A ^ � � � A = ) B 1 n to allo w an y or all of the literals in v olv ed to b e negated. No w w e can tak e an y problem and reduce it to something based on these pseudo-Horn clauses. John Harrison Univ ersit y of Cam bridge, 26 June 1997

  11. A Prolog T ec hnology Theorem Pro v er | Mark Stic k el (JAR 1988) 11 Con trap ositiv es W e tak e the fact w e w an t to pro v e (ma yb e an implication under a set of assumptions), negate it, Sk olemize it and reduce it to clausal form. W e w an t to deriv e ? . F or eac h clause: P _ : : : _ P 1 n w e form n c ontr ap ositives of the form: � P ^ � � � ^ � P ^ � P ^ � � � ^ � P = ) P 1 i � 1 i +1 n i and one more of the form: � P ^ : : : ^ � P = ) ? 1 n No w w e try to solv e the goal ? � a la Prolog. John Harrison Univ ersit y of Cam bridge, 26 June 1997

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend