Documentation

CatCryptCore.Package.Interface

Operation Signatures and Interfaces #

This file defines operation signatures and interfaces for the CatCrypt package system. An interface is a finite collection of operation signatures indexed by identifiers.

Main definitions #

References #

Operation signature: specifies the input type (src) and output type (tgt)

Instances For
    @[implicit_reducible]

    Two operation signatures are equal if their types are the same. Note: This uses heterogeneous equality for Type universes.

    Equations

    An interface entry: an operation id with its signature

    Instances For
      @[implicit_reducible]

      DecidableEq for InterfaceEntry (needed for Finset operations)

      Equations

      Interface: a finite collection of operation signatures indexed by identifiers. We represent this as a finite set of entries with unique ids.

      Instances For

        Check if an interface declares an operation with given id and signature

        Equations
        Instances For

          The set of operation ids in the interface

          Equations
          Instances For

            Lookup a signature by id (noncomputable since types aren't decidable)

            Equations
            Instances For

              Two interfaces are disjoint if they share no operation ids

              Equations
              Instances For
                noncomputable def CatCrypt.Package.Interface.singleton (id : ) (S T : Type) :

                A single operation interface

                Equations
                Instances For
                  theorem CatCrypt.Package.Interface.singleton_has (id : ) (S T : Type) :
                  (singleton id S T).has id S T

                  Empty interface has no operations

                  noncomputable def CatCrypt.Package.Interface.union (I₁ I₂ : Interface) (h : I₁.Disjoint I₂) :

                  Union of interfaces (requires disjoint ids for uniqueness)

                  Equations
                  Instances For
                    theorem CatCrypt.Package.Interface.union_has_left {I₁ I₂ : Interface} (h : I₁.Disjoint I₂) (id : ) (S T : Type) (hI₁ : I₁.has id S T) :
                    (I₁.union I₂ h).has id S T

                    Union contains operations from both interfaces

                    theorem CatCrypt.Package.Interface.union_has_right {I₁ I₂ : Interface} (h : I₁.Disjoint I₂) (id : ) (S T : Type) (hI₂ : I₂.has id S T) :
                    (I₁.union I₂ h).has id S T