Hakan Kjellerstrand · @hakan
47 followers · 38 posts · Server mastodon.sdf.org

v3.5#5 has been released
Download: picat-lang.org/download.html
Updates: picat-lang.org/updates.txt
* Fix in cumulative constraint
* Fix in SAT solver for mixed signed values in certain contexts.
* SAT solver: support for MaxSAT solver: new option "maxsat" (calls program named "maxsat")

#picat

Last updated 1 year ago

Hakan Kjellerstrand · @hakan
37 followers · 23 posts · Server mastodon.sdf.org

The "Nordic Network for researchers and practitioners of Constraint programming" () will be held June 8-9 in Odense, Denmark. Participation is free (registration is required).
See: event.sdu.dk/nordconsnet2023/c

For more on NordConsNet, see it.uu.se/research/NordConsNet

And - unrelated to these CP conferences - I'm now preparing a 1h30min talk "Constraint Programming - Solving Combinatorial puzzles when you are lazy" (in May 19). Mostly on Constraint Modeling using (and some ).

#nordconsnet #minizinc #picat

Last updated 2 years ago

R. Francis Smith · @rfrancis
93 followers · 447 posts · Server social.tchncs.de

@feoh @mdarweesh Legitimately one of the most surprisingly positive experiences I had in the past few years of proglang lasciviousness: picat-lang.org/

#picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
31 followers · 16 posts · Server mastodon.sdf.org

The DMC Community Challenge Jan-2023: dmcommunity.org/challenge-jan- is about maximizing the happiness for giving Christmas Gifts to some people within a given budget.

Here is my model this challenge: hakank.org/picat/christmas_mod

And the write up (PDF): hakank.org/picat/Christmas%20m

(As mentioned in the write up, it's a little more elaborate than necessary since I wanted to show all optimal solutions and test different budgets).

#picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
30 followers · 15 posts · Server mastodon.sdf.org

Advent of Code Day 25 (part 1) in : github.com/hakank/hakank/blob/

Using Constraint Programming for the harder part of this.

#picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
29 followers · 13 posts · Server mastodon.sdf.org

tutorial "NOPT042 Constraint Programming": github.com/jbulin-mff-uk/nopt0

The focus is on Constraint Modeling in Picat, and includes other things as well. Many fun models/exercises. It uses Marcio Minicz's great ipicat extension (pypi.org/project/ipicat/) for the Jupyter files.

#picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
27 followers · 11 posts · Server mastodon.sdf.org

Advent of Code 2022 - Day 21 in : github.com/hakank/hakank/blob/

Not very pretty, but it works...

#picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
25 followers · 9 posts · Server mastodon.sdf.org

Rotational words (a.k.a. rotagrams) in : hakank.org/picat/rotational_wo

For example:
* evil = vile
* evil = levi
* evocated = devocate
* evoker = revoke
* evolved = devolve
* evolver = revolve
* exploitations = sexploitation
* gunderson = undersong

Larger English list of rotational words: hakank.org/picat/rotational_wo

And Swedish words: hakank.org/picat/rotational_wo

Examples:
* abelsk = kabels
* abort = borta
* adlades = sadlade
* adresser = dressera
* alarm = larma
* alarm = malar

#picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
25 followers · 8 posts · Server mastodon.sdf.org

Advent of Code - Day 11: In : github.com/hakank/hakank/blob/

Quite imperative, but parsing the file was at least done with DCGs.

#picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
25 followers · 7 posts · Server mastodon.sdf.org

Advent of Code 2022 - Day 12 in : github.com/hakank/hakank/blob/

Using Picat's planner module.

(Part 1 should be correct, but see the comments for a tweak I had to do for Part 2.)

#picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
25 followers · 6 posts · Server mastodon.sdf.org

Solving the Kojun grid puzzle (janko.at/Raetsel/Kojun/index.h ) in : hakank.org/picat/kojun.pi

The hints grid has 54 unknowns. Using CP solver and all_distinct/1 then there's just 5 unknown values before solve/1. With all_different/1 then 15 values are unknown before solve/1.

#picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
25 followers · 5 posts · Server mastodon.sdf.org
Hakan Kjellerstrand · @hakan
25 followers · 4 posts · Server mastodon.sdf.org

Advent of Code 2022 - Day 8: In : github.com/hakank/hakank/blob/

(Fun variants of the Skyscraper problem: hakank.org/picat/skyscraper.pi )

#picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
42 followers · 34 posts · Server mastodon.sdf.org

Advent Of Code 2022 - Day 7: Another solution: github.com/hakank/hakank/blob/

Same idea, but moved the line checking to a separate predicate (check/3). (In part as a preparation for a possible SWI Prolog version.)

#picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
42 followers · 32 posts · Server mastodon.sdf.org

#picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
42 followers · 32 posts · Server mastodon.sdf.org

AoC 2022: Yesterday (Day 5) I skipped the solution, but here it is: github.com/hakank/hakank/blob/

It's not very pretty, to say the least. It uses the same general idea as my solution (github.com/hakank/hakank/blob/) which was probably not the best approach in Prolog for this problem...

#prolog #picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
42 followers · 29 posts · Server mastodon.sdf.org

Advent Of Code 2022 - Day 6: SWI solution: github.com/hakank/hakank/blob/

Port of my solution.

#prolog #picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
42 followers · 28 posts · Server mastodon.sdf.org

Advent Of Code 2022 - Day 6: solution: github.com/hakank/hakank/blob/

One variant using (mostly) logic programming, the other foreach loop.

#picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
42 followers · 26 posts · Server mastodon.sdf.org

AoC 22-5: Added a variant in using stack functions instead (pop_n/3 and a general push/2 that handles both single elements and lists): github.com/hakank/hakank/blob/

Shorter and IMHO neater.

#picat

Last updated 2 years ago

Hakan Kjellerstrand · @hakan
42 followers · 25 posts · Server mastodon.sdf.org

Advent Of Code 2022 - Day 5 in : github.com/hakank/hakank/blob/

Mostly imperative (for loop and reassignments), and a few logic programming thingies (append/3, select/3, and fail/0).

#picat

Last updated 2 years ago