 
 
 
 
 
 
 
  
In this chapter, we document a number of user forms for defining and modifying IMPS objects, for loading sections and files, and for presenting expressions. We will use the following template to describe each one of these forms.
 .
.
 
Modifier and keyword arguments can occur in any order.
In all of the above cases, spec-forms is either a name of an algebraic processor or is a list with keyword arguments and modifier arguments of its own. The keyword arguments for spec-forms are:
 .
operation-alist is a
list of entries (operation-type operator). operation-type is one of the symbols
.
operation-alist is a
list of entries (operation-type operator). operation-type is one of the symbols + * - / ^ sub zero unit. operator is the name of a constant in the processor language.
In order for simplification to reduce expressions involving only formal constants (for instance, 2+3), a processor associates such IMPS terms to executable T expressions involving algebraic procedures and objects from some data type S. This type is specified by the scalars declaration of the def-algebraic-processor form. We refer to this data type as a numerical type. Each formal constant o which denotes an algebraic function (such as +or -) is associated to an operation f(o) on the data type. This correspondence is specified by the operations keyword of processor. Finally, certain terms must be associated to elements of S. This is accomplished by a predicate and two mappings constructed by IMPS when the processor is built:
 which maps certain elements of S to terms.
which maps certain elements of S to terms.
 which maps certain terms to S.
which maps certain terms to S.
Evaluating a def-algebraic-processor form by itself will not affect theory simplification in any way. To add algebraic simplification to a theory, evaluate the form def-theory-processors. It is also important to note that an algebraic processor can only be installed in the simplifier when certain theorems generated by the processor are valid in the theory.
   (def-algebraic-processor RR-ALGEBRAIC-PROCESSOR
     (language numerical-structures)
     (base ((scalars *rational-type*)
            (operations
             (+ +)
             (* *)
             (- -)
             (^ ^)
             (/ /)
             (sub sub))
            use-numerals-for-ground-terms
            commutes)))
   (def-algebraic-processor VECTOR-SPACE-ALGEBRAIC-PROCESSOR
     (language real-vector-language)
     (base ((operations
             (+ ++)
             (* **)
             (zero v0))))
     (coefficient rr-algebraic-processor))
 .
.
 called sort-name from a unary predicate p of sort
called sort-name from a unary predicate p of sort
![$[\sigma,\ast]$](img459.gif) specified by quasi-sort-string and adds a set of
new theorems with usage list
specified by quasi-sort-string and adds a set of
new theorems with usage list 
 .
The new atomic sort and new theorems are added to the
theory T named theory-name provided:
.
The new atomic sort and new theorems are added to the
theory T named theory-name provided:
 is known to be a 
theorem of T.
is known to be a 
theorem of T.
   (def-atomic-sort NN
     "lambda(x:zz, 0<=x)"
     (theory h-o-real-arithmetic) 
     (witness "0"))
 
 ) ... (
) ... (
 
 )).  
  
  	Subsorts of the new datatype.  All these subsorts must be included
	within the new base type.  Thus, the enclosing sort of the first
	subsort must be the new base type, and the enclosing sort of a later
	subsort must be either the base type or a previously mentioned subsort
	of it.
)).  
  
  	Subsorts of the new datatype.  All these subsorts must be included
	within the new base type.  Thus, the enclosing sort of the first
	subsort must be the new base type, and the enclosing sort of a later
	subsort must be either the base type or a previously mentioned subsort
	of it.
 
 ) ... (
) ... (
 
 )).  Individual constants declared to
	belong to the base type (or one of its subsorts).
)).  Individual constants declared to
	belong to the base type (or one of its subsorts).
 (
 (
 ...
 ...
	
 ) (selectors s1 ...sn-1))).  
	
	Function constants declared to construct elements of the new type (or
	its subsorts).  Each range sort must be the new base type or one of its
	subsorts.  Each domain sort may belong to the underlying theory, or
	alternatively it may be the new base or one of its subsorts.  It may
	not be a higher sort involving the new type.
) (selectors s1 ...sn-1))).  
	
	Function constants declared to construct elements of the new type (or
	its subsorts).  Each range sort must be the new base type or one of its
	subsorts.  Each domain sort may belong to the underlying theory, or
	alternatively it may be the new base or one of its subsorts.  It may
	not be a higher sort involving the new type.
 
 ) ... (
) ... (
 
 )).  Declare that every
	element of subsort is also a member of supersort.  This is
	not needed when subsort is a syntactic subsort of supersort
	in the sense that there are zero or more intermediate sorts
)).  Declare that every
	element of subsort is also a member of supersort.  This is
	not needed when subsort is a syntactic subsort of supersort
	in the sense that there are zero or more intermediate sorts 
 such that the enclosing sort of subsort is
such that the enclosing sort of subsort is
	 ,
the enclosing sort of
,
the enclosing sort of  is supersort, and
	the enclosing sort of
is supersort, and
	the enclosing sort of  is
