My B-Prolog page
This page is maintained by Hakan Kjellerstrand (hakank@gmail.com)
B-Prolog, is a Prolog based Constraint Logic Programming System. Compared to traditional Prolog systems, B-Prolog has some extensions which makes constraint modelling easier:
More info about B-Prolog
2013-03-10: Blogged about B-Prolog in A first look at B-Prolog.
My B-Prolog models
Here are some of my B-Prolog models. Each model contains more information and references about the problem. Note that not all of these are CLP models; some (e.g. the Euler problems) are just etydes in B-Prolog programming.
- 1d_rubiks_cube.pl: 1-D Rubik's Cube (not CLP)
- a_round_of_golf.pl: A round of golf (Dell Logic Puzzles)
- abbots_puzzle.pl: Abbot's puzzle (Dudeney)
- added_corner.pl: Added corner problem
- all_differ_from_at_least_k_pos.pl: Decomposition of the global constraint
all_differ_from_at_least_k_pos
- all_equal.pl: Decomposition of the global constraint
all_equal
- all_interval.pl: All interval problem (CSPLib problem #7)
- all_min_dist.pl: Decomposition of the global constraint
all_min_dist
- alldiff_test.pl: Test of alldifference
- alldifferent_cst.pl: Decomposition of the global constraint
alldifferent_cst
- alldifferent_except_0.pl: Decomposition of the global constraint
alldifferent_except_0
- alldifferent_modulo.pl: Decomposition of the global constraint
alldifferent_modulo
- alldifferent_on_intersection.pl: Decomposition of the global constraint
alldifferent_on_intersection
- allpartitions.pl: Generating all partitions
- alphametic.pl: Fairly generic alphametic (cryptarithmetic) solver
- among.pl: Decomposition of the global constraint
among
- among_seq.pl: Decomposition of the global constraint
among_seq
- arch_friends.pl: Arch friends puzzle (Dell Logic Puzzles)
- assignment.pl: Some assigmnents problems
- averbach_1.2..pl: Seating problem (Problem 1.2 from Averbach & Chein "Problem Solving Through Recreational Mathematics")
- averbach_1.3..pl: Problem 1.3 from Averbach & Chein "Problem Solving Through Recreational Mathematics")
- averbach_1.4..pl: Problem 1.4 from Averbach & Chein "Problem Solving Through Recreational Mathematics"
- bales_of_hay.pl: Bales of hay problem (from "Math Less Traveled" )
- babysitting.pl: Baby sitting puzzle (Dell Logic Puzzles)
- best_host.pl: Best host puzzle (PuzzlOR problem)
- bin_packing.pl: Some bin packing problems
- bin_packing2.pl: Decomposition of the global constraint
bin_packing
- breaking_news.pl: Breaking news puzzle (Dell Logic Puzzles)
- broken_weights.pl: Broken weights (weighing problem)
- build_a_house.pl: Simple scheduling problem
- bus_schedule.pl: Bus scheduling
- calculs_d_enfer.pl: Calculs d'Enfer
- car.pl: Car sequence problem
- changes.pl: Coin change
- circling_squares.pl: Circling the squares puzzle
- circuit.pl: Decomposition of the global constraint
circuit
- clique.pl: Decomposition of the global constraint
clique
- combinatorial_auction.pl: Combinatorial auction
- clock_triplet.pl: Clock triplet puzzle
- coins3.pl: Coins problem
- coins_grid.pl: Coins grid problem
- contracting_costs.pl: Contracting costs (Sam Loyd)
- costas_array.pl: Costas array
- covering_opl.pl: Set covering problem
- crew.pl: Crew scheduling
- crossfigure.pl: Crossfigure problem (CSPLib #21)
- crossword2.pl: Simple cross word problem
- crypta.pl: Crypta alphametic problem
- crypto.pl: Crypta alphametic problem
- cumulative_test.pl: Test of built-in constraint
cumulative
- cur_num.pl: Curious numbers (Dudeney)
- curious_set_of_integers.pl: Curious set of integers (Martin Gardner)
- debruijn.pl: de Bruijn sequences
- devils_word.pl: Devil's word (sum of ASCII character of a word)
- diet.pl: Diet problem
- dinner.pl: A dinner problem
- discrete_tomography.pl: Discrete Tomography
- distribute.pl: Decomposition of the global constraint
distribute
- donald_gerald.pl: Alphametic problem: DONALD + ROBERT = GERALD
- divisible_by_9_through_1.pl: Divisible by 9 through 1 (only works for base 2..8)
- dudeney_numbers.pl: Dudeney numbers
- einav_puzzle.pl: Solving A programming puzzle from Einav
- einstein_opl.pl: Einstein logic puzzle (variant of the Zebra problem)
- eq10.pl: 10 equations (standard benchmark problem)
- eq20.pl: 20 equations (standard benchmark problem)
- equation.pl: Solve the problem
11x11=4; 22x22=16; 33x33=?
(four interpretations)
- euler1.pl: Euler #1 (11 different approaches, just a few CLP)
- euler2.pl: Euler #2 (not CLP)
- euler3.pl: Euler #3 (not CLP)
- euler4.pl: Euler #4 (not CLP)
- euler5.pl: Euler #5 (not CLP)
- euler6.pl: Euler #6 (not CLP)
- euler7.pl: Euler #7 (not CLP)
- euler8.pl: Euler #8 (not CLP)
- euler9.pl: Euler #9 (CLP)
- euler10.pl: Euler #10 (not CLP)
- euler11.pl: Euler #11 (not CLP)
- euler14.pl: Euler #14 (mode directed tabling)
- euler18.pl: Euler #18 (mode directed tabling)
- exodus.pl: Exodus puzzle (Dell Logic Puzzles)
- fancy.pl: Mr Greenguest puzzle (Fancy dress problem)
- fib.pl: Fibonacci (not CLP)
- fill_a_pix.pl: Fill a pix
- fill_in_the_squares.pl: Fill in the squares problem (Brainjammer)
- finding_celebrities2.pl: Finding celebrities at a party
- five_brigands.pl: Five bridands problem (Dudeney)
- five_elements.pl: Five elements problem (Charles W. Trigg)
- four_islands.pl: Four islands (Dell Logic Puzzles)
- fractions.pl: Fractions (arithmentic puzzle)
- furniture_moving.pl: Furniture moving scheduling (using
cumulative
)
- futoshiki.pl: Futoshiki grid puzzle
- game_theory_taha.pl: Game theory (simple zero-sum problem from Taha's "OR" book)
- general_store.pl: General store alphametic problem
- global_contiguity.pl: Decomposition of the global constraint
global_contiguity
- global_cardinality.pl: Simple (and limited) decomposition of the global constraint
global_cardinality
- golomb_ruler.pl: Golomb ruler
- hamming_distance.pl: Hamming distance
- handshaking.pl: Halmos' handshake problem
- hanging_weights.pl: Hanging weights problem
- heterosquare.pl: Heterosquare grid problem
- hidato.pl: Hidato puzzle
- hidato_table.pl: Hidato puzzle, using table constraint
- huey_dewey_louie.pl: Huey Dewey Louie problem (Marriott and Stuckey)
- isbn.pl: Some explorations of ISBN 13
- jobs_puzzle.pl: Jobs puzzle
- just_forgotten.pl: Just forgotten puzzle (Enigma 1517)
- K4P2GracefulGraph2.pl: K4P2 Graceful Graph
- kakuro.pl: Kakuro puzzle
- kenken2.pl: KenKen puzzle
- killer_sudoku.pl: Killer Sudoku puzzle
- knapsack_investments.pl: Knapsack problem with investments (from Lundgren, Rönnqvist, Värbrand: "Optimeringslära")
- labeled_dice.pl: Two word problem: Labeled dice and Building blocks
- langford.pl: Langford number problem
- latin_squares.pl: Latin squares
- lecture_series.pl: Lecture series puzzle (Dell Logic Puzzles)
- lectures.pl: Lectures problem (Biggs: Discrete Mathematics)
- least_diff.pl: Least Diff problem
- lichtenstein_coloring.pl: Lichtenstein Coloring problem
- magic_hexagon.pl: Magic hexagon
- magic_sequence.pl: Magic sequence (CSPLib problem #19)
- magic_square.pl: Magic squares
- magic_square_and_cards.pl: Magic square and cards (Martin Gardner)
- mankell.pl: "All" misspellings of "Mankell" and "Kjellerstrand" using DCG (not CLP)
- map.pl: Simple coloring problem
- marathon2.pl: Marathon puzzle
- max_flow_taha.pl: Maximum flow problem (from Taha: "Operations Research")
- max_flow_winston1.pl: Maximum flow problem (from Winston: "Operations Research")
- minesweeper.pl: Minesweeper solver
- money_change.pl: Money change problem
- monks_and_doors.pl: Monks and doors problem
- mr_smith.pl: Mr Smith logical problem
- music_men.pl: Music men logical problem
- nadel.pl: B.A. Nadel's construction problem (Rina Dichter)
- number_of_days.pl: Number of days knapsack problem (Nathan Brixius)
- nvalue.pl: Decomposition of the global constraint
nvalue
- nvalues.pl: Decomposition of the global constraint
nvalues
- olympic.pl: Olympic arithmetic puzzle
- organize_day.pl: Organizing a day, simple scheduling problem
- ormat_game.pl: Ormat game (from bit-player: The ormat game)
- p_median.pl: P median problem (OPL)
- pair_divides_the_sum.pl: Pair divides the sum puzzle
- pandigital_numbers.pl: Pandigital number problem
- partition_into_subset_of_equal_values.pl: Partition into subset of equal sums (Stack Exchange)
- pert.pl: Simple PERT model (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
- pythagoras.pl: Pythagora's problem
- quasigroup_completion.pl: Quasigroup completion
- queens.pl: N-Queens problem
- rabbits.pl: Rabbits problem (Van Hentenryck)
- remainders.pl: Remainders problem (Kordemsky)
- remarkable_sequence.pl: A Remarkable Sequence (Alma-0)
- safe_cracking.pl: Safe cracking (Mozart/Oz)
- schedule1.pl: Scheduling problem (from SICStus Prolog)
- scheduling_speakers.pl: Scheduling speakers (Rina Dechter)
- secret_santa.pl: Secret Santa problem
- send_more_money.pl: SEND+MORE=MONEY
- send_most_money.pl: SEND+MOST=MONEY (and maximize MONEY)
- sequence.pl: Decomposition of the global constraint
sequence
- seseman.pl: Seseman Convent problem
- set_covering.pl: Set covering: placing of firestations (Winston "Operations Research")
- set_covering2.pl: Set covering: security telephone on campus (Taha "Operations Research", example 9.1-2)
- set_covering3.pl: Set covering: assigning senators to committees (Murty "Optimization Models for Decision Making")
- set_covering4.pl: Set covering/partition problem (Lundgren, Rönnqvist, Värbrand "Optimeringslära", page 408)
- set_covering5.pl: Set covering, work scheduling (Lundgren, Rönnqvist, Värbrand "Optimeringslära", page 410)
- set_covering_deployment.pl: Set covering deployment
- set_covering_skiena.pl: Set covering (Skiena)
- set_partition.pl: Set partition problem
- sicherman_dice.pl: Sicherman Dice
- ski_assignment.pl: Ski assignment
- sliding_sum.pl: Decomposition of the global constraint
sliding_sum
- smugglers_knapsack.pl: Smuggler's knapsack (Marriott and Stuckey)
- social_gofters1.pl: Social golfer problem (CSPLib # 10)
- social_gofters2.pl: Social golfer problem (CSPLib # 10)
- sonet.pl: SONET problem
- spreadsheet.pl: Simple spreadsheet (using
lp_solve
)
- stable_marriage.pl: Stable marriage problem
- steiner.pl: Steiner triplets (emulating sets)
- strimko2.pl: Strimko grid puzzle
- stuckey_seesaw.pl: Seesaw problem (Marriott and Stuckey)
- subset_sum.pl: Subset sum
- sudoku.pl: Sudoku
- survo_puzzle.pl: Survo puzzle
- table.pl: (Simple) decomposition of the global constraint
table
- talisman_square.pl: Talisman square
- the_family_puzzle.pl: The family puzzle
- timpkin.pl: Mrs Timpkin's Age (Dudeney)
- to_num.pl: converts a number to a digit list (and vice versa)
- torn_numbers.pl: Torn numbers (Dudeney)
- tourist_site_competition.pl: Tourist Site Competition
- traffic_lights.pl: Traffic lights (CSPLib problem #16)
- trains.pl: Trains (example from SWI-Prolog of using table constraint)
- tunapalooza.pl: Tunapalooza puzzle (Dell Logic Puzzles)
- twin_letters.pl: Twin letters (Mozart/Oz)
- volsay1.pl: Volsay problem (OPL)
- volsay2.pl: Volsay problem (OPL), slightly different from volsay1.pl
- warehouse.pl: Warehouse location (OPL)
- who_killed_agatha.pl: Who killed Agatha (logical puzzle)
- xkcd.pl: Xkcd knapsack problem
- young_tableaux.pl: Young tableaux and partition
- zebra.pl: Zebra problem (Lewis Carroll)
Also, see information about other constraint programming systems:
* My Constraint Programming Blog, especially the B-Prolog category
* Constraint Programming
* My MiniZinc page
* My Zinc page
* My JaCoP page
* My JaCoP page
* My Choco page
* My Gecode/R page
* My Comet page
* My Gecode page
* My Tailor/Essence' page
* My SICStus Prolog page
* My Google or-tools page
* My OscaR page
* My JSR-331 page
* My Numberjack page
* My AIMMS+CP 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