Last active
October 14, 2022 00:18
-
-
Save Blaisorblade/e3d87c91923d7f6c9065c84764b143c6 to your computer and use it in GitHub Desktop.
SIGINT as Prolog cut
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
(* | |
* Copyright (C) BedRock Systems Inc. 2020-22 | |
* | |
* This software is distributed under the terms of the BedRock Open-Source License. | |
* See the LICENSE-BedRock file in the repository root for details. | |
*) | |
Require Export stdpp.fin_sets. | |
Require Export iris.prelude.prelude. | |
(** * Small extensions to [stdpp.fin_sets]. *) | |
Section finset. | |
#[local] Set Default Proof Using "Type*". | |
Context `{FinSet A C}. | |
Implicit Types X Y : C. | |
#[global] Instance list_to_set_elements_cancel : | |
Cancel (≡@{C}) list_to_set elements | 100 := list_to_set_elements. | |
#[global] Instance elements_inj : Inj equiv eq (elements (C := C)) | 100. | |
Proof. apply: (cancel_inj (f := list_to_set)). Qed. | |
Lemma elements_set_equiv_1 (x y : C) : | |
elements x = elements y -> x ≡ y. | |
Proof. | |
apply: (inj elements). (* Press Ctrl-C here to help the proof succeed. *) | |
Succeed Qed. Restart. Proof. | |
Timeout 1 apply: (inj elements). (* Automating Ctrl-C *) | |
Succeed Qed. Restart. Proof. | |
(* A few alternatives that work immediately *) | |
move: x y. apply: (inj elements). | |
Succeed Qed. Restart. Proof. | |
apply (inj elements). | |
Succeed Qed. Restart. Proof. | |
apply: (inj (elements (C := C))). | |
(* [elements] projects from an arbitrary [Elements] instance, so it can | |
unify against too many choices causing diverges; OTOH fixing [C] fixes the | |
instance to consider. *) | |
Qed. | |
End finset. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested on both Coq 8.15 and on the 8.16 platform: