]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/matita/nlibrary/hints_declaration.ma
non uniform coercions landed in hints_declaration.ma, setoids and sets library
[helm.git] / helm / software / matita / nlibrary / hints_declaration.ma
index 27330da468fb49b2c9bdcbc1a6161ae8f17ce29a..3df2db00194aa05d43e8073f1be6e4121dd5af3d 100644 (file)
@@ -69,11 +69,35 @@ interpretation "hint_decl_CProp1" 'hint_decl a b = (hint_declaration_CProp1 ? a
 interpretation "hint_decl_CProp0" 'hint_decl a b = (hint_declaration_CProp0 ? a b).
 interpretation "hint_decl_Type0"  'hint_decl a b = (hint_declaration_Type0 ? a b).
 
-(* little test
-naxiom A : Type[0].
-naxiom C : A → A → Type[0].
-ndefinition D ≝ C.               
-alias symbol "hint_decl" = "hint_decl_Type1".
-unification hint 0 ≔ 
-  X, R : A, Y ;  Z ≟ X, W ≟ Y ⊢ C X Y ≡ D Z W.
-*)  
+(* Non uniform coercions support *)
+nrecord lock2 (S : Type[2]) (s : S) : Type[3] ≝ {
+  force2 : Type[2];
+  lift2  : force2
+}.
+
+nrecord lock1 (S : Type[1]) (s : S) : Type[2] ≝ {
+  force1 : Type[1];
+  lift1  : force1
+}.
+
+ncoercion lift1 : ∀S:Type[1].∀s:S.∀l:lock1 S s. force1 S s l ≝ lift1 
+ on s : ? to force1 ???.
+
+ncoercion lift2 : ∀S:Type[2].∀s:S.∀l:lock2 S s. force2 S s l ≝ lift2
+ on s : ? to force2 ???.
+
+(* Example of a non uniform coercion declaration 
+   
+     Type[0]              setoid
+                >--->     
+     MR                   R  
+
+   provided MR = carr R
+
+unification hint 0 ≔ R : setoid;
+   MR ≟ carr R, 
+   lock ≟ mk_lock1 Type[0] MR setoid R 
+(* ---------------------------------------- *) ⊢ 
+   setoid ≡ force1 ? MR lock.
+
+*)
\ No newline at end of file