[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
1. Introduction to qepmax | ||
2. Functions and Variables for qepmax |
Qepmax
is a Qepcad B
- Maxima interfacing module written in
Maxima language and Common Lisp. As Qepcad B
provides so
called quantifier elimination in the real domain, qepmax
adds this functionality to Maxima computer algebra system.
With using quantifier elimination (Q.E. in short), a variety of problems can be expressed and solved. Optimization problems with multi-variate polynomials with equality and inequality constraints can be exactly(!) and symbolically(!!) solved.
Qepmax
requires Qepcad B
, developed at and distributed from
the United States Naval Academy. Qepmax
users are suggested to visit
Qepcad B homepage to
become familier with Qepcad B
, to obtain the distribution package, and
to know how to install it.
Lincese terms of Qepmax
can be found in each source files.
Qepmax
package is in GPL v2.
Qepmax
package is written by Yasuaki Honda, then Prof.
Dr. Reinhard Oldenburg of Goethe-Universität Frankfurt has
contributed the improvements for allowing the use of logical
operators and rational functions as well as better function
interface.
Further, ehito-san has contributed the improvement of the treatment of rational functions, nested qe() call, and strict rational function treatment.
Hereafter is the quick introduction of:
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
A large size of problems can be expressed as a first order predicate logic with the following properties:
A logical formula with some of its variables quntified is called a Tarski sentence. Example: a circle x^2+y^2=1 and a line y=x/2+1/3 crosses with each other. Tarski sentence for this is: E x, E y, x^2+y^2=1 and y=x/2+1/3 where E denotes the existential quantifier.
The quntifier elimination is a technique to obtain the equivarent condition to the given Tarski sentence. The resulted condition does not contain any quantified variables.
By using the quantifier elimination technique, we can obtain an equivarent condition: true meaning that, yes, there is a point (x,y) which satisfies both circle and line formulas.
On the other hand, from E x, E y, x^2+y^2=1 and y=x/2+5 we will obtain false since there is no such intersection point (x,y).
Further more, considering the following Tarski sentence with free variable a: E x, E y, x^2+y^2=1 and y=x/2+a
Using the quantifier elimination, we obtain a condition on a: 4*a^2-5<=0
So, while a is in this range, the circle and the line cross, but they don't cross if a is not in the range above.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Qepcad B is a software that implements a quantifier elimination algorithm called Cylindrical Algebraic Decomposition (CAD). The software is developed by Prof. Chris Brown of US Naval Academy. The homepage of the software is: http://www.usna.edu/CS/~qepcad/B/QEPCAD.html
On starting the program Qepcad B, the interactive session starts. You give a list of variables, number of free variables, a list of quntified variables, and a Tarski sentence with Qepcad B syntax during the session. Alternatively, you can supply all such information in a file and Qepcad B processes it. Then the program computes the equivarent condition to the specified Tarski sentence, only including the free variables.
It is a fun to use Qepcad B directly from its command line interface, as it provides many commands and options to use during the interactive sessions.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Qepmax is a Maxima package that calls Qepcad B internally using system() function to process Tarski sentence represented using Maxima syntax.
Assuming it is correctly installed according to INSTALL, you can load the package by:
(%i1) load("qepmax.mac");
Qepmax package provides a function qe(QFList, aLogicalExp)
.
QFList
is a list of quantified variables. aLogicalExp
is an
expression in the real domain. You can use =,<,>,<=,>=,# as
the predicates, polynomials and rational functions as terms,
and %and, %or, %not, %implies as the logical operators.
In polimomials and rational functions, you can use rational
numbers and variables as coefficients.
The function qe()
generates a temporary file that can be used for the
input of Qepcad B. Then Qepcad B is invoked with the file contents
supplied from standard input. Qepcad generates an output file in which
quantifier elimination result is written.
Then qe()
read the output file and translate the result into Maxima
formula and return it from qe(). You can of course use it for the futher
computation using Maxima.
@opencatbox @category{Symbolic methods} @category{Optimization} @category{Share packages} @category{Package qepmax} @closecatbox
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Compute a formula equivarent to LogicalExp with quantified variables specified in QFVList. The computed formula does NOT contain any quantified variables in QFVList.
Before giving preciese syntax definition, here goes the examples appeared in the Quantifier Elimination explanation.
(%i1) qe([[E,x],[E,y]], x^2+y^2=1 %and y=x/2+1/3); (%o1) true (%i2) qe([[E,x],[E,y]],x^2+y^2=1 %and y=x/2+5); (%o2) false [ qe1 ]
QFVList is a list of pairs (two element list) of a quantifier and a variable. A quantifier is one of A,E,F,G,C,and Xk, where k is a positive integer. Variables are ordinal Maxima variables, however, indexed variables are not supported. Quantifier A is the universal quantifier (for all). E is the existential quantifier (there exists). F,G,C are described in Qepcad B homepage. Xk is similar to E, but the number of existence is exactly k.
An example of QFVList is [[A,x],[A,y]], meaning "For all x and for all y in R". Another example is [[E,x],[A,y],[A,z]], meaning "There exists x in R such that for all y and for all z in R". Variables appeared in QVList are called quantified variables.
LogicalExp is a boolean formula in which you can use %and, %or, %implies,
and %not as boolean operators. Predicates in atomic formulas appeared in the
LogicalExp are restricted to <, <=, >, >=, =, #
. Terms in the
atomic formulas are restricted to multivariate polynomials or rational functions
with coefficients being rational numbers. Atomic formula may also be a maxima
function which returns a boolean formula.
Qepmax
supports the Extended Tarski Formula, the atomic formula
of the form var op etf_root(k, polynomial)
. Detailed semantics
of this atomic formula is difficult explain here. Instead you should
refer to the following URL
http://www.usna.edu/CS/~qepcad/B/user/ETF.html.
Here I give you a very typical example and its meaning. In the Q.E.,
you may want to express some conditions on one of roots of an
equation. Extended Tarski Formula can be used for this purpose. For an
example, you can specify that x is a second smallest root of
x^2=2
by the atomic formula x=etf_root(2,x^2-2)
. This is
a shortcut of expressing that x is sqrt(2).
Any quantified variables specified in the QVList can be used in the LogicalExp. Variables that are not specified in the QVList can also be used. They are called free variables.
Couple of examples of LogicalExp are:
x^2>=0 y=x/2+m %and y<x+1 %and y<-x+1
qe
returns a boolean formula which only contains free variables in
the LogicalExp, still the returned formula is equivalent to
LogicalExp quantified by QVList.
Default value: "~/qepmax/qesource"
By extracting Qepcad B source tarball, all the files are placed in the
directory qesource
. This variable needs to be set up to point
that directory.
Default value: sconcat(maxima_tempdir, "/qepcad_input.txt")
Qepmax
creates temporary files during its execution. One is
the input file to the qepcad command. This variable can be used to
specify the file path and the file name of the input file.
The default value is the concatenation of maxima_tempdir
and
"/qepcad_input.txt"
. Note that if you change the value of this
variable, you should also consider to change the value of the variable
qepcad_file_pattern
.
Default value: sconcat(maxima_tempdir, "/qepcad_output.txt")
Qepmax
creates temporary files during its execution. One is
the output file to the qepcad command. This variable can be used to
specify the file path and the file name of the output file.
The default value is the concatenation of maxima_tempdir
and
"/qepcad_output.txt"
. Note that if you change the value of this
variable, you should also consider to change the value of the variable
qepcad_file_pattern
.
Default value: sconcat(maxima_tempdir,"/qepcad_*.txt")
Qepmax
creates temporary files during its execution. Prior
to the creation, if exists, qepmax
deletes such temporary
files using rm
command using system()
function.
This variable is used to specify the files to be deleted.
The default value is the concatenation of maxima_tempdir
and
"/qepcad_*.txt"
, which are good for default file names of
the input and output files. If you change the value of qepcad_input_file
and / or qepcad_output_file
, you should also consider to change
the value of this variable.
Default value: " +N20000000 +L10000 "
Qepcad B
accepts several options. This variable is used to
specify such options to be passed.
The default value is " +N20000000 +L10000 ", which allocates more
memory to the computation library used in qepcad
.
[Top] | [Contents] | [Index] | [ ? ] |
This document was generated by 本田 康晃 on July, 27 2014 using texi2html 1.76.
The buttons in the navigation panels have the following meaning:
Button | Name | Go to | From 1.2.3 go to |
---|---|---|---|
[ < ] | Back | previous section in reading order | 1.2.2 |
[ > ] | Forward | next section in reading order | 1.2.4 |
[ << ] | FastBack | beginning of this chapter or previous chapter | 1 |
[ Up ] | Up | up section | 1.2 |
[ >> ] | FastForward | next chapter | 2 |
[Top] | Top | cover (top) of document | |
[Contents] | Contents | table of contents | |
[Index] | Index | index | |
[ ? ] | About | about (help) |
where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:
This document was generated by 本田 康晃 on July, 27 2014 using texi2html 1.76.