Skip to content

Getting Started

Installation

pip install gds-domains[games]

Or with uv:

uv add gds-games

Requirements

Import

The package is installed as gds-domains[games] and imported as gds_domains.games:

import gds_domains.games
from gds_domains.games.dsl.games import DecisionGame
from gds_domains.games import compile_to_ir, verify

Basic Workflow

from gds_domains.games.dsl.games import DecisionGame, CovariantFunction
from gds_domains.games.dsl.pattern import Pattern
from gds_domains.games import compile_to_ir, verify, generate_reports, save_ir

# 1. Define atomic games
sensor = CovariantFunction(name="Sensor", x="observation", y="signal")
agent = DecisionGame(name="Agent", x="signal", y="action", r="reward", s="experience")

# 2. Compose
game = sensor >> agent

# 3. Wrap in a Pattern
pattern = Pattern(name="Simple Decision", game=game)

# 4. Compile to IR
ir = compile_to_ir(pattern)

# 5. Verify
report = verify(ir)

# 6. Generate reports
reports = generate_reports(ir)

# 7. Save IR to JSON
save_ir(ir, "simple_decision.json")

CLI

# Compile a pattern to IR
ogs compile pattern.json -o output.json

# Run verification
ogs verify output.json

# Generate reports
ogs report output.json -o reports/