Debian Codegraph @

apps/derive/tests/test_invert.v

raw
1 From elpi.apps Require Import derive.invert.
2
3 Inductive test A : bool -> Type :=
4 K1 : test true
5 | K2 : forall x, A -> test (negb x) -> test (negb (negb x)).
6
7 Elpi derive.invert test.
8
9 Redirect "tmp" Check test_inv : Type -> bool -> Type.
10 Redirect "tmp" Check K1_inv : forall A b, b = true -> test_inv A b.
11 Redirect "tmp" Check K2_inv : forall A b, forall x, A -> test_inv A (negb x) -> b = negb (negb x) -> test_inv A b.
12
13 Inductive listR A PA : list A -> Type :=
14 | nilR : listR (@nil A)
15 | consR : forall a : A, PA a -> forall xs : list A, listR xs -> listR (cons a xs).
16
17 Elpi derive.invert listR.
18 Print listR_inv.