is 
 for each i with
for each i with
	
 .
.
The purpose of the def-bnf form is to define a new recursive data type to
be added (as a conservative extension) to some existing theory.  The members of
the new data type are the atoms in the declaration together with the objects
returned (``constructed'') by the constructor functions.  We will use the
 to refer to the base type; symbols such as
to refer to the base type; symbols such as  will stand for any
sort included in the base type (such as the base sort
will stand for any
sort included in the base type (such as the base sort  itself);
itself);  will be used for any sort of the underlying theory.
will be used for any sort of the underlying theory.
The logical content of a data type definition of this kind is determined by two main ideas:
 .
Moreover
.
Moreover 
 .
.
 apart from the atoms is generated
	by the constructor functions.  This is in fact a form of induction.  It
	allows us to infer that a property holds of all members of the data
	type on two assumptions:
apart from the atoms is generated
	by the constructor functions.  This is in fact a form of induction.  It
	allows us to infer that a property holds of all members of the data
	type on two assumptions:
    (rather than to some sort
(rather than to some sort  of the underlying
	  theory).
of the underlying
	  theory).
    and provide interpretations of the new vocabulary so that
the resulting M' is a model of extended theory.
and provide interpretations of the new vocabulary so that
the resulting M' is a model of extended theory.
In the case where  contains no subtype, it is clear that to ensure
conservatism, it is enough to establish that
contains no subtype, it is clear that to ensure
conservatism, it is enough to establish that  will be non-empty.  The
syntax of the declaration suffices to determine whether this condition is
met:  either there must be an atom, or else at least one constructor function
must take all of its arguments from types
will be non-empty.  The
syntax of the declaration suffices to determine whether this condition is
met:  either there must be an atom, or else at least one constructor function
must take all of its arguments from types  of the underlying theory.
of the underlying theory.
If  does have subtypes, the implementation must establish that each
subtype is non-empty.  That will hold if there is an ordering of the new
sorts
does have subtypes, the implementation must establish that each
subtype is non-empty.  That will hold if there is an ordering of the new
sorts  such that, for each
such that, for each  ,
at least one of the
following conditions holds:
,
at least one of the
following conditions holds:
 
 ;
or
;
or 
 occurring earlier in the ordering, and
occurring earlier in the ordering, and
	 is declared to be included within
is declared to be included within  ;
or
;
or 
   ,
and every domain sort of c is either some
,
and every domain sort of c is either some   belonging to the underlying theory or some
belonging to the underlying theory or some  occurring
	earlier in the ordering that
occurring
	earlier in the ordering that  .
.
 
- Constructor definedness
- A constructor is well-defined for every selection of arguments of the syntactically declared sorts.
- Disjointness
- If a and b are atoms and c0 and c1 are constructors, then
,
, and
is disjoint from
.
- Selector/constructor
- If s is the
th selector for the constructor c, then
. Moreover, if
, then
for some
.
- Sort Inclusions
, when
is specified as included within
.
- Induction
- The type
is the smallest containing the atoms and closed under the constructor functions in the sense given above (``No Junk'').
- Case Analysis
- If
, where
is the new type or one of its subsorts, then one of the following holds:
Strictly speaking this should be a theorem rather than an axiom, as it follows from the induction principle.
- 1.
- x is one of the atoms declared with sort
;
- 2.
- x is in the range of some constructor declared with range
;
- 3.
, where either
is the enclosing sort of
, or else the inclusion of
within
is declared as a sort inclusion.
 is uniquely
determined if a sort
is uniquely
determined if a sort  is given, together with the following:
is given, together with the following:
  ;
;
 
 of sort
of sort 
	 
 is quasi-equal to
is quasi-equal to
	 
 says how to combine the results of the
	recursive calls (for arguments in the primary type) with the values
	of the parameters (from sorts
says how to combine the results of the
	recursive calls (for arguments in the primary type) with the values
	of the parameters (from sorts  of the underlying theory).
of the underlying theory).  
 
The simplest example possible is:
   (def-bnf nat
     (theory pure-generic-theory-1)
     (base-type nat)
     (atoms (zero nat))
     (constructors (succ (nat nat) (selectors pred))))
The axioms generated from this definition are displayed in
Figure 17.1 on page ![[*]](cross_ref_motif.gif) .
. 
As a more complicated example, consider a programming language with phrases of
three kinds, namely identifiers, expressions, and statements.  The data type to
be introduced corresponds to set of phrases of all three syntactic categories;
each syntactic category will be represented by a subsort.  A  BNF for the
language might take the form given in Figure 17.2, with x ranging
over numbers and s ranging over strings.  A corresponding  IMPS def form is
shown in Figure 17.3, where it is assumed that the underlying
theory String-theory contains a sort string representing 
ASCII strings, as well as containing R.
 .
sort-name is the name of a sort
.
sort-name is the name of a sort 
 .
