vaxmacs is a software package that allows you to count perfect matchings of bipartite planar graphs, compute placement probabilities, q-enumerations, and many other things. The planar graph is represented as an ASCII picture in an emacs buffer. In addition to computing properties of the graph, vaxmacs can help construct the ASCII representation, and can construct postscript of the graph. vaxmacs is self-documenting, once you have it running, typing ``?'' will cause it to explain how to use it.

vaxmacs requires GNU emacs and Maple. (More precisely, vaxmacs is a major mode for emacs, which makes calls to Maple.)
GNU emacs may be downloaded from here.
For Macs there is also a version of emacs that uses the Aqua interface; vaxmacs will work with either version.

To download vaxmacs, click here to obtain vax.el (this is the file defining the vaxmacs commands), and save it to either your home directory or to an elisp subdirectory within your home directory. (It needs to be saved without a .txt extension.)

The next step is to add 4 lines to your .emacs file, as desribed below. If you have never used emacs before, you need to create a .emacs file. To do this, open emacs, then type C-x C-f (control-x control-f) ~/.emacs (and then return). Then add the lines to the .emacs file described below, and save it by typing C-x C-s.

The first line instructs emacs to start vax-mode when a .vax file is opened:

(setq auto-mode-alist (cons '("\\.vax$" . vax-mode) auto-mode-alist))

The second line tells emacs the location of the vax.el file. Some examples are

(autoload 'vax-mode (expand-file-name "~/elisp/vax.el") nil t) ;; what I used on my computer

(autoload 'vax-mode "/mit/tiling/elisp/vax.el" nil t) ;; used by MIT tilings research group

The third line tells emacs the path for the command-line version maple. This varies by operating system and version of maple. The following are some examples.

(setq maple-command "//Library/Frameworks/Maple.framework/Versions/2018/bin/maple") ;; for Mac

(setq maple-command "/mit/tiling/bin/mapletty") ;; for tiling research group

(setq maple-command "~/maple2018/bin/maple") ;; for Linux

(setq maple-command "C:\\Program Files\\Maple 2018\\bin.X86_64_WINDOWS\\cmaple.exe") ;; for Windows

(setq maple-command "C:\\Program Files (x86)\\Maple 2018\\\\cmaple.exe") ;; for Windows

(setq maple-command "C:\\Program Files\\Maple 2018\\\\cmaple.exe") ;; for Windows

(setq maple-command "C:\\Program Files\\Maple 7\\BIN.W2000\\cmaple.exe") ;; for Windows

The fourth line specifies what command to use to view postscript files. If you have a program which allows you to view postscript files from the command line, the name of that program goes here. If not, you can download ghostscript from here. Some examples are

(setq postscript-viewer "open") ;; for Mac

(setq postscript-viewer "ghostscript")

(setq postscript-viewer "ghostview")

(setq postscript-viewer "gs")

Then close emacs.

The next time emacs is opened, it will automatically read the .emacs file, which tells it where to find the vaxmacs commands.

If everything was done correctly, then whenever you open a file with a .vax filename extension, emacs will enter VAX mode, and you're in business. The following is some documentation on how to use vaxmacs; this documentation may also be viewed by typing "?" when in VAX mode.

Major mode for creating VAX files and computing stuff about the
regions they define.  A typical VAX file contains any of the characters
X, V, A, <, >, =, I, and white space.  Described below are
   1) The commands for computing with VAX files.
   2) The commands to help create VAX files more easily
      (especially useful when working with non-Cartesian lattices).
   3) The VAX file format  (Many dominoers are already familiar with this,
      if you are not, look at this first.)
   4) Working with other lattices.

                     Menu of available commands

? show this message

