My SICStus Prolog page
SICStus Prolog is a constraint programming system in Prolog.
More information about SICStus Prolog
Documentation
Feature Highlights
Community
My SICStus Prolog models
Here are some of my SICStus Prolog models. The models contains presentation of the problem, references, and links to comparison models in other constraint programming systems.
Note: Many of these models use the new and excellent feature of logical loops (do-loops) which was introduced in SICStus Prolog 4.1.
Also, many are translations (with some improvements) of my ECLiPSe models.
Some of these programs use hakank_utils.pl.
- 3_jugs.pl: 3 jugs problem (as a flow problem)
- a_round_of_golf.pl: A Round of Golf puzzle (Dell Logic Puzzles)
- abbots_puzzle.pl: Abbott's puzzle (Dudeney)
- added_corner.pl: Added corner puzzle
- alldifferent_except_0.pl: Decomposition of global constraint
alldifferent_except_0
- alldifferent_cst.pl: Decomposition of global constraint
alldifferent_cst
- alldifferent_modulo.pl: Decomposition of global constraint
alldifferent_modulo
- all_differ_from_at_least_k_pos.pl: Decomposition of global constraint
all_differ_from_at_least_k_pos
- all_equal.pl: Decomposition of global constraint
all_equal
- all_interval.pl: All interval problem (series), (CSPLib problem 7)
- all_min_dist.pl: Decomposition of global constraint
all_min_dist
- allpartitions.pl: All partitions
- alpha.pl: Standard alphametic problem (a.k.a crypto)
- among.pl: Decomposition of global constraint
among
- among_seq.pl: Decomposition of global constraint
among_seq
- arch_friends.pl: Arch friends (Dell Logic Puzzles)
- assignment.pl: Some assignment problems.
- averbach_1.2.pl: Example 1.2 in Averbach & Chein "Problem Solving Through Recreational Mathematics"
- averbach_1.3.pl: Example 1.3 in Averbach & Chein "Problem Solving Through Recreational Mathematics"
- averbach_1.4.pl: Example 1.4 in Averbach & Chein "Problem Solving Through Recreational Mathematics"
- babysitting.pl: Babysitting puzzle (Dell Logic Problem)
- bin_packing.pl: Bin packing problems
- bin_packing2.pl: (Decomposition of the) global
constraint bin_packing
(not exactly like the traditional bin packing))
- breaking_news.pl: Breaking news puzzle (Dell Logic Puzzles)
- build_a_house.pl: Build a house (simple scheduling)
- building_blocks.pl: Building blocks puzzle (for a more genral solution see labeled_dice.pl below)
- bus_schedule.pl: Simple bus scheduling (Taha)
- calculs_d_enfer.pl: Calculs d'enfer, an alphametic puzzle
- changes.pl: Coin changes
- circling_squares.pl: Circling squares (Dudeney)
- circuit.pl: Decomposition of global constraint
circuit
(SICStus has a built in circuit
)
- clique.pl: Decomposition of global constraint
clique
- clock_triplet.pl: Clock triplet (Dean Clark, via Martin Gardner)
- coins_grid.pl: Coins grid problem (Tony Hurlimann)
- coins3.pl: Minimum mumber of coins that allows one to pay exactly any amount smaller than one Euro (ECLiPSe)
- contracting_costs.pl: Contracting costs (Sam Loyd)
- covering_opl.pl: Set covering, selecting workers (from OPL example covering.mod)
- crew.pl: Crew Scheduling (via Gecode)
- crossword2.pl: Crossword solving (simple standard constraint programming example)
- crypta.pl: crypta, alphametic problem (standard Prolog/CLP benchmark)
- crypto.pl: crypto, alphametic problem (standard Prolog/CLP benchmark)
- cumulative_test.pl: Test of the built in
cumulative
constraint
- curious_set_of_integers.pl: Curious set of integers (Gardner)
- cur_num.pl: Curious number (Dudeney)
- debruijn.pl: de Bruijn sequences
- devils_word.pl: Devil's word (sum of ASCII character of a word)
- diet1.pl: Simple diet optimization problem
- dinner.pl: Dinner problem
- discrete_tomography.pl: Discrete tomography
- distribute.pl: Decomposition of global constraint
distribute
- donald_gerald.pl: DONALD + GERALD = ROBERT (alphametic problem)
- einav_puzzle.pl: Solving the A programming puzzle from Einav
- eq10.pl: Eq 10, standard benchmark problem
- eq20.pl: Eq 20, standard benchmark problem
- Project Euler problems:
Note: all these programs use hakank_utils.pl.
- exactly.pl: Decomposition of global constraint
exactly
- exodus.pl: Exodus puzzle (Dell Logic Puzzles)
- fancy.pl: Mr Greenguest puzzle (Fancy dress puzzle)
- fill_a_pix.pl: Fill-a-pix puzzle.
- five_brigands.pl: Five brigands problem (Dudeney)
- four_islands.pl: Four islands problem (Dell Logic Puzzles)
- fractions.pl: Fractions, alphametic problem (standard Prolog benchmark)
- furniture_moving.pl: Simple scheduling problem (using cumulative/2).
- futoshiki.pl: Futoshiki puzzle (yet another Japanese grid puzzle)
- general_store.pl: General store problem (Sam Loyd)
- global_contiguity.pl: Decomposition of global constraint
global contiguity
- hamming_distance.pl: Hamming distance
- heterosquare.pl: Heterosquare problem
- hidato.pl: Hidato puzzle
- huey_dewey_louie.pl: Huey, Dewey, Louie, logical problem from Marriott & Stuckey "Programming in Constraints"
- inverse.pl: Decomposition of global constraint
inverse
- isbn.pl: Some explorations in ISBN-13
- jobs_puzzle.pl: Jobs puzzle (a classic automated reasoning problem)
- just_forgotten.pl: Just forgotten puzzle (Enigma 1517)
- kakuro.pl: Kakuro grid puzzle
- K4P2GracefulGraph2.pl: K4P2 Graceful Graph
- kenken2.pl: Kenken grid puzzle
- killer_sudoku.pl: Killer Sudoku
- knapsack_investments.pl: Knapsack problem with investments (Lundgren, Rönnqvist, Värbrand: "Optimeringslära")
- knights_path.pl: Knights_path problem
- labeled_dice.pl: Labeled dice puzzle, more general approach (and contains the building_blocks.ecl as an instance). From Jim Orlin "Colored letters, labeled dice: a logic puzzle"
- langford.pl: Langford's number problem (CSP lib problem 24)
- latin_squares.pl: Latin squares
- least_diff.pl: Alphametic problem, smallest difference of two five digit numbers where are digits must be different.
- lecture_series.pl: Lecture seres (Dell Logic Puzzles)
- lectures.pl: Lectures, schedule problem from Biggs "Discrete Mathematics"
- lichtenstein_coloring.pl: Coloring problem: Lichtenstein's communes and exclaves
- magic_sequence.pl: Magic sequence (CSP lib problem)
- mamas_age.pl: Mama's age problem (Dudeney)
- mankell.pl: Generating all (mis) spelling of "Henrik Mankell" and "Kjellerstrand"
- map_coloring.pl: Simple map coloring example
- marathon2.pl: arathon Marathon puzzle (XPress example), CP model)
- minesweeper.pl: Minesweeper (with 14 problems, some from Gecode collections)
- miss_manners.pl: Miss Manners' seating problem (standard benchmark for rule engines). Includes problems of size 16, 64, and 128 guests.
- monks_and_doors.pl: Monks and doors
- mr_smith.pl: Mr Smith problem
- music_men.pl: Music men problem
- nadel.pl: B.A. Nadel's construction problem
- olympic.pl: Olympic puzzle (standard Prolog puzzle)
- pandigital_numbers.pl: Pandigital numbers
- pert.pl: Simple PERT problem (van Hentenryck)
- photo_problem.pl: Photo problem (Mozart/Oz)
- pigeon_hole.pl: Pigeon hole problem
- place_number_puzzle.pl: Place number puzzle
- post_office_problem2.pl: Post office problem (Winston)
- pythagoras.pl: Pythagoras number
- quasigroup_completion.pl: Quasigroup completion
- rabbits.pl: Rabbits problem (Van Hentenryck, OPL book)
- remainders.pl: Remainders problem (Kordemsky)
- remarkable_sequence.pl: Remarkable sequence (Coelho & Cotta "Prolog by Example" via Alma-0)
- safe_cracking.pl: Safe cracking (Mozart/Oz)
- send_more_money_any_base.pl: SEND+MORE=MONEY (in any base)
- scheduling_speakers.pl: Scheduling speakers (Rina Dechter)
- send_most_money.pl: Alphametic puzzle SEND + MOST = MONEY, where we maximize MONEY (and finds all solutions)
- sequence.pl: Decomposition of global constraint
sequence
- seseman.pl: Seseman convent puzzle
- set_covering.pl: Set covering (placing firestations, Winston)
- set_covering2.pl: Set covering (placing security telephones on a campus, Taha)
- set_covering3.pl: Set covering (selecting senators for a committee, Murty)
- set_covering4.pl: Set covering and set partition (Lundgren, Rönnqvist, Värbrand: "Optimeringslära")
- set_covering_deployment.pl: Set covering deployment problem (placing armies in the Roman Empire)
- set_covering_skiena.pl: Set covering (Skiena)
- set_partition.pl: Set partition problem
- ski_assignment.pl: Ski assignment problem
- sliding_sum.pl: Decomposition of global constraint
sliding sum
- smuggler_knapsack.pl: Smuggler's knapsack (Marriott & Stuckey)
- stable_marriage.pl: Stable marriage problem (examples from Van Hentenryck's OPL book, and MathWorld)
- steiner.pl: Steiner triplets (using boolean list as set representation)
- strimko2.pl: Strimko puzzle (Latin squares with "streams")
- stuckey_seesaw.pl: Seesaw problem (Marriott & Stuckey "Programming with Constraints")
- subset_sum.pl: Subset sum problem (Murty)
- sudoku.pl: Sudoku puzzle, an "all-loop" version (contains all 91 problems from Gecode's Sudoku problem set: 9x9, 16x16, and 25x25 problems)
- survo_puzzle.pl: Survo puzzle
- talisman_square.pl: Talisman square
- timpkin.pl: Mrs Timkin's Age (Dudeney)
- to_num.pl: Converts array <-> number
- torn_numbers.pl: Torn Numbers problem (Dudeney)
- tourist_site_competition.pl: Tourist site competition (P. Flener)
- traffic_lights.pl: Traffic lights problem (CSPLib problem 16)
- trains.pl: Trains problem (simple example of
table/2
from SWI Prolog manual)
- tsp.pl: Traveling salesperson problem, using loops and circuit (examples from Ulf Nilsson, SICStus' example tsp.pl, and the GLPK model tsp.mod)
- tunapalooza.pl: Tunalalooza puzzle (Dell Logic Puzzles)
- twin_letters.pl: Twin letters (Mozart/Oz)
- volsay1.pl: Volsay production problem (Van Hentenryck, The OPL Book)
- volsay2.pl: Volsay production problem (Van Hentenryck, The OPL Book), slightly different from volsay1.pl
- warehouse.pl: Warehouse location problem (OPL example)
- who_killed_agatha.pl: Who killed agatha? (a.k.a. The Dreadsbury Mansion Murder Mystery, an automated reasoning problem)
- xkcd.pl: Knapsack problem from xkcd
- young_tableaux.pl: Young tableaux and partitions
Also, see my other pages about constraint programming systems:
* My Constraint Programming Blog, especially the SICStus Prolog category
* Constraint Programming
* Common constraint programming problems
* My MiniZinc page
* My Zinc page
* My JaCoP page
* My JaCoP/Scala page
* My Choco page
* My Gecode/R page
* My Comet page
* My Gecode page
* My ECLiPSe page
* My Tailor/Essence' page
* My Google CP Solver page
* My OscaR page
* My JSR-331 page
* My Numberjack page
* My AIMMS+CP page
* My B-Prolog page
* My Choco3 page
* My Picat page
* My z3/python page
* My SWI-Prolog page
Back to my homepage
Created by Hakan Kjellerstrand hakank@gmail.com