Introduce a fixtype for the flat (i.e. not tagged) sum of disjoint fixtypes.
This is a very preliminary tool for now. In particular, it does not perform a thorough input validation.
deftagsum introduces
a tagged sum of fixtypes,
some of which may partially or totally overlap
(the tags distinguish them in the sum);
it is like a disjoint union in set theory.
In contrast, this
(defflatsum type (:kwd1 type1) ... (:kwdn typen) :pred ... :fix ... :equiv ... :parents ... :short ... :long ... :prepwork ... )
A symbol that specifies the name of the new fixtype.
Two or more doublets, one for each summand. The first component of each doublet is a keyword that identifies the summand; all these keywords must be distinct. The second component of each doublet is an existing fixtype that is a summand; these fixtypes must be pairwise disjoint.
A symbol that specifies the name of the fixtype's recognizer. If this is
nil (the default), the name of the recognizer istype followed by-p .
A symbol that specifies the name of the fixtype's fixer. If this is
nil (the default), the name of the fixer istype followed by-fix .
A symbol that specifies the name of the fixtype's equivalence. If this is
nil (the default), the name of the equivalence istype followed by-equiv .
These, if present, are added to the XDOC topic generated for the fixtype.
A list of preparatory event forms. See the `Generated Events' section.
In order for
The fixtypes
This macro generates a defflexsum with some accompanying theorems:
(defflexsum type (:kwd1 :fields ((get :type type1 :acc-body x)) :ctor-body get :cond (type1p x)) (:kwd2 :fields ((get :type type2 :acc-body x)) :ctor-body get :cond (type2p x)) ... (:kwdn :fields ((get :type typen :acc-body x)) :ctor-body get) :prepwork ... /// (defthm typep-when-type1p (implies (type1p x) (typep x))) (defthm typep-when-type2p (implies (type2p x) (typep x))) ... (defthm typep-when-typenp (implies (typenp x) (typep x))))
Note that the last summand does not have
If a