← All examples
17

Canonical Grid model

Declarative Games And Mechanisms

Reactive finite games, certified equilibria, evidence-carrying claims, backward induction, direct-mechanism audits, and VCG matching.

Scale
Medium
Source
17-declarative-games.grid
Length
113 lines
Collection
Advanced language
Level
Advanced
Runtime
Portable
Version
1.0.0

Watch it in Grid

See this model in motion.

Watch the model respond in the product, then inspect the exact source and checkpoints on this page.

What this model gives you

A compact survey of certified finite-game and mechanism lanes: general-sum analysis, mixed and correlated equilibria, backward induction, truthfulness auditing, and VCG assignment.

35 min to study · Source reviewed 2026-08-26

Continue with guided practice

What to notice

  • Declarative normal- and extensive-form games
  • Certified equilibrium result envelopes
  • Direct-mechanism truthfulness audits
  • Exact VCG unit-demand matching

Requirements

  • Runtime with GAME.* and MECHANISM.* certified kernels
  • Authored solver budgets must fit the finite game domains
  • No connector or network

Expected checkpoint

A known state for this walkthrough.

With the finite relations and mechanism specifications exactly as authored. Every published value is a solver evidence object; the current verification contract certifies compilation and does not yet assert internal runtime fields.

Bimatrix analysis
FiniteAnalysis plus mixed-Nash and welfare-correlated certificatesFiniteAnalysis / MixedNash / Correlated
Pure-equilibrium claim
Evidence refuting has_pure_nashPureClaim; source game has no pure equilibrium
Entry game
A child-before-parent backward-induction certificateSubgamePerfect
Service menu
Audit and DSIC verification evidenceIncentiveAudit / Truthfulness
Unit-demand market
Efficient assignment with Clarke-pivot evidenceEfficientMatching
01 · Normal form

Describe players, strategies, and every payoff profile

The BimatrixGame block lowers ordinary relations into a validated finite game. GAME.ANALYZE exhausts the declared domain, while NASH and CORRELATED choose narrower certified solver lanes with visible budgets and objectives.

02 · Claim

Keep verification evidence, not only a Boolean

GAME.VERIFY returns pass or refute polarity, status, witness, tolerance, and work. PureClaim is therefore a durable explanation of why the authored matching-versus-mismatching game lacks a pure equilibrium.

03 · Sequence

Use an explicit tree for contingent decisions

EntryGame names every decision, action, successor, and terminal payoff. GAME.EXTENSIVE validates the finite tree before returning replayable child-before-parent comparisons.

04 · Mechanism

Audit reports and allocations under separate contracts

ServiceMenu enumerates reports, outcomes, utilities, payments, and a prior for incentive checks. The unit-demand market instead uses VCG_ASSIGN to return an efficient matching and one counterfactual payment certificate per winner.

17-declarative-games.grid
Get Grid
MODEL "Declarative Games And Mechanisms"
DESCRIPTION "Reactive finite games, certified equilibria, evidence-carrying claims, backward induction, direct-mechanism audits, and VCG matching."
VERSION "1.0.0"
TAGS "game-theory", "mechanism-design", "equilibrium", "verification", "allocation"

# These three relations may instead be Frames or collected Graph query rows.
Players = ["row"; "column"]
Strategies = [
  "row", "first";
  "row", "second";
  "column", "first";
  "column", "second"
]

# A general-sum matching-versus-mismatching game with no pure equilibrium.
Payoffs = [
  "first",  "first",  2, 0;
  "first",  "second", 0, 2;
  "second", "first",  0, 1;
  "second", "second", 1, 0
]

game BimatrixGame {
  players = Players
  strategies = Strategies
  payoffs = Payoffs
}

output FiniteAnalysis = GAME.ANALYZE(BimatrixGame)
output MixedNash = GAME.NASH(BimatrixGame, {epsilon: 0.0000001, maxDeviations: 1000})
output Correlated = GAME.CORRELATED(BimatrixGame, "welfare")
output PureClaim = GAME.VERIFY(BimatrixGame, {property: "has_pure_nash"})

TreeSpecification = {
  players: ["entrant", "incumbent"],
  root: "entry",
  nodes: [
    {
      kind: "decision",
      id: "entry",
      player: 0,
      actions: [
        {id: "stay_out", next: "outside"},
        {id: "enter", next: "response"}
      ]
    },
    {kind: "terminal", id: "outside", payoffs: [1, 2]},
    {
      kind: "decision",
      id: "response",
      player: 1,
      actions: [
        {id: "fight", next: "fought"},
        {id: "accommodate", next: "shared"}
      ]
    },
    {kind: "terminal", id: "fought", payoffs: [-1, -1]},
    {kind: "terminal", id: "shared", payoffs: [2, 1]}
  ]
}

game EntryGame {
  extensive = TreeSpecification
}

output SubgamePerfect = GAME.EXTENSIVE(EntryGame)

# One-agent direct mechanism: low types prefer report 0; high types prefer 1.
DirectSpecification = {
  agents: [{id: "bidder", types: ["low", "high"]}],
  outcomes: [
    {
      reportProfile: [0],
      outcomeId: "low_service",
      utilities: [[1, 1]],
      payments: [0]
    },
    {
      reportProfile: [1],
      outcomeId: "high_service",
      utilities: [[0, 2]],
      payments: [0]
    }
  ],
  prior: [
    {typeProfile: [0], probability: 0.5},
    {typeProfile: [1], probability: 0.5}
  ]
}

mechanism ServiceMenu {
  direct = DirectSpecification
}

output IncentiveAudit = MECHANISM.AUDIT(ServiceMenu)
output Truthfulness = MECHANISM.VERIFY(ServiceMenu, "dsic")

UnitDemandMarket = {
  agents: ["alice", "bob"],
  items: ["x", "y"],
  valuations: [
    {agent: "alice", item: "x", value: 10},
    {agent: "alice", item: "y", value: 0},
    {agent: "bob", item: "x", value: 9},
    {agent: "bob", item: "y", value: 8}
  ],
  augmentationBudget: 1000,
  maxCounterfactuals: 10
}

output EfficientMatching = MECHANISM.VCG_ASSIGN(UnitDemandMarket)

END MODEL