Skip to content

Commit

Permalink
Merge pull request #35 from SkySkimmer/intuit-auto
Browse files Browse the repository at this point in the history
Stop using auto with * in intuition
  • Loading branch information
samuelgruetter committed Jul 5, 2023
2 parents cb9e8bf + a08754a commit a5f3efe
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Kami/InlineFacts.v
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Require Import (hints) btauto.Algebra.
Set Implicit Arguments.
Set Asymmetric Patterns.

Local Ltac Tauto.intuition_solver ::= auto with datatypes exfalso.

Lemma inlineDm_SemAction_intact:
forall {retK} or a nr calls (retV: type retK),
SemAction or a nr calls retV ->
Expand Down
5 changes: 4 additions & 1 deletion Kami/Lib/FMap.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Require Import Equalities Eqdep_dec FMapInterface.

Require Import Lib.CommonTactics Lib.StringAsOT Lib.StringEq Lib.Struct.

Local Ltac Tauto.intuition_solver ::= auto with datatypes.


Set Implicit Arguments.
Set Asymmetric Patterns.

Expand Down Expand Up @@ -2754,7 +2757,7 @@ Section MakeMap.
Proof.
induction m; simpl; intros; [apply M.KeysSubset_empty|].
destruct a as [an [atype av]]; simpl.
apply M.KeysSubset_add; intuition.
apply M.KeysSubset_add; intuition auto with MapDefs datatypes.
Qed.

Lemma makeMap_union:
Expand Down
6 changes: 3 additions & 3 deletions Kami/Lib/NatLib.v
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Section strong.
Hypothesis PH : forall n, (forall m, m < n -> P m) -> P n.

Lemma strong' : forall n m, m <= n -> P m.
induction n; simpl; intuition; apply PH; intuition.
induction n; simpl; intuition auto with zarith; apply PH; intuition.
exfalso; lia.
Qed.

Expand Down Expand Up @@ -92,7 +92,7 @@ Theorem drop_mod2 : forall n k,

do 2 (destruct n; simpl in *; repeat rewrite untimes2 in *; intuition).

destruct k; simpl in *; intuition.
destruct k; simpl in *; intuition lia.

destruct k; simpl; intuition.
rewrite <- plus_n_Sm.
Expand Down Expand Up @@ -380,7 +380,7 @@ Qed.
Theorem Npow2_nat : forall n, nat_of_N (Npow2 n) = pow2 n.
induction n as [|n IHn]; simpl; intuition.
rewrite <- IHn; clear IHn.
case_eq (Npow2 n); intuition.
case_eq (Npow2 n); intuition lia.
Qed.

Theorem pow2_N : forall n, Npow2 n = N.of_nat (pow2 n).
Expand Down
8 changes: 4 additions & 4 deletions Kami/Lib/Word.v
Original file line number Diff line number Diff line change
Expand Up @@ -484,15 +484,15 @@ Theorem natToWord_wordToNat : forall sz w, natToWord sz (wordToNat w) = w.
Qed.

Theorem roundTrip_0 : forall sz, wordToNat (natToWord sz 0) = 0.
induction sz; simpl; intuition.
induction sz; simpl; intuition lia.
Qed.

#[global] Hint Rewrite roundTrip_0 : wordToNat.

Lemma wordToNat_natToWord' : forall sz w, exists k, wordToNat (natToWord sz w) + k * pow2 sz = w.
induction sz as [|sz IHsz]; simpl; intro w; intuition; repeat rewrite untimes2.

exists w; intuition.
exists w; intuition lia.

case_eq (mod2 w); intro Hmw.

Expand Down Expand Up @@ -526,7 +526,7 @@ Qed.
Theorem wordToNat_natToWord:
forall sz w, exists k, wordToNat (natToWord sz w) = w - k * pow2 sz /\ (k * pow2 sz <= w)%nat.
Proof.
intros sz w; destruct (wordToNat_natToWord' sz w) as [k]; exists k; intuition.
intros sz w; destruct (wordToNat_natToWord' sz w) as [k]; exists k; intuition lia.
Qed.

Lemma wordToNat_natToWord_2: forall sz w : nat,
Expand Down Expand Up @@ -5087,7 +5087,7 @@ Qed.

Lemma ZToWord_plus: forall sz a b, ZToWord sz (a + b) = ZToWord sz a ^+ ZToWord sz b.
Proof.
destruct sz as [|sz]; intros n m; intuition.
destruct sz as [|sz]; intros n m; intuition auto with worder.
rewrite wplus_wplusZ.
unfold wplusZ, wordBinZ.
destruct (wordToZ_ZToWord' (S sz) n) as [k1 D1].
Expand Down
3 changes: 3 additions & 0 deletions Kami/PartialInlineFacts.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Require Import Program.Equality FunctionalExtensionality.

Import ListNotations.

Local Ltac Tauto.intuition_solver ::= auto with datatypes exfalso bool zarith.


Set Implicit Arguments.
Set Asymmetric Patterns.

Expand Down
2 changes: 2 additions & 0 deletions Kami/RefinementFacts.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Import ListNotations.
Set Implicit Arguments.
Set Asymmetric Patterns.

Local Ltac Tauto.intuition_solver ::= auto with exfalso zarith.

Section LabelMapComposition.
Definition compLabelMaps (p q: M.key -> sigT SignT -> option (sigT SignT)) :=
fun s v =>
Expand Down
4 changes: 3 additions & 1 deletion Kami/Renaming.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Require Import Lib.CommonTactics.
Set Implicit Arguments.
Set Asymmetric Patterns.

Local Ltac Tauto.intuition_solver ::= auto with datatypes.

Lemma prepend1To1: forall c s1 s2: string, (c ++ s1)%string = (c ++ s2)%string -> s1 = s2.
Proof.
induction c; simpl in *; intros.
Expand Down Expand Up @@ -218,7 +220,7 @@ Section Rename.
rewrite M.find_add_1; intuition.
unfold Morphisms.Proper, Morphisms.respectful; intros.
rewrite H, H1, H2.
intuition.
intuition auto with MapDefs.
unfold M.F.P.transpose_neqkey, M.Map.Equal; intros.
f_equal.
M.cmp (rename k0) (rename k').
Expand Down
6 changes: 4 additions & 2 deletions Kami/SemFacts.v
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Require Import Kami.Syntax Kami.Semantics Kami.Wf.
Set Implicit Arguments.
Set Asymmetric Patterns.

Local Ltac Tauto.intuition_solver ::= auto with exfalso datatypes.

Ltac specializeAll k :=
repeat
match goal with
Expand Down Expand Up @@ -99,11 +101,11 @@ Section LiftToMap.
+ intuition.
+ clear; unfold Morphisms.Proper, Morphisms.respectful; intros; subst.
apply M.leibniz in H1; subst.
intuition.
intuition auto with MapDefs.
+ clear; unfold M.F.P.transpose_neqkey; intros.
unfold rmModify.
destruct (p k e), (p k' e');
try apply M.transpose_neqkey_Equal_add; intuition.
try apply M.transpose_neqkey_Equal_add; intuition auto with MapDefs.
+ intuition.
Qed.

Expand Down
2 changes: 2 additions & 0 deletions Kami/Specialize.v
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Require Import Compare_dec.
Set Implicit Arguments.
Set Asymmetric Patterns.

Local Ltac Tauto.intuition_solver ::= auto with exfalso bool zarith.

Section SpecializeModule.
Variable m: Modules.
Variable i: nat.
Expand Down
2 changes: 2 additions & 0 deletions Kami/Wf.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Require Import FunctionalExtensionality Program.Equality Eqdep Eqdep_dec.
Set Implicit Arguments.
Set Asymmetric Patterns.

Local Ltac Tauto.intuition_solver ::= auto with datatypes.

(* PHOAS equivalence *)
Section Equiv.
Variable t1 t2: Kind -> Type.
Expand Down

0 comments on commit a5f3efe

Please sign in to comment.