<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Home</title><link>https://sourceforge.net/p/verlang/wiki/Home/</link><description>Recent changes to Home</description><atom:link href="https://sourceforge.net/p/verlang/wiki/Home/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 15 Jul 2013 11:22:35 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/verlang/wiki/Home/feed" rel="self" type="application/rss+xml"/><item><title>Home modified by Tim Carstens</title><link>https://sourceforge.net/p/verlang/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v6
+++ v7
@@ -33,6 +33,58 @@

 It is currently possible to generate Core Erlang which fails with run-time exceptions (if you curry a function, for instance). We are still evolving the extraction theory, and thus there may be other bugs as well. Our goal is to resolve these issues and provide a rigorous implementation.

+** Example **
+
+In this example, we show the extraction of Coq's &lt;code&gt;plus: nat -&gt; nat -&gt; nat&lt;/code&gt;.
+
+First we fire up our modified &lt;code&gt;coqtop&lt;/code&gt;:
+
+    $ ./coqtop
+    Welcome to Coq 8.4pl2 (July 2013)
+
+    Coq &lt; Extraction Language CoreErlang.
+
+    Coq &lt; Extraction plus.
+    'plus'/2 = fun (_n, _m) -&gt; 
+      case _n of
+        'O' when 'true' -&gt;
+            _m
+        {'S', _p} when 'true' -&gt;
+            {'S', call 'Coq.Init.Peano':'plus'
+                 ( _p
+                 , _m
+                 )}
+       end
+    Coq &lt;
+
+Notice that the recursion step is performed by making an inner-module call.
+
+If we place this into a file &lt;code&gt;Coq.Init.Peano.code&lt;/code&gt;, we can play around with the function:
+
+    $ cat Coq.Init.Peano.core
+    module 'Coq.Init.Peano' ['plus'/2] attributes []
+    'plus'/2 = fun (_n, _m) -&gt;
+      case _n of
+        'O' when 'true' -&gt;
+            _m
+        {'S', _p} when 'true' -&gt;
+            {'S', call 'Coq.Init.Peano':'plus'
+                 ( _p
+                 , _m
+                 )}
+       end
+    end
+
+    $ erl
+    Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false]
+
+    Eshell V5.10.2  (abort with ^G)
+    1&gt; c('Coq.Init.Peano', from_core).
+    {ok,'Coq.Init.Peano'}
+    2&gt; 'Coq.Init.Peano':'plus' ({'S', {'S', 'O'}}, {'S', {'S', {'S', 'O'}}}).
+    {'S',{'S',{'S',{'S',{'S','O'}}}}}
+    3&gt;
+

    [1]: http://coq.inria.fr/
    [2]: http://caml.inria.fr/
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim Carstens</dc:creator><pubDate>Mon, 15 Jul 2013 11:22:35 -0000</pubDate><guid>https://sourceforge.netc47320df0dbc340e801bdfcf6940914bb7c3bdfa</guid></item><item><title>Home modified by Tim Carstens</title><link>https://sourceforge.net/p/verlang/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -31,7 +31,7 @@
 * We have admitted an axiom which describes &lt;code&gt;receive&lt;/code&gt; (with finite timeout). The extractor recognizes a &lt;code&gt;case...of&lt;/code&gt; around this axiom, which it translates into the desired Core Erlang.
 * We don't (yet) generate Erlang header files for our modules (&lt;code&gt;.hrl&lt;/code&gt; files).

-It is currently possible to generate Core Erlang which fails with run-time exceptions (if you curry a function, for instance). We are still evolving the extraction theory, and thus there may be other bugs as well. Our goal is to resolve these issues and provide a correct implementation.
+It is currently possible to generate Core Erlang which fails with run-time exceptions (if you curry a function, for instance). We are still evolving the extraction theory, and thus there may be other bugs as well. Our goal is to resolve these issues and provide a rigorous implementation.

    [1]: http://coq.inria.fr/
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim Carstens</dc:creator><pubDate>Mon, 15 Jul 2013 11:07:49 -0000</pubDate><guid>https://sourceforge.net4333723932c76da33f04cdca5f7d5e60d99fc9b9</guid></item><item><title>Home modified by Tim Carstens</title><link>https://sourceforge.net/p/verlang/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -31,7 +31,7 @@
 * We have admitted an axiom which describes &lt;code&gt;receive&lt;/code&gt; (with finite timeout). The extractor recognizes a &lt;code&gt;case...of&lt;/code&gt; around this axiom, which it translates into the desired Core Erlang.
 * We don't (yet) generate Erlang header files for our modules (&lt;code&gt;.hrl&lt;/code&gt; files).

