Re: Riddle Solver send+more=money



Torkel Franzen a écrit :
Djamé <djame@xxxxxxxxxxxxxxxxxxxx> writes:


Some times ago, I've found a very interesting page (I archived it obecause I'm fed up to loose all the cool pages every year) about the magic of DCG, you'll find some cool way to solve the SEND money problem..


Again, why go for the "cool way"? You can get a solution of this
problem in no time by using the SICStus constraint solver, for
example. But it seems to me utterly pointless to strive for elegance
in the solution of trivial problems. What is great about Prolog is
that you can quickly write a program that uses a mindless
generate-and-test algorithm to solve the problem. In other cases,
of course, you need a better algorithm for solving constraint
problems in reasonable time, and such algorithms are usually also
fairly easy to implement in Prolog.

I've not been enough precise, sorry... By cool I just meant to point the original poster to a way of doing that using dcg.
I was not making any judgement or so...



> But what's the point of finding > an elegant and efficient algorithm that solves a particular problem > if an idiot algorithm solves it in a few seconds anyway?

what's the point of oil painting when when camera exist ?

more seriously, I found this page interesting in the way it discribes the problem. That's all.





Cheers

Djamé
.



Relevant Pages

  • Re: Riddle Solver send+more=money
    ... But it seems to me utterly pointless to strive for elegance ... generate-and-test algorithm to solve the problem. ... fairly easy to implement in Prolog. ...
    (comp.lang.prolog)
  • Re: Balanced trees vs. B-trees
    ... > which is are more elegant than that of Red-Black trees. ... > This may be affected by the algorithm description that I have used: ... If you want to see the elegance of red-black trees, ... view them as an efficient implementation of 2-3-4 trees. ...
    (comp.programming)
  • Re: Prolog Execution Algorithm
    ... prolog uses to solve a query. ... algorithm, but I'm looking for a more elaborate version (with ... WAM), which descirbes efficient abstract machine that executes compiled ... the reverse direction. ...
    (comp.lang.prolog)
  • Re: Prolog Execution Algorithm
    ... > prolog uses to solve a query. ... > algorithm, but I'm looking for a more elaborate version (with ... Well, there are different approaches to implement prolog, wiht consequently ... But try to get a hold of WAM thesis (ort any text on ...
    (comp.lang.prolog)
  • Re: Thinking Recursion
    ... store it in parameters, rules, or others (by example, SWI has several very interesting methods) is only a subject of performance in execution/memory/... ... gave for the Dijkstra shortest path algorithm is a good example, ... found in Prolog, and the chances are the algorithm expressed in this ... way will look a lot clearer than the version which uses assert/retract. ...
    (comp.lang.prolog)