@@ -394,6 +394,25 @@ exprt smt2_parsert::binary(irep_idt id, const exprt::operandst &op)
394
394
return binary_exprt (op[0 ], id, op[1 ], op[0 ].type ());
395
395
}
396
396
397
+ exprt smt2_parsert::function_application_ieee_float_eq (
398
+ const exprt::operandst &op)
399
+ {
400
+ if (op.size () != 2 )
401
+ throw error () << " FloatingPoint equality takes two operands" ;
402
+
403
+ if (op[0 ].type ().id () != ID_floatbv || op[1 ].type ().id () != ID_floatbv)
404
+ throw error () << " FloatingPoint equality takes FloatingPoint operands" ;
405
+
406
+ if (op[0 ].type () != op[1 ].type ())
407
+ {
408
+ throw error () << " FloatingPoint equality takes FloatingPoint operands with "
409
+ << " matching sort, but got " << smt2_format (op[0 ].type ())
410
+ << " vs " << smt2_format (op[1 ].type ());
411
+ }
412
+
413
+ return ieee_float_equal_exprt (op[0 ], op[1 ]);
414
+ }
415
+
397
416
exprt smt2_parsert::function_application_ieee_float_op (
398
417
const irep_idt &id,
399
418
const exprt::operandst &op)
@@ -745,6 +764,16 @@ exprt smt2_parsert::function_application()
745
764
746
765
return unary_predicate_exprt (ID_isinf, op[0 ]);
747
766
}
767
+ else if (id == " fp.isNormal" )
768
+ {
769
+ if (op.size () != 1 )
770
+ throw error (" fp.isNormal takes one operand" );
771
+
772
+ if (op[0 ].type ().id () != ID_floatbv)
773
+ throw error (" fp.isNormal takes FloatingPoint operand" );
774
+
775
+ return isnormal_exprt (op[0 ]);
776
+ }
748
777
else if (id == " fp" )
749
778
{
750
779
return function_application_fp (op);
@@ -754,6 +783,30 @@ exprt smt2_parsert::function_application()
754
783
{
755
784
return function_application_ieee_float_op (id, op);
756
785
}
786
+ else if (id == " fp.eq" )
787
+ {
788
+ return function_application_ieee_float_eq (op);
789
+ }
790
+ else if (id == " fp.leq" )
791
+ {
792
+ return binary_predicate (ID_le, op);
793
+ }
794
+ else if (id == " fp.lt" )
795
+ {
796
+ return binary_predicate (ID_lt, op);
797
+ }
798
+ else if (id == " fp.geq" )
799
+ {
800
+ return binary_predicate (ID_ge, op);
801
+ }
802
+ else if (id == " fp.gt" )
803
+ {
804
+ return binary_predicate (ID_gt, op);
805
+ }
806
+ else if (id == " fp.neg" )
807
+ {
808
+ return unary (ID_unary_minus, op);
809
+ }
757
810
else
758
811
{
759
812
// rummage through id_map
0 commit comments