VT-DSL
1. Overview
VT-DSL is a domain-specific language for describing variation and sign tables. It is designed to be:
- Human-readable
- AI-friendly for generation and parsing
- Structurally regular while semantically flexible
The DSL describes table structure, not mathematical correctness.
2. General Syntax
header [var] : [domain]
row [row-label] [/height] : [row-content]
...
A file must contain exactly one header, followed by zero
or more row declarations. All bracketed components are
optional.
header — defines the first row; must
come before any row.
-
var: Defines the variable name. -
domain: Defines the boundaries and values, separated by commas (,).
Values can be text (delimited by
' or ") or
math (delimited by $). You can nest math
inside text quotes: "variation of $\abs{x}$".
header $x$ : $-\infty$, $0$, $+\infty$
row — defines a horizontal row.
-
row-label: label of the row, placed at the first column, e.g.,"sign of $f'(x)$". -
/height: Relative height multiplier, e.g.,/2. -
row-content: Sequence of cell contents (text, math,signs, ...) and separators.
Signs + and - are
native tokens and do not require quotes.
row "sign of $f'(x)$" /1.5 : + -
3. Separators
Separators describe vertical lines between cells. They are optional.
| Syntax | Meaning |
|---|---|
& |
Invisible separator |
|& |
single bar |
||& |
double bar |
:& |
Dashed |
::& |
Double dashed |
row : ::& + :& - |&
row : -& + & - ||&
Labels
can be attached to a separator using
&{position:value}. There are 9 positions:
top-left |
top-center (alias top) |
top-right |
|---|---|---|
center-left |
center-center (alias center) |
center-right |
bottom-left |
bottom-center (alias bottom) |
bottom-right |
row : + |&{top-left:"top-left", bottom-right:"bottom-right"} -
row : + |&{center:$0$} -
4. Undefined and Skipped Regions
-
UNDEF: Renders a hashed region where a function is not defined. -
SKIP: Skips a cell entirely; nothing is drawn, and the next content moves to the next cell.
row : + UNDEF +
row : UNDEF SKIP UNDEF
5. Variations
Three commands describe function variation:
| Command | Meaning |
|---|---|
INC |
Increasing arrow |
DEC |
Decreasing arrow |
CONST |
Constant (horizontal) |
row : INC CONST DEC
Options:
-
arrow: Set head to"start","end","both", or"none". -
vPos: (ForCONST) Set to"top","center", or"bottom".
row : INC{arrow:"start"} CONST{arrow:"none", vPos:"bottom"} DEC{arrow:"both"}
Extrema and Limits: we can specify extrema and limits by attaching them to a separator
row : &{bottom-right:$-\infty$} INC |&{top:$-1$} DEC &{bottom-left:$-\infty$}
Note : Labels on boundary separators must be explicitly aligned inward: use right-aligned positions at the left edge and left-aligned positions at the right edge.
6. Multicolumn Content
Any content type can span multiple columns using the
colSpan option. If multiple options are used, separate
them with a comma.
row : "text"{colSpan:2} INC
row : UNDEF{colSpan:3}
row : DEC{arrow:"none", colSpan:2} CONST