.
This form creates a new atomic sort  called name. This
sort can be regarded as the cartesian product of the sorts
called name. This
sort can be regarded as the cartesian product of the sorts 
 The sort actually created is a subsort of the 
function sort
The sort actually created is a subsort of the 
function sort 
 
 
 is the name of the canonical projection onto the
i-th coordinate:
is the name of the canonical projection onto the
i-th coordinate:

   (def-cartesian-product complex
     (rr rr)
     (constructor make%complex)
     (accessors real imaginary)
     (theory h-o-real-arithmetic))
 .
.
 .
.
 .
.
 .
.
 .
.
   (def-compound-macete FRACTIONAL-EXPRESSION-MANIPULATION
     (repeat
       beta-reduce
       addition-of-fractions
       multiplication-of-fractions
       multiplication-of-fractions-left
       multiplication-of-fractions-right
       equality-of-fractions
       left-denominator-removal-for-equalities
       right-denominator-removal-for-equalities
       strict-inequality-of-fractions
       right-denominator-removal-for-strict-inequalities
       left-denominator-removal-for-strict-inequalities
       inequality-of-fractions
       right-denominator-removal-for-inequalities
       left-denominator-removal-for-inequalities))
   (def-compound-macete ELIMINATE-IOTA-MACETE
     (sequential
       (sound
        tr%abstraction-for-iota-body
        beta-reduce
        beta-reduce)
       (series
        tr%defined-iota-expression-elimination
        tr%negated-defined-iota-expression-elimination
        tr%left-iota-expression-equation-elimination
        tr%right-iota-expression-equation-elimination)
       beta-reduce))
 .
.
 ,
where e is
the expression specified by defining-expr-string.  The sort
,
where e is
the expression specified by defining-expr-string.  The sort
 of c is the sort specified by sort-string if there
is a sort argument and otherwise is the sort of e.  The new
constant and new axiom are added to the theory T named theory-name provided:
of c is the sort specified by sort-string if there
is a sort argument and otherwise is the sort of e.  The new
constant and new axiom are added to the theory T named theory-name provided:
 is known to be a 
theorem of T.
is known to be a 
theorem of T.
   (def-constant ABS
     "lambda(r:rr, if(0<=r,r,-r))"
     (theory h-o-real-arithmetic))
   (def-constant >
     "lambda(x,y:rr,y<x)"
     (theory h-o-real-arithmetic)
     (usages rewrite))
   (def-constant POWER%OF%TWO
     "lambda(x:zz,2^x)"
     (sort "[zz,zz]")
     (theory h-o-real-arithmetic))
 .
.
 ).
).
 .
name is the name of a recursive constant in
the theory or the symbol
.
name is the name of a recursive constant in
the theory or the symbol #t. This form instructs the inductor not to
unfold the recursive constant named name when processing the
induction step. If #t is specified, then no recursive definitions will
be unfolded in the induction step.
![\begin{displaymath}\forall
p\mbox{:}[\alpha,\ast],x_1\mbox{:}\alpha_1, \ldots,
x_n\mbox{:}\alpha_n, \varphi
\Leftrightarrow \psi_0 \wedge \psi_1.\end{displaymath}](img521.gif) 
 being of kind
being of kind  .
.
 is referred to as the base case and
is referred to as the base case and  is the induction step.
is the induction step.
 represented by induction-principle or if the
translation keyword is present, from the translation of
represented by induction-principle or if the
translation keyword is present, from the translation of
 under the translation named by name. The base-case
and induction-step hooks are macetes or commands that provide additional
handling for the base and induction cases.
under the translation named by name. The base-case
and induction-step hooks are macetes or commands that provide additional
handling for the base and induction cases.
   (def-inductor TRIVIAL-INTEGER-INDUCTOR
     "forall(s:[zz,prop],m:zz,
        forall(t:zz,m<=t implies s(t)) 
         iff 
        (s(m) and 
        forall(t:zz,m<=t implies (s(t) implies s(t+1)))))"
     (theory h-o-real-arithmetic))
   (def-inductor NATURAL-NUMBER-INDUCTOR
     "forall(s:[nn,prop],
        forall(t:nn, s(t)) 
         iff 
        (s(0) and forall(t:nn,s(t) implies s(t+1))))"
     (theory h-o-real-arithmetic))
   (def-inductor INTEGER-INDUCTOR
     induct
     (theory h-o-real-arithmetic)
     (base-case-hook unfold-defined-constants-repeatedly))
   (def-inductor SM-INDUCT  
     "forall(p:[state,prop],
        forall(s:state, accessible(s) implies p(s)) 
         iff
        (forall(s:state, initial(s) implies p(s)) and
         forall(s_1, s_2:state, a:action,
           (accessible(s_1) and p(s_1) and tr(s_1, a, s_2))
            implies
           p(s_2))))"
     (theory h-o-real-arithmetic)
     (base-case-hook 
       eliminate-nonrecursive-definitions-and-simplify))
   (def-inductor SEQUENCE-INDUCTOR
     "forall(p:[[nn,ind_1],prop],
        forall(s:[nn,ind_1], f_seq_q(s) implies p(s))
         iff
        (p(nil(ind_1)) and 
         forall(s:[nn,ind_1], e:ind_1,
           f_seq_q(s) and p(s) implies p(cons{e,s}))))"
    (theory sequences)
    (base-case-hook simplify))
 .
