A Simple Solver for Linear Equations Containing Nonlinear Operators

This paper presents a simple equation solver. The solver finds solutions for sets of linear equations extended with several nonlinear operators, including integer division and modulus, sign extension, and bit slicing. The solver uses a new technique called balancing, which can eliminate some nonlinear operators from a set of equations before applying Gaussian elimination. The solver's principal advantages are its simplicity and its ability to handle some nonlinear operators, including nonlinear functions of more than one variable. The solver is part of an application generator that provides encoding and decoding of machine instructions based Oil equational specifications. The solver is presented not as pseudo code but as a literate program, which guarantees that the code shown in the paper is the same code that is actually used. Using real code exposes more detail than using pseudocode, but literate-programming techniques help manage the detail. The detail should benefit readers who want to implement their own solvers based on the techniques presented here.

[1]  Ivan E. Sutherland,et al.  Sketchpad a Man-Machine Graphical Communication System , 1899, Outstanding Dissertations in the Computer Sciences.

[2]  Donald E. Knuth,et al.  Literate Programming , 1984, Comput. J..

[3]  EMANUEL DERMAN,et al.  A simple equation solver and its application to financial modelling , 1984, Softw. Pract. Exp..

[4]  Donald Ervin Knuth,et al.  The METAFONTbook , 1986 .

[5]  William Pugh,et al.  A practical algorithm for exact array dependence analysis , 1992, CACM.

[6]  J. Christopher Ramming,et al.  Two Application languages in software production , 1994 .

[7]  Christoph M. Hoffmann,et al.  Programming with Equations , 1982, TOPL.

[8]  Kenneth Steiglitz,et al.  Combinatorial Optimization: Algorithms and Complexity , 1981 .

[9]  Alan Borning,et al.  The Programming Language Aspects of ThingLab, a Constraint-Oriented Simulation Laboratory , 1981, TOPL.

[10]  Christopher J. Van Wyk Arithmetic Equality Constraints as C++ Statements , 1992, Softw. Pract. Exp..

[11]  Bjarne Stroustrup,et al.  The C++ Programming Language, Second Edition , 1991 .

[12]  Norman Ramsey,et al.  Literate programming simplified , 1994, IEEE Software.

[13]  Norman Ramsey,et al.  New Jersey Machine-Code Toolkit Architecture Specifications , 1994 .

[14]  Stephen J. Garland,et al.  Larch: Languages and Tools for Formal Specification , 1993, Texts and Monographs in Computer Science.

[15]  Norman Ramsey,et al.  The New Jersey Machine-Code Toolkit , 1995, USENIX.