Dusa helpers
In addition to the Dusa class and solution iterator and the the DusaSolution class, the Dusa API includes a couple of other utility functions.
compareTerm()
and compareTerms()
Provides a consistent comparison function for sorting Dusa terms or list of Dusa terms.
termToString()
Provides a consistent way of making terms into strings. If true
is passed
as the parens
argument, then structured terms with arguments will be
surrounded by parentheses.
check()
and compile()
The check()
function runs just static checks on a Dusa program, and returns
a list of any issues that exist.
The compile()
function transforms a Dusa source program into an
intermediate “bytecode” representation which can be passed to the Dusa
constructor instead of a source program. If there are any issues, the
DusaCompileError
exception will be thrown.