---(****************************
 * Auto-generated Maude model *
 ******************************)---
omod ALARM is
    including LF-REPR .
    protecting LF-VALUE-TIME .

    op Alarm : -> ReactorId [ctor] .
    op c : -> ReactorId [ctor] .
    op c.sv.fault : -> RVarId [ctor] .
    op c.out.out : -> RPortId [ctor] .
    op c.out.out2 : -> RPortId [ctor] .
    op c.la.turnOff : -> RActionId [ctor] .
    op startup : -> RActionId [ctor] .
    op init : -> Configuration .
    
    eq init = 
        < c : Reactor |
            inports : none,
            outports : 
                < c.out.out : Port | value : [0] >
                < c.out.out2 : Port | value : [0] >,
            state : 
                ( c.sv.fault |-> [0] ),
            timers : none,
            actions : 
                < c.la.turnOff : LogicalAction | minDelay : 1000000, minSpacing : 0, policy : defer, payload : [0] >
                < startup : LogicalAction | minDelay : 0, minSpacing : 0, policy : defer, payload : [0] >,
            reactions : 
                (reaction when (startup) --> (c.out.out ; c.out.out2 ; c.la.turnOff) do {
                    (c.sv.fault := [1]) ;
                    if ((c.sv.fault === [1])) then (schedule(c.la.turnOff, [0], [0]) ;
                    (c.out.out <- [5]) ;
                    (c.out.out2 <- [10])) fi
                })
                (reaction when (c.la.turnOff) do {
                    if ((c.la.turnOff === [1])) then ((c.sv.fault := [0])) fi
                })
        >
    .
endom

omod TEST-ALARM is
    including ALARM .
    including DYNAMICS-WITHOUT-TICK .

    ops env queue rxns : -> Oid [ctor] .

    op initSystem : -> GlobalSystem .
    eq initSystem =
        { < env : Environment |
            physicalActions : none
             > 
            addReactionIndices(init)
            < queue : EventQueue | queue : 
            addStartup(startup, init, empty) >
            < rxns : Invoked | reactions : none >} .
endom

omod ANALYSIS-ALARM is
    including TEST-ALARM .
    including LF-PROP-EXT .
    including SEARCH-GOAL .
endom

omod MODELCHECKER-ALARM is
    including TEST-ALARM .
    including LF-OUTPUT-COUNTEREXAMPLE .
    including LF-PROP-EXT .
    including MODEL-CHECKER .
endom

omod SIMULATION-ALARM is
    including TEST-ALARM .
    including TIMED-SIMULATION-DYNAMICS .
endom

red in MODELCHECKER-ALARM : modelCheck(initSystem timeBound 2000000 , ([] (((c . 1) invoked ) -> <> ((c . 2) invoked ))) ) .

quit
