Reference#
The reference pages describe exactly what mathspec accepts, what it refuses, and what it prints. The tutorials teach the language to a reader who has not yet written the specification of an optimisation model (a spec).
The language#
- The language lists the rules a spec file must meet, and which page states each rule in full.
- File shape lists the top-level keys of a spec file, and how mathspec reads the YAML.
- Given, parameters, variables, objective and constraints
lists the keys of the data, the decisions, the rules and the goal, and of the
given:section. - Dimensions lists the keys of a named set of labels (a dimension).
- Relations and maps lists the keys of a set of combinations of labels (a relation) and of the label each row has (a map), and how an expression uses them.
- Expressions defines the grammar of arithmetic and of conditions, and how dimensions combine.
- Named expressions, conditions and macros describes the three ways to name a piece of an expression and use it again.
- Operators lists every construct built into the
language (an operator), such as
sumandshift, and the math mathspec prints for each. - Piecewise curves and SOS lists the keys of a piecewise-linear curve and of a special ordered set (SOS).
- Assumptions lists the keys that state what a spec expects of its data.
- Absence and where describes which rows do not exist (absent), and how absence spreads through an expression.
- Errors and advice lists what mathspec refuses at load, and what it advises without refusing.
Tools and the Python API#
- Composing specs describes the rules that
mergeandoverridefollow when they build one spec from several files. - Typeset output describes the document that mathspec prints in each output format, LaTeX, Typst and Markdown.
- Command line lists every command of
python -m mathspec, its flags with their Python keywords, and its exit codes. - Python API lists every public function of the
mathspecpackage, and where each class is documented.
Glossary and changelog#
Examples#
- Examples are whole specs, each beside the math that mathspec prints from it.
See also
- Reading a spec and its program, reference for a person who writes a tool that reads a spec, such as an engine or a renderer