Re: CLP vs. plain old Prolog?
- From: "Robert Oschler" <no-mail-please@xxxxxxxxxx>
- Date: Fri, 29 Apr 2005 10:10:02 -0400
"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
.
- References:
- CLP vs. plain old Prolog?
- From: Robert Oschler
- Re: CLP vs. plain old Prolog?
- From: Dr Andrew R. Verden
- CLP vs. plain old Prolog?
- Prev by Date: Re: Non dominating queens problem
- Next by Date: bad pi
- Previous by thread: Re: CLP vs. plain old Prolog?
- Next by thread: bad pi
- Index(es):
Relevant Pages
|
|