Conversation
Signed-off-by: Elazar Gershuni <elazarg@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR significantly refactors the Vegas compiler to transition from a prototype scripting language to a structured, robust DSL for game theory. It introduces a formal
ActionDagintermediate representation, explicit commit-reveal syntax, and first-class support for subgame-perfect "quit" semantics (split/burn).Key Changes
1. Language Syntax & Design
game main() { ... }blocks, allowing for future modularity.commitandrevealkeywords to explicitly model information hiding, replacing implicit inference.splitandburnkeywords to declaratively handle player abandonment, replacing error-prone manual null checks inwithdrawclauses.2. Compiler & IR (
ToIR.kt,IR.kt)ActionDagbefore backend generation. This decouples game logic from execution details.split/burnpayoffs.Letexpressions during the lowering phase to simplify IR analysis.3. Solidity/EVM Backend (
GameToEvmIR.kt)ActionDaglinearization. Actions are now gated by immutableACTION_IDconstants rather than mutable phase counters.CheckReveallogic to cryptographically bind hidden values to specific roles and actions, preventing replay and copy-commit attacks.4. Testing & Reliability
ExamplesValidationTest.ktandcopy-test-outputs.pyto detect regressions in generated output (Solidity, EFG, etc.) against a known good state.Semantics.ktto treat "Quit" as a first-class move in the game's transition system.5. Documentation
SUBGAMES.mdspecifying conservation of money and availability rules for subgames.AGENTS.mdfor AI agent context.