]> matita.cs.unibo.it Git - helm.git/commitdiff
- lambda_delta: context-free weak head normal forms continued ...
authorFerruccio Guidi <ferruccio.guidi@unibo.it>
Wed, 16 Nov 2011 23:40:42 +0000 (23:40 +0000)
committerFerruccio Guidi <ferruccio.guidi@unibo.it>
Wed, 16 Nov 2011 23:40:42 +0000 (23:40 +0000)
-               delift started ...
- nnAuto: we removed an optimization that breaks lambda_delta

matita/components/ng_tactics/nnAuto.ml
matita/matita/contribs/lambda_delta/Basic_2/grammar/thom.ma
matita/matita/contribs/lambda_delta/Basic_2/reducibility/twhnf.ma
matita/matita/contribs/lambda_delta/Basic_2/substitution/tps.ma
matita/matita/contribs/lambda_delta/Basic_2/unfold/delift.ma [new file with mode: 0644]
matita/matita/contribs/lambda_delta/Basic_2/unfold/tsubst.ma [deleted file]
matita/matita/contribs/lambda_delta/Ground_2/xoa.conf.xml
matita/matita/contribs/lambda_delta/Ground_2/xoa.ma
matita/matita/contribs/lambda_delta/Ground_2/xoa_notation.ma

index 320f4f630c07c5787be6e7211ebcbd7132b56c1a..572cd4e28932d25c1bf1ed119ade0c8a4fd95bb5 100644 (file)
@@ -973,6 +973,9 @@ let try_candidate ?(smart=0) flags depth status eq_cache ctx t =
         with Error _ -> 
           smart_apply_auto ("",0,t) eq_cache status 
     in
+(* FG: this optimization rules out some applications of
+ * lift_bind (from contribs/lambda_delta/Basic_2/substitution/lift.ma)
+ *
     (* we compare the expected branching with the actual one and
        prune the candidate when the latter is larger. The optimization
        is meant to rule out stange applications of flexible terms,
@@ -993,7 +996,7 @@ let try_candidate ?(smart=0) flags depth status eq_cache ctx t =
                    ^ (string_of_int res) ^ " vs. " ^ (string_of_int og_no)));
        debug_print ~depth (lazy "strange application"); None)
     else 
-      (incr candidate_no; Some ((!candidate_no,t),status))
+*)      (incr candidate_no; Some ((!candidate_no,t),status))
    with Error (msg,exn) -> debug_print ~depth (lazy "failed"); None
 ;;
 
index d796e10ba0ac3723c9268ee1fb4a24de641b16e3..4bb9748d2aa7f62c379c4cce0af57aabaaedc8dc 100644 (file)
@@ -49,6 +49,33 @@ lemma simple_thom_repl_sn: βˆ€T1,T2. T1 β‰ˆ T2 β†’ π•Š[T2] β†’ π•Š[T1].
 
 (* Basic inversion lemmas ***************************************************)
 
+fact thom_inv_bind1_aux: βˆ€T1,T2. T1 β‰ˆ T2 β†’ βˆ€I,W1,U1. T1 = π•“{I}W1.U1 β†’
+                         βˆƒβˆƒW2,U2. I = Abst & T2 = π•”{Abst} W2. U2.
+#T1 #T2 * -T1 T2
+[ #J #I #W1 #U1 #H destruct
+| #V1 #V2 #T1 #T2 #I #W1 #U1 #H destruct -V1 T1 /2/
+| #V1 #V2 #T1 #T2 #H_ #_ #_ #I #W1 #U1 #H destruct
+]
+qed.
+
+lemma thom_inv_bind1: βˆ€I,W1,U1,T2. π•“{I}W1.U1 β‰ˆ T2 β†’
+                      βˆƒβˆƒW2,U2. I = Abst & T2 = π•”{Abst} W2. U2.
+/2 width=5/ qed-.
+
+fact thom_inv_flat1_aux: βˆ€T1,T2. T1 β‰ˆ T2 β†’ βˆ€I,W1,U1. T1 = π•—{I}W1.U1 β†’
+                         βˆƒβˆƒW2,U2. U1 β‰ˆ U2 & π•Š[U1] & π•Š[U2] &
+                                  I = Appl & T2 = π•”{Appl} W2. U2.
+#T1 #T2 * -T1 T2
+[ #J #I #W1 #U1 #H destruct
+| #V1 #V2 #T1 #T2 #I #W1 #U1 #H destruct
+| #V1 #V2 #T1 #T2 #HT12 #HT1 #HT2 #I #W1 #U1 #H destruct -V1 T1 /2 width=5/
+]
+qed.
+
+lemma thom_inv_flat1: βˆ€I,W1,U1,T2. π•—{I}W1.U1 β‰ˆ T2 β†’
+                      βˆƒβˆƒW2,U2. U1 β‰ˆ U2 & π•Š[U1] & π•Š[U2] &
+                               I = Appl & T2 = π•”{Appl} W2. U2.
+/2/ qed-.
 
 (* Basic_1: removed theorems 7:
             iso_gen_sort iso_gen_lref iso_gen_head iso_refl iso_trans
index c96bf4762f1316c07a6e1b80b8ec54b826c4e100..dea7077b494eafd17e09fc2798bd20e964b3e066 100644 (file)
@@ -1,12 +1,57 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+include "Basic_2/grammar/thom.ma".
 include "Basic_2/reducibility/tpr.ma".
 
 (* CONTEXT-FREE WEAK HEAD NORMAL TERMS **************************************)
 
 definition twhnf: term β†’ Prop β‰
-   NF β€¦ tpr (thom β€¦).
+   NF β€¦ tpr thom.
 
 interpretation
    "context-free weak head normality (term)"
    'WHdNormal T = (twhnf T).
 
+(* Basic inversion lemmas ***************************************************)
+
+lemma twhnf_inv_thom: βˆ€T. π•Žβ„β„•[T] β†’ T β‰ˆ T.
+normalize /2 depth=1/
+qed-.
+
 (* Basic properties *********************************************************)
+
+lemma tpr_thom: βˆ€T1,T2. T1 β‡’ T2 β†’ T1 β‰ˆ T1 β†’ T1 β‰ˆ T2.
+#T1 #T2 #H elim H -T1 T2 //
+[ #I #V1 #V2 #T1 #T2 #_ #_ #_ #IHT12 #H
+  elim (thom_inv_flat1 β€¦ H) -H #W2 #U2 #HT1U2 #HT1 #_ #H1 #H2 destruct -I T1 V1;
+  lapply (IHT12 HT1U2) -IHT12 HT1U2 #HUT2
+  lapply (simple_thom_repl_dx β€¦ HUT2 HT1) /2 width=1/
+| #V1 #V2 #W #T1 #T2 #_ #_ #_ #_ #H
+  elim (thom_inv_flat1 β€¦ H) -H #W2 #U2 #_ #H
+  elim (simple_inv_bind β€¦ H)
+| #I #V1 #V2 #T1 #T #T2 #_ #_ #_ #_ #_ #H
+  elim (thom_inv_bind1 β€¦ H) -H #W2 #U2 #H destruct -I //
+| #V2 #V1 #V #W1 #W2 #T1 #T2 #_ #_ #_ #_ #_ #_ #_ #H
+  elim (thom_inv_flat1 β€¦ H) -H #U1 #U2 #_ #H
+  elim (simple_inv_bind β€¦ H)
+| #V #T #T1 #T2 #_ #_ #_ #H
+  elim (thom_inv_bind1 β€¦ H) -H #W2 #U2 #H destruct
+| #V #T1 #T2 #_ #_ #H
+  elim (thom_inv_flat1 β€¦ H) -H #W2 #U2 #_ #_ #_ #H destruct
+]
+qed.
+
+lemma twhnf_thom: βˆ€T. T β‰ˆ T β†’ π•Žβ„β„•[T].
+/2/ qed.
index 744c00b81cf4a291b5ed802763da7107e6a81213..9f10dcc2a830c15c52919356a71a311a78452dff 100644 (file)
@@ -220,11 +220,7 @@ lemma tps_inv_refl_O2: βˆ€L,T1,T2,d. L βŠ’ T1 [d, 0] β‰« T2 β†’ T1 = T2.
 
 lemma tps_fwd_tw: βˆ€L,T1,T2,d,e. L βŠ’ T1 [d, e] β‰« T2 β†’ #[T1] β‰€ #[T2].
 #L #T1 #T2 #d #e #H elim H normalize -H L T1 T2 d e
-[ //
-| /2/
-| /3 by monotonic_le_plus_l, le_plus/ (**) (* just /3/ is too slow *)
-| /3 by monotonic_le_plus_l, le_plus/ (**) (* just /3/ is too slow *)
-] 
+/3 by monotonic_le_plus_l, le_plus/ (**) (* just /3/ is too slow *)
 qed-.
 
 (* Basic_1: removed theorems 25:
diff --git a/matita/matita/contribs/lambda_delta/Basic_2/unfold/delift.ma b/matita/matita/contribs/lambda_delta/Basic_2/unfold/delift.ma
new file mode 100644 (file)
index 0000000..5d19b65
--- /dev/null
@@ -0,0 +1,23 @@
+(**************************************************************************)
+(*       ___                                                              *)
+(*      ||M||                                                             *)
+(*      ||A||       A project by Andrea Asperti                           *)
+(*      ||T||                                                             *)
+(*      ||I||       Developers:                                           *)
+(*      ||T||         The HELM team.                                      *)
+(*      ||A||         http://helm.cs.unibo.it                             *)
+(*      \   /                                                             *)
+(*       \ /        This file is distributed under the terms of the       *)
+(*        v         GNU General Public License Version 2                  *)
+(*                                                                        *)
+(**************************************************************************)
+
+include "Basic_2/unfold/tpss.ma".
+
+(* DELIFT ON TERMS **********************************************************)
+
+definition delift: nat β†’ nat β†’ lenv β†’ relation term β‰
+                   Ξ»d,e,L,T1,T2. βˆƒβˆƒT. L βŠ’ T1 [d, e] β‰«* T & β†‘[d, e] T2 β‰‘ T.
+
+interpretation "delift (term)"
+   'TSubst L T1 d e T2 = (delift d e L T1 T2).
diff --git a/matita/matita/contribs/lambda_delta/Basic_2/unfold/tsubst.ma b/matita/matita/contribs/lambda_delta/Basic_2/unfold/tsubst.ma
deleted file mode 100644 (file)
index 7d31f3b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-(**************************************************************************)
-(*       ___                                                              *)
-(*      ||M||                                                             *)
-(*      ||A||       A project by Andrea Asperti                           *)
-(*      ||T||                                                             *)
-(*      ||I||       Developers:                                           *)
-(*      ||T||         The HELM team.                                      *)
-(*      ||A||         http://helm.cs.unibo.it                             *)
-(*      \   /                                                             *)
-(*       \ /        This file is distributed under the terms of the       *)
-(*        v         GNU General Public License Version 2                  *)
-(*                                                                        *)
-(**************************************************************************)
-
-include "Basic_2/unfold/tpss.ma".
-
-(* SUBSTITUTION ON TERMS ****************************************************)
-
-definition tsubst: nat β†’ nat β†’ lenv β†’ relation term β‰
-                   Ξ»d,e,L,T1,T2. βˆƒβˆƒT. L βŠ’ T1 [d, e] β‰«* T & β†‘[d, e] T2 β‰‘ T.
-
-interpretation "substitution (term)"
-   'TSubst L T1 d e T2 = (tsubst d e L T1 T2).
index ac5635c7c60b84b9209393c8161fa72ea2361ea6..5a4cf8c49def766bd5c14a892e3623aa1f2b950c 100644 (file)
@@ -22,6 +22,7 @@
     <key name="ex">4 2</key>
     <key name="ex">4 3</key>
     <key name="ex">4 4</key>
+    <key name="ex">5 2</key>
     <key name="ex">5 3</key>
     <key name="ex">5 4</key>
     <key name="ex">6 4</key>
index 2b75c902d50524eefadcd5f8647f6e14d8afc7bf..48593d76e7c636150c4b75dbcc779700c2cd56dd 100644 (file)
@@ -80,6 +80,14 @@ inductive ex4_4 (A0,A1,A2,A3:Type[0]) (P0,P1,P2,P3:A0β†’A1β†’A2β†’A3β†’Prop) : P
 
 interpretation "multiple existental quantifier (4, 4)" 'Ex P0 P1 P2 P3 = (ex4_4 ? ? ? ? P0 P1 P2 P3).
 
+(* multiple existental quantifier (5, 2) *)
+
+inductive ex5_2 (A0,A1:Type[0]) (P0,P1,P2,P3,P4:A0β†’A1β†’Prop) : Prop β‰
+   | ex5_2_intro: βˆ€x0,x1. P0 x0 x1 β†’ P1 x0 x1 β†’ P2 x0 x1 β†’ P3 x0 x1 β†’ P4 x0 x1 β†’ ex5_2 ? ? ? ? ? ? ?
+.
+
+interpretation "multiple existental quantifier (5, 2)" 'Ex P0 P1 P2 P3 P4 = (ex5_2 ? ? P0 P1 P2 P3 P4).
+
 (* multiple existental quantifier (5, 3) *)
 
 inductive ex5_3 (A0,A1,A2:Type[0]) (P0,P1,P2,P3,P4:A0β†’A1β†’A2β†’Prop) : Prop β‰
index 80f9762a67ea9fa77b2d2eb4dbbd6a0f959a61b4..20ab21e69124c1894ecf79cd16f67682e561afa3 100644 (file)
@@ -94,6 +94,16 @@ notation < "hvbox(βˆƒβˆƒ ident x0 , ident x1 , ident x2 , ident x3 break . term
  non associative with precedence 20
  for @{ 'Ex (Ξ»${ident x0}:$T0.Ξ»${ident x1}:$T1.Ξ»${ident x2}:$T2.Ξ»${ident x3}:$T3.$P0) (Ξ»${ident x0}:$T0.Ξ»${ident x1}:$T1.Ξ»${ident x2}:$T2.Ξ»${ident x3}:$T3.$P1) (Ξ»${ident x0}:$T0.Ξ»${ident x1}:$T1.Ξ»${ident x2}:$T2.Ξ»${ident x3}:$T3.$P2) (Ξ»${ident x0}:$T0.Ξ»${ident x1}:$T1.Ξ»${ident x2}:$T2.Ξ»${ident x3}:$T3.$P3) }.
 
+(* multiple existental quantifier (5, 2) *)
+
+notation > "hvbox(βˆƒβˆƒ ident x0 , ident x1 break . term 19 P0 break & term 19 P1 break & term 19 P2 break & term 19 P3 break & term 19 P4)"
+ non associative with precedence 20
+ for @{ 'Ex (Ξ»${ident x0}.Ξ»${ident x1}.$P0) (Ξ»${ident x0}.Ξ»${ident x1}.$P1) (Ξ»${ident x0}.Ξ»${ident x1}.$P2) (Ξ»${ident x0}.Ξ»${ident x1}.$P3) (Ξ»${ident x0}.Ξ»${ident x1}.$P4) }.
+
+notation < "hvbox(βˆƒβˆƒ ident x0 , ident x1 break . term 19 P0 break & term 19 P1 break & term 19 P2 break & term 19 P3 break & term 19 P4)"
+ non associative with precedence 20
+ for @{ 'Ex (Ξ»${ident x0}:$T0.Ξ»${ident x1}:$T1.$P0) (Ξ»${ident x0}:$T0.Ξ»${ident x1}:$T1.$P1) (Ξ»${ident x0}:$T0.Ξ»${ident x1}:$T1.$P2) (Ξ»${ident x0}:$T0.Ξ»${ident x1}:$T1.$P3) (Ξ»${ident x0}:$T0.Ξ»${ident x1}:$T1.$P4) }.
+
 (* multiple existental quantifier (5, 3) *)
 
 notation > "hvbox(βˆƒβˆƒ ident x0 , ident x1 , ident x2 break . term 19 P0 break & term 19 P1 break & term 19 P2 break & term 19 P3 break & term 19 P4)"