next up previous contents
Next: 18. The Proof Commands Up: 3. Reference Manual Previous: 3. Reference Manual

Subsections

  
17. The IMPS Special Forms

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.

Positional Arguments.
This is a list of arguments that must occur in the order given, and must precede the modifier arguments and the keyword arguments. All IMPS definition forms have a name as first argument or, a list of names as first argument.
Modifier Arguments.
Each modifier argument is a single symbol called the modifier.

Keyword Arguments.
Each keyword argument is a list whose first element is a symbol called the keyword. Keyword arguments have one of two forms: Note: By default, nearly every special form in this chapter is allowed to have a keyword argument of the form

\begin{displaymath}{\tt (syntax \mbox{\it syntax-name})}\end{displaymath}

where syntax-name is the name of a syntax (e.g., string-syntax or sexp-syntax) which specifies what syntax to use when reading the form. If this keyword argument is missing, the current syntax is used when reading the form.

Modifier and keyword arguments can occur in any order.

Description.
A brief description of the definition form.
Remarks:
Hints or observations that we think you should find useful.
Examples.
Some example forms.

17.1 Creating Objects

   
def-algebraic-processor

Positional Arguments:

Modifier Arguments:

Keyword Arguments:

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:

The modifier arguments for spec-forms are:

Description:

This form builds an object called a processor for algebraic simplification. Processors are used by IMPS to generate algebraic and order simplification procedures used by the simplifier for the following purposes:

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:

The simplifier uses these functions to reduce expressions containing numerical terms, according to the following rule: If f denotes a processor operation, and s,t denote numerical terms, and o(s,t) is defined, then o(s,t) is replaced by T(f(o)(N(s),N(t))).

Remarks:

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.

Examples:

   (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))

   
def-atomic-sort

Positional Arguments:

Keyword Arguments:

Description:

This form creates a new atomic sort $\sigma$ called sort-name from a unary predicate p of sort $[\sigma,\ast]$ specified by quasi-sort-string and adds a set of new theorems with usage list $\mbox{\it symbol}_1,\ldots,\mbox{\it
symbol}_n$. The new atomic sort and new theorems are added to the theory T named theory-name provided: If there is a witness argument, the systems tries to verify condition (2) by simplifying p(a), where a is the expression specified by witness-expr-string.

Examples:

   (def-atomic-sort NN
     "lambda(x:zz, 0<=x)"
     (theory h-o-real-arithmetic) 
     (witness "0"))

   
def-bnf

Positional Arguments:

Keyword Arguments:

Description:

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 $\tau$ to refer to the base type; symbols such as $\alpha_i$ will stand for any sort included in the base type (such as the base sort $\tau$ itself); $\beta_i$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:

The implementation ensures that the resulting theory will be a model conservative extension of the underlying theory. That is, given any model M of the underlying theory, we can augment M with a new domain to interpret $\tau$ and provide interpretations of the new vocabulary so that the resulting M' is a model of extended theory.

In the case where $\tau$ contains no subtype, it is clear that to ensure conservatism, it is enough to establish that $\tau$ 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 $\beta_i$ of the underlying theory.

If $\tau$ 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 $\alpha_i$ such that, for each $\alpha_i$, at least one of the following conditions holds:

1.
There is an atom declared to be of sort $\alpha_i$; or
2.
There is a sort $\alpha_j$ occurring earlier in the ordering, and $\alpha_j$ is declared to be included within $\alpha_i$; or
3.
There is at least one constructor c declared with range sort $\alpha_i$, and every domain sort of c is either some $\beta_i$ belonging to the underlying theory or some $\alpha_j$ occurring earlier in the ordering that $\alpha_i$.
When this condition is not met, the implementation raises an error and identifies the uninhabited sort (or sorts) for the user.

17.1.0.0.1 Axioms Generated.

