Monos Algebra Software

R. Alexander Milowski

Mathematics Department

University of California, Davis


Table of Contents


Monos is a software system written in Java [7] for computing on monomial and binomial ideals. The software contains implementations of algorithms found in [1] and [2] for computations related to monomial and binomial ideals. In addition, monos contains a scripting language that uses R5RS Scheme [3].

This software was referenced last year in a presentation at ISSAC 2004 [4] and has since been enhanced and released. The latest version is also available as a web-based application that can be used without installing any software.


The following is a list of the major computations supports by monos:

In addition, there is a full complement of functions for manipulating the data produced with the scripting language.


A monomial ideal generating set can be listed directly as an expression in scheme. When the monomials are stored, they are stored as vectors. As such, a lexicographic ordering must be specified. The constructor monomial-ideal allows both the lexicographic ordering and the generators of the ideal to be specified in variable expression format:

   (lex-order x1 x2 x3 x4) 
   (x1^2*x2 x1*x3*x4 x2^4*x3*x4^2 x3^3*x4^2))

Within the Scheme-based scripting language, a lexicographic ordering is just another object in the language. As such, you can bind the lex order to a variable and re-use that ordering during computations. The monomial-ideal constructor also allows you to leave off the monomial ordering. When this is done, it expects the monomial ordering to be bound to the *lex-order* symbol in the environment as shown in the following example:

(fluid-let ((*lex-order* (lex-order x1 x2 x3 x4)))
     (monomial-ideal x1  x2  x3*x4)
     (monomial-ideal x1^2*x2  x1*x3*x4 
                     x2^4*x3*x4^2  x3^3*x4^2)) )

In addition, mathematical objects can be read and written as scheme objects. For example, here is a simple program that decomposes an ideal read from a file and writes the result to program output:

(let* ((file (vector-ref command-line-arguments 0))
       (input (open-input-file file))
       (generators (eval (read input)))
   (write (decompose-ideal generators))

In fact, every mathematical object can be written by the Scheme write function such that it can be read in again. The Scheme read function allows a serialized object to be read and instantiated by the eval function. This treatment is consistent with Scheme's use of read and write for its own data structures.

A more complicated example is the following program that will post-process the decomposition of a monomial ideal for an integer gap computation. This program will only output the components where the generators have exponents greater than one:

(let* ((file (vector-ref command-line-arguments 0))
       (input (open-input-file file))
       (components (eval (read input)))
                   (lex-order-ref components))
       (size (java.util.List:size components)) )
     (do ((i 0 
            (if (monomial-divides?
                  (lcm (java.util.List:get components i))
              (begin (invoke 'remove components i) i)
              (+ i 1)) ))
        ((= i size) components) ) ) )

The scheme environment provided by the kawa [8] scheme implementation [9] provides the ability for Schema and Java to interact. This means that not only is all the R5RS functionality available within the environment but also all of Java and any Java library that exposes public APIs.

For example, this example creates a window that contains a label via the Java AWT library:

(let ((frame (java.awt.Frame:new "My Application"))
      (label (java.awt.Label:new "Math is Cool!")))
   (java.awt.Frame:add frame label)
   (java.awt.Frame:show frame))

Finally, there is a full Java API for the core algorithms. This API can be used independently of the Scheme scripting language.


The monos software is currently integrated into a XML pipelining technology called smallx [6] as well as a P2P (peer to peer) computing environment based on JXTA [5] for distributed process. The smallx XML pipelining technology allows computations to be input as XML documents. This allows easy deployment as a web service or for integration into other web-based technologies.

The JXTA-based P2P software is for collaborative grid computing. The essential idea here is to use the XML-enabled form of the monos software to allow distributed processing. This version of the monos software allows processing to be distributed to unused computing power such in a computer lab or on a desktop computer at night. In contrast to other distributed computing environments, as a P2P technology, the computation is decentralized and runs on whatever resources "decide" to join a computation.

A test P2P grid will be deployed this summer (2005) between San Francisco State University and the author's servers.


Monos is available at:

and requires a Java 1.4.x environment to run.

Also, there is an online demonstration of the software that allows computing:

all within a web form. Eventually, this application will be attached to the P2P grid to share its computational power.

This web application also has a set of web services available that mirror the web form functionality. In fact, the web forms are just interfaces to these web services.

For example, the following document can be sent to compute example 12.7 in [2]:

<list>1 2 3 4 0 1 4 5</list>
<list>2 3 4 1 1 4 5 0</list>
<list>3 4 1 2 4 5 0 1</list>
<list>4 1 2 3 5 0 1 4</list>

The result comes back as:

<binomial-ideal xmlns=''>
<matrix compact="true">
<list>0 0 0 4 0 -1 0 -3</list>
<list>0 0 4 0 -1 0 -3 0</list>
<list>0 1 0 -3 0 0 0 2</list>
<list>0 1 0 1 0 -1 0 -1</list>
<list>0 2 0 -2 0 -1 0 1</list>
<list>0 3 0 -1 0 -2 0 0</list>
<list>1 0 -3 0 0 0 2 0</list>
<list>1 0 1 0 -1 0 -1 0</list>
<list>2 0 -2 0 -1 0 1 0</list>
<list>3 0 -1 0 -2 0 0 0</list>


  1. R. Alexander Milowski, Computing Irredundant Irreducible Decompositions and the Scarf Complex of Large Scale Monomial Ideals, San Francisco State University, 2004
  2. Bernd Sturmfels, Gröbner Bases and Convex Polytopes, American Mathematical Society, 1995
  3. R. Kelsey, W. Clinger, J. Rees, Revised 5 Report on the Algorithmic Language Scheme, August 1998
  4. R. Alexander Milowski, Computing Irredundant Irreducible Decompositions of Large Scale Monomial Ideals, ISSAC 2004, ACM, 235-242, 2004
  5. Sun Microsystems, JXTA,, 2005
  6. R. Alexander Milowski, smallx,, 2005
  7. Sun Microsystems, Java,, 2005
  8. Per Bothner, Kawa: Compiling Scheme to Java, Lisp Users Conference, 1998
  9. Per Bothner, Kawa Software,, 2005