Create a goal from a ``Lean.Expr`` and close it. Uses ``simp [Int.ofNat]`` to normalise the fully-elaborated Int literals before ``omega`` decides the linear arithmetic.
(lib, kernel, lean_expr)
| 240 | |
| 241 | |
| 242 | def _verify_expr(lib, kernel, lean_expr) -> bool: |
| 243 | """Create a goal from a ``Lean.Expr`` and close it. |
| 244 | |
| 245 | Uses ``simp [Int.ofNat]`` to normalise the fully-elaborated Int |
| 246 | literals before ``omega`` decides the linear arithmetic. |
| 247 | """ |
| 248 | try: |
| 249 | gs_handle = lib.effectful_goal_from_expr(lean_expr) |
| 250 | gs = GoalState(kernel, gs_handle) |
| 251 | result = gs.try_tactic("intros; simp [Int.ofNat] at *; omega") |
| 252 | return result.ok and result.state is not None and result.state.is_solved() |
| 253 | except Exception as exc: |
| 254 | print(f" [verify error: {exc}]") |
| 255 | return False |
no test coverage detected