Display program code

gamma_gen.pl : Gamma-to-CHR transformation
GAMMA is an acronym for General Abstract Model for Multiset Manipulation. It is a programming paradigm relying solely on multiset transformation. [For more please consider DETAILS in the comment.]
Note: Prolog shows some warnings about singleton variables because file was auto-generated.

How to use:
These four small programs can be used:
- gamma(prime, N): prime numbers
Returns all prime numbers Pi up to N by s(prime, Pi).
- gamma(fact, N): factorial
Returns the factorial N! by s(fact, N!).
- gamma(sp, (L1,L2)): partition into sets
Partitions the elements of L1 and L2 into sets S and T (with size(S)=size(L1)) so that all elements from S are smaller than those from T. E belongs to S is represented: s(sp, (E,inS)). E belongs to T is represented: s(sp, (E,inT)).
- gamma(sort, (L)): sort
List L (n elements) is sorted to [S1,S2,..Sn]: s(sort, (i-1,Si)).

See also:
File "Gamma_ref.pl" for more conservative and better readable versions. [1] JP Banatre, D Le Metayer. Programming by Multiset Transformation. Communications of the ACM, 1993.

Program: Change the code, then submit!

Console: Enter query or select example from below, then submit and wait for answer!

Select example query: 

WebCHR help - CHR Website - (c) Copyrights Martin Kaeser Uni Ulm 2007