An AWS Machine Learning Blog post by Ferhat Erata and Remi Delmas describes semantic diffing of formal policies with anti-unification, which computes a most specific common pattern for two expressions; the post credits Plotkin's 1970 paper for the classical formulation. The engine works over an e-graph that tracks expressions known to be equal, supplied with algebraic laws and domain rules such as equating an external destination with one that is not internal. The output shows shared parts once and keeps both versions of each differing part for review, and if no differences remain the policies are equivalent under those laws. AWS presents autoformalization as the main use case: a large language model translates prose requirements into SMT-LIB, Cedar or Dogwood, and running it twice can produce two different formalizations with no ground truth to pick between them, so a semantic diff shows which parts agree and which vary. The post also covers translations into OpenShell sandbox policies and Common Expression Language, notes that target languages can disagree on a condition, scope or event, and points to an open-source engine.
Our takeThe useful move is that the model writes the artifact but plays no part in comparing it, so the diff checks the model instead of adding another model output. That strength is also the limit: an equivalence claim is only as good as the supplied laws and the e-graph search, and the post concedes that a residual difference may be an equivalence the engine never found. It is a review aid, not a verifier.