The BNF mechanism generates six categories of axioms:
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 $a\not= b$, $a \notin
\mbox{ran}(c_0)$, and $\mbox{ran}(c_0)$ is disjoint from $\mbox{ran}(c_1)$.
Selector/constructor
If s is the $i\/$th selector for the constructor c, then $s(c(\vec{x}))=x_i$. Moreover, if $s(y)\!\!\downarrow$, then $y=c(\vec{x})$ for some $\vec{x}$.
Sort Inclusions
$\forall x\mbox{:}\alpha_0,x\downarrow\alpha_1$, when $\alpha_0$ is specified as included within $\alpha_1$.
Induction
The type $\tau$ is the smallest containing the atoms and closed under the constructor functions in the sense given above (``No Junk'').
Case Analysis
If $x\downarrow\alpha$, where $\alpha$ is the new type or one of its subsorts, then one of the following holds:
1.
x is one of the atoms declared with sort $\alpha$;
2.
x is in the range of some constructor declared with range $\alpha$;
3.
$x\downarrow\alpha'$, where either $\alpha$ is the enclosing sort of $\alpha'$, or else the inclusion of $\alpha'$ within $\alpha$ is declared as a sort inclusion.
Strictly speaking this should be a theorem rather than an axiom, as it follows from the induction principle.

17.1.0.0.2 Primitive Recursion.

A data type introduced via the BNF mechanism justifies a schema for defining functions by primitive recursion. Roughly speaking, a function g of sort $\tau\rightarrow \sigma$ is uniquely determined if a sort $\sigma$ is given, together with the following:

17.1.0.0.3 Additional Theorems.

A number of consequences of the axioms are installed.

Examples:

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 [*].
   
Figure 17.1: Axioms for Nat, as Introduced by BNF
bnf data type nat:
\fbox{
\begin{minipage}{5.25in}
{\bf Constructor
definedness axioms:} Theorem ...
...cc }_{0}) \supset
\varphi({\rm succ }({\rm y\_succ }_{0})))) .$ \end{minipage}}

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.

  
Figure 17.2: BNF Syntax for a Small Programming Language
\fbox{\begin{minipage}{4.5in}
\begin{tabbing}
E ::= \= Ide(str)\quad \= while E ...
...\\
\>$\vert$\space Num($x$ ) \\
I ::=\> Ide($s$ )\end{tabbing}\end{minipage}}



  
Figure 17.3: IMPS def-bnf Form for Programming Language Syntax
\begin{figure}\begin{tex2html_preform}\begin{verbatim}(def-bnf pl-syntax
(theor...
...''
(selectors ide%name))))\end{verbatim}\end{tex2html_preform} \par\end{figure}

   
def-cartesian-product

Positional Arguments:

Keyword Arguments:

Description:

This form creates a new atomic sort $\sigma$ called name. This sort can be regarded as the cartesian product of the sorts $\alpha_1 \ldots
\alpha_m.$ The sort actually created is a subsort of the function sort

\begin{displaymath}\alpha_1\times\cdots\times\alpha_{m} \rightharpoonup \mbox{ \rm unit\_sort}\end{displaymath}

Examples:

   (def-cartesian-product complex
     (rr rr)
     (constructor make%complex)
     (accessors real imaginary)
     (theory h-o-real-arithmetic))

   
def-compound-macete

Positional Arguments:

Keyword Arguments:

None.

Description:

This form adds a compound macete with the given name and components. See the section on macetes for the semantics of macetes.

Examples:

   (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))

   
def-constant

Positional Arguments:

Keyword Arguments:

Description:

This form creates a new constant c called constant-name and a new axiom of the form c =e with usage list $\mbox{\it symbol}_1,\ldots,\mbox{\it
symbol}_n$, where e is the expression specified by defining-expr-string. The sort $\sigma$ 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:

Examples:

   (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))

   
def-imported-rewrite-rules

Positional Arguments:

Keyword Arguments:

Description:

This form imports into the theory named theory-name all the transportable rewrite rules installed in the theory named source-theory-name (or in the theories named $\mbox{\it source-theory-name}_1,\ldots,\mbox{\it
source-theory-name}_n$).

   
def-inductor

Positional Arguments:

Keyword Arguments:

Remarks:

