Generator of sequence editions for sets of modules

Author(s): Isabel Garcia-Contreras.

This module generates sequences of states sets, i.e., having present their elements or not, (represented as lists).

To specify the configuration of the sets a list must be created of the form [NameSet1-NObjects1, NameSet2-NObjects2 ...]. Each step of the sequence is composed of an atom p(Name, List), with the List of length NObjects of the set.

Example

This is an example to create a sequence in which elements are added 1 by 1 until the sets have all their elements present. In this case we are using the number 1 to mark that an element is present:

?- gen_edit_sequence([m3-1, m2-1, m1-2], cfg(4, 4, 1, 1,0,4), gen_num_sequence, S).

S =[[p(m3,[1]),p(m2,[_]),p(m1,[_,_])],
    [p(m3,[1]),p(m2,[1]),p(m1,[_,_])],
    [p(m3,[1]),p(m2,[1]),p(m1,[1,_])],
    [p(m3,[1]),p(m2,[1]),p(m1,[1,1])]]
?

yes
?-
An example to get a sequence in which elements are added 2 by 2 and randomly:
?- gen_edit_sequence([set1-3, set2-1, set3-2], cfg(6, 3, 2, 1, 0, 3), gen_random_sorted_sequence, S).

S = [[p(set1,[_,_,_]),p(set2,[_]),p(set3,[_,_])],
     [p(set1,[_,1,_]),p(set2,[1]),p(set3,[_,_])],
     [p(set1,[_,1,_]),p(set2,[1]),p(set3,[1,1])],
     [p(set1,[1,1,1]),p(set2,[1]),p(set3,[1,1])]] ? 

yes
?- 

Usage and interface

Documentation on exports

Usage:gen_edit_sequence(Mods,SeqConfig,SeqGenerator,Seq)

  • The following properties should hold at call time:
    (nonvar/1)Mods is currently a term which is not a free variable.
    (nonvar/1)SeqConfig is currently a term which is not a free variable.
    (nonvar/1)SeqGenerator is currently a term which is not a free variable.
    (var/1)Seq is a free variable.
  • The following properties should hold globally:
    (not_fails/1)All the calls of the form gen_edit_sequence(Mods,SeqConfig,SeqGenerator,Seq) do not fail.
    (is_det/1)All calls of the form gen_edit_sequence(Mods,SeqConfig,SeqGenerator,Seq) are deterministic.
Meta-predicate with arguments: gen_edit_sequence(?,?,pred(4),?).

Usage:gen_random_sorted_sequence(NNumbers,Low,Up,Seq)

Generates a random sequence of different numbers with length NNumbers .

    No further documentation available for this predicate.

    No further documentation available for this predicate.