<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sail/test/ocaml/void, branch sail2</title>
<subtitle>Formal specification language for ISAs</subtitle>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sail/'/>
<entry>
<title>Interactive: Refactor sail.ml</title>
<updated>2019-03-27T16:32:08+00:00</updated>
<author>
<name>Alasdair Armstrong</name>
</author>
<published>2019-03-27T16:21:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sail/commit/?id=790de19f73f1c164aba2259a6fe3f1a50eeff70c'/>
<id>790de19f73f1c164aba2259a6fe3f1a50eeff70c</id>
<content type='text'>
Rather than having a separate variable for each backend X,
opt_print_X, just have a single variable opt_print_target, where
target contains a string option, such as `Some "lem"` or `Some
"ocaml"`, then we have a function target that takes that string and
invokes the appropriate backend, so the main function in sail.ml goes
from being a giant if-then-else block to a single call to

target !opt_target ast env

This allows us to implement a :compile &lt;target&gt; command in the
interactive toplevel

Also implement a :rewrites &lt;target&gt; command which performs all the
rewrites for a specific target, so rather than doing e.g.

&gt; sail -c -O -o out $FILES

one could instead interactively do

&gt; sail -i
:option -undefined_gen
:load $FILES
:option -O
:option -o out
:rewrites c
:compile c
:quit

for the same result.

To support this the behavior of the interactive mode has changed
slightly. It no longer performs any rewrites at all, so a :rewrites
interpreter is currently needed to interpret functions in the
interactive toplevel, nor does it automatically set any other flags,
so -undefined_gen is needed in this case, which is usually implied by
the -c flag.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rather than having a separate variable for each backend X,
opt_print_X, just have a single variable opt_print_target, where
target contains a string option, such as `Some "lem"` or `Some
"ocaml"`, then we have a function target that takes that string and
invokes the appropriate backend, so the main function in sail.ml goes
from being a giant if-then-else block to a single call to

target !opt_target ast env

This allows us to implement a :compile &lt;target&gt; command in the
interactive toplevel

Also implement a :rewrites &lt;target&gt; command which performs all the
rewrites for a specific target, so rather than doing e.g.

&gt; sail -c -O -o out $FILES

one could instead interactively do

&gt; sail -i
:option -undefined_gen
:load $FILES
:option -O
:option -o out
:rewrites c
:compile c
:quit

for the same result.

To support this the behavior of the interactive mode has changed
slightly. It no longer performs any rewrites at all, so a :rewrites
interpreter is currently needed to interpret functions in the
interactive toplevel, nor does it automatically set any other flags,
so -undefined_gen is needed in this case, which is usually implied by
the -c flag.
</pre>
</div>
</content>
</entry>
<entry>
<title>Parser tweaks and fixes</title>
<updated>2018-11-30T19:13:39+00:00</updated>
<author>
<name>Alasdair Armstrong</name>
</author>
<published>2018-11-30T18:54:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sail/commit/?id=0363a325ca6c498e086519c4ecaf1f51dbff7f64'/>
<id>0363a325ca6c498e086519c4ecaf1f51dbff7f64</id>
<content type='text'>
- Completely remove the nexp = nexp syntax in favour of nexp ==
  nexp. All our existing specs have already switched over. As part of
  this fix every test that used the old syntax, and update the
  generated aarch64 specs

- Remove the `type when constraint` syntax. It just makes changing the
  parser in any way really awkward.

- Change the syntax for declaring new types with multiple type
  parameters from:

  type foo('a : Type) ('n : Int), constraint = ...

  to

  type foo('a: Type, 'n: Int), constraint = ...

  This makes type declarations mimic function declarations, and makes
  the syntax for declaring types match the syntax for using types, as
  foo is used as foo(type, nexp). None of our specifications use types
  with multiple type parameters so this change doesn't actually break
  anything, other than some tests. The brackets around the type
  parameters are now mandatory.

