Add some missing FP symbols to LFSC (#8629)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Mon, 18 Apr 2022 22:01:34 +0000 (17:01 -0500)
committerGitHub <noreply@github.com>
Mon, 18 Apr 2022 22:01:34 +0000 (22:01 +0000)
proofs/lfsc/signatures/theory_def.plf
src/proof/lfsc/lfsc_node_converter.cpp

index 361493537be0ddea01e7f11365ae1feb346631b3..eb2c34991486a45e16df387d5e39fa1bfab3e7bb 100644 (file)
 (define to_fp_ieee_bv (# x mpz (# y mpz (# z term (apply (f_to_fp_ieee_bv x y) z)))))
 (declare f_to_fp_bv (! i mpz (! j mpz term)))
 (define to_fp_bv (# x mpz (# y mpz (# z term (apply (f_to_fp_bv x y) z)))))
+(declare f_fp.to_ubv_total (! i mpz term))
+(define fp.to_ubv_total (# x mpz (# z term (# w term (# u term (apply (apply (apply (f_fp.to_ubv_total x) z) w) u))))))
+(declare f_fp.to_sbv_total (! i mpz term))
+(define fp.to_sbv_total (# x mpz (# z term (# w term (# u term (apply (apply (apply (f_fp.to_sbv_total x) z) w) u))))))
 ; rounding modes
 (declare roundNearestTiesToEven term)
 (declare roundNearestTiesToAway term)
index fcbf6cea04e7e3177ab67dad734408dd13c8205b..563e7809b168d582105d3e97a79286d4feea1694 100644 (file)
@@ -883,7 +883,9 @@ bool LfscNodeConverter::isIndexedOperatorKind(Kind k)
          || k == FLOATINGPOINT_TO_FP_FROM_FP
          || k == FLOATINGPOINT_TO_FP_FROM_IEEE_BV
          || k == FLOATINGPOINT_TO_FP_FROM_SBV
-         || k == FLOATINGPOINT_TO_FP_FROM_REAL || k == APPLY_UPDATER
+         || k == FLOATINGPOINT_TO_FP_FROM_REAL || k == FLOATINGPOINT_TO_SBV
+         || k == FLOATINGPOINT_TO_UBV || k == FLOATINGPOINT_TO_SBV_TOTAL
+         || k == FLOATINGPOINT_TO_UBV_TOTAL || k == APPLY_UPDATER
          || k == APPLY_TESTER;
 }
 
@@ -965,6 +967,32 @@ std::vector<Node> LfscNodeConverter::getOperatorIndices(Kind k, Node n)
       indices.push_back(nm->mkConstInt(fr.getSize().significandWidth()));
     }
     break;
+    case FLOATINGPOINT_TO_SBV:
+    {
+      const FloatingPointToSBV& fsbv = n.getConst<FloatingPointToSBV>();
+      indices.push_back(nm->mkConstInt(Rational(fsbv)));
+    }
+    break;
+    case FLOATINGPOINT_TO_UBV:
+    {
+      const FloatingPointToUBV& fubv = n.getConst<FloatingPointToUBV>();
+      indices.push_back(nm->mkConstInt(Rational(fubv)));
+    }
+    break;
+    case FLOATINGPOINT_TO_SBV_TOTAL:
+    {
+      const FloatingPointToSBVTotal& fsbv =
+          n.getConst<FloatingPointToSBVTotal>();
+      indices.push_back(nm->mkConstInt(Rational(fsbv)));
+    }
+    break;
+    case FLOATINGPOINT_TO_UBV_TOTAL:
+    {
+      const FloatingPointToUBVTotal& fubv =
+          n.getConst<FloatingPointToUBVTotal>();
+      indices.push_back(nm->mkConstInt(Rational(fubv)));
+    }
+    break;
     case APPLY_TESTER:
     {
       unsigned index = DType::indexOf(n);