The induction principle used for constructing an inductor must satisfy a number of requirements.

Description:

This form builds an inductor from the formula $\varphi$ represented by induction-principle or if the translation keyword is present, from the translation of $\varphi$ 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.

Examples:

   (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))

   
def-language

Positional Arguments:

Keyword Arguments:

Description:

This form builds a language with name language-name satisfying the following properties:

Examples:

   (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))))

   
def-order-processor

Positional Arguments:

Keyword Arguments:

Description:

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:

Examples:

   (def-order-processor RR-ORDER 
     (algebraic-processor rr-algebraic-processor)
     (operations (< <) (<= <=))
     (discrete-sorts zz))

   
def-primitive-recursive-constant

Positional Arguments:

Keyword Arguments:

Description:

Each BNF is automatically equipped with a principle of definition by structural (primitive) recursion. A def-primitive-recursive-constant form instantiates this principle by stipulating the intended range sort, the values for atoms of the BNF data type, and how the recursively defined operator combines its results on the arguments of each datatype constructor.

Examples:

See, for instance, the compiler exercise file.

   
def-quasi-constructor

Positional Arguments:

Keyword Arguments:

Description:

This form builds a quasi-constructor named name from the schema specified by lambda-expr-string, which is a lambda-expression in the language named language-name. The sorts in the theories named $\mbox{\it theory-name}_1$, ... $\mbox{\it theory-name}_n$ are held fixed.

Examples:

   (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))

   
def-record-theory

Positional Arguments:

Keyword Arguments:

Description:

NO DESCRIPTION.

Examples:

   (def-record-theory ENTITIES-AND-LEVELS
     (type access)
     (accessors 
       (read "prop")
       (write "prop")))

   
def-recursive-constant

Positional Arguments:

Keyword Arguments:

Description:

Let T be the theory named theory-name; $\mbox{\it const-name}_1$,..., $\mbox{\it
const-name}_n$ be the names given by names; and $f_1,\ldots,f_n$be the functionals specified by the strings in defining-functional-strings. This form creates a list of new constants $c_1,\ldots, c_n$ called $\mbox{\it const-name}_1$,..., $\mbox{\it
const-name}_n$ and a set of new axioms with usage list $\mbox{\it symbol}_1$,..., $\mbox{\it
symbol}_n$. The axioms say that $c_1,\ldots, c_n$ are a minimal fixed point of the family $f_1,\ldots,f_n$ of functionals. The new constants and new axioms are added to T provided: If the definition-name keyword is present, the name of the definition is def-name; otherwise, it is $\mbox{\it const-name}_1$.

Examples:

   (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))

   
def-renamer

Positional Arguments:

Keyword Arguments:

Description:

This form defines a T procedure named name which, given a symbol x, returns the symbol y if (xy) is one of the pairs, and otherwise returns x.

Examples:

   (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

Positional Arguments:

Modifier Arguments:

Keyword Arguments:

Examples:

   (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))

   
def-script

Positional Arguments:

Keyword Arguments:

Description:

This form is used to build a new command named script-name. This new command can be used in either interactive mode or in script mode. The script defining the command is a list of forms, each of which is a command form or a keyword form. See a description of the proof script language in Chapter 12.

Examples:

   (def-script EPSILON/N-ARGUMENT 1 
     ((instantiate-universal-antecedent 
        "with(p:prop, forall(eps:rr, 0<eps implies p))" ($1))))

   
def-section

Positional Arguments:

Keyword Arguments:

Description:

This form builds a section which, when loaded, loads the sections with names $\mbox{\it section-name}_1, \ldots, \mbox{\it section-name}_n$and then loads the files with specifications $\mbox{\it
file-spec}_1, \ldots, \mbox{\it file-spec}_n$. A section can be loaded with the form load-section.

Examples:

   (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)))

   
def-sublanguage

Positional Arguments:

Keyword Arguments:

Description:

