From: Enrico Tassi Date: Thu, 8 Jan 2009 18:12:28 +0000 (+0000) Subject: more composites to make all happy! X-Git-Tag: make_still_working~4266 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=3e51297756e2c2422db7e35ca03af7123ff2498d;p=helm.git more composites to make all happy! --- diff --git a/helm/software/components/cic_unification/cicRefine.mli b/helm/software/components/cic_unification/cicRefine.mli index 924020cbb..d17b1ac85 100644 --- a/helm/software/components/cic_unification/cicRefine.mli +++ b/helm/software/components/cic_unification/cicRefine.mli @@ -45,6 +45,7 @@ val typecheck : Cic.obj * Cic.metasenv * CicUniv.universe_graph val insert_coercions: bool ref (* initially true *) +val pack_coercions : bool ref val pack_coercion_obj: Cic.obj -> Cic.obj diff --git a/helm/software/components/library/librarySync.ml b/helm/software/components/library/librarySync.ml index 13596c84e..e6871b60e 100644 --- a/helm/software/components/library/librarySync.ml +++ b/helm/software/components/library/librarySync.ml @@ -331,7 +331,12 @@ let add_coercion ~add_composites refinement_toolkit uri arity saturations CoercDb.eq_carr t tgt_carr && if fst (CicReduction.are_convertible [] (CicUtil.term_of_uri u) bo CicUniv.oblivion_ugraph) - then true else + then + (HLog.warn + ("Skipping coercion " ^ UriManager.name_of_uri uri ^ " since " ^ + "it is a duplicate of " ^ UriManager.string_of_uri u); + true) + else (HLog.warn ("Coercions " ^ UriManager.string_of_uri u ^ " and " ^ UriManager.string_of_uri diff --git a/helm/software/components/tactics/closeCoercionGraph.ml b/helm/software/components/tactics/closeCoercionGraph.ml index 0041685ef..83d706542 100644 --- a/helm/software/components/tactics/closeCoercionGraph.ml +++ b/helm/software/components/tactics/closeCoercionGraph.ml @@ -281,9 +281,11 @@ let generate_composite' (c1,sat1,arity1) (c2,sat2,arity2) context metasenv univ= let c = mk_lambda_spine c (namer (names_c1 @ names_c2)) spine_len in debug_print (lazy ("COMPOSTA: " ^ CicPp.ppterm c)); let old_insert_coercions = !CicRefine.insert_coercions in + let old_pack_coercions = !CicRefine.pack_coercions in let c, metasenv, univ, saturationsres, cpos = try CicRefine.insert_coercions := false; + CicRefine.pack_coercions := false; let term, ty, metasenv, ugraph = CicRefine.type_of_aux' metasenv context c univ in @@ -334,14 +336,17 @@ let generate_composite' (c1,sat1,arity1) (c2,sat2,arity2) context metasenv univ= debug_print (lazy ("MENV: "^CicMetaSubst.ppmetasenv [] metasenv)); debug_print (lazy ("####################")); CicRefine.insert_coercions := old_insert_coercions; + CicRefine.pack_coercions := old_pack_coercions; term, metasenv, ugraph, saturationsres, cpos with | CicRefine.RefineFailure s | CicRefine.Uncertain s -> debug_print s; CicRefine.insert_coercions := old_insert_coercions; + CicRefine.pack_coercions := old_pack_coercions; raise UnableToCompose | exn -> CicRefine.insert_coercions := old_insert_coercions; + CicRefine.pack_coercions := old_pack_coercions; raise exn in c, metasenv, univ, saturationsres, arity2, cpos @@ -451,7 +456,7 @@ let close_coercion_graph src tgt uri saturations baseuri = (CicUtil.term_of_uri coer, saturations2, arity2) [] [] univ in - if (menv = []) then + if (menv <> []) then HLog.warn "MENV non empty after composing coercions"; let o,univ = build_obj t univ arityres in (o,saturationsres,arityres,cposres),univ diff --git a/helm/software/matita/contribs/formal_topology/overlap/categories.ma b/helm/software/matita/contribs/formal_topology/overlap/categories.ma index 0ac3b518b..d83fd0319 100644 --- a/helm/software/matita/contribs/formal_topology/overlap/categories.ma +++ b/helm/software/matita/contribs/formal_topology/overlap/categories.ma @@ -264,11 +264,6 @@ definition setoid_of_SET: objs1 SET → setoid. intros; apply o; qed. coercion setoid_of_SET. -definition setoid1_of_SET: SET → setoid1. - intro; whd in t; apply setoid1_of_setoid; apply t. -qed. -coercion setoid1_of_SET. - notation "hbox(a break ⇒ b)" right associative with precedence 20 for @{ 'Imply $a $b }. interpretation "unary morphism" 'Imply a b = (arrows1 SET a b). @@ -320,7 +315,7 @@ qed. coercion Type1_OF_SET1. definition Type_OF_setoid1_of_carr: ∀U. carr U → Type_OF_setoid1 ?(*(setoid1_of_SET U)*). - [ apply setoid1_of_SET; apply U + [ apply rule U; | intros; apply c;] qed. coercion Type_OF_setoid1_of_carr. diff --git a/helm/software/matita/contribs/formal_topology/overlap/o-algebra.ma b/helm/software/matita/contribs/formal_topology/overlap/o-algebra.ma index 10f503581..6f58f53b2 100644 --- a/helm/software/matita/contribs/formal_topology/overlap/o-algebra.ma +++ b/helm/software/matita/contribs/formal_topology/overlap/o-algebra.ma @@ -48,6 +48,9 @@ interpretation "unary morphism comprehension with proof" 'comprehension_by s \et interpretation "unary morphism1 comprehension with proof" 'comprehension_by s \eta.f p = (mk_unary_morphism1 s _ f p). +definition carr' ≝ λx:Type_OF_category1 SET.Type_OF_Type0 (carr x). +coercion carr'. (* we prefer the lower carrier projection *) + (* per il set-indexing vedere capitolo BPTools (foundational tools), Sect. 0.3.4 complete lattices, Definizione 0.9 *) (* USARE L'ESISTENZIALE DEBOLE *) @@ -56,8 +59,8 @@ record OAlgebra : Type2 := { oa_P :> SET1; oa_leq : binary_morphism1 oa_P oa_P CPROP; (* CPROP is setoid1, CPROP importante che sia small *) oa_overlap: binary_morphism1 oa_P oa_P CPROP; - oa_meet: ∀I:SET.unary_morphism2 (arrows2 SET1 I oa_P) oa_P; - oa_join: ∀I:SET.unary_morphism2 (arrows2 SET1 I oa_P) oa_P; + oa_meet: ∀I:SET.unary_morphism2 (I ⇒ oa_P) oa_P; + oa_join: ∀I:SET.unary_morphism2 (I ⇒ oa_P) oa_P; oa_one: oa_P; oa_zero: oa_P; oa_leq_refl: ∀a:oa_P. oa_leq a a; @@ -65,8 +68,8 @@ record OAlgebra : Type2 := { oa_leq_trans: ∀a,b,c:oa_P.oa_leq a b → oa_leq b c → oa_leq a c; oa_overlap_sym: ∀a,b:oa_P.oa_overlap a b → oa_overlap b a; (* Errore: = in oa_meet_inf e oa_join_sup *) - oa_meet_inf: ∀I.∀p_i.∀p:oa_P.oa_leq p (oa_meet I p_i) → ∀i:I.oa_leq p (p_i i); - oa_join_sup: ∀I.∀p_i.∀p:oa_P.oa_leq (oa_join I p_i) p → ∀i:I.oa_leq (p_i i) p; + oa_meet_inf: ∀I:SET.∀p_i:I ⇒ oa_P.∀p:oa_P.oa_leq p (oa_meet I p_i) = ∀i:I.oa_leq p (p_i i); + oa_join_sup: ∀I:SET.∀p_i:I ⇒ oa_P.∀p:oa_P.oa_leq (oa_join I p_i) p = ∀i:I.oa_leq (p_i i) p; oa_zero_bot: ∀p:oa_P.oa_leq oa_zero p; oa_one_top: ∀p:oa_P.oa_leq p oa_one; oa_overlap_preserves_meet_: @@ -74,8 +77,8 @@ record OAlgebra : Type2 := { (oa_meet ? { x ∈ BOOL | match x with [ true ⇒ p | false ⇒ q ] | IF_THEN_ELSE_p oa_P p q }); (* ⇔ deve essere =, l'esiste debole *) oa_join_split: - ∀I:SET.∀p.∀q:arrows2 SET1 I oa_P. - oa_overlap p (oa_join I q) ⇔ ∃i:carr I.oa_overlap p (q i); + ∀I:SET.∀p.∀q:I ⇒ oa_P. + oa_overlap p (oa_join I q) = ∃i:I.oa_overlap p (q i); (*oa_base : setoid; 1) enum non e' il nome giusto perche' non e' suriettiva 2) manca (vedere altro capitolo) la "suriettivita'" come immagine di insiemi di oa_base