CHR examples
Minimal
gcd.pl
:
Greatest Common Divisor
markup_examples.pl
:
Markup commands
minimal.pl
:
Minimal CHR program
CHR Working Week
colors.pl
:
Color mixing in CHR (tutorial example)
knapsack.pl
:
Solves the knapsack problem
lazyCHR.pl
:
Some examples of lazy evaluation using CHR
rsa.pl
:
This Program implements the RSA Encryption Algorithm.
strips.pl
:
a STRIP-like planning language
DB
db_family.pl
:
Family relations (deductive database)
db_parts.pl
:
Computer components (deductive database)
family.pl
:
Inferring family relationships
Functions
fib_bottomup.pl
:
Fibonnaci numbers (bottom-up)
fib_topdown.pl
:
Fibonnaci numbers (top-down)
fib_topdown_tab.pl
:
Fibonnaci numbers (tabling)
gcd.pl
:
Greatest Common Divisor
hamming.pl
:
Solves Hamming Problem
minset.pl
:
Minimum of set of numbers
primes1.pl
:
Prime numbers
primes2.pl
:
Prime numbers (faster variant)
primes3.pl
:
Prime numbers (from "The Art of Prolog")
successor_add.pl
:
Add numbers in successor notation
tak.pl
:
Takeuchi function
Auto-generated
autogen_boolean.pl
:
Auto-generated boolean handler
autogen_fulladder.pl
:
Auto-generated full-adder handler
gamma_gen.pl
:
Gamma-to-CHR transformation
gamma_ref.pl
:
Gamma-to-CHR examples references (hand-translated version)
Graph
dfsearch.pl
:
Depth first search in tree
dijkstra.pl
:
Dijkstra's single-source shortest path algorithm
fib_heap.pl
:
Fibonacci heap priority queue
shortest_paths.pl
:
All-pairs shortest paths of a graph
transitive_closure_1.pl
:
Transitive Closure
transitive_closure_2.pl
:
Transitive Closure w/candidates
Miscellaneous
lexicographic.pl
:
Lexicographic order
ram_simulator.pl
:
Simulates a Random Access Machine
var_order.pl
:
Stable variable order
Puzzles
nqueens1.pl
:
Solves n-queens problem
nqueens2.pl
:
Solves n-queens problem
sudoku.pl
:
Sudoku solver
sudoku_simple.pl
:
Simple Sudoku Solver
zebra.pl
:
Based on the classic zebra puzzle
Constraint solvers
boolean.pl
:
Boolean handler with labeling
equations_gauss.pl
:
Solves linear polynomial equations
interval.pl
:
Interval domains over integer and real
leq.pl
:
Less-equal handler
minmax.pl
:
Inequalities, min & max (ground terms)
rationaltree.pl
:
Rational (finite and infinite) tree handler
rationaltree_exist.pl
:
Rational tree with exist. quantifiers
time_point.pl
:
Time point constraints
Sorting
mergesort.pl
:
Mergesort
ordered_merge.pl
:
Merge and sort chains
sorting.pl
:
Numbers to sorted chain
Union-find
unionfind.pl
:
Union find
unionfind_opt.pl
:
Union find (optimised)