This form finds the smallest sublanguage of the language L named superlanguage-name which contains the sublanguages of Lnamed language- $\mbox{\it name}_1$, ..., language- $\mbox{\it name}_n$; the atomic sorts of L named sort- $\mbox{\it name}_1$, ..., sort- $\mbox{\it name}_n$; and the constants of L named $\mbox{\it
constant-name}_1,\ldots,\mbox{\it constant-name}_n$.

Each of $\mbox{\it superlanguage-name\/},\mbox{\it
language-name}_1,\ldots,\mbox{\it language-name}_n$ may be the name of a theory instead of a language.

Examples:

   (def-sublanguage REAL-VECTOR-LANGUAGE
     (superlanguage vector-spaces-over-rr-language)
     (languages h-o-real-arithmetic)
     (sorts uu)
     (constants ++ v0 **))

   
def-theorem

Positional Arguments:

Modifier Arguments:

Keyword Arguments:

Description:

This form installs a theorem in three steps. Let $\Phi$ 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 $\Phi$ if there is a translation argument and otherwise H=T. Finally, let $\varphi$ be the formula specified by formula-spec in H.

Step 1. IMPS verifies that $\varphi$ is a theorem of H. If proof-spec is the symbol existing-theorem, IMPS checks to see that $\varphi$ 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 $\varphi$is a theorem of H by running the script proof-spec. Otherwise, IMPS simply checks that $\varphi$ is a formula in H, and it is assumed that the user has verified that $\varphi$ is a theorem of H.

Step 2. The theorem $\varphi'$ to be installed is generated from $\varphi$ as follows:

Step 3. $\varphi'$ is installed as a theorem in T with usage list $\mbox{\it symbol}_1$, $\ldots$, $\mbox{\it
symbol}_n$.

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:

In other words, the reverse argument allows you to install both a theorem and its reverse. It is very useful for building a macete (or transportable macete) and its reverse by evaluating one form. Of course, it would not be wise to use the reverse argument when rewrite is a usage.

Examples:

   (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))

   
def-theory

Positional Arguments:

Keyword Arguments:

Description:

This form builds a theory named theory-name. The language of this theory is the union of the language language-name and the languages of the component theories. The axioms of the theory are the formulas represented by the strings in the list axiom-spec. The distinct-constants list implicitly adds new axioms asserting that the constants in each list distinct are not equal.

Examples:

   (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)")))

   
def-theory-ensemble

Positional Arguments:

Keyword Arguments:

Description:

This form builds a theory ensemble such that
1.
The base theory is the theory with name theory-name if the base-theory keyword argument is provided or ensemble-name otherwise.
2.
The fixed theories are those given in the fixed-theories keyword argument list if the fixed-theories keyword argument is provided or those theories in the global fixed theories list at the time the form is evaluated.

Remarks:

If there is already a theory ensemble with name ensemble-name but with different fixed-theories set or different renamer an error will result.

Examples:

   (def-theory-ensemble METRIC-SPACES)

   
def-theory-ensemble-instances

Positional Arguments:

Keyword Arguments:

Description:

This form is used to build translations from selected theory multiples and to transport natively defined constants and sorts from these multiples. To describe the effects of evaluating this form, we consider a number of cases and subcases determined by the presence of certain keyword arguments.

