Variation Table DSL (VT-DSL)

VT-DSL

  1. Overview
  2. General Syntax
  3. Separators
  4. Undefined and Skipped Regions
  5. Variations
  6. Multicolumn Content

1. Overview

VT-DSL is a domain-specific language for describing variation and sign tables. It is designed to be:

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.

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.

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

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:

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