-It is currently possible to generate Core Erlang which fails with run-time exceptions (if you curry a function, for instance). But if the code runs without encountering such a scenario, and supposing you don't mangle something with the &lt;code&gt;Extract&lt;/code&gt; command, your code should behave correctly.
+It is currently possible to generate Core Erlang which fails with run-time exceptions (if you curry a function, for instance). We are still evolving the extraction theory, and thus there may be other bugs as well. Our goal is to resolve these issues and provide a correct implementation.

    [1]: http://coq.inria.fr/
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim Carstens</dc:creator><pubDate>Mon, 15 Jul 2013 11:06:58 -0000</pubDate><guid>https://sourceforge.net10d4b02b556297bddbdafc709769543eef6ffcfd</guid></item><item><title>Home modified by Tim Carstens</title><link>https://sourceforge.net/p/verlang/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -29,6 +29,9 @@
 * We don't yet address problems related to currying. For the time being, we have been programming in Coq in such a way to avoid these issues in the extracted code.
 * We treat all top-level function calls as inter-module calls, noting that a module is permitted to &lt;code&gt;call&lt;/code&gt; into itself.
 * We have admitted an axiom which describes &lt;code&gt;receive&lt;/code&gt; (with finite timeout). The extractor recognizes a &lt;code&gt;case...of&lt;/code&gt; around this axiom, which it translates into the desired Core Erlang.
+* We don't (yet) generate Erlang header files for our modules (&lt;code&gt;.hrl&lt;/code&gt; files).
+
+It is currently possible to generate Core Erlang which fails with run-time exceptions (if you curry a function, for instance). But if the code runs without encountering such a scenario, and supposing you don't mangle something with the &lt;code&gt;Extract&lt;/code&gt; command, your code should behave correctly.

    [1]: http://coq.inria.fr/
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim Carstens</dc:creator><pubDate>Mon, 15 Jul 2013 11:05:10 -0000</pubDate><guid>https://sourceforge.net7b2c2f8ecc6c03693110564da101430dab829ef8</guid></item><item><title>Home modified by Tim Carstens</title><link>https://sourceforge.net/p/verlang/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -8,9 +8,27 @@

 *Verlang* adds Core Erlang as an extraction target to Coq. From here it is possible to compile the extracted code and run it along-side ordinary Erlang modules.

