Checkfun (H : For_all (fun x => C (f x))) => H : forall x, D (f x). Checkfun (H : For_all (fun x => C (f x))) x => H x : D (f x). Checkfun (H : For_all (fun x => C (f x))) => H : For_all (fun x => D (f x)).
End Q.
(* Combining class lookup and path lookup so that if a lookup fails, another
descent in the class can be found (see wish #1934) *)
Record Setoid : Type :=
{ car :> Type }.
Record Morphism (X Y:Setoid) : Type :=
{evalMorphism :> X -> Y}.
Definition ClaimB := forall (X Y:Setoid) (f: extSetoid X Y) (x:X), f x= f x.
(* Check that coercions are made visible only when modules are imported *)
Module A. Module B. Coercion b2n (b:bool) := if b then 0 else 1. End B.
Fail Check S true. End A. Import A.
Fail Check S true.
(* Tests after the inheritance condition constraint is relaxed *)
Inductive list (A : Type) : Type :=
nil : list A | cons : A -> list A -> list A. Inductive vect (A : Type) : nat -> Type :=
vnil : vect A 0 | vcons : forall n, A -> vect A n -> vect A (1+n). Fixpoint size A (l : list A) : nat := match l with nil _ => 0 | cons _ _ tl => 1+size _ tl end.
Section test_non_unif_but_complete. Fixpoint l2v A (l : list A) : vect A (size A l) := match l as l return vect A (size A l) with
| nil _ => vnil A
| cons _ x xs => vcons A (size A xs) x (l2v A xs) end.
Local Coercion l2v : list >-> vect. Check (fun l : list nat => (l : vect _ _)).
Class coercion (A B : Type) : Type := cast : A -> B. Instance atom : coercion T1 T2 := c12. Instance pair A B C D (c1 : coercion A B) (c2 : coercion C D) : coercion (A * C) (B * D) := fun x => (c1 (fst x), c2 (snd x)).
Fixpoint l2v2 {A B} {c : coercion A B} (l : list A) : (vect B (size A l)) := match l as l return vect B (size A l) with
| nil _ => vnil B
| cons _ x xs => vcons _ _ (c x) (l2v2 xs) end.
Local Coercion l2v2 : list >-> vect.
Check (fun l : list (T1 * T1) => (l : vect _ _)). Check (fun l : list (T1 * T1) => (l2v2 l : vect _ _)). End what_we_could_do.
End InitialTest.
(** Unit test for Prop as source class *)
Module TestPropAsSourceCoercion.
Parameter heap : Prop.
Parameter heap_empty : heap.
Definition hprop := heap -> Prop.
Coercion hpure (P:Prop) : hprop := fun h => h = heap_empty /\ P.
Lemma group1 : let y := G : @set_type unit in True. Abort.
End GroupProp.
End PhantType.
Messung V0.5
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.10Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.