Skip to content

SMT2 parser: add abbreviated versions of the rounding modes #8539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/solvers/smt2/smt2_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1088,25 +1088,49 @@
return from_integer(ieee_floatt::ROUND_TO_EVEN, unsignedbv_typet(32));
};

expressions["RNE"] = [] {
// we encode as 32-bit unsignedbv
return from_integer(ieee_floatt::ROUND_TO_EVEN, unsignedbv_typet(32));

Check warning on line 1093 in src/solvers/smt2/smt2_parser.cpp

View check run for this annotation

Codecov / codecov/patch

src/solvers/smt2/smt2_parser.cpp#L1092-L1093

Added lines #L1092 - L1093 were not covered by tests
};

Check warning on line 1095 in src/solvers/smt2/smt2_parser.cpp

View check run for this annotation

Codecov / codecov/patch

src/solvers/smt2/smt2_parser.cpp#L1095

Added line #L1095 was not covered by tests
expressions["roundNearestTiesToAway"] = [this]() -> exprt {
throw error("unsupported rounding mode");
};

expressions["RNA"] = [this]() -> exprt {
throw error("unsupported rounding mode");

Check warning on line 1101 in src/solvers/smt2/smt2_parser.cpp

View check run for this annotation

Codecov / codecov/patch

src/solvers/smt2/smt2_parser.cpp#L1100-L1101

Added lines #L1100 - L1101 were not covered by tests
};

Check warning on line 1103 in src/solvers/smt2/smt2_parser.cpp

View check run for this annotation

Codecov / codecov/patch

src/solvers/smt2/smt2_parser.cpp#L1103

Added line #L1103 was not covered by tests
expressions["roundTowardPositive"] = [] {
// we encode as 32-bit unsignedbv
return from_integer(ieee_floatt::ROUND_TO_PLUS_INF, unsignedbv_typet(32));
};

expressions["RTP"] = [] {
// we encode as 32-bit unsignedbv
return from_integer(ieee_floatt::ROUND_TO_PLUS_INF, unsignedbv_typet(32));

Check warning on line 1111 in src/solvers/smt2/smt2_parser.cpp

View check run for this annotation

Codecov / codecov/patch

src/solvers/smt2/smt2_parser.cpp#L1110-L1111

Added lines #L1110 - L1111 were not covered by tests
};

Check warning on line 1113 in src/solvers/smt2/smt2_parser.cpp

View check run for this annotation

Codecov / codecov/patch

src/solvers/smt2/smt2_parser.cpp#L1113

Added line #L1113 was not covered by tests
expressions["roundTowardNegative"] = [] {
// we encode as 32-bit unsignedbv
return from_integer(ieee_floatt::ROUND_TO_MINUS_INF, unsignedbv_typet(32));
};

expressions["RTN"] = [] {
// we encode as 32-bit unsignedbv
return from_integer(ieee_floatt::ROUND_TO_MINUS_INF, unsignedbv_typet(32));

Check warning on line 1121 in src/solvers/smt2/smt2_parser.cpp

View check run for this annotation

Codecov / codecov/patch

src/solvers/smt2/smt2_parser.cpp#L1120-L1121

Added lines #L1120 - L1121 were not covered by tests
};

expressions["roundTowardZero"] = [] {
// we encode as 32-bit unsignedbv
return from_integer(ieee_floatt::ROUND_TO_ZERO, unsignedbv_typet(32));
};

expressions["RTZ"] = [] {
// we encode as 32-bit unsignedbv
return from_integer(ieee_floatt::ROUND_TO_ZERO, unsignedbv_typet(32));

Check warning on line 1131 in src/solvers/smt2/smt2_parser.cpp

View check run for this annotation

Codecov / codecov/patch

src/solvers/smt2/smt2_parser.cpp#L1130-L1131

Added lines #L1130 - L1131 were not covered by tests
};

Check warning on line 1133 in src/solvers/smt2/smt2_parser.cpp

View check run for this annotation

Codecov / codecov/patch

src/solvers/smt2/smt2_parser.cpp#L1133

Added line #L1133 was not covered by tests
expressions["lambda"] = [this] { return lambda_expression(); };
expressions["let"] = [this] { return let_expression(); };
expressions["exists"] = [this] { return quantifier_expression(ID_exists); };
Expand Down
Loading