From 5dc414a70feaaeed45350bda00836ca8ca3cbe61 Mon Sep 17 00:00:00 2001 From: "Gabriel B. Sant'Anna" <baiocchi.gabriel@gmail.com> Date: Mon, 26 Apr 2021 14:53:37 +0200 Subject: [PATCH] Add missing static const parameter --- lib/bitset.lus | 2 +- lib/sas.lus | 2 +- lib/utils.lus | 4 ++-- test/coloring/verify.lus | 2 +- test/token/verify.lus | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/bitset.lus b/lib/bitset.lus index 36b6a029..f753cb7f 100644 --- a/lib/bitset.lus +++ b/lib/bitset.lus @@ -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; diff --git a/lib/sas.lus b/lib/sas.lus index f36bb3f8..4a34d031 100644 --- a/lib/sas.lus +++ b/lib/sas.lus @@ -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); diff --git a/lib/utils.lus b/lib/utils.lus index b17500d3..6185c902 100644 --- a/lib/utils.lus +++ b/lib/utils.lus @@ -1,7 +1,7 @@ -- 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. diff --git a/test/coloring/verify.lus b/test/coloring/verify.lus index d5b94eb2..957a20cb 100644 --- a/test/coloring/verify.lus +++ b/test/coloring/verify.lus @@ -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; diff --git a/test/token/verify.lus b/test/token/verify.lus index d0b7128e..53d11a68 100644 --- a/test/token/verify.lus +++ b/test/token/verify.lus @@ -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; -- GitLab