← All stories
● Covered by 1 source · 1 reportMedium impact1 neutral

Semantic Diffing for Formal Policies Using Anti-Unification Engine

🔄 Updated 9d ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • Engine uses anti-unification to find common patterns in policy expressions.
  • Operates on an e-graph, incorporating algebraic laws and domain rules.
  • Distinguishes semantic changes from syntactic changes in formal policies.
  • Assists in comparing autoformalized policies and LLM-generated formalizations.

Addressing Limitations of Textual Diffs

Traditional textual diffs are insufficient for comparing formal policies because they often highlight syntactic changes that do not alter the policy's meaning. Reordering elements or using equivalent predicates can make a policy appear significantly changed, obscuring actual behavioral differences. A semantic diff, in contrast, focuses on what two policies share and where their actual disagreements lie.

How Semantic Diffing Works

An open-source engine computes semantic diffs by employing anti-unification to find the most specific common pattern between two expressions. This process occurs on an e-graph, which tracks expressions known to be equivalent. The engine integrates algebraic laws and domain-specific rules, such as equating an external destination with a non-internal one, to justify these equivalences. The output displays shared policy components once and presents both versions of differing parts for review. If no differences remain, the policies are considered equivalent under the applied laws and rules.

Application in Autoformalization

One key application is in autoformalization, where natural language requirements are translated into formal languages like SMT-LIB, Cedar, or Dogwood. When large language models (LLMs) generate these formal artifacts, running the model multiple times can produce varying formalizations without a clear ground truth. A semantic diff reveals areas of agreement and disagreement between these LLM-generated outputs. By comparing multiple candidates, reviewers can identify consistent parts and focus their attention on the varying sections, streamlining the review process.

Broader Policy Language Compatibility

The semantic diffing approach is also relevant for other policy languages and formats, including OpenShell sandbox policies and Common Expression Language (CEL) expressions. OpenShell uses YAML to define filesystem and network access for agents, while CEL is embedded in applications to evaluate policy conditions. The engine's ability to handle different formal languages and formats extends its utility across various policy management scenarios.

✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →

The daily brief

One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.

One email a day. Unsubscribe in one click, any time.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~4 min · 3 stories · Nov 21

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Reporting from

An open-source engine now computes semantic differences between formal policies using anti-unification on an e-graph. This method identifies behavioral changes by accounting for algebraic laws and domain rules, unlike textual diffs that highlight syntactic variations. The engine helps in reviewing autoformalized policies and comparing different formalizations generated by large language models.