Skip to content

Conversation

kroening
Copy link
Collaborator

@kroening kroening commented May 1, 2024

The generation of netlists from transition system now uses the state constraint facility of the netlist data structure for state constraints, as opposed to adding everything as a transition constraint.

This fixes cases where analyzers over-approximate the model semantics.

@kroening kroening force-pushed the trans-to-netlist-invar branch 3 times, most recently from be7194d to 0e030eb Compare May 1, 2024 13:39
@kroening kroening marked this pull request as ready for review May 1, 2024 13:49
Comment on lines 149 to 168
Function: has_next_symbol
Inputs:
Outputs:
Purpose:
\*******************************************************************/

static bool has_next_symbol(const exprt &expr)
{
auto begin = expr.depth_cbegin(), end = expr.depth_cend();
return std::find_if(begin, end, [](const exprt &expr) {
return expr.id() == ID_next_symbol;
}) != end;
}

/*******************************************************************\
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use has_subexpr(expr, ID_next_symbol) from expr_utils.{h,cpp} (which does exactly the above).

instantiate_convert(prop, dest.var_map, *it, ns, get_message_handler());
transition_constraints.push_back(l);

if(has_next_symbol(*it))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above: change this to if(has_subexpr(*it, ID_next_symbol)).

The generation of netlists from transition system now uses the state
constraint facility of the netlist data structure for state constraints, as
opposed to adding everything as a transition constraint.

This fixes cases where analyzers over-approximate the model semantics.
@kroening kroening force-pushed the trans-to-netlist-invar branch from 0e030eb to 1352e26 Compare May 2, 2024 10:33
@kroening kroening merged commit 24262e8 into main May 2, 2024
@kroening kroening deleted the trans-to-netlist-invar branch May 2, 2024 10:39
Romy15200 pushed a commit to Romy15200/nws that referenced this pull request Aug 19, 2025
state invariants are now converted into AIG state constraints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants