The symbol registry provides typed, unit-aware formal symbol definitions with LaTeX rendering hints and normative traceability. Symbols are referenced from OCL expressions inside calculations and form evaluation rules.
Without a symbol registry, OCL expressions reference bare identifiers with no type checking, no unit validation, and no documentation hint. For technical standards with many symbols (OIML R 60 has ~50), this leads to:
The symbol registry solves all four problems.
| Construct | Relationship |
|---|---|
measurement |
Measurements are runtime values; symbols are their formal types. |
calculation |
Calculations reference symbols by name in their
expression
. |
form |
Form fields can reference symbols; calculation bindings resolve to symbols. |
reference |
Symbols link to normative sources via
reference { }
. |
Symbol identifiers should match the printed standard's notation where possible. For Unicode-friendliness:
A symbol declaration uses the
symbol
keyword followed by an identifier
and a brace-delimited body.
symbol <SymbolID> {
name "Human-readable name"
definition "Formal definition"
type <SymbolType>
unit "<unit>"
latex "<LaTeX rendering>"
reference { <ReferenceID> }
}
| Property | Required | Description |
|---|---|---|
name |
yes | Human-readable name. |
definition |
no | Formal definition. |
type |
yes | One of
number
,
integer
,
string
,
boolean
,
enum
. |
unit |
no | Unit annotation. Defaults to ” 1 “ (dimensionless). |
latex |
no | LaTeX rendering hint. Defaults to the identifier. |
reference |
no | Normative references for traceability. |
symbol f {
name "Conversion factor"
definition "Ratio of indication change to load change at 75% of Max. Converts counts to verification units (v)."
type number
unit "counts/v"
latex "f"
reference { R60-3-2-1-2-4 }
}
symbol nLC {
name "Maximum number of load cell verification intervals"
definition "Declared by the manufacturer. Determines the MPE tier and run count."
type integer
unit "1"
latex "n_{LC}"
reference { R60-1-3-5-8 }
}
symbol Emax {
name "Maximum capacity"
definition "Upper bound of the measuring range."
type number
unit "kg"
latex "E_{max}"
reference { R60-1-3-3 }
}
symbol MPE {
name "Maximum permissible error"
definition "Tiered MPE values derived from p_LC and verification intervals."
type number
unit "v"
latex "MPE"
reference { R60-1-5-3-2 }
}
Symbols are typed. The type system is intentionally minimal — five primitives that cover virtually all compliance use cases.
| Type | Description |
|---|---|
number |
Floating-point or integer numeric value. |
integer |
Whole number. Use for counts (e.g.,
n_LC
). |
string |
Free-text value. |
boolean |
True/false value. |
enum |
Named value from a finite set. Use `values` block to declare allowed values. |
Units are free-form strings, but should follow SI conventions:
When a calculation input has a declared unit and a binding provides a different unit, the parser:
If no unit is declared, the default is ” 1 “ (dimensionless). Dimensionless values can be bound to any unit without explicit conversion.
For
type enum
, declare allowed values via the
values
property:
symbol accuracy_class {
name "Accuracy class"
type enum
values [A, B, C, D]
reference { R60-1-3-7-1 }
}
The
latex
property provides rendering hints for documentation
generators. It does not affect runtime behavior.
The
latex
value is a string containing valid LaTeX math-mode markup.
The documentation generator wraps it in
\(...\)
or
\[ ... \]
as
appropriate.
If
latex
is omitted, the documentation generator uses the symbol's
identifier verbatim.
symbol C_C {
name "Creep"
type number
unit "v"
latex "C_C"
reference { R60-1-5-5-1 }
}
symbol C_DR {
name "Dead load output return"
type number
unit "v"
latex "C_{DR}"
reference { R60-1-5-5-2 }
}
Renders as
C_C
and
C_{DR}
(with subscript) respectively.
Symbols link to normative sources via the
reference
property. This
provides traceability from the formal symbol back to its printed
definition.
symbol <SymbolID> {
// ...
reference { <ReferenceID> { <ReferenceID> } }
}
Multiple references are allowed. The first listed is the canonical source; subsequent ones are additional sources.
A
reference { R60-3-2-1-2-4 }
requires a top-level
reference R60-3-2-1-2-4 { ... }
declaration elsewhere in the model. The parser:
1. Collects all
reference
declarations
2. Validates that every symbol's
reference { ... }
points to a
declared reference
3. Emits an error if a symbol references an undeclared source
reference R60-1-5-3-2 {
document "OIML R 60-1:2021"
clause "5.3.2"
title "Maximum permissible errors on type evaluation"
}
symbol MPE {
name "Maximum permissible error"
type number
unit "v"
reference { R60-1-5-3-2 }
}
The chain
symbol → reference → external document
enables:
SymbolDecl = "symbol" ID "{" { SymbolProperty } "}" ;
SymbolProperty = "name" STRING
| "definition" STRING
| "type" SymbolType
| "unit" STRING
| "latex" STRING
| "values" "[" ID { "," ID } "]"
| "reference" "{" { ID } "}" ;
SymbolType = "number" | "integer" | "string" | "boolean" | "enum" ;
As per the forms grammar (see formal-grammar-forms ).
SymbolDecl
may appear at the top level of a model, alongside other
declarations.