mirror of
https://github.com/Z3Prover/z3
synced 2026-05-16 07:05:35 +00:00
This PR targets the main TFF frontend parsing failures: bare numeric
atoms were being treated as uninterpreted terms (`U`) in formula
position, decimal literals were not parsed, and `$uminus` was not
recognized as an arithmetic builtin. These issues caused widespread
parse/type failures in arithmetic-heavy TPTP inputs.
- **Numeric atom parsing in formulas (TFF)**
- Added a shared numeric-literal parser path for term/formula contexts.
- In atomic formulas, numeric LHS now parses as arithmetic numerals
before `=`/`!=` handling, avoiding `U` vs `Int/Real` mismatches.
- **Decimal literal support**
- Extended numeral parsing to accept `d.d` forms and construct `Real`
numerals.
- Keeps existing integer (`d`) and rational (`d/d`) behavior on the same
code path.
- **`$uminus` builtin support**
- Added explicit handling for `$uminus(<arg>)` in term parsing.
- Enforces arity 1 and arithmetic-argument checks; maps directly to
arithmetic unary minus.
- **Focused regression coverage**
- Added/updated TPTP unit cases for:
- bare integer inequality: `31 != 12`
- decimal arithmetic literal usage
- `$uminus` in arithmetic predicates
Example of now-supported inputs:
```tptp
tff(c1,conjecture, 31 != 12).
tff(c2,conjecture, ~ $less(-3.25,-8.69)).
tff(c3,conjecture, $less($uminus(2),0)).
```
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| extra_cmds | ||
| basic_cmds.cpp | ||
| basic_cmds.h | ||
| CMakeLists.txt | ||
| cmd_context.cpp | ||
| cmd_context.h | ||
| cmd_context_to_goal.cpp | ||
| cmd_context_to_goal.h | ||
| cmd_util.cpp | ||
| cmd_util.h | ||
| echo_tactic.cpp | ||
| echo_tactic.h | ||
| eval_cmd.cpp | ||
| eval_cmd.h | ||
| parametric_cmd.cpp | ||
| parametric_cmd.h | ||
| pdecl.cpp | ||
| pdecl.h | ||
| README | ||
| simplifier_cmds.cpp | ||
| simplifier_cmds.h | ||
| simplify_cmd.cpp | ||
| simplify_cmd.h | ||
| tactic_cmds.cpp | ||
| tactic_cmds.h | ||
| tactic_manager.cpp | ||
| tactic_manager.h | ||
| tptp_frontend.cpp | ||
| tptp_frontend.h | ||
Command context provides the infrastructure for executing commands in front-ends such as SMT-LIB 2.0. It is also provides the solver abstraction to plugin solvers in this kind of front-end.