contextual-equivalence

Proves contextual equivalence between programs using bisimulation techniques.

17|2|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/rainoftime/pl-skills --skill contextual-equivalence
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: contextual-equivalence
Source: https://github.com/rainoftime/pl-skills/tree/main/contextual-equivalence
Command: npx skills add https://github.com/rainoftime/pl-skills --skill contextual-equivalence

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires operational-semantics-definer, bisimulation-checker, and includes references (resource) components.

What problem does it solve?

This Skill addresses the challenge of proving that two programs behave identically, which is crucial for compiler correctness, program transformation verification, and optimization validation.

Core Features & Use Cases

  • Prove Contextual Equivalence: Demonstrate that two programs are indistinguishable in all possible execution contexts.
  • Bisimulation Techniques: Build and utilize bisimulation relations for rigorous behavioral equivalence proofs.
  • Use Case: Verify that a compiler optimization pass preserves the original program's observable behavior by proving contextual equivalence between the source and optimized code.

Quick Start

Use the contextual-equivalence skill to prove that program A is contextually equivalent to program B.

Frequently Asked Questions about contextual-equivalence

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prove contextual equivalence between two programs?

Prove contextual equivalence by demonstrating that two programs are indistinguishable in all possible execution contexts, utilizing bisimulation relations and operational semantics for rigorous behavioral equivalence validation.

Do I need OCaml or Coq to verify program equivalence?

You need OCaml or Coq to perform formal verification and reason about program behavior, as these languages provide the foundational environment required for executing bisimulation and operational semantics techniques.

Can bisimulation be used for compiler optimization verification?

Bisimulation is used for compiler optimization verification by building relations that rigorously prove a compiler optimization pass preserves the original program's observable behavior across transformed code.

What is the best way to validate program transformation correctness?

The best way to validate program transformation correctness is to prove contextual equivalence, ensuring the transformed program behaves identically to the source using operational semantics and bisimulation checking.

When do I need operational semantics for program equivalence checking?

You need operational semantics for program equivalence checking when defining the execution rules of programs to rigorously reason about and establish bisimulation relations for behavioral equivalence proofs.