forked from coq/coq
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filter to actually unsatisfied constraint in error message
Maybe we should be filtering when raising instead? Or instead of doing ~~~ if not @@ check_constraints csts then error_unsat_constraint csts ~~~ we should do ~~~ Constraints.iter (fun cst -> if not @@ check_constraint cst then error_unsat_constraint csts) csts ~~~ ? although then we would only mention the first unsatisfied constraint.
- Loading branch information
1 parent
5a3617b
commit 37f4eeb
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
File "./output/unsat_constraints.v", line 22, characters 2-15: | ||
The command has indeed failed with message: | ||
Unsatisfied constraints: v < w | ||
u <= w (maybe a bugged tactic). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Require Import Ltac2.Ltac2. | ||
|
||
Import Constr. | ||
Import Unsafe. | ||
|
||
Polymorphic Axiom foo@{u v w | u < v, u <= w, v < w} : Prop. | ||
|
||
Polymorphic Axiom bar@{u v w | } : Prop. | ||
|
||
Universes u v w. | ||
|
||
Constraint u < v. | ||
|
||
Lemma baz : Prop. | ||
Proof. | ||
(* easiest way to get unsatisfied constraints *) | ||
match kind 'bar@{u v w}, kind 'foo with | ||
| Constant _ u, Constant c _ => Std.exact_no_check (make (Constant c u)) | ||
| _ => Control.throw Assertion_failure | ||
end. | ||
(* should mention u <= w and v < w but not u < v *) | ||
Fail Defined. | ||
Abort. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters