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.
- 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 Scholar
- BARTUSCH. I~{ 1983. Optlmlerung yon Netzplaenen mit Anordnungsbeztehungen be~ Knappen Betriebsmittein. Ph.D thesis. Fakultaet fuer Mathematik und Informatik, Universitaet Passau, Germany.Google Scholar
- BERTHIER, F 1988. Using CHIP to support decision making In Acres du Se.mina~re Programmarzon en Logzque (Tregastel, France)Google Scholar
- 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 Scholar
- COLMERAUER, A 1990. An introduction t~o Protog III Commun. ACM 28, 4, 412-418~ Google Scholar
- COSTA, M. 1984 lJne etude pratique de d6coupes de panneaux de bois. RAIRO Recherche Operat~onne~le ~8, 3, IAug.), 21t-219Google Scholar
- DANTZIG, G. 1963 Linear Programrnzng and Extenswns. Princeton University Press, Princeton, N.5.Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- JAFFAR~ J. AND MAHER. M. 1994. Constraint }ogle orogramming: A survey. Y. Logzc Program. 19/20, 503-582.Google Scholar
- 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 Scholar
- 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 Scholar
- LASSEZ, C., MCALOON. K. AND YAP, R. 1987. Constrain~ logm programming and optmn tradrag. {EEE Expert 2. 3 (Fall). 42-50.Google Scholar
- 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 Scholar
- STUCKEY~ P. ~99t. Incremental linear constraint solving and detection of implicit equalities. ORSA J. Comput. & 269-274.Google Scholar
- WAN HENTENRYCK, P. 1989a A logic language for combinatorial ol~timization. Ann. Oper. Res~ 2t, 247-274. Google Scholar
- VAN HENTENRYCK. P. 1989b. Constraint Satlsfactwn ~n Loozc Programming. Logic Programmmg Ser~es, The MIT Press. Cambridge, Mass. Google Scholar
- 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 Scholar
- 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 Scholar
- WARREN, D. 1983. An abstract prolog instruction set. Tech. Rep. 309~ SRI, Menlo Park, Calif. Oct.Google Scholar
Index Terms
- Backtracking without trailing in CLP (ℜLin)
Recommendations
Backtracking without trailing in CLP (RLin)
Constraint logic programming (CLP) is a generalization of logic programming where unification is replaced by constraint solving as the basic operation of the language. The combination of constraint solving and nondeterminism (approximated by ...
Backtracking without trailing in CLP (RLin)
PLDI '94: Proceedings of the ACM SIGPLAN 1994 conference on Programming language design and implementationConstraint logic programming (CLP) is a generalization of logic programming where unification is replaced by constraint solving as the basic operation of the language. The combination of constraint solving and nondeterminism (approximated by ...
Comments