name is the name of a
language or theory.
.
name is the name of a
language or theory.
 .
.
 .
sort-spec is a list of the form 
(sort enclosing-sort), called a sort-specification. sort must be a symbol, and
enclosing-sort must satisfy one of the following:
.
sort-spec is a list of the form 
(sort enclosing-sort), called a sort-specification. sort must be a symbol, and
enclosing-sort must satisfy one of the following:
 .
type-sort-alist is a list of
the form (numerical-type-name sort). numerical-type-name is the name of a numerical type, that is, a
class of objects defined in T. For example, *integer-type* and
*rational-type* are names of numerical types. This keyword
argument is used for defining self-extending languages.  This is a
language that incorporates new formal symbols when the expression
reader encounters numerical objects of the given type.
.
type-sort-alist is a list of
the form (numerical-type-name sort). numerical-type-name is the name of a numerical type, that is, a
class of objects defined in T. For example, *integer-type* and
*rational-type* are names of numerical types. This keyword
argument is used for defining self-extending languages.  This is a
language that incorporates new formal symbols when the expression
reader encounters numerical objects of the given type.
 .
constant-spec is a list
(constant-name sort-or-compound-sort).
.
constant-spec is a list
(constant-name sort-or-compound-sort).
 as sublanguages.
as sublanguages.
   (def-language NUMERICAL-STRUCTURES
     (extensible (*integer-type* zz) (*rational-type* qq))
     (sorts (rr ind) (qq rr) (zz qq))
     (constants
      (^ (rr zz rr))                             
      (+ (rr rr rr))
      (* (rr rr rr))
      (sub (rr rr rr))
      (- (rr rr))
      (/ (rr rr rr))
      (<= (rr rr prop))
      (< (rr rr prop))))
   (def-language METRIC-SPACES-LANGUAGE
     (embedded-language h-o-real-arithmetic)
     (base-types pp)
     (constants 
      (dist (pp pp rr))))
   (def-language REAL-VECTOR-LANGUAGE
     (embedded-language h-o-real-arithmetic)
     (base-types uu)
     (constants
      (++ (uu uu uu))
      (v0 uu)
      (** (rr uu uu))))
   (def-language HAM-SANDWICH-LANGUAGE
     (base-types sandwich)
     (embedded-language h-o-real-arithmetic)
     (constants 
      (ham%sandwich  sandwich)
      (tuna%sandwich sandwich)
      (refrigerator (sandwich unit%sort))))
 .
operation-alist is a
list of entries (operation-type operator), where operation-type is one of: <, <=.  operator is the name of a
constant in the language of the associated algebraic processor.
.
operation-alist is a
list of entries (operation-type operator), where operation-type is one of: <, <=.  operator is the name of a
constant in the language of the associated algebraic processor.
 .
.
This form builds an object called an order processor for simplification of formulas involving order relations. Processors are used by IMPS to generate algebraic and order simplification procedures used by the simplifier for the following purposes:
   (def-order-processor RR-ORDER 
     (algebraic-processor rr-algebraic-processor)
     (operations (< <) (<= <=))
     (discrete-sorts zz))
 .
.
 ,
...
,
... 
 are
held fixed.
are
held fixed.
   (def-quasi-constructor PREDICATE-TO-INDICATOR
     "lambda(s:[uu,prop], 
        lambda(x:uu, if(s(x),an%individual, ?unit%sort)))"
     (language indicators)
     (fixed-theories the-kernel-theory))
   (def-quasi-constructor GROUP
     "lambda(a:sets[gg], 
             mul%:[gg,gg,gg], 
             e%:gg, 
             inv%:[gg,gg], 
        forall(x,y:gg, 
          (x in a and y in a) implies mul%(x,y) in a) and
        e% in a and 
        forall(x:gg, x in gg% implies inv%(x) in gg%) and
        forall(x:gg, x in a implies mul%(e%,x)=x) and 
        forall(x:gg, x in a implies mul%(x,e%)=x) and
        forall(x:gg, x in a implies mul%(inv%(x),x)=e%) and 
        forall(x:gg, x in a implies mul%(x,inv%(x))=e%) and
        forall(x,y,z:gg, 
          (x in a) and (y in a) and (z in a) 
           implies
          mul%(mul%(x,y),z) = mul%(x,mul%(y,z))))"
     (language groups))
 .
accessor-spec is a list
.
accessor-spec is a list
 
NO DESCRIPTION.
   (def-record-theory ENTITIES-AND-LEVELS
     (type access)
     (accessors 
       (read "prop")
       (write "prop")))
 .
