Proceedings

Logic Program Derivation for a Class of First Order Logic Relations

Download BibTeX Cite

Proceedings of the Tenth International Joint Conference on Artificial Intelligence. Architectures and Languages. Pages 9-13.

© 1987 International Joint Conferences on Artificial Intelligence

Abstract

Logic programming has been an attempt to bridge the gap be~en specification and programming language and thus to simplify the software deve1opment process. Even though the only d,itference between a specification and a program in a 1ogic programming frame~rlc. is that of effi.ciency, there is still some conceptual distance to be covered be~en a naive, intuitively correct specification and an effi.ciently executable version of it. And even though some mechanical tools have been developed to assist in covering this distance, no fully automatic system for this purpose is :yet known. In this raper ~ present a general class of first-order 1ogic re1ations, which is a subset of the extended Hom c1ause subset of 1ogic, for which ~ give mechanical means for deriving Hom 1ogic programs, which are guaranteed to be correct and complete with respect to the initial specifications.

  1. s) <M> AJ( r) emr lu Jv(A2(r,u,v) & Ql(u,v,s) & Q(u,s))] Thus we have: a) Base case. Assume: Al( r) ?-;>true.
  2. Pl,Pll-[Q(r,s) ?-;>true] I-(since:-R<.r,q,s) ?-;>true) -[
  3. Q(r,s) ?-;>\lq CR(r,q,s) or Al.q,s))}l- 1-[Q< r,s) ?-;> Vq ( R( r,q,s)-.;> AI. q,s))j: S b) Induction step. Assume (Al( r) ?-;> false and) A2( r,u,v) ?-;>true, for some u and v and, by assuming:
  4. Q(u,s) ?-;> \lq (R(u,q,s) -.;> Alq,s))} (:S'), prove S. Then: Pl,Pll-fQ(r,s) <M>Ql(u,v,s) & Q(u,s)]l-(by AS andS') 1-[Q(r,s) <M>Yq (RJ(u,v,q,s) ...:;>A{q,s)) & Vq (R(u,q,s) ...:;>A{q,s)) 11- 1-[
  5. Q(r,s) ~Yq(Rl(u,v,q,s)orR(u,q,s)...:;>A{q,s))j I- I-[Q(r,s) <M> Yq (/u Jv(A2(r,u,v) &<Rl(u,v,q,s) or R(u,q,s))) ...:;>A/.q,s))J (byS2) 1-[Q(r,s) <M>Yq (R(r,q,s) ...:;>A{q,s))]:S.
  6. Similarly here we only consider the case where u is a singleton. Comlctnea: We have to show: S,S3,AS1 ,AS2 1-Pl&Pl, ~ can be split into a) S,S3,AS1 ,AS2 1-Pl and b) S,S3,ASJ,AS21-Pl. However for a better presentation we can follow the same ~th of (top-down) inferences up to a point for both (a) and (b) and then continue with two different branches in a bottom-up fashion. Thus: S: [Q(r,s) <M> Yq (R( r,q,s) ...:;> Alq,s))] I- I-[Q(r,s) <.:-Yq (R(r,q,s) ...:;>A{q,s))j 1-(byS3) 1-[Q(r,s) <.:-Yq ((Al(r) & Rl(r,q,s)) or lu lv (A2( r,u,v) & [R2(u,v,q,s) or R(u,q,s)J) ...:;>A{q,s))J 1-[Q(r,s) <.:-Yq (Al(r) & Rl(r,q,s) ...:;>A{q,s)) & Yq (/u lv (A2(r,u,v) & [R2(u,v,q,s) or R(u,q,s)J) ...:;>A{q,s))] -
  7. & Yu Yv (A2( r,u,v) ...:;> Yq (R2(u,v,q,s) or R(u,q,s) ...:;>A{q,s)))]
  8. -(by ASl, AS2 and by S 'With r-u -fo1ding) 1-[Q(r,s) <.:-(Al(r) ...:;>QJ(r,s)) & Yu ¥v(A2(r,u,v) ...:;>Q2(u,v,s) & Q(u,s))j: IS a) It suffices to show: IS 1-Pl . ISI-fQ(r,s) <.:-AJ(r)&Ql(r,s)] <-> <->IS, Al(r), Ql(r,s) 1-Q(r,s) <-> <-> [Q( r ,s) <.:-(true ...:;>true) & Vu Vv(ftlae ...:;>Q2(u,v,s) & Q(u,s))]l-Q(r,s) <-> Q(r,sH Q(r,s), \\bich Is valid. b) It suffices to show: IS 1-Pl. IS 1-[Q(r,s) <.:-A2!r,u,v) & Q2(u,v,s) & Q(u,s)] <-> <->IS, A2<r,u,v), Q2(u,v,s), Q(u,s) 1-Q(r,s) <-> <-> [Q(r,s) <.:-(ftlae ...:;>QJ(r,s)) & Yu Vv(true .:;>true)]!-Q(r,s) <-> <-> Q(r,s) 1-Q(r,s), \\bich Is valid. Completeneas: We have to show: Pl,Pl,AS1,AS2,S31-S. Again we resort to induction. Notice that by c. w.a.: Pl,Pl ~[Q(r,s) <~(Al(r) & Ql(r,s)) or (A2(r,u,v) & Q2(u,v,s) & Q(u,s))} a) Base case. Assume: Al(r) <~true. Then S31-1[
  9. R(r,q,s) <M>Rl(r,q,s)](:S3') and
  10. Pl,P2+-/Q(r,s) <M>(true & Ql(r,s)) or ftlae]I- 1-[Q(r,s) <M>Ql(r,s)} 1-(by ASl) 1-[Q(r,s) <M> Yq (R1<r,q,s) ...:;>A{q,s))]l-(byS3') 1-[Q(r,s) <M> Yq (R(r,q,s) ...:;>A{q,s))]: S. b) Induction step. Assume ( Al( r) ?-;> false and) A2( r,u) <~ true, for some u and v and, by assuming
  11. Q(u,s) <M> Yq (R(u,q,s) ...:;> Alq,s))J (:S'), prove S. First, 'WC have: S3 ~ [R( r,q,s) ?-;> R2( u,v,q,s) orR( u,q,s)}: S3'. Then.: Pl,Pll-[Q(r,s) <M> pJae or(tnle & Q2(u,v,s) & Q(u,6))]
  12. - ~ ~Yr~~ ~9?fli~.~.?JY~ A q' Jf51: 2 and S') Yq (R(u,q,s) ...:;>A{q,s)) ]I- I-[Q(r,s) <M> Yq (R2(u,v,q,s) or R(u,q,s) ...:;> Alq,s))]l- (byS3') 1-[Q(r,s) <-...:;> Yq (R(r,q,s) ...:;>AI.q,s))]: S. 4) From S and S4 easily follows that: [Q(r,s) <M>Yql Yq2 (Rl(r,ql,s) & R2(r,q2,s) ...:;> ...:;> A{(ql,q2),s))]l-l I-I[Q(r,s) <-...:;> Yql (Rl(r,ql,s) ...:;> ...:;> Yq2 (R2(r,lJ._2,s) ...:;> A{(ql,q2),s)))
  13. J from which AS follows (using ASl). Of course, this is not a (Hom clause) program, but it can be easily seen - Dayantls REFERENCES
  14. Bowen, K. Programming with full first-order logic. Machine Intelligence, VoLlO, pp.421-440, 1982.
  15. Burstall, R.M. & J. Darlington. A transformation system for developing recursive programs. JACM, Vo124, pp.44-67, 1977.
  16. Clark, K. Synthesis and verification of logic pro- ~ms. Research Report CCD, Imperial College, 1977.
  17. Clark, K. & S. SickeL Predicate logic:A calculus for deriving programs. In Proc. IJCAI-77, pp.419-420, 1977.
  18. Clark., K. & S. Tarnlund. A first order theory of data and programs. Information Processing (IFIP) '77, North-Holland, pp.939-944, 1977.
  19. Clocksin, W.F. & C.S. Mellish. Programming in Pro- tog. Springer-Verlag, 1981.
  20. 7J Darlington, J. An experimental program transforma- tion and synthesis system. Artificial Intelligence, Vo116, pp.l-46, 1981.
  21. Hannson, A. A formal development of programs. Ph.D. thesis, Dept. of Information Processing, Univ. of Stockholm, Sweden, 1980.
  22. Hogger, C.J. Program synthesis in predicate logic. In Proc. AISB Conf. on A.I., pp.138-146, Hamburg, 1978.
  23. Hogger, C.J. Derivation of Logic Programs. Ph.D thesis. University of London, Imperial College, 1978.
  24. Hogger, C.J. Derivation of Logic Programs. JACM, Vo128, No.2, pp.372-392, 1981. •
  25. Kowalski, R. Logic for problem so1vmg. North- Holland, 1979.
  26. Kowalski, R. The relation between logic program- ming and logic specification. In: (eds.)
  27. Hoare, C.A.R. & J.C. Sheperdson. Mathematical logic and programming languages. Prentice-Hall, 1985.
  28. 14J Murray, N. Completely non-clausal theorem prov- ing. Artificial Intelligence, Vo118, pp.67-87, 1982.
  29. Stickel, M. A Prolog Technology Theorem Prover. IEEE Symposium on Logic Programming, 1984.
  30. Vasey, P.E. First-Order Logic Applied to the Description and Derivation of Programs. Ph.D thesis, Imperial College, 1985.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards