heptagon/compiler/heptagon
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
..
analysis Add error for non-stateful decls. in pervasives 2016-04-26 16:34:26 +02:00
ctrln Correct typing of numericals when translating Controllable-Nbac nodes 2016-03-30 17:35:56 +01:00
main Fixed warnings & documentation comments. 2013-11-08 18:51:06 +01:00
parsing Added syntax for reachability and attractivity in contracts 2015-01-06 00:26:59 +01:00
transformations Bug correction in reset 2015-09-04 17:35:12 +02:00
_tags New tool `ctrl2ept' for translating ReaX's output functions into Heptagon 2014-10-22 17:46:05 +02:00
hept_mapfold.ml Added syntax for reachability and attractivity in contracts 2015-01-06 00:26:59 +01:00
hept_printer.ml Added syntax for reachability and attractivity in contracts 2015-01-06 00:26:59 +01:00
hept_utils.ml Fixed warnings. 2014-03-18 11:01:56 +01:00
heptagon.ml Added syntax for reachability and attractivity in contracts 2015-01-06 00:26:59 +01:00