.
 ,...,
,...,
 be the names given by names; and
be the names given by names; and 
 be the functionals specified by the strings in defining-functional-strings.  This form creates a list of new
constants
be the functionals specified by the strings in defining-functional-strings.  This form creates a list of new
constants 
 called
called 
 ,...,
,...,
 and a set of new
axioms with usage list
and a set of new
axioms with usage list 
 ,...,
,...,
 .
The axioms say that
.
The axioms say that 
 are a minimal fixed
point of the family
are a minimal fixed
point of the family 
 of functionals.  The new
constants and new axioms are added to T provided:
of functionals.  The new
constants and new axioms are added to T provided:
 is not the name of any current 
constant of T or of a structural supertheory of T; and
is not the name of any current 
constant of T or of a structural supertheory of T; and
 .
.
   (def-recursive-constant SUM 
     "lambda(sigma:[zz,zz,[zz,rr],rr],
        lambda(m,n:zz,f:[zz,rr], 
          if(m<=n,sigma(m,n-1,f)+f(n),0)))"
     (theory h-o-real-arithmetic)
     (definition-name sum))
   (def-recursive-constant (EVEN ODD)
     ("lambda(even,odd:[nn,prop],
         lambda(n:nn, if_form(n=0, truth, odd(n-1))))"
      "lambda(even,odd:[nn,prop],
         lambda(n:nn, if_form(n=0, falsehood, even(n-1))))")
     (theory h-o-real-arithmetic)
     (definition-name even-odd))
   (def-recursive-constant OMEGA%EMBEDDING
     "lambda(f:[nn,nn], a:sets[nn],
        lambda(k:nn, 
          if(k=0,
             iota(n:nn, n in a and 
               forall(m:nn, m<n implies not(m in a))),
             lambda(z:nn,
               iota(n:nn, n in a and z<n
                 forall(m:nn, (z<m and m<n) implies 
                   (not(m in a)))))(f(k-1)))))"
     (theory h-o-real-arithmetic)
     (definition-name omega%embedding))
 .
pair is of the form 
(old-name new-name).
.
pair is of the form 
(old-name new-name).
   (def-renamer SB-RENAMER
     (pairs
      (last%a%index last%b%index)
      (a%inf b%inf)
      (a%even b%even)
      (a%odd b%odd)))
   (def-schematic-macete ABSTRACTION-FOR-DIFF-PROD 
     "with(a,b:rr,y:rr,
        diff(lambda(x:rr,a*b))(y)=
        diff(lambda(x:rr,
          lambda(x:rr,a)(x)*lambda(x:rr,b)(x)))(y))" 
     null
    (theory calculus-theory))
 .
A proof script consisting of 0 or more
forms.
.
A proof script consisting of 0 or more
forms.
#t. The inclusion of this
argument will cause the command name to appear as a selection in the
command menu whenever the current sequent node satisfies the
predicate.  Supplying #t as an argument is equivalent to
supplying a predicate which is always true.
   (def-script EPSILON/N-ARGUMENT 1 
     ((instantiate-universal-antecedent 
        "with(p:prop, forall(eps:rr, 0<eps implies p))" ($1))))
 .
.
 .
.
 and then loads the files with specifications
and then loads the files with specifications 
 .
A section can be
loaded with the form load-section.
.
A section can be
loaded with the form load-section. 
   (def-section BASIC-REAL-ARITHMETIC
     (component-sections reals)
     (files 
      (imps theories/reals/some-lemmas)
      (imps theories/reals/arithmetic-macetes)
      (imps theories/reals/number-theory)))
   (def-section FUNDAMENTAL-COUNTING-THEOREM
     (component-sections 
      basic-cardinality 
      basic-group-theory)
     (files 
      (imps theories/groups/group-cardinality)
      (imps theories/groups/counting-theorem)))
 .
.
 .
.
 .
.
 ,
..., language-
,
..., language-
 ;
the atomic sorts of L named sort-
;
the atomic sorts of L named sort-
 ,
..., sort-
,
..., sort-
 ;
and the constants of L named
;
and the constants of L named 
 .
.
Each of 
 may be the name of
a theory instead of a language.
may be the name of
a theory instead of a language.
   (def-sublanguage REAL-VECTOR-LANGUAGE
     (superlanguage vector-spaces-over-rr-language)
     (languages h-o-real-arithmetic)
     (sorts uu)
     (constants ++ v0 **))
 .
.
 be the theory interpretation named translation-name when there is a translation argument, and let
M be the bidirectional macete named macete-name when there is
a macete argument.  Also, let T be the theory named theory-name, and let H be the theory named by home-theory-name.  If there is no home-theory argument, then
H is the source theory of
be the theory interpretation named translation-name when there is a translation argument, and let
M be the bidirectional macete named macete-name when there is
a macete argument.  Also, let T be the theory named theory-name, and let H be the theory named by home-theory-name.  If there is no home-theory argument, then
H is the source theory of  if there is a translation
argument and otherwise H=T.  Finally, let
if there is a translation
argument and otherwise H=T.  Finally, let  be the formula
specified by formula-spec in H.
be the formula
specified by formula-spec in H.
Step 1.  IMPS verifies that  is a theorem of H.
If proof-spec is the symbol existing-theorem,  IMPS checks to see that
is a theorem of H.
If proof-spec is the symbol existing-theorem,  IMPS checks to see that  is alpha-equivalent to some existing
theorem of H. If the theorem is being installed in ``batch mode''
(see Section 12.3.1),  IMPS verifies that
is alpha-equivalent to some existing
theorem of H. If the theorem is being installed in ``batch mode''
(see Section 12.3.1),  IMPS verifies that  is a theorem of H by running the script proof-spec.
Otherwise,  IMPS simply checks that
is a theorem of H by running the script proof-spec.
Otherwise,  IMPS simply checks that  is a formula in H,
and it is assumed that the user has verified that
is a formula in H,
and it is assumed that the user has verified that  is a
theorem of H.
is a
theorem of H.
Step 2. The theorem  to be installed is generated from
to be installed is generated from
 as follows:
as follows:
 .
.
 is a formula of Twhich is the result of generalizing the constants of H which are not
in T (assuming each sort of T is also a sort of H).
is a formula of Twhich is the result of generalizing the constants of H which are not
in T (assuming each sort of T is also a sort of H).
 is the translation of
is the translation of  by
by  .
.
 is the result of applying M to
is the result of applying M to  .
.
 is the result of applying M to the translation of
is the result of applying M to the translation of
 by
by  .
.
Step 3.  is installed as a theorem in T with usage
list
is installed as a theorem in T with usage
list 
 ,
,
 ,
,
 .
.
If the modifier argument reverse is present, evaluating this form is equivalent to evaluating the form without reverse followed by evaluating the form again without reverse but with:
   (def-theorem ABS-IS-TOTAL
     "total_q(abs,[rr,rr])"
     (theory h-o-real-arithmetic)
     (usages d-r-convergence)
     (proof 
      (
       (unfold-single-defined-constant (0) abs)
       insistent-direct-inference
       beta-reduce-repeatedly
       )))
   (def-theorem RIGHT-CANCELLATION-LAW
     left-cancellation-law
     (theory groups)
     (translation mul-reverse)
     (proof existing theorem))
   (def-theorem FUNDAMENTAL-COUNTING-THEOREM
     "f_indic_q{gg%subgroup} 
        implies 
      f_card{gg%subgroup} = 
        f_card{stabilizer(zeta)}*f_card{orbit(zeta)}"
     ;; "forall(zeta:uu, 
     ;;    f_indic_q{gg%subgroup} 
     ;;      implies
     ;;    f_card{gg%subgroup} = 
     ;;      f_card{stabilizer(zeta)}*f_card{orbit(zeta)})"
     (theory group-actions)
     (home-theory counting-theorem-theory))
 .
.
 .
axiom-spec is a list
.
axiom-spec is a list
 
 .
distinct is a list
.
distinct is a list
 
   (def-theory METRIC-SPACES
     (component-theories h-o-real-arithmetic)
     (language metric-spaces-language)
     (axioms
       (positivity-of-distance 
         "forall(x,y:pp, 0<=dist(x,y))" 
         transportable-macete)
       (point-separation-for-distance
         "forall(x,y:pp, x=y iff dist(x,y)=0)" 
         transportable-macete)
       (symmetry-of-distance
         "forall(x,y:pp, dist(x,y) = dist(y,x))" 
         transportable-macete)
       (triangle-inequality-for-distance
         "forall(x,y,z:pp, dist(x,z)<=dist(x,y)+dist(y,z))")))
   (def-theory VECTOR-SPACES-OVER-RR
     (language real-vector-language)
     (component-theories generic-theory-1)
     (axioms
       ("forall(x,y,z:uu, (x++y)++z=x++(y++z))")
       ("forall(x,y:uu, x++y=y++x)")
       ("forall(x:uu, x++v0=x)")
       ("forall(x,y:rr, z:uu, (x*y)**z=x**(y**z))")
       ("forall(x,y:uu,a:rr,a**(x++y)=(a**x)++(a**y))")
       ("forall(a,b:rr, x:uu,(a+b)**x=(a**x)++(b**x))")
       ("forall(x:uu, 0**x=v0)")
       ("forall(x:uu, 1**x=x)")))
 .
The theories listed are not
replicated when the theory replicas and multiples are built. If this
argument is not provided, then the fixed theories are those in the
global fixed theories list at the time the form is evaluated.
.
The theories listed are not
replicated when the theory replicas and multiples are built. If this
argument is not provided, then the fixed theories are those in the
global fixed theories list at the time the form is evaluated.
(def-theory-ensemble METRIC-SPACES)
 .
For
each i,
.
For
each i, 
 must be the name of a theory
must be the name of a theory
 or an error will result.
or an error will result.
 
 is the name
of the i-th theory replica.  The target- multiple and
target-theories keyword arguments are exclusive.
is the name
of the i-th theory replica.  The target- multiple and
target-theories keyword arguments are exclusive.
 .
sort-assoc is a list
.
sort-assoc is a list
 
 is either
is either
 

 .
const-assoc is a list
.
const-assoc is a list
 
 is either
is either
 or
or

 .
Each argument M is an integer not exceeding the
number N of theory entries. This instructs  IMPS to translate
constants defined in the ensemble M-multiple.
.
Each argument M is an integer not exceeding the
number N of theory entries. This instructs  IMPS to translate
constants defined in the ensemble M-multiple.
 .
Each argument P is a list
.
Each argument P is a list 
 of integers in
of integers in 
 The
presence of this list instructs  IMPS to translate constants defined
in the ensemble
The
presence of this list instructs  IMPS to translate constants defined
in the ensemble  -multiple into the theory generated by the
theories
-multiple into the theory generated by the
theories  
 .
A list of entries
(name new-name) if you want to override the system's naming
conventions. Note that name is the full constant name, not just
the root name.
.
A list of entries
(name new-name) if you want to override the system's naming
conventions. Note that name is the full constant name, not just
the root name.
 .
Let
.
Let 
 be the theory with
name
be the theory with
name 
 In this case, evaluation of the form builds
translations and transports natively defined constants and sorts by
these translations from selected theory multiples into the theory
union
In this case, evaluation of the form builds
translations and transports natively defined constants and sorts by
these translations from selected theory multiples into the theory
union  
 .
Each argument P is a list
.
Each argument P is a list 
 of integers in
of integers in 
 which
instructs  IMPS to translate constants defined in the
ensemble
which
instructs  IMPS to translate constants defined in the
ensemble  -multiple into the theory union
-multiple into the theory union
 
 .
