Skip to content

Add Gallina backend#35

Closed
google-labs-jules[bot] wants to merge 1 commit intomainfrom
gallina-backend-10285061198093169135
Closed

Add Gallina backend#35
google-labs-jules[bot] wants to merge 1 commit intomainfrom
gallina-backend-10285061198093169135

Conversation

@google-labs-jules
Copy link
Contributor

Implemented a Gallina backend that transpiles Vegas IR to Coq modules. The backend generates dependent types to model the game state and valid transitions, ensuring that witnesses for actions carry proofs of their dependencies and guards.

Key features:

  • Witness Records: Each action (Join, Commit, Move, Reveal) produces a Witness record type that depends on the witnesses of its prerequisites.
  • State Machine: An inductive State type indexed by Stage, with step functions that transition between states upon receiving valid signed messages.
  • Guard Handling: Translates Vegas expressions to Coq terms. Guards on hidden fields (e.g. private knowledge before reveal) are gracefully skipped with comments, as they cannot be verified in the public transcript.
  • Determinism: Ensures deterministic output by sorting roles, types, and action dependencies.

Verified with GoldenMasterTest against standard examples like MontyHall, OddsEvens, and TicTacToe.


PR created automatically by Jules for task 10285061198093169135 started by @elazarg

Implements a new backend targeting Coq (Gallina) which generates a protocol specification including:
- Inductive types for Roles and domain-specific Enums.
- Abstract evidence and Witness records that accumulate causal history.
- An Explicit State Machine (ESM) modeling valid transitions.
- Handling of commit-reveal patterns and public guards.

Includes integration with `GoldenMasterTest` and generated examples.
@google-labs-jules
Copy link
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

@elazarg elazarg closed this Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant