Re: CLP vs. plain old Prolog?




"Dr Andrew R. Verden" <andrew.verden@xxxxxxxxxxxxx> wrote in message
news:67ae2aa2.0504290451.49e1248d@xxxxxxxxxxxxxxxxxxxxx
> I think in general CLP is easier to engineer complex search problems
> than Prolog alone. You are working more with sets (domains) and
> constraints
> which range from expressions to more complex rules over more variables
> (global constraints, for example all_different([A,B,C]) ).
>
> In Prolog you are generally interested in searching and pruning
> solutions
> in the generate-test framework. This works fine until the generate or
> tests
> pieces of code become very complex or the order in which the
> generates/tests are applied affects the performance you require.
>
> In CLP the generate-test is replaced by:
>
> 1. setting variables and their domains
> 2. applying constraints
> 3. finding a solution (labelling)
>
> 1. is done similar to the generate part of generate-test
> 2. is new but the code looks pretty much identical to the test code
> you would otherwise write.
> 3. labelling is new, but for small problems you can simply pass all
> variables into label/1 and standard propagation will give a
> solution
> faster (two orders of magnitude) than Prologs naive search.
>
> For medium sized problems you can simply order the variables
> "intelligently"
>
> For large problems you might have to program some specific
> propagation code.
>
> Dont forget, with Prolog alone you have to rewrite the search or
> consider
> hacking parts of the code in C to get the same performance; all at
> the price
> of expressiveness and ultimately the maintainability of your code.
>
> The engineering advantage CLP offers over Prolog (in my opinion) is
> being able to add layers and layers of constraint code (point 2.) and
> test these pieces
> separately to know that your formulation of the problem and its
> sub-parts
> are correct.
>
> It is not important in which order the constraints are applied so
> there
> test-ordering problem is not encountered.
>
> In generate-test you often have the problem of knowing whether all
> generates
> are actually generated, in CLP this is from the domains of variables.
>
> The search performance problem is shifted into the labelling part - a
> separate
> module and one which can be developed last, when required.
>
> What is the disadvantage of CLP: That you have to model your value
> sets as integers but this can be handled by mapping code.
>
> I hope I have wetted your appetite for CLP.
>
> For a ISO standard Prolog that does support CLP, COM, Java, C/C++,
> Visual Studio... see www.ifcomputer.de !
>
> Andrew

Andrew,

It sounds like CLP is to constraint solving problems, as the optimizer in a
standard compiler is to writing code.

BTW, you have a typo on your web page:

http://www.ifcomputer.de/home_en.html

Under the "News" section:

"Shiftplan Manager V2.0 - [Four Letter Word] Manager Version V2.0 is now
released "

ShiftPlan is mispelled. Look closely at the real text I've substituted with
what's in the square brackets.

Thanks,

--
Robert Oschler
Forum Administrator
http://www.wordnetchat.com/phpBB2/
WordNet Chat - Developer's Forum


.



Relevant Pages

  • Re: CLP vs. plain old Prolog?
    ... I think in general CLP is easier to engineer complex search problems ... (global constraints, for example all_different() ... In Prolog you are generally interested in searching and pruning ... In CLP the generate-test is replaced by: ...
    (comp.lang.prolog)
  • Re: How long it takes to educate Prolog/CLP programmer?
    ... other language" is pretty shallow. ... Now some guys want to apply the same principle to Prolog. ... 20 K lines of Prolog (with CLP) and they want someone to "learn ... years of C++ or Java. ...
    (comp.lang.prolog)
  • CLP vs. plain old Prolog?
    ... Can someone point me to a "white paper" or summary that gives me the ... advantages of CLP over plain vanilla Prolog? ... what does CLP add to the party? ...
    (comp.lang.prolog)
  • Re: Solving quiz using Prolog
    ... CLP is a great extension to Logic Programming. ... never used it and thus I'm probably going for a plain Prolog solution. ... You seem quite fluent... ... > You can't instantiated X-es in the database like that. ...
    (comp.lang.prolog)
  • Re: swi-prolog or visual prolog or CLIPS
    ... As part of the MasterPiece software we solved a 2D packing problem with ... many complex alignment constraints using CLP implemented in IF/Prolog. ... I would not try to solve such a problem without CLP. ...
    (comp.lang.prolog)