Getting Started¶
Installation¶
Or with uv:
Requirements¶
- Python 3.12 or later
- gds-framework >= 0.1 (installed automatically)
- pydantic >= 2.10
- typer >= 0.15 (for CLI)
- jinja2 >= 3.1 (for reports)
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")