Skip to content
Snippets Groups Projects
Commit 5dc414a7 authored by Gabriel B. Sant'Anna's avatar Gabriel B. Sant'Anna
Browse files

Add missing static const parameter

parent 3fc322ba
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,7 @@ include "utils.lus"
function one_hot<<const N:int>>(x : int) returns (s : bool^N);
let
assert(x >= 0 and x < N);
s = map<<=,N>>(x^N, range<<N>>());
s = map<<=,N>>(x^N, range<<N>>(true));
assert(boolred<<1,1,N>>(s));
tel;
......
......@@ -40,7 +40,7 @@ var
locally_central : bool ^ pn;
let
active = map<<boolany<<an>>, pn>>(acti);
active_adjacencies = map<<inter,pn>>(active^pn, adjacency);
active_adjacencies = map<<inter<<pn>>, pn>>(active^pn, adjacency);
no_active_adjacencies = map<<boolnone<<pn>>, pn>>(active_adjacencies);
locally_central = map<<=>,pn>>(active, no_active_adjacencies);
y = boolall<<pn>>(locally_central);
......
-- Generates an array of indexes: [0, 1, ..., N-1]
function range<<const N:int>>() returns (r : int^N);
function range<<const N:int>>(_ : bool) returns (r : int^N);
let
r = with (N = 1) then [ 0 ] else range<<N-1>>() | [ N-1 ];
r = with (N = 1) then [ 0 ] else range<<N-1>>(true) | [ N-1 ];
tel;
-- First-class if statement, since we don't have lambdas.
......
......@@ -19,5 +19,5 @@ let
-- the execution terminates after at most |N|−1 moves
moves = move_count<<actions_number,card>>(activations);
ok = closure and
((moves = card - 1) => legitimate);
((moves >= card - 1) => legitimate);
tel;
......@@ -24,5 +24,5 @@ let
steps = (-1 -> pre(steps)) + 1;
ok = closure and
tokens >= 1 and -- there always exists at least one token holder
((steps = card*(card-1) + ((card-4)*(card+1)/2) + 1) => legitimate); -- worst-case stabilization
((steps >= card*(card-1) + ((card-4)*(card+1)/2) + 1) => legitimate); -- worst-case stabilization
tel;
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