Skip to content

When expression must be the argument of a current operator #541

@hbourbouh

Description

@hbourbouh

Hi Daniel,
How we can define a stream that is clocked in Kind2 syntax?
As it seems from the following code, Kind2 asking me to use the "current" operator when I use "when". In Lustre, we can define streams that are clocked by some bool clock.

node _make_clock(per: int; ph: int)
returns( clk: bool );
var cnt: int;
let
cnt = ((per - ph) -> (pre(cnt) + 1)) mod per ;
clk = if (cnt = 0) then true else false ;
tel
node trigger_test_PP(In1_1 : real;)
returns(Out1_1 : real;);
var RateTransition_1 : real;
RateTransition1_1 : real;
__time_step : real;
_clk_2_0 : bool ;
let
RateTransition_1 = (In1_1 when _clk_2_0);
RateTransition1_1 = (merge _clk_2_0
(true -> (0.000000000000000 -> (pre RateTransition_1)))
(false -> ((0.000000000000000 -> (pre RateTransition1_1)) when not(_clk_2_0))));
Out1_1 = RateTransition1_1;
__time_step = (0.0 -> ((pre __time_step) + 1.000000000000000));
_clk_2_0 = _make_clock(2, 0);
tel

Thanks,
Hamza

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions