skip to main content
article
Open Access

Backtracking without trailing in CLP (ℜLin)

Authors Info & Claims
Published:01 July 1995Publication History
Skip Abstract Section

Abstract

Existing CLP languages support backtracking by generalizing traditional Prolog implementations: modifications to the constraint system are trailed and restored on backtracking. Although simple and efficient, trailing may be very demanding in memory space, since the constraint system may potentially be saved at each choice point.

This article proposes a new implementation scheme for backtracking in CLP languages over linear (rational or real) arithmetic. The new scheme, called semantic backtracking, does not use trailing but rather exploits the semantics of the constraints to undo the effect of newly added constraints. Semantic backtracking reduces the space complexity compared to implementations based on trailing by making it essentially independent of the number of choice points. In addition, semantic backtracking introduces negligible space and time overhead on deterministic programs. The price for this improvement is an increase in backtracking time, although constraint-solving time may actually decrease. The scheme has been implemented as part of a complete CLP system CLP (ℜLin) and compared analytically and experimentally with optimized trailing implementations. Experimental results on small and real-life problems indicate that semantic backtracking produces significant reduction in memory space, while keeping the time overhead reasonably small.

References

  1. AGGOI;N, A AND BELDICEANU, N. 1991 An Overview of the CHIP compiler In the 8th International Conference on Logzc Programming (ICLP-91) (Parts, France} The MIT Press, Cambridge, MassGoogle ScholarGoogle Scholar
  2. BARTUSCH. I~{ 1983. Optlmlerung yon Netzplaenen mit Anordnungsbeztehungen be~ Knappen Betriebsmittein. Ph.D thesis. Fakultaet fuer Mathematik und Informatik, Universitaet Passau, Germany.Google ScholarGoogle Scholar
  3. BERTHIER, F 1988. Using CHIP to support decision making In Acres du Se.mina~re Programmarzon en Logzque (Tregastel, France)Google ScholarGoogle Scholar
  4. BURG, J., LANG, S, AND HUGHES, C. 1994 Finding conflmt sets and backtrack points m CLP(R) In the llth {nternatzon, al Conference on Lo.qzc Programmzng (ICLP-94) (Santa Marguerita Ligure, Ira|v) The MtT Press, Cambridge, Mass Google ScholarGoogle Scholar
  5. COLMERAUER, A 1990. An introduction t~o Protog III Commun. ACM 28, 4, 412-418~ Google ScholarGoogle Scholar
  6. COSTA, M. 1984 lJne etude pratique de d6coupes de panneaux de bois. RAIRO Recherche Operat~onne~le ~8, 3, IAug.), 21t-219Google ScholarGoogle Scholar
  7. DANTZIG, G. 1963 Linear Programrnzng and Extenswns. Princeton University Press, Princeton, N.5.Google ScholarGoogle Scholar
  8. DINCBAS, ~({., VAN HENTENRYCK, P., SIMONIS, H., AGGOUN, A., GRAF, T., AND BERTHIER, F 1988. The constraint }ogre programming language CHIP. in Proceedings of the Internatwnat Conference on Fifth Generation Computer Systems~ ICOT. Tokyo. Japan.Google ScholarGoogle Scholar
  9. GRAF, T., VAN HENTENRYCK. P., PRADELLES., C., AND ZIMIvIER, L. 1990. Simulation of hybrid circuits in constraint, logic programming. Comput. Math. AppL 20, 9-10, 45-56Google ScholarGoogle Scholar
  10. HEINTZE, N., MICHAYLOV, S.~ AND STUCKEY, P i987. CLP(~) and some electrical engineering problems. In the 4th {nternat~ona~ Confe~nce on Logic Programming (Melbourne, Austraha~. The MIT Press, Cambridge, Mass.Google ScholarGoogle Scholar
  11. HELM, R., HUYNH, T~ MARRIOTT, K. AND VLISSlDES, J. 1992 An architecture for objectormn~ed constraint-based graphics editors. In Proceedings of EUROGRAPHfCS'92~ W. Hansmann~ F R.A. Hopgood, and W. Strasser, Ecls. North-Holland, Amsterdam.Google ScholarGoogle Scholar
  12. HUYNH, T. AND LASSEZ. C 1988 A CLPINt optmn ~rading analysis system. In the 5th Internatwnal Con}erence on Loq~c Proqramrn~ng ~Seattte, Wash.). The MIT Press, Cambridge,Google ScholarGoogle Scholar
  13. MBERT, J -L., COHEN, J., AND WEEGER, M.-D. 1993. An algorithm for linear constraint solving: tts incorporagion m a proiog meta-mterpreter for cip. J. Loq~c Program. 16, 3/4 IJuty}, 235- 254.Google ScholarGoogle Scholar
  14. JAFFAR, J. AND LASSEZ, J.-L. 1987. Constraint logic programming. In Proceedings of the ACM Symposium on PmncwZes of Programming Languages (POPL-8~ (Mumeh. Germany l. ACM Press, New- York. Google ScholarGoogle Scholar
  15. JAFFAR~ J. AND MAHER. M. 1994. Constraint }ogle orogramming: A survey. Y. Logzc Program. 19/20, 503-582.Google ScholarGoogle Scholar
  16. JAFFAR, J., MICHAYLOV, S., STUCKEY, P., AND YAP, R. 1992a. The CLP(N) language and system. ACM Trans. Program. Lang. Syst. 1~, 3, 339-395. Google ScholarGoogle Scholar
  17. JAFFAR, J., MICHAYLOV, S., STUCKEY, P., AND YAP, R. 1992b. An abstract machine for CLP(N). in Proceedznqs of the A CM Conference on Proqrammmg Language Design and ImpIementatwn (PLDI'92) (San Francisco, Calif.). ACM, New York. Google ScholarGoogle Scholar
  18. LASSEZ, C., MCALOON. K. AND YAP, R. 1987. Constrain~ logm programming and optmn tradrag. {EEE Expert 2. 3 (Fall). 42-50.Google ScholarGoogle Scholar
  19. SIMONIS, H. AND DINCBAS, M. 1987. Using an extended prolog for digital circuit design In IEEE International Workshop on AI Apphcatzons to CAD Systems for Electronzcs I Munich, Germany). IEEE0 New York, 165-:t8~.Google ScholarGoogle Scholar
  20. STUCKEY~ P. ~99t. Incremental linear constraint solving and detection of implicit equalities. ORSA J. Comput. & 269-274.Google ScholarGoogle Scholar
  21. WAN HENTENRYCK, P. 1989a A logic language for combinatorial ol~timization. Ann. Oper. Res~ 2t, 247-274. Google ScholarGoogle Scholar
  22. VAN HENTENRYCK. P. 1989b. Constraint Satlsfactwn ~n Loozc Programming. Logic Programmmg Ser~es, The MIT Press. Cambridge, Mass. Google ScholarGoogle Scholar
  23. VAN HENTENRYCK, P. AND CARILLON, J.-P. 1988. Generality versus specificity" An experience with AI and OR techniques. In Proceedings of the American Assoczatzon for Artzficzal InteIhgence (AAAI-88) (St. Paul, Minn.). AAAI, Menlo Park. Calif.Google ScholarGoogle Scholar
  24. VAN HENTENRYCK, P. AND (}RAF, T. 1992. Standard forms for ratmnal linear amthmetlcs m constraint logm programming. Ann. Math. Artif. Intell. ~, 2-4, 303-320.Google ScholarGoogle Scholar
  25. WARREN, D. 1983. An abstract prolog instruction set. Tech. Rep. 309~ SRI, Menlo Park, Calif. Oct.Google ScholarGoogle Scholar

Index Terms

  1. Backtracking without trailing in CLP (ℜLin)

          Recommendations

          Reviews

          Jeffrey B. Putnam

          Constraint logic programming (CLP) is a powerful mechanism for solving combinatorial search problems, combining ease of use with powerful problem-solving techniques. CLP, as usually implemented, operates in the same way as Prolog, using backtracking to explore the search space, and saving states as they are encountered in order to enable backtracking (“trailing backtracking”). This paper offers a different method for backtracking, called “semantic backtracking,<__?__Pub Caret>” in CLP R Lin (a version of CLP that operates over the real numbers with constraints in the form of linear equations, inequalities, and disequations). This backtracking method uses the semantics of the operations applied at choice points, and effectively computes the inverse operator for the decisions made. The paper gives the algorithms in excellent detail as well as in overview. The authors provide information on time and space usage that shows just how the semantic backtracking compares to the usual backtracking methods. It uses less space, at the expense of time. The space requirements in the semantic scheme range from slightly over half the space requirements in the usual scheme to about one tenth, with the time requirements ranging from slightly faster, in one or two cases, to about 1.6 times the original time. This seems (especially with the numbers presented) to be a favorable exchange, since machines seem to be speeding up faster than memory is growing. The tables confused me for a moment, because they show the cost for semantic divided by the cost for trailing in the space section and the cost for trailing divided by the cost for semantic in the time section. I was left with one question. The backtracking techniques presented both depend on the actual operations performed, with backtracking just reversing the order of those operations. Is it possible (rather in the spirit of a truth maintenance system) to run them backwards in a different order__?__

          Access critical reviews of Computing literature here

          Become a reviewer for Computing Reviews.

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in

          Full Access

          • Published in

            cover image ACM Transactions on Programming Languages and Systems
            ACM Transactions on Programming Languages and Systems  Volume 17, Issue 4
            July 1995
            129 pages
            ISSN:0164-0925
            EISSN:1558-4593
            DOI:10.1145/210184
            Issue’s Table of Contents

            Copyright © 1995 ACM

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 1 July 1995
            Published in toplas Volume 17, Issue 4

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • article

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader