Sashité for Developers
  1. Sashité for Developers
  2. Specifications
  3. PIN
  4. 1.0.0

Piece Identifier Notation (PIN) Specification


1. Status of this document

The key words MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY are to be interpreted as normative requirements.

Capitalized terms (Game, Rule System, Piece, Piece Side, Piece Name, Piece State, Terminal Status, etc.) are defined in the Glossary.


2. Overview

Piece Identifier Notation (PIN) is a compact, ASCII-only token format used to encode a piece’s identity at the level of notation.

A PIN token encodes exactly these attributes:

PIN is designed as a minimal building block that can be embedded in higher-level notations (positions, moves, catalogs).

Chess Pieces Board Sketch

2.1 Scope

PIN defines only:

2.2 Non-goals

PIN does not define:

Those belong to the Rule System and (where relevant) the Game Protocol layer.

Note on Piece Style: The Game Protocol defines Piece Style as part of Piece Identity. PIN intentionally omits this attribute, leaving Style resolution to the surrounding context (e.g., game definition, position notation, or catalog metadata). This keeps PIN minimal and context-independent.


3. Dependencies

PIN is self-contained and has no dependencies on other Sashité specifications.


4. Token format

4.1 Structure

A PIN token is:

[<state-modifier>]<abbr>[<terminal-marker>]

Where:

4.2 Grammar (EBNF)

pin              ::= [ state-modifier ] abbr [ terminal-marker ] ;
state-modifier   ::= "+" | "-" ;
abbr             ::= "A"…"Z" | "a"…"z" ;
terminal-marker  ::= "^" ;

4.3 Regular expression

A PIN token MUST match the following regular expression, anchored to the whole string (i.e. the pattern MUST match the entire input, from start to end):

^[+-]?[A-Za-z]\^?$

Anchoring requirement (normative):

Notes for implementers:


5. Attribute mapping

A conforming implementation MUST interpret a valid token as follows.

5.1 Piece Name (via abbreviation)

The <abbr> letter serves as a single-letter abbreviation of the Piece Name, assigned by convention within a Game / Rule System.

The letter’s case is used to encode Piece Side (see §5.2), but the identity of the abbreviation is case-insensitive: K and k represent the same Piece Name abbreviation, differing only in which side owns the piece.

PIN does not reserve any letters; the mapping from abbreviation to full Piece Name is entirely Rule System-defined.

5.2 Piece Side

The case of <abbr> encodes Piece Side:

This aligns with the two-side model defined in the Game Protocol.

5.3 Piece State

The optional <state-modifier> encodes Piece State:

PIN standardizes only the encoding. The Rule System defines the semantics of these states.

5.4 Terminal Status

The optional <terminal-marker> encodes Terminal Status:

PIN standardizes only the marking. The Rule System defines what Terminal Status implies for continuation, evaluation, and outcomes.


6. Parsing and conformance requirements

6.1 Validity

A string is a valid PIN token if and only if:

Implementations:

6.2 Canonical form

PIN tokens are already canonical by construction:

Implementations MUST NOT reorder or normalize tokens beyond strict validation. In particular:

6.3 Component extraction

Implementations SHOULD provide accessors for each component:

Accessor Description
abbr The single-letter abbreviation (always uppercase)
side first or second
state The state modifier (normal, enhanced, or diminished)
terminal? Boolean indicating Terminal Status

7. Design constraints and considerations

7.1 Character space

PIN provides 52 base letters (A–Z and a–z) as abbreviations. With optional state modifiers and terminal marker, a context may use up to 312 distinct tokens (3 states × 2 terminal × 52 abbreviations).

7.2 Two-side assumption

PIN encodes exactly two Piece Sides (first/second) using case.

Games with more than two sides MUST use a convention outside the scope of PIN or use a different notation designed for multi-side encoding.

7.3 Abbreviation conventions

Since Piece Name is represented by a single-letter abbreviation, a Rule System SHOULD:

7.4 Style omission

PIN intentionally omits Piece Style encoding. In contexts where Style matters:


8. Examples

See PIN Examples for practical mappings in various game contexts.


9. Reference implementations

The following reference libraries are maintained by Sashité and are intended to be idiomatic, fully tested, and spec-accurate implementations of PIN v1.0.0.

They generally provide:

If a library behavior appears to conflict with this document, this specification is normative. Please report issues (or propose clarifications) on the relevant repository.


10. License

This specification is made available under the terms of the Open Web Foundation Agreement 1.0 (OWFa 1.0).

The authoritative legal text is the OWF “Final Specification Agreement (OWFa 1.0)”.