/*-------------------------------------------------------------------------
    program: permuting a multiset of items
    file:    perm1
    date:    December 97
    updated: Pablo Lopez (lopez@lcc.uma.es)
             Dept. of CS
             University of Malaga, SPAIN

    notes:   This code is a Forum version of a Lolli example originally
             proposed by Joshua S. Hodas and Dale Miller in
             "Logic Programming in a Fragment of Intuitionistic Linear Logic"
             Information and Computation, 110(2), pp. 327-365, 1994.

    sample goal:
         go(X).
-------------------------------------------------------------------------*/

module perm1.

item(X) # perm(Xs) *- perm([X|Xs]).

perm(X) # result(X).

go(X) *- item(a) # item(b) # item(c) # item(d) # item(e) # item(f) #
         item(g) # item(h) # item(i) # item(j) # item(k) # item(l) #
         perm([]) # result(X).