+** Challenges **
+
+The theory behind Coq's extraction, as well as the majority of its present implementation, is due to [Pierre Letouzey][8]. His extraction mechanism is based on a two step process: first, Coq terms are translated into an internal language (MiniML); after that, target-specific code translates from MiniML into the target.
+
+MiniML maps to Core Erlang in a more or less obvious manner, but as usual the devil's in the details:
+
+* Core Erlang's notion of "modules" do not allow for nesting. Care must thus be taken when extracting MiniML into Core Erlang, as source in the former is likely to have nested modules.
+* Core Erlang does not support currying. In fact, the (&lt;code&gt;-&amp;gt;&lt;/code&gt;) type constructor isn't even associative -- the arity of a function is encoded in its type, and a function of arity &lt;code&gt;x&lt;/code&gt; which yields a function of arity &lt;code&gt;y&lt;/code&gt; cannot be used as a function of arity (&lt;code&gt;x+y&lt;/code&gt;).
+* Core Erlang distinguishes between inner- and inter-module calls. The former are invoked with the &lt;code&gt;apply&lt;/code&gt; construction, while the latter are invoked with &lt;code&gt;call&lt;/code&gt;.
+* Core Erlang's &lt;code&gt;receive&lt;/code&gt; primitive is a special case of side-effecting &lt;code&gt;case...of&lt;/code&gt; construction, for which there is no analog in MiniML. Thus one needs special trickery to provide "natural" access to this primitive from within Coq source.
+
+There are other issues as well (dealing with Erlang's sum-type constructor &lt;code&gt;|&lt;/code&gt;, for instance), but many of them can be managed through careful use of Coq's &lt;code&gt;Extract&lt;/code&gt; command.
+
 ** Status **

-Our work is highly experimental.
+Our work is highly experimental. We have a prototype extractor which attempts to address most of the challenges mentioned above:
+
+* We support "module nesting" in a boring way: the outter-most module is preserved in the translation to Core Erlang, and name mangling is used to encode the sub-modules.
+* We don't yet address problems related to currying. For the time being, we have been programming in Coq in such a way to avoid these issues in the extracted code.
+* We treat all top-level function calls as inter-module calls, noting that a module is permitted to &lt;code&gt;call&lt;/code&gt; into itself.
+* We have admitted an axiom which describes &lt;code&gt;receive&lt;/code&gt; (with finite timeout). The extractor recognizes a &lt;code&gt;case...of&lt;/code&gt; around this axiom, which it translates into the desired Core Erlang.

    [1]: http://coq.inria.fr/
@@ -20,3 +38,4 @@
    [5]: http://erlang.org/
    [6]: http://www.ericsson.org/
    [7]: http://www.it.uu.se/research/group/hipe/cerl/
+   [8]: http://www.pps.univ-paris-diderot.fr/~letouzey/index.fr.html
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim Carstens</dc:creator><pubDate>Mon, 15 Jul 2013 10:57:29 -0000</pubDate><guid>https://sourceforge.net69d74b126358e8cd018bdde45d47151f9cb0eae9</guid></item><item><title>Home modified by Tim Carstens</title><link>https://sourceforge.net/p/verlang/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,8 +1,22 @@
-Welcome to your wiki!
+Verlang is a project seeking to enable formally-verified software development within the Erlang environment. It is currently highly experimental.

-This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
+** Background **

-The wiki uses [Markdown](/p/verlang/wiki/markdown_syntax/) syntax.
+[*Coq*][1] is an environment for functional programming with an integrated proof agent. The software development process with Coq is a bit non-standard: one doesn't ordinarily compile Coq source directly, but instead "extracts" the computationally-relevant portions to another language. Coq supports extraction to [OCaml][2], [Haskell][3], and [Scheme][4], though at time of writing the OCaml target is the most mature.

-[[members limit=20]]
-[[download_button]]
+[*Erlang*][5] is a functional programming language by [Ericsson][6]. Among Erlang's notable features is its support for hot-swapping of modules, enabling software updates with reduced downtime. To compile Erlang, one first converts it to [*Core Erlang*][7], which is then compiled to a specific Erlang VM.
+
+*Verlang* adds Core Erlang as an extraction target to Coq. From here it is possible to compile the extracted code and run it along-side ordinary Erlang modules.
+
+** Status **
+
+Our work is highly experimental.
+
+
+   [1]: http://coq.inria.fr/
+   [2]: http://caml.inria.fr/
+   [3]: http://haskell.org/
+   [4]: http://groups.csail.mit.edu/mac/projects/scheme/
+   [5]: http://erlang.org/
+   [6]: http://www.ericsson.org/
+   [7]: http://www.it.uu.se/research/group/hipe/cerl/
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim Carstens</dc:creator><pubDate>Mon, 15 Jul 2013 09:11:06 -0000</pubDate><guid>https://sourceforge.netc120f8369fc74c0a46b34b571b0d248133948666</guid></item><item><title>Home modified by Tim Carstens</title><link>https://sourceforge.net/p/verlang/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Welcome to your wiki!&lt;/p&gt;
&lt;p&gt;This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: &lt;span&gt;[SamplePage]&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;The wiki uses &lt;a class="" href="/p/verlang/wiki/markdown_syntax/"&gt;Markdown&lt;/a&gt; syntax.&lt;/p&gt;
&lt;p&gt;&lt;h6&gt;Project Members:&lt;/h6&gt;
&lt;ul class="md-users-list"&gt;
&lt;li&gt;&lt;a href="/u/intoverflow/"&gt;Tim Carstens&lt;/a&gt; (admin)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;span class="download-button-51e3aaff0594ca18be895a90" style="margin-bottom: 1em; display: block;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tim Carstens</dc:creator><pubDate>Mon, 15 Jul 2013 09:10:25 -0000</pubDate><guid>https://sourceforge.net88b99ecc9d063a57f1189eb089c441b8b67ecfcc</guid></item></channel></rss>