Re: Is Prolog a good language for generating semi-random, constrained solutions?

Markus Triska <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
Hi all,

Jan Wielemaker <[email protected]> writes:

> My initial thought was to express the problem as a list of variables
> with (clp(fd)) constraints and perform random labelling. I think that is
> a bit too optimistic, mostly because it the translation from your rules
> to clp(fd) will be non-trivial. Still, it might make sense to keep that
> model in mind.

Consider especially the automaton/3 and automaton/8 constraints, which
allow you to describe a sequence via finite automata with counters:

   http://www.swi-prolog.org/pldoc/doc_for?object=automaton/8

You can of course post several such constraints for different criteria.

Such a formulation can also handle partially instantiated sequences.

You need to map your entities to integers when working with CLP(FD).

All the best,
Markus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.