diff options
| author | Matthieu Sozeau | 2018-10-01 14:41:33 +0200 |
|---|---|---|
| committer | Matthieu Sozeau | 2018-10-01 14:41:33 +0200 |
| commit | aff4c089548c4e77b93a5676fe82abf93189d6ce (patch) | |
| tree | 21732e66a7f5be31aae916ac6d4828bca6772f0a /test-suite | |
| parent | d4e452e7561f3a72e03c1965518b5c29905ed2a2 (diff) | |
| parent | 5ea3d1b1e01f56573e72d7818a4b7e6393ffdfa8 (diff) | |
Merge PR #7634: Extend combined scheme to Schemes in Type
Diffstat (limited to 'test-suite')
| -rw-r--r-- | test-suite/success/CombinedScheme.v | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test-suite/success/CombinedScheme.v b/test-suite/success/CombinedScheme.v new file mode 100644 index 0000000000..d6ca7a299f --- /dev/null +++ b/test-suite/success/CombinedScheme.v @@ -0,0 +1,35 @@ +Inductive even (x : bool) : nat -> Type := +| evenO : even x 0 +| evenS : forall n, odd x n -> even x (S n) +with odd (x : bool) : nat -> Type := +| oddS : forall n, even x n -> odd x (S n). + +Scheme even_ind_prop := Induction for even Sort Prop +with odd_ind_prop := Induction for odd Sort Prop. + +Combined Scheme even_cprop from even_ind_prop, odd_ind_prop. + +Check even_cprop : + forall (x : bool) (P : forall n : nat, even x n -> Prop) + (P0 : forall n : nat, odd x n -> Prop), + P 0 (evenO x) -> + (forall (n : nat) (o : odd x n), P0 n o -> P (S n) (evenS x n o)) -> + (forall (n : nat) (e : even x n), P n e -> P0 (S n) (oddS x n e)) -> + (forall (n : nat) (e : even x n), P n e) /\ + (forall (n : nat) (o : odd x n), P0 n o). + +Scheme even_ind_type := Induction for even Sort Type +with odd_ind_type := Induction for odd Sort Type. + +(* This didn't work in v8.7 *) + +Combined Scheme even_ctype from even_ind_type, odd_ind_type. + +Check even_ctype : + forall (x : bool) (P : forall n : nat, even x n -> Prop) + (P0 : forall n : nat, odd x n -> Prop), + P 0 (evenO x) -> + (forall (n : nat) (o : odd x n), P0 n o -> P (S n) (evenS x n o)) -> + (forall (n : nat) (e : even x n), P n e -> P0 (S n) (oddS x n e)) -> + (forall (n : nat) (e : even x n), P n e) * + (forall (n : nat) (o : odd x n), P0 n o). |
