Sashité for Developers
  1. Sashité for Developers
  2. Specifications
  3. PMN
  4. 1.0.0
  5. Examples

PMN Examples

Practical implementation guide for Portable Move Notation v1.0.0.


Examples by Complexity

Simple Movements

Basic move with explicit piece:

["e2", "e4", "C:P"]

Basic move with inferred piece:

["e2", "e4"]

Note: When only one legal move exists from e2 to e4.

Transformation (promotion):

["e7", "e8", "C:Q"]

Drop from reserve:

["*", "e5", "S:P"]

Pass Moves and Same-Location Actions

Pass move at board position with inferred piece:

["e2", "e2"]

Pass move with explicit piece (reserve to reserve):

["*", "*", "P"]

Pass move with inferred piece (reserve to reserve):

["*", "*"]

In-place transformation with explicit specification:

["e4", "e4", "C:+P"]

Note: Piece at e4 transforms to enhanced state without moving.

In-place transformation with inference:

["a7", "a7"]

Note: When context makes the transformation unambiguous (e.g., mandatory pawn promotion).

Capture Mechanics

Capture with explicit specification:

["a1", "*", "S:L", "b2", "a1", "S:S"]

Explanation: Gote lance (s:l) at a1 is captured to sente’s reserve (becoming S:L), then sente silver moves from b2 to a1.

Capture with inference:

["b2", "a1"]

Note 1: When context makes the capturing piece and result unambiguous, the source and destination of the move are sufficient.

Note 2: At the protocol level, a capture always removes a piece from the board and places it in a player’s reserve, regardless of game rules. Whether the captured piece changes ownership, maintains its identity, or can later be dropped back onto the board depends entirely on the specific game rules. PMN handles all capture mechanics uniformly through the same board-to-reserve mechanism.

Complex Movements

Western Chess castling with explicit specification:

["e1", "g1", "C:K", "h1", "f1", "C:R"]

Castling with inference:

["e1", "g1"]

Note: When castling is the only legal move from e1 to g1.

En passant with explicit specification:

["e5", "f6", "C:P", "f5", "*", "c:p"]

Note: White pawn moves from e5 to f6, capturing the black pawn on f5 en passant.

En passant with inference:

["e5", "f6"]

Note: When en passant is the only legal move from e5 to f6.

Shōgi promotion with explicit specification:

["g8", "g9", "S:+P"]

Shōgi promotion with inference:

["g8", "g9"]

Note: This shorter version of the move would be possible if a shogi sente pawn is on g8, as its promotion is required on g9.

Piece exchange:

[
  "e2", "*" , "X:A",
  "e3", "e2", "X:B",
  "*" , "e3", "X:A"
]

Three actions:

  1. X:A at e2 goes to reserve
  2. X:B moves e3e2
  3. X:A from reserve goes to e3

STN Integration Examples

PMN actions produce corresponding STN deltas when executed. Here are common patterns:

Simple Movement

PMN action:

["e2", "e4", "C:P"]

Resulting STN delta:

{
  "board": {
    "e2": null,
    "e4": "C:P"
  },
  "toggle": true
}

Drop from Reserve

PMN action:

["*", "e5", "S:P"]

Resulting STN delta:

{
  "hands": {
    "S:P": -1
  },
  "board": {
    "e5": "S:P"
  },
  "toggle": true
}

Pass Move

PMN action:

["e2", "e2"]

Resulting STN delta:

{
  "toggle": true
}

Note: The pass move action produces only a turn change in the resulting position.

Multiple Actions

PMN sequence:

["e2", "e4", "C:P", "e7", "e5", "c:p"]

Resulting STN delta:

{
  "board": {
    "e2": null,
    "e4": "C:P",
    "e7": null,
    "e5": "c:p"
  },
  "toggle": false
}

Note: After two actions, the turn typically returns to the original player (depending on game rules).

STN-Only Scenarios

Some STN deltas cannot be represented as PMN actions:

STN delta (no action occurred):

{}

This represents no changes to the position - no board changes, no hand changes, no turn change. Since PMN represents actions, and this STN shows no action occurred, there is no PMN equivalent.


When to Specify vs Infer Pieces

Specify Pieces When:

Infer Pieces When:


Integration with GGN

For actions with inferred pieces, PMN coordinates correspond to GGN query parameters:

GGN Validation Examples

Western Chess castling:

// PMN with inferred piece
["e1", "g1"]

// Corresponding GGN validation
{
  "C:+K": {              // Source piece (from position analysis)
    "e1": {              // Source position (from PMN)
      "g1": [            // Destination position (from PMN)
        {
          "must": { "f1": "empty", "g1": "empty", "h1": "C:+R" }
        }
      ]
    }
  }
}

Western Chess promotion:

// PMN with explicit piece
["e7", "f8", "C:N"]

// Corresponding GGN validation
{
  "C:P": {               // Source piece (from position analysis)
    "e7": {              // Source position (from PMN)
      "f8": [            // Destination position (from PMN)
        {
          "must": { "f8": "enemy" }
        }
      ]
    }
  }
}

Pass move:

// PMN with inferred piece
["e2", "e2"]

// Corresponding GGN validation
{
  "C:P": {               // Source piece (from position analysis)
    "e2": {              // Source position (from PMN)
      "e2": [            // Destination position (from PMN)
        {
          "must": {}     // Pass move constraints (game-specific)
        }
      ]
    }
  }
}

Xiangqi general movement:

// PMN with inferred piece
["e1", "e2"]

// Corresponding GGN validation
{
  "X:G": {               // General xiangqi (from position analysis)
    "e1": {              // Position source (from PMN)
      "e2": [            // Position destination (from PMN)
        {
          "must": { "e2": "empty" }
        }
      ]
    }
  }
}