﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4570	State-machines translation error	Andrea Bartolini	Bernhard Thiele	"Please consider the following state-machines basic-model:

{{{
model TwoStatesMachine1
  inner Integer i(start=0);

  block State1
    outer output Integer i;
  equation
    i = previous(i)+2;
  end State1;
  State1 state1;

  block State2
    outer output Integer i;
  equation
    i = previous(i)-1;
  end State2;
  State2 state2;

equation
    initialState(state1);
    transition(state1, state2, i>10, immediate=false, reset=true);
    transition(state2, state1, i<1, immediate=false, reset=true);

end TwoStatesMachine1;
}}}

Checking this model from OMEdit will produce the following error:
{{{
[1] 15:12:08 Translation Error
[StateMachines: 20:5-20:25]: Failed to elaborate expression: initialState(state1).

[2] 15:12:08 Translation Error
Error occurred while flattening model StateMachines.TwoStatesMachine1
}}}

if you comment-out the line ""initialState(state1);"" and retry to check the model, the following error is returned:

{{{
[1] 15:15:46 Translation Error
[StateMachines: 21:5-21:66]: Failed to elaborate expression: transition(state1, state2, i > 10, immediate = false, reset = true).

[2] 15:15:46 Translation Error
Error occurred while flattening model StateMachines.TwoStatesMachine1
}}}

Is there some flags or setting to be changed in order to activate the state-machines semantics in OMC?

OMEdit 1.13.0~dev-18-gf627d10
Connected to OpenModelica 1.13.0~dev-192-gd3b895d
SysOp: Linux Ubuntu 16.04 - 64 bit"	defect	closed	critical	1.12.0	*unknown*	v1.13.0-dev-nightly	fixed		Lennart Ochel Olena Rogovchenko berger@…
