heptagon/compiler
Timothy Bourke 0b7eba8458 Add error for non-stateful decls. in pervasives
Attempts to compile a pervasives.epi containing functions with multiple
outputs or nodes now fail with an informative error message.

* The following files demonstrate the problem:

  pervasives.epi:
    type bool = true | false
    external val node test(bool;bool) returns bool

  broken.ept:
    node broken() returns (y : bool)
    let
      y = test(false, false);
    tel

  Running:
    heptc -nopervasives pervasives.epi
    heptc -stdlib . -target c broken.ept

  Fails with:

    ---------
    Internal compiler error
    Passe : Static evaluation failed of the pervasive operator test
    ----------
    Fatal error: exception Misc.Assert_false

* A different error occurs for nodes that return multiple outputs:

  pervasives.epi:
    type bool = true | false
    external val node test(bool;bool) returns (bool;bool)

  broken.ept:
    node broken() returns (y : bool)
    var l1 : bool;
    let
      (y,l1) = test(false, false);
    tel

  Running:
    heptc -nopervasives pervasives.epi
    heptc -stdlib . broken.ept

  Gives:
    Inconsistent clock annotation for exp test(false, false).
    File "broken.ept", line 4, characters 11-29:
    >  (y,l1) = test(false, false);
    >           ^^^^^^^^^^^^^^^^^^
    Clock Clash: this expression has clock 'a3,
    but is expected to have clock ('a4 * 'a5).

  The name "test" is parsed as an Eextvalue (rather than an Eapp), and there
  is an implicit assumption in compiler/minils/analysis/clocking.ml that such
  values have a simple clock.
2016-04-26 16:34:26 +02:00
..
global Insertion of call to controller(s) when exporting to Controllable-Nbac node. 2014-10-28 16:43:13 +01:00
heptagon Add error for non-stateful decls. in pervasives 2016-04-26 16:34:26 +02:00
main hepts: enum types & alias 2016-01-18 17:24:51 +01:00
minils New option to force abstraction of infinite-domain state variables in ctrln export 2015-09-18 14:11:04 +02:00
obc Deadcode removal improvement 2016-01-18 14:32:54 +01:00
utilities Version 1.03.00 2016-01-18 17:43:25 +01:00
_tags.in Removal of -custom option for compilation 2015-12-11 17:00:29 +01:00
Makefile Added bzreax script ; added uninstall target in Makefiles 2015-02-27 15:50:21 +01:00
myocamlbuild.ml Insertion of call to controller(s) when exporting to Controllable-Nbac node. 2014-10-28 16:43:13 +01:00
myocamlbuild_config.ml Fixed warnings & documentation comments. 2013-11-08 18:51:06 +01:00
preproc.ml Fixed warnings & documentation comments. 2013-11-08 18:51:06 +01:00