File tree 1 file changed +28
-0
lines changed 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)
1362
1362
}
1363
1363
out << " )" ;
1364
1364
}
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 operands" );
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
+ }
1365
1393
else if (expr.id ()==ID_implies)
1366
1394
{
1367
1395
const implies_exprt &implies_expr = to_implies_expr (expr);
You can’t perform that action at this time.
0 commit comments