Skip to content

Commit a0500f6

Browse files
Use standard algorithm for finding an element
1 parent ba13c94 commit a0500f6

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/solvers/prop/prop_conv.cpp

+6-9
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Author: Daniel Kroening, [email protected]
77
\*******************************************************************/
88

99
#include "prop_conv.h"
10+
#include <algorithm>
1011

1112
/// determine whether a variable is in the final conflict
1213
bool prop_convt::is_in_conflict(literalt l) const
@@ -368,16 +369,12 @@ void prop_conv_solvert::set_to(const exprt &expr, bool value)
368369
{
369370
PRECONDITION(expr.type().id() == ID_bool);
370371

371-
bool boolean=true;
372+
const bool has_only_boolean_operands = std::all_of(
373+
expr.operands().begin(),
374+
expr.operands().end(),
375+
[](const exprt &expr) { return expr.type().id() == ID_bool; });
372376

373-
forall_operands(it, expr)
374-
if(it->type().id()!=ID_bool)
375-
{
376-
boolean=false;
377-
break;
378-
}
379-
380-
if(boolean)
377+
if(has_only_boolean_operands)
381378
{
382379
if(expr.id()==ID_not)
383380
{

0 commit comments

Comments
 (0)