#Picat v3.5#5 has been released
Download: http://picat-lang.org/download.html
Updates: http://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")
The "Nordic Network for researchers and practitioners of Constraint programming" (#NordConsNet) will be held June 8-9 in Odense, Denmark. Participation is free (registration is required).
See: https://event.sdu.dk/nordconsnet2023/conference
For more on NordConsNet, see http://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 #MiniZinc (and some #Picat).
@feoh @mdarweesh Legitimately one of the most surprisingly positive experiences I had in the past few years of proglang lasciviousness: #Picat http://www.picat-lang.org/
The DMC Community Challenge Jan-2023: https://dmcommunity.org/challenge-jan-2023/ is about maximizing the happiness for giving Christmas Gifts to some people within a given budget.
Here is my #Picat model this challenge: http://hakank.org/picat/christmas_model.pi
And the write up (PDF): http://hakank.org/picat/Christmas%20model%20in%20Picat.pdf
(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).
Advent of Code Day 25 (part 1) in #Picat: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/25.pi
Using Constraint Programming for the harder part of this.
#Picat tutorial "NOPT042 Constraint Programming": https://github.com/jbulin-mff-uk/nopt042
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 (https://pypi.org/project/ipicat/) for the Jupyter files.
Advent of Code 2022 - Day 21 in #Picat: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/21.pi
Not very pretty, but it works...
Rotational words (a.k.a. rotagrams) in #Picat: http://hakank.org/picat/rotational_words.pi
For example:
* evil = vile
* evil = levi
* evocated = devocate
* evoker = revoke
* evolved = devolve
* evolver = revolve
* exploitations = sexploitation
* gunderson = undersong
Larger English list of rotational words: http://hakank.org/picat/rotational_words_eng.txt
And Swedish words: http://hakank.org/picat/rotational_words_swe.txt
Examples:
* abelsk = kabels
* abort = borta
* adlades = sadlade
* adresser = dressera
* alarm = larma
* alarm = malar
Advent of Code - Day 11: In #Picat: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/11.pi
Quite imperative, but parsing the file was at least done with DCGs.
Advent of Code 2022 - Day 12 in #Picat: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/12.pi
Using Picat's planner module.
(Part 1 should be correct, but see the comments for a tweak I had to do for Part 2.)
Solving the Kojun grid puzzle (https://www.janko.at/Raetsel/Kojun/index.htm ) in #Picat: http://www.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.
I've now added some #Picat programs for AoC 2022 (Days 1,2,4,5,7) that use DCG instead of regex, etc for parsing the input files:
* Day 1: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/1_dcg.pi
* Day 2: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/2_dcg.pi
* Day 4: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/4_dcg.pi
* Day 5: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/5_dcg.pi
* Day 7: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/7_dcg.pi
* Day 7 (calculations also in the DCG using heap map): https://github.com/hakank/hakank/blob/master/advent-of-code-2022/7_dcg2.pi
GitHub Commit: https://github.com/hakank/hakank/commit/c1c53ea9d7513628a181a3867071cd6d46cb779c
Advent of Code 2022 - Day 8: In #Picat: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/8.pi
(Fun variants of the Skyscraper problem: http://hakank.org/picat/skyscraper.pi )
Advent Of Code 2022 - Day 7: Another #Picat solution: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/7b.pi
Same idea, but moved the line checking to a separate predicate (check/3). (In part as a preparation for a possible SWI Prolog version.)
Advent Of Code 2022 - Day 7: Solution in #Picat: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/7.pi
AoC 2022: Yesterday (Day 5) I skipped the #Prolog solution, but here it is: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/5_swi.pl
It's not very pretty, to say the least. It uses the same general idea as my #Picat solution (https://github.com/hakank/hakank/blob/master/advent-of-code-2022/5b.pl) which was probably not the best approach in Prolog for this problem...
Advent Of Code 2022 - Day 6: SWI #Prolog solution: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/6_swi.pl
Port of my #Picat solution.
Advent Of Code 2022 - Day 6: #Picat solution: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/6.pi
One variant using (mostly) logic programming, the other foreach loop.
AoC 22-5: Added a variant in #Picat using stack functions instead (pop_n/3 and a general push/2 that handles both single elements and lists): https://github.com/hakank/hakank/blob/master/advent-of-code-2022/5b.pi
Shorter and IMHO neater.
Advent Of Code 2022 - Day 5 in #Picat: https://github.com/hakank/hakank/blob/master/advent-of-code-2022/5.pi
Mostly imperative (for loop and reassignments), and a few logic programming thingies (append/3, select/3, and fail/0).