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

Qualified Piece Identifier (QPI) Specification


Overview

Qualified Piece Identifier (QPI) provides a rule-agnostic format for identifying game pieces in abstract strategy board games by combining Style Identifier Notation (SIN) and Piece Identifier Notation (PIN) with a colon separator and consistent case encoding.

QPI represents all four fundamental piece attributes:

Unlike Extended Piece Identifier Notation (EPIN) which uses derivation markers, QPI explicitly names the style for unambiguous identification.


Terminology

For complete definitions of terms used in this document, see the Glossary.


Format Specification

Structure

<sin>:<pin>

Grammar (BNF)

<qpi> ::= <uppercase-qpi> | <lowercase-qpi>

<uppercase-qpi> ::= <uppercase-style> <colon> <uppercase-pin>
<lowercase-qpi> ::= <lowercase-style> <colon> <lowercase-pin>

<colon> ::= ":"

<uppercase-style> ::= <letter-uppercase> <identifier-tail-uppercase>*
<lowercase-style> ::= <letter-lowercase> <identifier-tail-lowercase>*
<identifier-tail-uppercase> ::= <letter-uppercase> | <digit>
<identifier-tail-lowercase> ::= <letter-lowercase> | <digit>

<uppercase-pin> ::= <letter-uppercase> | <state-modifier> <letter-uppercase>
<lowercase-pin> ::= <letter-lowercase> | <state-modifier> <letter-lowercase>
<state-modifier> ::= "+" | "-"

<letter-uppercase> ::= "A" | "B" | "C" | ... | "Z"
<letter-lowercase> ::= "a" | "b" | "c" | ... | "z"
<digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"

Regular Expression

\A([A-Z][A-Z0-9]*:[-+]?[A-Z]|[a-z][a-z0-9]*:[-+]?[a-z])\z

Piece Attribute Mapping

QPI encodes piece attributes by combining SIN and PIN information:

Piece Attribute QPI Encoding Examples
Type PIN letter choice C:K = King, C:P = Pawn
Side Unified case across both components C:K = First player, c:k = Second player
State PIN prefix modifier S:+P = Enhanced, C:-P = Diminished
Style SIN identifier C:K = Chess style, S:K = Shōgi style

Design Properties


Implementation

Ruby Reference

Practical Examples

Comprehensive implementation examples for single-style and cross-style scenarios are available in the QPI Examples.