Skip to content
Snippets Groups Projects
Commit fec91576 authored by erwan's avatar erwan
Browse files

refactoring

parent e23b5101
No related branches found
No related tags found
No related merge requests found
......@@ -17,7 +17,7 @@ let
tel;
-- Any activation Ai implies Ei was previously enabled.
node activation_is_valid<<const an:int>>(acti, enab : bool^an) returns (y : bool);
function activation_is_valid<<const an:int>>(acti, enab : bool^an) returns (y : bool);
let
y = boolall<<an>>(map<<=>,an>>(acti, enab));
tel;
......
-- Here, we use the Lustre version of the algorithm as an oracle for the ocaml version
-- Here, we use the Lustre version of the algorithm as a test oracle for the ocaml version
include "../../lib/utils.lus"
......
-----------------------------------------------------------
--Usefull function for type struct:
function d (neigh: state)
returns(res: int)
let
res=neigh.d;
tel;
-----------------------------------------------------------
--Return the tab minimal value:
function min_tab<<const n:int>> (this : int; neighbors : int^n)
returns (new: int);
......
-- automatically generated by salut
type state = struct { d:int ; par:int };
type action = enum { CD , CP };
......@@ -10,8 +8,20 @@ function action_of_int(i : int) returns (a : action);
let
a = if i = 0 then CD else CP;
tel;
function legitimate<<const actions_number:int; const card:int>>(enables : bool^actions_number^card; config: state^card)
function legitimate<<const actions_number:int; const card:int>>(
enables : bool^actions_number^card; config: state^card)
returns (res : bool);
let
res=silent<<actions_number,card>>(enables);
tel;
-----------------------------------------------------------
--Usefull function for type struct:
-----------------------------------------------------------
function d (neigh: state)
returns(res: int)
let
res=neigh.d;
tel;
......@@ -41,7 +41,7 @@ tel;
----------------------------------------------------------------------------
-- all states are initially in correctly
----------------------------------------------------------------------------
node rangei<<const low:int; const card:int; const max:int>>(config:state^card) returns (res:bool);
function rangei<<const low:int; const card:int; const max:int>>(config:state^card) returns (res:bool);
var
e:state;
let
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment