ItemValue
NameLOCAL (a 5Q bundle. See the member table below for the name of each code)
TAG ID0x005L~0x009L
Section0 0000 (Reference entity), offset within section C = 5~9
KindReference · category: declaration
Hugo sidereference/local.md

Members

This page covers one 5Q set, five codes together. The quantification is the offset within the section, C % 5 (Reference). There is one codec document per code. The fields of the five codec documents are the same; only the DECLARE target and the name (BIND) differ.

TAG IDNameQuantificationCodec IDSpec documentTAG WORD
0x005LLOCAL-IDENTIFIEDIdentified0x000000500x00000000/codecs/0x00000050/0000 0000 0101 LLLL
0x006LLOCAL-GENERICGeneric0x000000600x00000000/codecs/0x00000060/0000 0000 0110 LLLL
0x007LLOCAL-FREE-CHOICEFree-choice0x000000700x00000000/codecs/0x00000070/0000 0000 0111 LLLL
0x008LLOCAL-UNIVERSALUniversal0x000000800x00000000/codecs/0x00000080/0000 0000 1000 LLLL
0x009LLOCAL-VARIABLEVariable0x000000900x00000000/codecs/0x00000090/0000 0000 1001 LLLL

Fields (spec document)

The order of FIELDs in the document is the order of Payload fields (Codec spec document).

OrderField (BIND)FIELDWidthAccepted form (CODEC)ENUM
1local-id#2Remaining raw value (0xFFFF)

LOCAL is a declaration Reference that points to a target by an ID issued by this document. It refers to a target inside the document without an external Issuer. To point to it from outside the document, place a Meta DOC-ID in the document, and have another document point to it with a pointer Reference.

Layout

TAG WORD          0000 0000 0101 LLLL      Codec 0x005L~0x009L (Identified 0x005L)
[Length extension TAG]
LOCAL ID          unsigned big-endian in the shortest width
LOCAL IDTotalTAG WORD (Identified)
0..655352 WORD0x0051
65536..2^32-13 WORD0x0052
2^32..2^48-14 WORD0x0053
2^48..2^64-15 WORD0x0054
  • The Codec is 0x005L (Identified), 0x006L (Generic), 0x007L (Free-choice), 0x008L (Universal), or 0x009L (Variable). The TAG WORD of Identified is 0000 0000 0101 LLLL.
  • It follows the common Reference rule of writing the target ID in the fewest WORDs.

Edge Id

  • The LOCAL that is the first element of an Edge Payload is the Edge Id declaration of that Edge (Edge). A LOCAL that declares an Edge Id uses only Identified (0x005L).
  • A LOCAL in any other position of an Edge Payload is a mention. A target of this document is written as a LOCAL each time it is mentioned. There is no separate pointer code for pointing to a target of this document.

ID allocation

  • An ID is an integer and the encoder assigns it. The magnitude of the number and the order of allocation mean nothing except identity.
  • UNIQUE (required). In a document, one LOCAL ID points to only one target. An Edge Id is declared only once per document (HEAD Edges and BODY Edges share one number space). If two or more Edges declare the same Edge Id, the document is invalid.
  • AUTO INCREMENT (recommended). Assign a new ID as the maximum of the IDs assigned so far in that document + 1, and let it grow in document order. The same holds across versions (a new one is created with a value larger than any deleted ID). This is only a recommendation, not a validity condition; a document that does not increase is also valid. The decoder does not rely on the magnitude or continuity of IDs.
  • ID 0 is not assigned. It points to no target and is not used as an Edge Id. Target IDs are assigned from 1.
  • A document is pointed to, whether from inside that document or outside it, only by a single DOC-POINTER (the document itself is the DOC-POINTER of its own DOC-ID). BIND, LABEL, and judgment Edges can be attached to a document too.
  • An Issuer itself is pointed to by ISSUER-POINTER. Document ID 0 is the term-definition index document of the Issuer.
  • A Codec that gives meaning to 0 in a component slot (the “none” of TOULMIN REF and execution Edges, the “whole document” of the Target of a HEAD SOURCE) follows that Codec’s rule. This is a convention inside that Codec, different from a slot marker.
  • An ID, once assigned, is not reused in the same document.
  • Always use the minimum width that can express the value.

Identity and scope

  • In the same document, LOCAL IDs with the same integer value are the same target. The encoding width is not part of identity.
  • An Identified LOCAL denotes an identified target. Do not use it as anonymous, unspecified, null, or a sentinel. To say that a value exists but is unknown (UNKNOWN-VALUE) or that there is no value (NO-VALUE), write it as a slot marker in a field that accepts that marker.
  • Different LOCAL IDs are merely different References; they do not mean the targets in reality are different.
  • The identity of a LOCAL is not extended outside the document. The same number in another document is unrelated.
  • A Variable (0x009L) LOCAL is a named discourse variable (Reference Variable).

Merging

When merging several documents into one, make an old ID → new ID mapping table for each source document, reassign every LOCAL ID to an ID of the new document, and change all references.

  • IDs that were the same in the same source document must remain the same after the merge.
  • The same number in different source documents is unrelated, and is not automatically merged into the same Reference.
  • If even one LOCAL could not be changed, the merge is rejected.

Validity

The following encodings or allocations are invalid.

  • A non-minimal encoding with a leading 0x0000 WORD (the 1 WORD 0x0000 for value 0 is an exception)
  • A Codec in an Edge Id declaration slot that is not Identified (0x005L), or an ID of 0
  • One ID allocated to different targets in the same document
  • The same Edge Id declared two or more times in the same document

Examples

LOCAL IDWORD sequence
10051 0001
655350051 FFFF
655360052 0001 0000
42949672950052 FFFF FFFF
1, Variable0091 0001

Related pages

Spec document source

This is the spec document 0x00000000/codecs/0x00000050/latest.geul as read by geul show (hex in uppercase).

SPEC-VERSION 0x0001
DOC-ID 0x0426000000000000005000000000
BODY
#1 DECLARE 0x0050
#2 FIELD #1 rest
#3 BIND #1 "LOCAL-IDENTIFIED"
#4 BIND #2 "local-id"

The above is the codec document of LOCAL-IDENTIFIED (0x005L). The codec documents of the other members (LOCAL-GENERIC, LOCAL-FREE-CHOICE, LOCAL-UNIVERSAL, LOCAL-VARIABLE) differ only in the codec ID of the DOC-ID, the DECLARE target, and the name bound in #1 (BIND).