Ninth annual ICFP Programming Contest


This page is about the ICFP Programming Contest of the year 2006,
lived and experienced by the team called
PLOP

About PLOP

The PLOP team is composed of four members :

We are students in computer science at Paris VI University in 4th and 5th years (Master degree).
It was our first participation to the ICFP contest and we managed to get 4738 points (6th position).

Our programming language of choice is Objective Caml.

intro

Our UM is written in about four hundred lines of the C programming language.
It is the main problem that caused our lack of time since we passed about eight hours to debug some weird programming errors...
It is not especially fast nor slow : 2 min 50 to run the sandmark benchmark on a Linux - AMD Athlon XP 3200+.
We wrote a second version (with no checks) which takes 1 min 30 on the same machine, however it has to run on a 32bit system. It is 80 lines long.

The other languages used were Objective Caml, Perl, and Bash.

circs

We resolved all the puzzles manually, the raytracer is the 2D version of our experiments in Caml, it doesn't work on some tests, but since the tests seem to be generated from the submitted program and the current version (version means the actual ascii art, not the program) passes them, it's ok :-p.
However, when a version failed on a test, the Caml program found the good result with the given data, so it seems to be just a transcription problem, and since there are only three colors, it seems that there's no real need for a search for the fixed point...


blnce

We wrote a little printer in Caml in order to have a more readable concrete syntax...
We didn't write any program to optimise the PHYSICS use, so they were all written by hand and some programs are far from perfection since we used repetitions of patterns found for some standard behaviours...
We didn't have enough time to complete this task, we didn't manage to program fillmem and multmem.

stop, stop1, stop127, stop128
(10/10, 10/10, 20/20, 15/15)
These were a good start to show how to stop a program. They were all solved with the first solution
7F00
swapmem
(36/40)
407F267F3300
swapreg
(50/50)
We found two solutions for this one
7F64716100
and then
7F617F00
swapreg2
(50/50)
7F61616200
addmem
(40/40)
627C2300
addmem2
(46/50)
627C237F615500
clearreg
(97/100)
7F7F247E7D7C7B6100
copyreg
(138/200)
Here we filled the spec with a funny solution: since the wanted output was to have the value somewhere in the memory, we filled the mem with values [|1;2;...;254;255;0|].
6162627C61617F7F61617F7F61612B03
01610161617F7F61617F7F6161616102
10017F7F61612B610461610001021201
61617F7D61617F7F61617F7F6111
copymem
(161/200)
617F7F6161686261012E61617F61617F
616161617F6112617F61617F61617F7F
7F7F7F7F7F116400


black

We solved the first puzzle on paper and the next, up to 300, manually with the help of an ever evolving perl script. The solutions becoming too long, we transformed the script to a solver. The algorithm it implements is the folowing:

  1. Sort
  2. Cut the list in blocks of three.
  3. If the last block contains less than three items, empty the items in it.
  4. Print the commands executed up to here.
  5. For every block, if the sum of the plinks remaining in it is odd, remove one plink from the last item of the block.
  6. For every block:
    1. If the first has more plinks than the second, equalize them by descending it twice and then getting it back to place, as many times as needed.
    2. If the second has more plinks than the first, equalize them by descending it once and then getting it back to place, as many times as needed.
    3. Empty the third by going twice up and twice down, as many times as needed.
    4. Empty the first two items.
  7. Print the rest of the commands, putting in parallel the commands of the different blocks.
The solver works great for the big puzzles (100-500) but not for most of the small ones.

basic

antwo

All the puzzles were solved by hand since they were not too hard after we defined the two main patterns which are: a group of two ants which walks at an average speed of 0.5x the speed of one ant, and another pattern which follows a diagonal.

advtr

We resolved all the puzzles manually, with the aid of vim to generate the commands easily. We didn't try writing a parser because we advanced fast enough and we hadn't discovered the "switch goggles" tip that would simplify the eventual parser.

In order to circumvent the censory engine we encoded the censored message in the condition of an item. Every character of the string is transformed to a kindlist of a length equal to the value of the character. The kindlists are chained in a condition encoding the string. A decoding function inverts the process and returns the original message which this is not censored.

Our solution is in two files, with the commands that we wrotte manually. The only interesting part is the modified robot mind source, also provided seperately.

advis

We implemented addition and multiplication according to the corresponding classic recursive primitive functions. To minimize the length of the code we factorized it using a specialized if-then-else construction inspired by that in Lambda-calculus.


concl

This first participation in an ICFP programming contest was a huge experience that we all enjoyed very much.
And for all the fun it gave us, we thank the team that organized all the amazing stuff for this contest.
Bravo.


 
The PLOP Team