This case can be reduced to
the case of the (permutations
.
This case can be reduced to
the case of the (permutations 
 argument by considering all
lists of length Mi of nonnegative integers
argument by considering all
lists of length Mi of nonnegative integers 
 argument by letting
argument by letting
 be the name of the i-th theory replica.
be the name of the i-th theory replica.
   (def-theory-ensemble-instances METRIC-SPACES 
     (target-theories h-o-real-arithmetic metric-spaces) 
     (multiples 1 2) 
     (sorts (pp rr pp)) 
     (constants (dist "lambda(x,y:rr,abs(x-y))" dist)))
(def-theory-ensemble-multiple metric-spaces 2)
 Each N is an integer
Each N is an integer
 
(def-theory-ensemble-overloadings metric-spaces 1 2)
 .
.
 be
the source and target theories, respectively, of the translation
be
the source and target theories, respectively, of the translation
 named trans-name.  Also, let T1 and
named trans-name.  Also, let T1 and 
 be the theories named source-theory-name and target-theory-name, respectively.  Lastly, let
be the theories named source-theory-name and target-theory-name, respectively.  Lastly, let 
 be the set of
theories named
 be the set of
theories named 
 .
.
Suppose that T0 and 
 are subtheories of T1 and
are subtheories of T1 and
 ,
respectively, and that every member of
,
respectively, and that every member of 
 is a
subtheory of T1.  The theory named name is an extension Uof
 is a
subtheory of T1.  The theory named name is an extension Uof 
 built as follows.  First, the primitive vocabulary
of T1 which is outside of T0 and
built as follows.  First, the primitive vocabulary
of T1 which is outside of T0 and 
 is added to the language
of
 is added to the language
of 
 ;
the vocabulary is renamed using the value of renamer.  Next, the translations of the axioms of T1 which are
outside of T0 and
;
the vocabulary is renamed using the value of renamer.  Next, the translations of the axioms of T1 which are
outside of T0 and 
 are added to the axioms of
 are added to the axioms of
 ;
the axioms are renamed using the value of renamer.  U is union of the resulting theory and the members of
;
the axioms are renamed using the value of renamer.  U is union of the resulting theory and the members of
 .  The translation
.  The translation  from T1 to U extending
from T1 to U extending  is
created with name new-trans-name.
is
created with name new-trans-name.
   (def-theory-instance METRIC-SPACES-COPY
     (source metric-spaces)
     (target the-kernel-theory)
     (translation the-kernel-translation)	
     (fixed-theories h-o-real-arithmetic))
   (def-theory-instance VECTOR-SPACES-OVER-RR
     (source vector-spaces)
     (target h-o-real-arithmetic)
     (translation fields-to-rr)
     (renamer vs-renamer))
 .
.
 
 
 are within the scope of the specified processor.
are within the scope of the specified processor.
 .
.
 
 
 are within the scope of the
specified order processor.
are within the scope of the
specified order processor.
 .
spec is just
the name of an algebraic or order processor. We will
say that the equality constructor is within the scope of the specified
processor.
.
spec is just
the name of an algebraic or order processor. We will
say that the equality constructor is within the scope of the specified
processor.
This form causes the simplifier of the theory named theory-name to simplify certain terms using the specified algebraic and order processors as follows:
  (def-theory-processors H-O-REAL-ARITHMETIC
    (algebraic-simplifier 
      (rr-algebraic-processor * ^ + - / sub))
    (algebraic-order-simplifier (rr-order < <=))
    (algebraic-term-comparator rr-order))
   (def-theory-processors VECTOR-SPACES-OVER-RR
    (algebraic-simplifier 
      (vector-space-algebraic-processor ** ++))
    (algebraic-term-comparator 
      vector-space-algebraic-processor))
 .
.
 .
.
 .
.
 ,
where
,
where
 ,
,
 ,
,
 .) The
translation is specified by the set of fixed theories, the set of sort
pairs, and the set of constant pairs.
.) The
translation is specified by the set of fixed theories, the set of sort
pairs, and the set of constant pairs.  
If there is a core-translation argument, an extension of the translation named core-translation-name is build using the information given by the other arguments. The argument theory-interpretation-check tells IMPS how to check if the translation is a theory interpretation (relative to the set of assumptions).
If the modifier argument force is present, the obligations of the translation are not generated, and thereby the translation is forced to be a theory interpretation. Similarly, if the modifier argument force-under-quick-load is present and the switch quick-load? is set to true, the obligations of the translation are not generated. The former lets you build a theory interpretation when the obligations are very hard to prove, and the latter is useful for processing the def-form faster, when it has been previously determined that the translation is indeed a theory interpretation.
If the modifier argument dont-enrich is present, the translation will not be enriched. A translation is enriched at various times to take into account new definitions in the source and target theories. If one expects there to be many untranslated definitions after enrichment, it may be computationally beneficial to use this modifier argument.
   (def-translation MONOID-THEORY-TO-ADDITIVE-RR
     (source monoid-theory)
     (target h-o-real-arithmetic)
     (fixed-theories h-o-real-arithmetic)
     (sort-pairs
      (uu rr))
     (constant-pairs
      (e 0)
      (** +))
     (theory-interpretation-check using-simplification))
   (def-translation MUL-REVERSE
     (source groups)
     (target groups)
     (fixed-theories h-o-real-arithmetic)
     (constant-pairs
       (mul "lambda(x,y:gg, y mul x)"))
     (theory-interpretation-check using-simplification))
   (def-translation GROUPS->SUBGROUP
     force	
     (source groups)
     (target groups)
     (assumptions 
       "with(a:sets[gg], nonempty_indic_q{a})"
       "with(a:sets[gg], 
          forall(g,h:gg, 
            (g in a) and (h in a) 
              implies
            (g mul h) in a))"
        "with(a:sets[gg], 
          forall(g:gg, (g in a) implies (inv(g) in a)))")
     (fixed-theories h-o-real-arithmetic)
     (sort-pairs
      (gg (indic "with(a:sets[gg], a)")))
     (constant-pairs
      (mul "with(a:sets[gg], 
              lambda(x,y:gg, 
                if((x in a) and (y in a), x mul y, ?gg)))")
      (inv "with(a:sets[gg], 
              lambda(x:gg, if(x in a, inv(x), ?gg)))"))
     (theory-interpretation-check using-simplification))
 named translation-name, and let
named translation-name, and let 
 ,...,
,...,
 be the symbols whose names are given by names.  For each
be the symbols whose names are given by names.  For each
 which is a defined symbol in T, this form creates
a corresponding new defined symbol
which is a defined symbol in T, this form creates
a corresponding new defined symbol 
 in
T' by translating the defining object of
in
T' by translating the defining object of 
 via
via
 .
If
.
If  already translates
already translates 
 to some
defined symbol, the new symbol is not created.
to some
defined symbol, the new symbol is not created.
   (def-transported-symbols 
     (last%a%index a%inf a%even a%odd)
     (translation schroeder-bernstein-symmetry)
     (renamer sb-renamer))
   (def-transported-symbols 
    (prec%increasing prec%majorizes prec%sup)
    (translation order-reverse)
    (renamer first-renamer))
 theory-name-pair is a list (theory-name symbol-name).
theory-name-pair is a list (theory-name symbol-name).
   (def-overloading *  
     (h-o-real-arithmetic *) 
     (normed-linear-spaces **))
   (def-parse-syntax + 
     (left-method infix-operator-method) 
     (binding 100))
   (def-parse-syntax factorial
     (token !)
     (left-method postfix-operator-method)
     (binding 160))
   (def-print-syntax + 
     (method present-binary-infix-operator) 
     (binding 100))
   (def-print-syntax factorial 
     (token !) 
     (method present-postfix-operator) 
     (binding 160))
 .
.
 which have not been
loaded.
which have not been
loaded.
 
 
 
 
 
 
