<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Andreas Höhmann&#039;s Weblog &#187; ICFP</title>
	<atom:link href="http://ahoehma.wordpress.com/category/icfp/feed/" rel="self" type="application/rss+xml" />
	<link>http://ahoehma.wordpress.com</link>
	<description></description>
	<lastBuildDate>Thu, 26 Nov 2009 15:53:12 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='ahoehma.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/6b74f500a29ea048aa3d7a14adc1a24f?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Andreas Höhmann&#039;s Weblog &#187; ICFP</title>
		<link>http://ahoehma.wordpress.com</link>
	</image>
			<item>
		<title>Das war der 12. ICFP</title>
		<link>http://ahoehma.wordpress.com/2009/06/30/das-war-der-12-icfp/</link>
		<comments>http://ahoehma.wordpress.com/2009/06/30/das-war-der-12-icfp/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 22:55:46 +0000</pubDate>
		<dc:creator>Andreas Höhmann</dc:creator>
				<category><![CDATA[ICFP]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://ahoehma.wordpress.com/?p=207</guid>
		<description><![CDATA[Der ICFP ist ein jährlich stattfindender Programmierwettbewerb im Rahmen der International Conference on Functional Programming. Dieses Jahr hatten wir uns entschlossen am ICFP teilzunehmen. Die Aufgaben der letzten Jahre waren immer recht anspruchsvoll, wir waren sehr gespannt wie es dieses Jahr sein würde. Gerüchten zufolge sollte die etwas krumme Startzeit mit der Aufgabe zu tun [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=207&subd=ahoehma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Der <a href="http://icfpcontest.org/index.php" target="_blank">ICFP</a> ist ein jährlich stattfindender Programmierwettbewerb im Rahmen der <a href="http://www.icfpconference.org/">International Conference on Functional Programming</a>. Dieses Jahr hatten wir uns entschlossen am ICFP teilzunehmen. Die Aufgaben der letzten Jahre waren immer recht anspruchsvoll, wir waren sehr gespannt wie es dieses Jahr sein würde. Gerüchten zufolge sollte die etwas krumme Startzeit mit der Aufgabe zu tun haben &#8230; so war es dann auch <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Wir (Steffen, Kleiner und ich) trafen uns bei Steffen und warteten auf die Freigabe der Spezifikation.</p>
<p>Pünktlich um <strong>20:00:16</strong> ging es los bzw. ging es erstmal nicht los, denn der Webserver des Ausrichters war nicht mehr erreichbar &#8230; normal wenn knapp 300 Teams versuchen die Aufgabestellungen herunterzuladen. Das Problem war nach ein paar Minuten erledigt.</p>
<p>Nun ging es erstmal ans Lesen des 16 Seiten langen PDFs. Eine Kurzfassung:</p>
<ul>
<li>es galt eine VM zu programmieren, mit Grundbefehlen wie Addition, Subtraktion, Wurzel etc.</li>
<li>auf dieser sollten herunterladbare Binardatein ladbar und ausführbar sein, ausführbar bedeutet alles geladenen Operationen nacheinander ausführen und Speicher verändern</li>
<li>die VM sollte Art Input/Ouput Schnittstelle haben mit deren Hilfe ein Satellit auf seinem Weg um die Erde gesteuert werden sollte</li>
<li>es gab insgesamt 5 Szenarien (erst 3, dann 4 und am Ende kam noch eine 5. Bonusaufgabe dazu), die unterschiedliche, jeweils immer &#8220;komplexere&#8221; Lösungen zum Thema &#8220;wie steuere ich einen Satelliten&#8221; erforderten</li>
</ul>
<p>Die VM war detailiert beschrieben, es gab Daten und Befehle, das Binärformat musste geladen werden, die Befehle mussten ausgeführt werden usw.</p>
<p><strong>Wir haben das Ganze mit Java umgesetzt.</strong></p>
<p>Laut Specifikation muss die VM 32bit Operatoren und 64bit Daten halten, diese sind über einen 14bit Pointer adressiert, was eine maximale Anzahl von 16384 Einträgen ergibt. Es wird zwischen  D-Operatoren (2 Paramtern) und S-Operatoren (1 Parameter) unterschieden:</p>
<p><img class="aligncenter size-full wp-image-223" title="Orbit VM Operation Types" src="http://ahoehma.files.wordpress.com/2009/06/icfp_2009_vm_optypes.png?w=605&#038;h=39" alt="Orbit VM Operation Types" width="605" height="39" /></p>
<p>Die Daten im &#8220;Orbit Executable Format&#8221; sind in 96 bit lange Frames aufgeteilt, bei gerade Frames (0, 2, 4, &#8230;) kommen erst die Daten (64 bit, double) und dann der Operationen (32 bit, int), bei ungerade Frames umgedreht:</p>
<p style="text-align:center;"><img title="Orbit Executable Format - Frame" src="http://ahoehma.files.wordpress.com/2009/06/icfp_2009_orbit_exe_format_frame.png?w=515&#038;h=39" alt="Orbit Executable Format - Frame" width="515" height="39" /></p>
<p>Diese Frames werden durch den <em>MemoryLoader</em> in den <em>Memory</em> geladen. Dieser besteht aus zwei Listen (Operationen und Daten), einem Status-Bit, einem Output/Input Bereich:</p>
<p><img class="aligncenter size-full wp-image-224" title="VM Memory" src="http://ahoehma.files.wordpress.com/2009/06/icfp_2009_vm_memory.png?w=663&#038;h=285" alt="VM Memory" width="663" height="285" /></p>
<p>Für die unterschiedlichen Operationen erzeugen wir während des Ladens konkrete Objekte die das Interfaces <em>Instruction</em> implementieren und entweder von <em>DoubleInstruction </em>oder <em>SingleInstruction </em>ableiten. Dadurch enthält unser Memory nach dem Laden bereits eine Liste von &#8220;ausführbaren&#8221; Objekten, die selbständig den Memory verändern können (eine Instruction kann aus dem Memory lesen bzw. in den Memory schreiben).</p>
<p><img class="aligncenter size-full wp-image-225" title="UML" src="http://ahoehma.files.wordpress.com/2009/06/icfp_2009_vm_uml.png?w=425&#038;h=338" alt="UML" width="425" height="338" /></p>
<p><img class="aligncenter size-full wp-image-226" title="Instruction Hierarchie" src="http://ahoehma.files.wordpress.com/2009/06/icfp_2009_vm_instructions.png?w=246&#038;h=261" alt="Instruction Hierarchie" width="246" height="261" /></p>
<p>Gegen <strong>1:00</strong> konnten wir die Datei  &#8220;bin1.obf&#8221; laden und ausführen. Als Ergebnis sahen wir allerdings nur &#8220;0.0.0&#8243;. Hmm 3 mal 0, das konnte nix sinnvolles sein &#8230; das Problem war nach einer weiteren halben Stunde gelöst &#8230;</p>
<p>Um <strong>1:26</strong> hatten wir das erste Szenario &#8220;Hohmann&#8221; am laufen.  Mit 50000 Interationen konnten wir dann auch soviel Ausgabedaten erzeugen um in Openoffice mit einem XY-Diagramm eine KREIS zu sehen. WOW!!! Das war ein sinnvolles Ergebnis. Wir waren hell wach. Das war unser um die Erde kreisender Sputnik. Ziel war es nun via Input Steuerbefehle an den Sputnik zu senden um die einzelnen Szenarien zu erledigen.</p>
<p><img class="aligncenter size-full wp-image-234" title="icfp_firstimage" src="http://ahoehma.files.wordpress.com/2009/06/icfp_firstimage.jpg?w=700&#038;h=525" alt="icfp_firstimage" width="700" height="525" /></p>
<p><img class="aligncenter size-full wp-image-235" title="icfp_firstimageb" src="http://ahoehma.files.wordpress.com/2009/06/icfp_firstimageb.jpg?w=700&#038;h=525" alt="icfp_firstimageb" width="700" height="525" /></p>
<p>Im ersten, dem <a href="http://de.wikipedia.org/wiki/Hohmannbahn" target="_blank">Hohmann</a>-Szenario, ging es nun darum einen Satelliten von seiner initialen Umlaufbahn auf eine höhere Umlaufbahn zu steuern. Die Mathematik war beschrieben und musste nur noch programmiert werden, Kleiner und Steffen machten sich an die Arbeit. Ich versuchte in der Zeit eine Visualisierung mit SWT zu programmieren. Pro Szenario gab es noch 4 unterschiedliche Konfigurationen die wir bewältigten mussten. Hier ist der Anfang und das Ende von Konfiguration 1002 zu sehen. Der Sputnik bewegt sicht von der inneren zur äusseren Umlaufbahn:</p>
<table class="aligncenter" border="0" width="450">
<tbody>
<tr>
<td><a href="http://ahoehma.files.wordpress.com/2009/06/hohmann_1002a.jpg"><br />
<img class="aligncenter attachment-thumbnail" src="http://ahoehma.files.wordpress.com/2009/06/hohmann_1002a.jpg?w=150&amp;h=98&#038;h=98" alt="" width="150" height="98" /><br />
</a></td>
<td><a href="http://ahoehma.files.wordpress.com/2009/06/hohmann_1002b.jpg"><br />
<img class="aligncenter attachment-thumbnail" src="http://ahoehma.files.wordpress.com/2009/06/hohmann_1002b.jpg?w=150&amp;h=98&#038;h=98" alt="" width="150" height="98" /><br />
</a></td>
<td><a href="http://ahoehma.files.wordpress.com/2009/06/hohmann_1002c.jpg"><br />
<img class="aligncenter attachment-thumbnail" src="http://ahoehma.files.wordpress.com/2009/06/hohmann_1002c.jpg?w=150&amp;h=98&#038;h=98" alt="" width="150" height="98" /><br />
</a></td>
</tr>
</tbody>
</table>
<p>Die notwendigen Steuerbefehle galt es dann in einem weiteren Binärformat abzuspeichern und auf der ICFP-Homepage einzureichen. Die zu erreichende Punktezahl hing u.a. von der verbrauchten Zeit und dem verbrauchten Sprit des Sputniks ab. 6:15 hatten wir das erste Szenario geschafft!</p>
<p>Nun ging es ans zweit dem &#8220;Meet and Greet&#8221; Szenario. Dort galt es einen zweiten Satelliten anzufliegen. Die Mathematik war hier schon wesentlich schwieriger. Wir versuchten unser bestes. Aber irgendwie wollte es nicht so recht klappen. Wir waren knapp davor die Aufgabe zu lösen aber irgendwie fehlten immer ein paar huntert Meter zum Zielpunkt. Und da wir nun jeder über 24  Stunden nicht geschlafen hatten, beschlossen wir es erstmal sein zu lassen <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  Immerhin hatten wir eine VM programmiert und einen Sputnik auf eine höhere Umlaufbauen gebracht. Zufrieden und müde trennten wir uns. Danke nochmal an Steffen für die Bereitstellung einer angenehmen Programmierumgebung <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Kleiner hat dann Sonntag noch rausgefunden, dass wir wirklich soooo knapp vor einer Lösung waren &#8230; leider hat uns die visualisierte Ausgabe getäuscht, dort waren alle Winkel umgedreht. Statt 150 Grad in die eine Richtung mussten wir in Wirklichkeit (360 &#8211; 150 = 210) in die andere <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  Somit konnten wir dieses Jahr mit 8 gelösten Aufgaben  glänzen was uns den <a href="http://icfpcontest.org/scoreboard.php" target="_blank">139. Platz</a> einbrachte.</p>
<p>Das 3. Szenario &#8220;Eccentric Meet and Greet&#8221; war vergleichbar mit dem zweiten, nur hier befand sich der Ziel-Satellite nicht auf einer Kreisbahn sondern auf einer Eclipse um die Erde. Im 4. Szenaria &#8220;Operation Clear Skies&#8221; galt es 11 (!) Satelliten auf unterschiedlichen Umlaufbahnen anzufliegen. Der <a href="http://de.wikipedia.org/wiki/Mond" target="_blank">Mond</a> war hier auch mit dabei <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  Aber diese Szenarien werden wir wohl ausserhalb des Wettbewerbs hacken.</p>
<p>Vielleicht  sind ja nächstes Jahr  noch ein paar mehr dabei ?! <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Hier noch ein paar Screenshots der anderen Szenarien:</p>
<table border="0">
<tbody>
<tr>
<td><a title="hoehmann_3002a" href="http://ahoehma.files.wordpress.com/2009/06/hoehmann_3002a.jpg"><br />
<img class="aligncenter attachment-thumbnail" src="http://ahoehma.files.wordpress.com/2009/06/hoehmann_3002a.jpg?w=150&amp;h=98&#038;h=98" alt="" width="150" height="98" /></a></td>
<td><a title="hoehmann_2004a" href="http://ahoehma.files.wordpress.com/2009/06/hoehmann_2004a.jpg"><br />
<img class="aligncenter attachment-thumbnail" src="http://ahoehma.files.wordpress.com/2009/06/hoehmann_2004a.jpg?w=150&amp;h=98&#038;h=98" alt="" width="150" height="98" /> </a></td>
<td><a title="hoehmann_2004b" href="http://ahoehma.files.wordpress.com/2009/06/hoehmann_2004b.jpg"><br />
<img class="aligncenter attachment-thumbnail" src="http://ahoehma.files.wordpress.com/2009/06/hoehmann_2004b.jpg?w=150&amp;h=98&#038;h=98" alt="" width="150" height="98" /> </a></td>
</tr>
<tr>
<td><a title="hoehmann_4002a" href="http://ahoehma.files.wordpress.com/2009/06/hoehmann_4002a.jpg"><img class="aligncenter attachment-thumbnail" src="http://ahoehma.files.wordpress.com/2009/06/hoehmann_4002a.jpg?w=150&amp;h=98&#038;h=98" alt="" width="150" height="98" /></a></td>
<td><a title="hoehmann_4003a" href="http://ahoehma.files.wordpress.com/2009/06/hoehmann_4003a.jpg"><img class="aligncenter attachment-thumbnail" src="http://ahoehma.files.wordpress.com/2009/06/hoehmann_4003a.jpg?w=150&amp;h=98&#038;h=98" alt="" width="150" height="98" /></a></td>
</tr>
</tbody>
</table>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ahoehma.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ahoehma.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ahoehma.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ahoehma.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ahoehma.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ahoehma.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ahoehma.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ahoehma.wordpress.com/207/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ahoehma.wordpress.com/207/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ahoehma.wordpress.com/207/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=207&subd=ahoehma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ahoehma.wordpress.com/2009/06/30/das-war-der-12-icfp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/438fe36eabd9440a47ba9463aa194ac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ahoehma</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/icfp_2009_vm_optypes.png" medium="image">
			<media:title type="html">Orbit VM Operation Types</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/icfp_2009_orbit_exe_format_frame.png" medium="image">
			<media:title type="html">Orbit Executable Format - Frame</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/icfp_2009_vm_memory.png" medium="image">
			<media:title type="html">VM Memory</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/icfp_2009_vm_uml.png" medium="image">
			<media:title type="html">UML</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/icfp_2009_vm_instructions.png" medium="image">
			<media:title type="html">Instruction Hierarchie</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/icfp_firstimage.jpg" medium="image">
			<media:title type="html">icfp_firstimage</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/icfp_firstimageb.jpg" medium="image">
			<media:title type="html">icfp_firstimageb</media:title>
		</media:content>

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/hohmann_1002a.jpg?w=150&#38;h=98" medium="image" />

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/hohmann_1002b.jpg?w=150&#38;h=98" medium="image" />

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/hohmann_1002c.jpg?w=150&#38;h=98" medium="image" />

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/hoehmann_3002a.jpg?w=150&#38;h=98" medium="image" />

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/hoehmann_2004a.jpg?w=150&#38;h=98" medium="image" />

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/hoehmann_2004b.jpg?w=150&#38;h=98" medium="image" />

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/hoehmann_4002a.jpg?w=150&#38;h=98" medium="image" />

		<media:content url="http://ahoehma.files.wordpress.com/2009/06/hoehmann_4003a.jpg?w=150&#38;h=98" medium="image" />
	</item>
		<item>
		<title>Today starts the 12th ICFP Contest</title>
		<link>http://ahoehma.wordpress.com/2009/06/26/today-starts-the-12th-icfp-contest/</link>
		<comments>http://ahoehma.wordpress.com/2009/06/26/today-starts-the-12th-icfp-contest/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 06:21:11 +0000</pubDate>
		<dc:creator>Andreas Höhmann</dc:creator>
				<category><![CDATA[ICFP]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[Contest]]></category>
		<category><![CDATA[Functional Programming]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://ahoehma.wordpress.com/2009/06/26/today-starts-the-12th-icfp-contest/</guid>
		<description><![CDATA[http://icfpcontest.org/
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=206&subd=ahoehma&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>http://icfpcontest.org/</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ahoehma.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ahoehma.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ahoehma.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ahoehma.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ahoehma.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ahoehma.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ahoehma.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ahoehma.wordpress.com/206/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ahoehma.wordpress.com/206/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ahoehma.wordpress.com/206/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ahoehma.wordpress.com&blog=1781916&post=206&subd=ahoehma&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ahoehma.wordpress.com/2009/06/26/today-starts-the-12th-icfp-contest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/438fe36eabd9440a47ba9463aa194ac1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ahoehma</media:title>
		</media:content>
	</item>
	</channel>
</rss>