Lh032 — Constant reference (`#NAME`/`@NAME`) used where instance reference required

§12.1b header/numbering

P1 — silent data loss

spec-violation syntax

Sources

Description

ISO 10303-21 distinguishes `#NAME`/`@NAME` (uppercase identifier, refers to a schema-defined constant) from `#NNN`/`@NNN` (refers to an instance). Tools occasionally emit `#PI` thinking it is a literal alias when the schema defines no such constant, producing an unresolved-reference error.

Reproducer recipe

`#1=DIRECTION('',(#PI,0.,0.));` where `PI` is not a schema-defined constant.

Expected kernel behavior

reject as undefined constant with a diagnostic that distinguishes "constant not in schema" from "instance not defined".

Notes

Synonyms: "#NAME constant reference where #NNN expected", "@NAME used as instance reference", "schema constant in STEP DATA", "#PI as alias not resolved", "constant reference unresolved".

Expected validation

occt=empty/empty gmsh=empty ifc=schema_n/a

Byte assertions

Tier-3 assertions

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1ISO-10303-21;
2/* Lh032: #PI used as schema-defined constant where an instance reference is required */
3/* ISO 10303-21: #NAME refers to a schema-defined constant; #NNN refers to an instance */
4/* DEFECT: #PI is not a constant in AUTOMOTIVE_DESIGN; unresolved-reference error */
5/* OCC silently accepts with diagnostic (empty result); catalog requires reject */
6HEADER;
7FILE_DESCRIPTION(('Lh032: #PI constant reference where #NNN instance expected'),'2;1');
8FILE_NAME('Lh032.stp','2026-06-20T00:00:00',(''),(''),'cad-research-suite','','');
9FILE_SCHEMA(('AUTOMOTIVE_DESIGN'));
10ENDSEC;
11DATA;
12#1=CARTESIAN_POINT('origin',(0.,0.,0.));
13#2=CARTESIAN_POINT('pi-point',(#PI,0.,0.));
14/* DEFECT: #PI used as if it were a schema-defined constant (like math pi = 3.14159) */
15/* but AUTOMOTIVE_DESIGN defines no constant named PI; this is an unresolved reference */
16#3=DIRECTION('xdir',(#PI,0.,0.));
17#4=DIRECTION('zdir',(0.,0.,1.));
18#5=GEOMETRIC_CURVE_SET('constant-ref-shape',(#1,#2));
19ENDSEC;
20END-ISO-10303-21;