915 Commits (e4b0578b38875bdeb820b601f3d7f7344d1d6066)

Author SHA1 Message Date
Gwenaël Delaval 1ead8a98ea Correction of unary minus priority
To fix: see test minus_pre.ept:

node main() = (o,p:int)
let
  o = ~-1 -> pre o + 1;
  p = -1 fby p + 1
tel
7 years ago
Gwenaël Delaval 028c564a31 Clean-up of verbose output
Leave only comments about compilation passes.
Remove output of intermediate code on standard output: added
generation of <module>.log containing all intermediate code.
7 years ago
Gwenaël Delaval 63e090633c Corrected bug in causality analysis
The following node was accepted by the causality analysis:

node m(x:int) = (y,z:int)
let
    automaton
    state A
    do
      y = x + z;
      z = x + 1;
    until x = 3 then B
    state B
    do
      y = x + 3;
      z = y * x;
    until x = 10 then A
    end
tel

Each state is indeed causal, but once the automaton is translated to equations
(which is the systematic way in the current version), the node is not
schedulable.

Correction: all "Or" of dependency constraints translated to "And".

This constraint could be relaxed if code generation is done from Heptagon code,
before translation to minils equations.
7 years ago
Gwenaël Delaval cc666cb32c Bug correction in init analysis
Correction: nodes instances must have well initialized inputs.
7 years ago
Gwenaël Delaval e4f51fea68 Switch to non-deprecated String functions
Use of String.*_ascii non-deprecated versions.

NB: Heptagon becomes available only for Ocaml versions >= 4.03.0.
7 years ago
Gwenaël Delaval d2dfed5019 Correction of shift/reduce conflict in syntax
Correction: in a contract, the list of objectives cannot be empty.
7 years ago
Gwenaël Delaval 0515cf4f80 Handling of implication operator in Ctrln back-end 7 years ago
Gwenaël Delaval 6c3caec234 Bug correction in ctrl2ept: no systematic conversion from int to float 7 years ago
Gwenaël Delaval 2f18926bf4 Clean up documentation comments 7 years ago
Gwenaël Delaval 2e107cd872 Suppress "c_" prefix in Ctrl-Nbac generation 7 years ago
Gwenaël Delaval 5b215f832b Version 1.03.02 7 years ago
Gwenaël Delaval a0e97b82ea CtrlNbac backend: systematic sink state, outputs as local variables
Changes in CtrlNbac back-end :
- systematic sink state, only in ctrln code
- sink state "ok" removed (useless as was coded)
- no sink state in minils code
- outputs in ctrln are local variables, no longer state variables
8 years ago
Gwenaël Delaval 69b8cc5a18 Added operator (=>) in Pervasives module
Operator (=>) for implication added in Pervasives module.

"a => b" is translated into "not a or b" at code generation.
8 years ago
Gwenaël Delaval 5e277fcc8a Version 1.03.01 8 years ago
Gwenaël Delaval 83905f9039 Remove traces and warnings 8 years ago
Gwenaël Delaval d8d24ffd95 Handle modularity/several controllers by module
* Several controllers by module : added option "-m <Module>" in ctrl2ept

Generate controllers for each node of one module in <module>_controller.ept

* Types of <Module> no longer moved to <Module>_controller

* Added "_types" suffix for type dependencies for C target
8 years ago
Gwenaël Delaval 05150f2078 [ctrl-n] Suppression of type declarations in Heptagon controller
TODO : move type declarations in separated module.
8 years ago
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.
8 years ago
Nicolas Berthier 755b570a96 Correct typing of numericals when translating Controllable-Nbac nodes
Without this change one could end up with inconsistent numerical types
when expressions like 1 + xx /. 3.0 >= 0 (with xx being a float), that
is correctly handled in ReaTK's frontend, are translated into the
heptagon's internal representation.
8 years ago
Gwenaël Delaval 4f0ef44ebd Version 1.03.00 9 years ago
Gwenaël Delaval e9540a2159 hepts: enum types & alias
The graphical simulator hepts now support type aliasing.
9 years ago
Gwenaël Delaval 2aed0f6537 Deadcode removal improvement
Deadcode removal in Obc :
- suppression of switch unused cases :

switch(true) {
  case false: ...
}

