File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -1839,21 +1839,19 @@ void smv_typecheckt::typecheck_assignment(exprt &expr)
18391839
18401840 if (rhs.type ().id () == ID_smv_set && rhs.id () == ID_smv_set)
18411841 {
1842- // sets can be assigned to scalars, which yields a nondeterministic
1843- // choice
1844- std::string identifier =
1845- module_identifier + " ::var::" + std::to_string (nondet_count++);
1846-
1847- rhs.set (ID_identifier, identifier);
1848- rhs.set (" #smv_nondet_choice" , true );
1842+ // Sets can be assigned to scalars, which yields a nondeterministic
1843+ // choice. First check the set elements.
1844+ for (auto &op : rhs.operands ())
1845+ convert_expr_to (op, lhs.type ());
18491846
1850- rhs.id (ID_constraint_select_one);
1851- rhs.type () = lhs.type ();
1847+ // Now turn the nondeterministic choice into a top-level
1848+ // disjunctive constraint.
1849+ exprt::operandst disjuncts;
18521850
1853- // check the set elements
18541851 for (auto &op : rhs.operands ())
1855- convert_expr_to (op, lhs. type () );
1852+ disjuncts. push_back (equal_exprt{lhs, op} );
18561853
1854+ expr = disjunction (disjuncts);
18571855 return ;
18581856 }
18591857
You can’t perform that action at this time.
0 commit comments