Skip to content
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

Add NAME_ASSUMS_TAC and PRINT_GOAL_TAC, improve error messages of a few decision procedures #90

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

aqjune
Copy link
Contributor

@aqjune aqjune commented Feb 19, 2024

This patch adds two simple tactics and improves error messages of a few decision procedures.

The added tactics are PRINT_GOAL_TAC and NAME_ASSUMS_TAC. PRINT_GOAL_TAC simply prints the current goal. This is useful for debugging failures from a complicated tactic. NAME_ASSUMS_TAC labels all unnamed assumptions in the goal. This is useful when it is hard to pick an assumption using ASSUME or FIRST_ASSUM.

The improved error message now contains the goal term that the decision procedure tried to solve but failed. Updated conversions and tactics are WORD_ARITH, WORD_ARITH_TAC, WORD_BLAST, WORD_RULE, WORD_BITWISE_RULE, ARITH_RULE, ARITH_TAC, INT_ARITH, INT_ARITH_TAC, REAL_ARITH, REAL_ARITH_TAC and TAUT.

> ARITH_RULE `1 = 0`;;
Exception: Failure "ARITH_RULE `1 = 0`: linear_ineqs: no contradiction".

> prove(`1=2`, ARITH_TAC);;
Exception: Failure "ARITH_RULE `1 = 2`: linear_ineqs: no contradiction".

…ew decision procedures

This patch adds two simple tactics and improves error messages of a few decision procedures.

The added tactics are PRINT_GOAL_TAC and NAME_ASSUMS_TAC.
PRINT_GOAL_TAC simply prints the current goal. This is useful for debugging failures from a complicated tactic.
NAME_ASSUMS_TAC labels all unnamed assumptions in the goal. This is useful when it is hard to pick an assumption using ASSUME or FIRST_ASSUM.

The improved error message now contains the goal term that the decision procedure tried to solve but failed.
Updated conversions and tactics are WORD_ARITH, WORD_ARITH_TAC, WORD_BLAST, WORD_RULE, WORD_BITWISE_RULE, ARITH_RULE, ARITH_TAC, INT_ARITH, INT_ARITH_TAC, REAL_ARITH, REAL_ARITH_TAC and TAUT.

```
> ARITH_RULE `1 = 0`;;
Exception: Failure "ARITH_RULE `1 = 0`: linear_ineqs: no contradiction".

> prove(`1=2`, ARITH_TAC);;
Exception: Failure "ARITH_RULE `1 = 2`: linear_ineqs: no contradiction".
```
@jrh13
Copy link
Owner

jrh13 commented Feb 22, 2024

These all look like good improvements to usability.
Thanks for also fixing up the appropriate .hlp files!

@jrh13 jrh13 merged commit ec54c6b into jrh13:master Feb 22, 2024
2 checks passed
@aqjune aqjune deleted the errmsg branch March 1, 2024 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants