mirror of
https://github.com/Z3Prover/z3
synced 2026-05-16 15:15:35 +00:00
Refine digit-check helper naming in TPTP frontend
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/f2be81f6-e506-47ea-a38a-46d1970add8c Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
72dae76464
commit
e0c13aee15
1 changed files with 3 additions and 3 deletions
|
|
@ -331,7 +331,7 @@ class tptp_parser {
|
|||
return s->get_name() == symbol("$tType");
|
||||
}
|
||||
|
||||
static bool is_unsigned_integer(std::string const& s) {
|
||||
static bool contains_only_digits(std::string const& s) {
|
||||
if (s.empty()) return false;
|
||||
for (char c : s) {
|
||||
if (!std::isdigit(static_cast<unsigned char>(c)))
|
||||
|
|
@ -469,11 +469,11 @@ class tptp_parser {
|
|||
if (n == "$true") return expr_ref(m.mk_true(), m);
|
||||
if (n == "$false") return expr_ref(m.mk_false(), m);
|
||||
|
||||
if (is_unsigned_integer(n)) {
|
||||
if (contains_only_digits(n)) {
|
||||
rational num(n.c_str());
|
||||
if (accept(token_kind::slash_tok)) {
|
||||
std::string d = parse_name();
|
||||
if (!is_unsigned_integer(d))
|
||||
if (!contains_only_digits(d))
|
||||
throw parse_error("denominator of rational literal must be a sequence of digits");
|
||||
rational den(d.c_str());
|
||||
if (den.is_zero())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue