Nominal Packages #
This file defines nominal packages - packages equipped with nominal structure (atom support) enabling separated composition.
Main definitions #
NomPackage- A package wrapped with support informationNomPackage.sep- Separated composition (packages with disjoint supports)
Overview #
In nominal CatCrypt, packages are given a nominal structure where atoms represent abstract memory locations. The key insight is that:
- Each package has a finite support (the atoms/locations it uses)
- Packages with disjoint supports can be composed without interference
- The "move" operation can rename atoms to achieve disjoint supports
References #
- Larsen and Schürmann, Nominal State-Separating Proofs
- [Pitts, Nominal Sets], Chapter 6
A nominal package: a raw package together with its atom support. The support represents the abstract locations/names the package uses.
- raw : Package.RawPackage
The underlying raw package
The support: atoms that matter for this package
Instances For
Empty nominal package with empty support
Equations
- CatCrypt.Nominal.NomPackage.empty = { raw := CatCrypt.Package.RawPackage.empty, support := ∅ }
Instances For
Equations
- CatCrypt.Nominal.NomPackage.instEmptyCollection = { emptyCollection := CatCrypt.Nominal.NomPackage.empty }
Equations
An atom is fresh for a package if it's not in the support
Equations
- CatCrypt.Nominal.NomPackage.Fresh a P = (a ∉ P.support)
Instances For
Two nominal packages are disjoint if their supports are disjoint
Instances For
Separated composition: compose two packages with disjoint supports. This is the key operation for nominal reasoning - packages that use different atoms can be composed without interference.
Equations
Instances For
Parallel composition without disjointness proof (using trivially empty supports). This is a fallback when support information isn't needed.
Instances For
Sequential composition (linking) of nominal packages
Instances For
Create a singleton nominal package with given support.
S and T are restricted to Type (not Type*) to match the
underlying RawPackage.singleton constraint.
Equations
- CatCrypt.Nominal.NomPackage.singleton id S T f support = { raw := CatCrypt.Package.RawPackage.singleton id S T f, support := support }
Instances For
Rename atoms in a package using a finite permutation. This changes the support according to the permutation.
WARNING: This only renames the support, NOT the underlying code.
The RawPackage stores S → SPComp T functions that have no notion of
atom/location identity, so there is nothing to rename inside the code.
For actual code renaming, use the deep embedding layer where RawCode
has explicit location references that can be permuted via
RawCode.renameLocations.
Equations
- P.rename π = { raw := P.raw, support := Finset.image (fun (x : CatCrypt.Nominal.Atom) => π.apply x) P.support }
Instances For
Separated composition properties #
Fresh atoms don't affect packages under renaming
NominalAction and NomSet instances #
NomPackage has a nominal action: permutations act on the support
Equations
- One or more equations did not get rendered due to their size.
NomPackage is a nominal set
Equations
- One or more equations did not get rendered due to their size.
Alpha-equivalence for packages #
Alpha-equivalence for NomPackage: two packages are equivalent if they differ only by a permutation
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Alpha-equivalence is reflexive
Alpha-equivalence is symmetric
Alpha-equivalence is transitive
Package algebra laws #
Raw package parallel composition is commutative up to alpha-equivalence.
This theorem states that the underlying raw packages have the same entries (though possibly in different order in the union).
Commutativity of separated composition for NomPackage.
When two packages have disjoint supports, their separated composition is equal (not just alpha-equivalent) because:
- The raw packages combine with union (which is commutative)
- The supports combine with union (which is commutative)
Associativity of separated composition (equality version).
For three packages with mutually disjoint supports, separated composition is associative.
Associativity of separated composition up to alpha-equivalence