Examples:

   (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

Positional Arguments:

Description:

Builds a theory which is an N-multiple of the theory ensemble base, together with N theory interpretations from the base theory into the multiple. All existing definitions of the base theory are translated via these interpretations. The N-multiple is constructed to be a subtheory of the (N+1)-multiple.

Examples:

   (def-theory-ensemble-multiple metric-spaces 2)

   
def-theory-ensemble-overloadings

Positional Arguments:

Description:

Installs overloadings for constants natively defined in the theory multiples $\mbox{\it N}_1 \ldots {\it
N}_k.$

Examples:

   (def-theory-ensemble-overloadings metric-spaces 1 2)

   
def-theory-instance

Positional Arguments:

Keyword Arguments:

Description:

Let T0 and $T^{\prime}_{0}$ be the source and target theories, respectively, of the translation $\Phi$ named trans-name. Also, let T1 and $T^{\prime}_{1}$be the theories named source-theory-name and target-theory-name, respectively. Lastly, let $\mathcal F$ be the set of theories named $\mbox{\it theory-name}_1,\ldots,\mbox{\it
theory-name}_n$.

Suppose that T0 and $T^{\prime}_{0}$ are subtheories of T1 and $T^{\prime}_{1}$, respectively, and that every member of $\mathcal F$ is a subtheory of T1. The theory named name is an extension Uof $T^{\prime}_{1}$ built as follows. First, the primitive vocabulary of T1 which is outside of T0 and $\mathcal F$ is added to the language of $T^{\prime}_{1}$; the vocabulary is renamed using the value of renamer. Next, the translations of the axioms of T1 which are outside of T0 and $\mathcal F$ are added to the axioms of $T^{\prime}_{1}$; the axioms are renamed using the value of renamer. U is union of the resulting theory and the members of $\mathcal F$ . The translation $\Phi'$ from T1 to U extending $\Phi$ is created with name new-trans-name.

Examples:

   (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))

   
def-theory-processors

Positional Arguments:

Keyword Arguments:

Description:

This form causes the simplifier of the theory named theory-name to simplify certain terms using the specified algebraic and order processors as follows:

Examples:

  (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))

   
def-translation

Positional Arguments:

Modifier Arguments:

Keyword Arguments:

Description:

This form builds a translation named name from the source theory S named source-theory-name to the target theory T named target-theory-name. (The target context in T is the set of assumptions specified by $\mbox{\it formula-string}_1$, $\ldots$, $\mbox{\it formula-string}_n$.) 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.

Examples:

   (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))

   
def-transported-symbols

Positional Arguments:

Keyword Arguments:

Description:

Let T and T' be the source and target theories, respectively, of the translation $\Phi$ named translation-name, and let $\mbox{\it sym}_1$,..., $\mbox{\it
sym}_n$ be the symbols whose names are given by names. For each $\mbox{\it sym}_i$ which is a defined symbol in T, this form creates a corresponding new defined symbol $\mbox{\it sym}^{\prime}_{i}$ in T' by translating the defining object of $\mbox{\it sym}_i$ via $\Phi$. If $\Phi$ already translates $\mbox{\it sym}_i$ to some defined symbol, the new symbol is not created.

Examples:

   (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))

17.2 Changing Syntax

   
def-overloading

Positional Arguments:

Examples:

   (def-overloading *  
     (h-o-real-arithmetic *) 
     (normed-linear-spaces **))

   
def-parse-syntax

Positional Arguments:

Keyword Arguments:

Description:

This form allows you to set (or reset) the parse syntax of a constant. In particular, you can change the precedence, parsing method, and token representation of a constant. The most common parsing methods are: Note that an operator can have both a null-method and a left-method.

Examples:

   (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

Positional Arguments:

Modifier Arguments:

Keyword Arguments:

Description:

This form allows you to set (or reset) the print syntax of a constant. In particular, you can change the precedence, parsing method, and token representation of a constant.

Examples

   (def-print-syntax + 
     (method present-binary-infix-operator) 
     (binding 100))

   (def-print-syntax factorial 
     (token !) 
     (method present-postfix-operator) 
     (binding 160))

17.3 Loading Sections and Files

   
load-section

Positional Arguments:

Modifier Arguments:

Keyword Arguments:

None.

Description:

If there are no modifier arguments, this form will simply load the component sections and files of the section named section-name which have not been loaded.

   
include-files

Positional Arguments:

None.

Modifier Arguments:

Keyword Arguments:

Description:

If there are no modifier arguments, this form will simply load the files with specifications $\mbox{\it
file-spec}_1, \ldots, \mbox{\it file-spec}_n$ which have not been loaded.

17.4 Presenting Expressions

   
view-expr

Positional Arguments:

Modifier Arguments:

Keyword Arguments:


next up previous contents
Next: 18. The Proof Commands Up: 3. Reference Manual Previous: 3. Reference Manual
System Administrator
2000-07-23