Inductive ExtractTest (A:Type) (F:nat->Type) (I:Inner): Inner -> Inner -> unit -> Type :=
| extract_f_x_from_index : forall (x:nat) (f:nat->Type) (t:f x),
ExtractTest A F I (innerI_inner (innerI_nat x)) (innerI_fun f) tt
| extract_F_from_param_x_from_index : forall (x:nat) (f:nat->Type) (t:F x),
ExtractTest A F I (innerI_inner (innerI_nat x)) innerI_extra tt
| extract_fail : forall (x y: nat) (f : nat -> Type) (t : f x),
ExtractTest A F I (innerI_nat y) (innerI_fun f) tt
| extract_fx_from_index : forall (x:nat) (f:nat->Type) (t:f x),
ExtractTest A F I (innerI_Type (f x)) innerI_extra tt
| extract_t_match : forall (b:bool) (t:if b then unit else nat),
ExtractTest A F I (innerI_Type (if b then unit else nat)) innerI_extra tt
.
(* This still dosn't work, because the fields type isn't composeable from extracteable parts of its inductive type.*) Lemma test_extract_fail A F x y f t1 t2 : extract_fail A F innerI_extra x y f t1 = extract_fail A F innerI_extra x y f t2 -> t1 = t2. Proof.
Fail congruence. Abort.
(* I think this should also work when the whole match statement is part of the inductive type, but something with universes is wrong because A is Type but if b then unit else nat is Set below is the projection that is getting created but it doesn't work *) Lemma test_extract_t_match_success (A:Set) (F:nat->Type) (b:bool) (t1 t2: if b then unit else nat) :
extract_t_match A F innerI_extra b t1 = extract_t_match A F innerI_extra b t2 -> t1 = t2. Proof. intros H.
ail. Abort.
projAT)(:-Type)(: t1if )=
(fun
e : (:,
(innerI_Type :java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
e in (ExtractTestjava.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 75
(match i ExtractTest A Fjava.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 54
| innerI_Type T => T
| _ => if Ijava.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 57
- match i with
java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 27
| _ => if b then Lemma test_extract_fail A F x java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 133 end with
| extract_f_x_from_index _ _ _ x f _ => fun
t : match innerI_inner (innerI_nat x) with
innerI_Type T => T
| _ => if b then unit else nat end =>
t
| extract_F_from_param_x_from_index _ _ _ x _ _ => fun
t : match innerI_inner (innerI_nat x) with
(:) (:-T b:)(1t2 ):
| _ => b java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 89
t
|: fun
y
| innerI_Type T => T
| _ => if b then unit else nat end =>
t
| extract_fx_from_index _ _ _ x f _ =>
un
java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 40
| innerI_Type T |java.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 27
| _ java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 end=
t
| extract_t_match java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 32 fun
_ : =
| java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 32
| _ |= java.lang.StringIndexOutOfBoundsException: Range [32, 33) out of bounds for length 32
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.