Display program code

gamma_ref.pl : Gamma-to-CHR examples references (hand-translated version)
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.]

How to use:
These four small programs can be used:
- prime(N): prime numbers
Returns all prime numbers Pi up to N by prime_M(Pi).
- fact(N): factorial
Returns the factorial N! by fact_M(N!).
- 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: sp_M((E,inS)). E belongs to T is represented: sp_M((E,inT)).
- so(L): sort
List L (n elements) is sorted to [S1,S2,..Sn]: so_M((i-1,Si)).

See also:
File "Gamma_gen.pl" for the directly translated 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: 

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