Equation instantiate_equation(Equation innerEq, Name variable, Real index, VarSymbolTable &symbolTable) { VarSymbolTable v=symbolTable; VarInfo vinfo = VarInfo(TypePrefixes(1,parameter), "Integer", Option<Comment>(), Modification(ModEq(Expression(index)))); v.insert(variable,vinfo); if (is<Equality>(innerEq)) { Equality eqeq = boost::get<Equality>(innerEq); Expression l=eqeq.left(), r=eqeq.right(); //std::cout << "Left= " << l << " right " << r << std::endl; return Equality(Visit(Modelica::PartEvalExp(v),l),Visit(Modelica::PartEvalExp(v),r)); } else { ERROR("process_for_equations - instantiate_equation:\n" "Incorrect equation type or not supported yet.\n"); } return Equation(); }
static void add_trans(State& src, const State& dst, const Function& evt, std::size_t ovid) { Guard g({ Equality(src.observer().mk_var(ovid)) }); src.add_transition(std::make_unique<Transition>(evt, g, dst)); }
static void add_trans(State& src, const State& dst, const Function& evt) { Guard g({ Equality(OValue::Empty()) }); src.add_transition(std::make_unique<Transition>(evt, g, dst)); }
bool LessOrEqual(struct IntStruct ptr,struct IntStruct other_ptr) { return LessThan(ptr, other_ptr) || Equality(ptr, other_ptr); }
bool GreaterOrEqual(struct IntStruct ptr,struct IntStruct other_ptr) { return GreaterThan(ptr, other_ptr) || Equality(ptr, other_ptr); }
bool NotEqual(struct IntStruct ptr,struct IntStruct other_ptr) { return !Equality(ptr,other_ptr); }