Chapter 4: Constraint Logic Programming

Constraint Logic Programming Given a particular domain, a constraint expresses a desired relationship among one or more of the objects. Chapter 4: Constraint Logic Programming Introduction; The constraint logic programming scheme; CLP languages and applications (CLP, CLP, B-Prolog); Conclusions. | Chapter 4 Constraint Logic Programming Outline Introduction The constraint logic programming scheme CLP languages and applications CLP(R) CHIP B-Prolog Conclusions Introduction Given a particular domain, a constraint expresses a desired relationship among one or more of the objects. Many practical problems can be regarded as constraint satisfaction problems (CSPs). Logic Programming (LP) languages such as Prolog, with their general purpose Horn clause represen-tation and single clear semantics, are very good at expressing constraints in a declarative fashion. However, Prolog’s unification mechanism is not sufficiently powerful to handle constraints properly. Unification is not good at processing constraints non-deterministically. Limitation of Prolog Example 1: plus(X,Y,Z) :- Z = X+Y. It is unable to deal satisfactorily with: ?- plus(X,Y,2). Example 2: fact(0,1). fact(N,F):- N>0, N1 is N -1, fact(N1,F1), F is N*F1. The query ?- fact(2,F). gives the answer F = 2, but . | Chapter 4 Constraint Logic Programming Outline Introduction The constraint logic programming scheme CLP languages and applications CLP(R) CHIP B-Prolog Conclusions Introduction Given a particular domain, a constraint expresses a desired relationship among one or more of the objects. Many practical problems can be regarded as constraint satisfaction problems (CSPs). Logic Programming (LP) languages such as Prolog, with their general purpose Horn clause represen-tation and single clear semantics, are very good at expressing constraints in a declarative fashion. However, Prolog’s unification mechanism is not sufficiently powerful to handle constraints properly. Unification is not good at processing constraints non-deterministically. Limitation of Prolog Example 1: plus(X,Y,Z) :- Z = X+Y. It is unable to deal satisfactorily with: ?- plus(X,Y,2). Example 2: fact(0,1). fact(N,F):- N>0, N1 is N -1, fact(N1,F1), F is N*F1. The query ?- fact(2,F). gives the answer F = 2, but Prolog fails with the query ?- fact(N,2). CLP = logic Programming + Constraint Programming There has been some effort within the Logic Programming community to extend Prolog to overcome these limitations with unification. However, despite these improvements, LP language still suffer from significant efficiency problems when dealing with constraint satisfaction. Their simple backtracking search method implies a generate-and-test procedure in which variable values are generated and the constraints are used passively to check the values. Recently, there has been a radical approach at extending the Logic Programming paradigm to produce Constraint Logic Programming (CLP) languages. CLP is a merger of two declarative paradigms: constraint programming and logic programming. Improvements of CLP Like Logic Programming, CLP uses the resolution principle. However, unification has been replaced by constraint solving over an application domain. CLP improves on Logic Programming when dealing .

Không thể tạo bản xem trước, hãy bấm tải xuống
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.