File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -1362,6 +1362,34 @@ void smt2_convt::convert_expr(const exprt &expr)
13621362 }
13631363 out << " )" ;
13641364 }
1365+ else if (expr.id () == ID_nand || expr.id () == ID_nor)
1366+ {
1367+ DATA_INVARIANT (
1368+ expr.is_boolean (),
1369+ " logical nand, nor expressions should have Boolean type" );
1370+ DATA_INVARIANT (
1371+ expr.operands ().size () >= 1 ,
1372+ " logical nand, nor expressions should have at least one operand" );
1373+
1374+ // SMT-LIB doesn't have nand, nor
1375+ out << " (not " ;
1376+ if (expr.operands ().size () == 1 )
1377+ convert_expr (to_multi_ary_expr (expr).op0 ());
1378+ else
1379+ {
1380+ if (expr.id () == ID_nand)
1381+ out << " (and" ;
1382+ else
1383+ out << " (or" ;
1384+ for (const auto &op : expr.operands ())
1385+ {
1386+ out << " " ;
1387+ convert_expr (op);
1388+ }
1389+ out << ' )' ; // or, and
1390+ }
1391+ out << ' )' ; // not
1392+ }
13651393 else if (expr.id ()==ID_implies)
13661394 {
13671395 const implies_exprt &implies_expr = to_implies_expr (expr);
You can’t perform that action at this time.
0 commit comments