- activation with -deadcode option
9 years ago
Gwenaël Delaval 64b8c0592a Pretty-printing class parameters in obc 9 years ago
Gwenaël Delaval 19911506de Removal of warnings 9 years ago
Gwenaël Delaval e8ec3e012c Merge branch 'ctrl-n' into decade 9 years ago
Gwenaël Delaval 4552f62872 Version 1.02.00 9 years ago
Gwenaël Delaval 2c1717e99f Removal of -custom option for compilation
-custom option trigger bugs with opam
9 years ago
Gwenaël Delaval 2777753b7e Cleanup : removal of useless files 9 years ago
Nicolas Berthier fb6755efb2 Bugfix in ctrl2ept: do not reset symbol table after loading type declarations 9 years ago
Nicolas Berthier 14a7b67a70 New option to force abstraction of infinite-domain state variables in ctrln export
Also add an option to silence related warnings
9 years ago
Nicolas Berthier 2d874f8070 New option to silence warnings about untranslatable constructs 9 years ago
Nicolas Berthier 74b94c9718 Fix handling of nodes without actual controllers by ctrl2ept
These changes allow to handle the case where contracts are only used
for verification purposes, in which case the functions generated by
ReaX have no outputs and are not functions stricto sensu.  Indeed, in
this case the new controller module still needs to be declared and
compiled as we may have re-qualified types during the generation of
the Controllable-Nbac code: we moved all types declared in the
original module into the controller module to break cyclic module
dependencies that would otherwise be introduced if the controller is
expressed using data of such types.
9 years ago
Gwenaël Delaval 61f043856a Version 1.01.00 9 years ago
Gwenaël Delaval 9b75408f23 Bug correction in reset
"e1 fby e2" was not handled in the reset pass.
9 years ago
Adrien Guatto dc47767ba4 Print an empty default statement at the end of all C switches
This prevents modern compilers from emitting warnings when the generated C code
contains switch statements with (intentionally) missing cases.
9 years ago
Gwenaël Delaval e0bbc838d5 Allow use of declared parameters within parameters
Allow this node :

node f<<m:int; t1: int^m>>(a:int^m) = (o:int^m)
let
o = map<<m>> (+)(a, t1);
tel
9 years ago
Gwenaël Delaval c5c5654068 Added bzreax script ; added uninstall target in Makefiles 9 years ago
Gwenaël Delaval 0d1aef8c78 Bug correction: support of enumerated types as input for simulation
- use of a buffer to translate enumerated types from string to enum value
- hepts : correct interface with main
9 years ago
Nicolas Berthier 95aa03ed21 Interface for new incremental API of menhir parsers' relies on MenhirLib 10 years ago
Gwenaël Delaval 3dfbeffeb6 Added syntax for reachability and attractivity in contracts
Contracts can now comprise a list of objectives (in any order).

One objective can be (e being a Boolean heptagon expression) :
- invariance, with the syntax "enforce e"
- reachability, "reachable e"
- attractivity, "attractive e"
10 years ago
Nicolas Berthier 177f5f9f3e Avoid exporting contract-less or parametric nodes into DCS tool formats. 10 years ago
Nicolas Berthier 307f3d8418 Controllable-Nbac import&export now support relocation of alias types.
- Controllable-Nbac export (CtrlNbacGen): correct handling of float
  expressions, as well as alias types;

- Controllable-Nbac controller importer (CtrlNbacAsEpt): Declaration
  of enumerated types and aliases that are relocated to controller
  modules is now performed based on the interface.  Dependencies
  between type aliases are also taken into account now;

- ctrl2ept tool: correct loading of pervasives module.
10 years ago
Nicolas Berthier c86d7af0b1 Introducing a hack to normalize comparison of tuples in Heptagon. 10 years ago
Nicolas Berthier 045e624f94 Bug fix with controllable-less contracts in ControllableNbac exporter. 10 years ago
Gwenaël Delaval 2a0927bd98 Bug correction in maybe_ctrln_pass 10 years ago
Nicolas Berthier cbcf8b9ac0 Using unqualified names for string representation of constructors in C backend.
+ minor modifications in various places.
10 years ago
Nicolas Berthier d4fe017864 Bug correction in names of C functions for converting constructors to string. 10 years ago
Nicolas Berthier 2d00f0a91c Fix sink state variable generation in Controllable-Nbac export. 10 years ago
Nicolas Berthier 0afdb16c57 Requalify enumeration types only when exporintg to Controllable-Nbac. 10 years ago
Nicolas Berthier 39aa0e13c1 Ugly fix for handling enumerated types when exporting to Controllable-Nbac.
To avoid cyclic module dependencies (that show up when trying to
compile, e.g, the generated C code), enumerated types declared in the
main program are now "moved" into the module containing the generated
controllers.
10 years ago