1 (**************************************************************************)
4 (* ||A|| A project by Andrea Asperti *)
6 (* ||I|| Developers: *)
7 (* ||T|| The HELM team. *)
8 (* ||A|| http://helm.cs.unibo.it *)
10 (* \ / This file is distributed under the terms of the *)
11 (* v GNU General Public License Version 2 *)
13 (**************************************************************************)
17 include "logic/equality.ma".
19 record R1 : Type := { C:> Type; plus: C \to C \to C}.
20 record R2 : Type := { K:> Type; mult: K \to K \to K}.
22 (* Missing syntactic sugar:
23 record R : Type := { r1 :> R1; r2 :> R2 with C r1 = K r2}
25 record R : Type := { r1 :> R1; r2_ : R2; with_: C r1 = K r2_ }.
27 (* This can be done automatically *)
32 | rewrite > (with_ r); exact (mult (r2_ r))]
34 coercion cic:/matita/tests/multiple_inheritance/r2.con.
36 (* convertibility test *)
37 lemma conv_test : ∀r:R.C r -> K r.
39 change with (C (r1 r)).
40 change with (K (r2 r)).
41 change with (C (r1 r)).
45 (* Let's play with it *)
46 definition f ≝ λr:R.λx:r.plus ? (mult ? x x) x.
48 axiom plus_idempotent: ∀r1:R1.∀x:r1. plus ? x x = x.
49 axiom mult_idempotent: ∀r2:R2.∀x:r2. mult ? x x = x.
51 lemma test: ∀r:R. ∀x:r. f ? x = x.
54 autobatch paramodulation.