- Experiment with splitting Type/Order type parameters from Int type
  parameters in the parser.

  Currently in a type bar(x, y, z) all of x, y, and z could be either
  numeric expressions, orders, or types. This means that in the parser
  we are severely restricted in what we can parse in numeric
  expressions because everything has to be parseable as a type (atyp)
  - it also means we can't introduce boolean type
  variables/expressions or other minisail features (like removing
  ticks from type variables!) because we are heavily constrained by
  what we can parse unambigiously due to how these different type
  parameters can be mixed and interleaved.

  There is now experimental syntax: vector::&lt;'o, 'a&gt;('n) &lt;--&gt;
  vector('n, 'o, 'a) which splits the type argument list into two
  between Type/Order-polymorphic arguments and Int-polymorphic
  arguments. The exact choice of delimiters isn't set in stone - ::&lt;
  and &gt; match generics in Rust. The obvious choices of &lt; and &gt; / [ and
  ] are ambigious in various ways.

  Using this syntax right now triggers a warning.

- Fix undefined behaviour in C compilation when concatenating a
  0-length vector with a 64-length vector.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Completely remove the nexp = nexp syntax in favour of nexp ==
  nexp. All our existing specs have already switched over. As part of
  this fix every test that used the old syntax, and update the
  generated aarch64 specs

- Remove the `type when constraint` syntax. It just makes changing the
  parser in any way really awkward.

- Change the syntax for declaring new types with multiple type
  parameters from:

  type foo('a : Type) ('n : Int), constraint = ...

  to

  type foo('a: Type, 'n: Int), constraint = ...

  This makes type declarations mimic function declarations, and makes
  the syntax for declaring types match the syntax for using types, as
  foo is used as foo(type, nexp). None of our specifications use types
  with multiple type parameters so this change doesn't actually break
  anything, other than some tests. The brackets around the type
  parameters are now mandatory.

- Experiment with splitting Type/Order type parameters from Int type
  parameters in the parser.

  Currently in a type bar(x, y, z) all of x, y, and z could be either
  numeric expressions, orders, or types. This means that in the parser
  we are severely restricted in what we can parse in numeric
  expressions because everything has to be parseable as a type (atyp)
  - it also means we can't introduce boolean type
  variables/expressions or other minisail features (like removing
  ticks from type variables!) because we are heavily constrained by
  what we can parse unambigiously due to how these different type
  parameters can be mixed and interleaved.

  There is now experimental syntax: vector::&lt;'o, 'a&gt;('n) &lt;--&gt;
  vector('n, 'o, 'a) which splits the type argument list into two
  between Type/Order-polymorphic arguments and Int-polymorphic
  arguments. The exact choice of delimiters isn't set in stone - ::&lt;
  and &gt; match generics in Rust. The obvious choices of &lt; and &gt; / [ and
  ] are ambigious in various ways.

  Using this syntax right now triggers a warning.

- Fix undefined behaviour in C compilation when concatenating a
  0-length vector with a 64-length vector.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update and fix test suite</title>
<updated>2018-01-22T13:41:35+00:00</updated>
<author>
<name>Alasdair Armstrong</name>
</author>
<published>2018-01-22T13:41:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sail/commit/?id=1f8ac16d110e2b964a482c083e3782f406e94b69'/>
<id>1f8ac16d110e2b964a482c083e3782f406e94b69</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>More OCaml test cases</title>
<updated>2017-12-07T19:53:14+00:00</updated>
<author>
<name>Alasdair Armstrong</name>
</author>
<published>2017-12-07T19:53:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.0x7felf.com/sail/commit/?id=47f1892406b5c10d06eb99af40d4523b93b2f254'/>
<id>47f1892406b5c10d06eb99af40d4523b93b2f254</id>
<content type='text'>
Improved handling of try/catch

Better handling of unprovable constraints when the environment contains
false
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Improved handling of try/catch

Better handling of unprovable constraints when the environment contains
false
</pre>
</div>
</content>
</entry>
</feed>
