Re: difference lists ad CLP(FD) exercises
- From: Jan Wielemaker <jan@xxxxxxxxxxxxxxxxxxx>
- Date: 08 Dec 2006 08:20:34 GMT
On 2006-12-08, Richard Szopa <ryszard.szopa@xxxxxxxxx> wrote:
Hello,
I have been learning Prolog for a few months and I think I like it.
However, there's one thing I still find really difficult: difference
lists. I have read the appropriate chapters in Bratko and Art of
Prolog, so I quite understand the concept, and I am able to solve my
Prolog-class difference-lists homework. However, I do it with a lot of
trial-and-error, and I tend to be very surprised that my predicate
actually works -- I don't feel really comfortable using difference
lists and I rather avoid them in my own programs. I recognize this
isn't good and I'd like to change it.
Difference lists is always a bit nasty typing. They took me quite a
while before I could write them with little effort. If you need only one
though, consider using grammar rules. They effectively provide syntactic
sugar over a difference list. There is really no reason to limit the use
to parsing. They are great for `un-parsing' as well as for general list
processing involving one difference list.
Success --- Jan
I have a similar problem with CLP(FD)---I feel the lack of toy problems.
that would allow me to get used to the CLP way of thinking.
Could anybody recommend me some sort of exercise set concerning
difference lists and CLP(FD)? I've searched the web but I haven't found
anything really interesting.
Thanks in advance,
-- Richard
- References:
- difference lists ad CLP(FD) exercises
- From: Richard Szopa
- difference lists ad CLP(FD) exercises
- Prev by Date: difference lists ad CLP(FD) exercises
- Next by Date: Re: difference lists ad CLP(FD) exercises
- Previous by thread: difference lists ad CLP(FD) exercises
- Next by thread: Re: difference lists ad CLP(FD) exercises
- Index(es):
Relevant Pages
|
|