Commands for obtaining information from VAX file

  P  make a picture of the region
  #  compute number of tilings
  p  compute prime factorization of number of tilings
  [  compute q-factorization of q-analogue of number of tilings
  m  compute lots of data with maple
  g  graph the placement probabilities
  f  toggle floating point / fraction
  d  make your own character definition, like A, V, <, I, =
     you will be prompted for weights for matchings to each to each of
     a squares four neighbors -- for the predefined characters these
     weights are all either 0 or 1, but in general the weights may be
     arbitrary maple expressions
  .  exclude/include current square from current subdeterminant
  q  toggle q-mode

Commands for editing VAX file
    Note that any of the standard VAX characters may be
    typed without the shift key, capitalization is automatic.

  z  write out an Aztec diamond using lattice
  r  write out rectangle using lattice
  h  write out hexagon using lattice
  l  set the lattice (default is square lattice)
  k  kill to beginning of line
 ^k  kill to end of line
  0  clear entire buffer
  (, ), e  macro define and execute
  `  move cursor up and left
  '  move cursor up and right
  /  move cursor down and left
  \  move cursor down and right

VAX mode runs in Picture mode, in which a quarter-plane screen model is used.
Printing characters replace instead of inserting themselves with motion
afterwards settable by these commands:
  C-c <	  Move left after insertion.
  C-c >	  Move right after insertion.
  C-c ^	  Move up after insertion.
  C-c .	  Move down after insertion.
  C-c `	  Move northwest (nw) after insertion.
  C-c '	  Move northeast (ne) after insertion.
  C-c /	  Move southwest (sw) after insertion.
  C-c \   Move southeast (se) after insertion.
The current direction is displayed in the mode line.  The initial
direction is right.  Whitespace is inserted and tabs are changed to
spaces when required by movement.

                         VAX File Format

A VAX file is a file format for describing planar bipartite graphs.
For most regions that Propp's tiling group is interested in, VAX files
tend to be compact and human readable.  To make VAX files extra readable,
vaxmacs can generate postscript pictures of the graphs they define.

The region to be tiled should be given as a pattern of V's, A's, X's,
<'s, >'s, ='s, I's, and white space.  There are two ways to view a VAX
file.  In the first, any non-whitespace character represents a vertex of
graph, and we are interested in perfect matchings of this graph.  In the
second, the non-whitespace characters represent units of area in a region
that is to be covered by tiles.  (These tiles may be dominos, lozenges,
diabolos, and the like.)

By default two characters that look adjacent in the file (either left, right,
up, or down) represent vertices that are adjacent in the graph -- and they
are connected unless one (or both) of the characters objects.  Different
characters object to different sets of connections.

X: may be paired in any direction, it has no objections
V: objects to being paired DOWN
A: objects to being paired UP
<: objects to being paired LEFT
>: objects to being paired RIGHT
=: objects to being paired UP or DOWN
I: objects to being paired LEFT or RIGHT

For instance, the graphs

|     |			       o--o--o--o
o     o          and           |        |
|     |			       o--o--o--o

may be represented as

X X              and   	       AVVA
XXX			       VAAV

There are two mnemonics for remembering the meanings of V,A,<,>.
These characters object to connections in their pointed direction.
The second mnemonic is that these characters resemble triangles, and
if one has a region tiled by equilateral triangles
                                   /\  /\
                                  \  /\  /

and one wishes to pair up the triangles to form a rhombus-tiling, the
triangles that look like V's are the ones that can pair (sort of) leftward,
(sort of) rightward, or upward.  This region would be represented with


The characters = and I are useful for "vertex splitting".  If some vertex
in the graph that we wish to represent has high degree, it may be split into
three vertices.  The middle vertex is connected to only the other two vertices,
and these vertices partition the connections of the original vertex to the
rest of the graph.  Matchings in the new graph are in one-to-one correspondence
with matchings in the new graph.  When splitting, the middle vertex character
is either = or I, indicating that the two vertices on either side of it are
EQUAL or IDENTICAL in the original graph.

                     Things you can do with VAX files

The most basic question you can ask is how many tilings there are of the
region defined by the VAX file.  To find out, just type #.  Lots more
information is available if you type m.

                           The current lattice

Almost every region that people care about is a subregion of some infinite
regular lattice.  Vax mode provides commands that can be used to quickly
generate these regions.  Use "l" to define the periodic unit of the
infinite lattice.  The default lattice is the square lattice.  To set the
lattice to something else, type "l".  This will take you to a menu letting
you set the lattice to one of the following predefined lattices
  urban-renewal (diabolo-weighted square)
or you can define your own lattice, by then typing "g" (for general),
and then inputing the repeating blocks of the lattice.  For instance,
the hexagonal lattice has a 2x2 repeating block consisting of
which could be entered as
or since it's predefined, as

Once the lattice is defined, the commands for generating regions will
automatically use the lattice.  For instance, the "r" command for making
a rectangle, the "z" command for making an Aztec diamond, and the "h"
command for making hexagons, will make their respective shapes using the
current lattice.  This regions can then be edited and explored.