module Ledger.Conway.Foreign.Cert where

open import Class.Convertible
open import Tactic.Derive.Convertible
open import Class.HasHsType
open import Tactic.Derive.HsType

open import Ledger.Prelude
open import Ledger.Prelude.Foreign.HSTypes

open import Ledger.Conway.Foreign.HSStructures hiding (CertEnv; DCert) renaming (⟦_,_,_⟧ᶜˢ to ⟦_,_,_⟧ᶜˢ'; CertState to CertState')
open import Ledger.Conway.Foreign.Certs
open import Ledger.Conway.Conformance.Certs.Properties govStructure
  using ( Computational-CERT
        ; Computational-CERTS
        )
open import Ledger.Conway.Conformance.Certs govStructure

open Computational

instance
  HsTy-CertState = autoHsType CertState  withConstructor "MkCertState"
  Conv-CertState = autoConvert CertState

  Conv-CertState-CertState' : Convertible CertState CertState'
  Conv-CertState-CertState' .to $\begin{pmatrix} \,\href{Ledger.Conway.Foreign.Cert.html#849}{\htmlId{849}{\htmlClass{Bound}{\text{dState}}}}\, \\ \,\href{Ledger.Conway.Foreign.Cert.html#858}{\htmlId{858}{\htmlClass{Bound}{\text{pState}}}}\, \\ \,\href{Ledger.Conway.Foreign.Cert.html#867}{\htmlId{867}{\htmlClass{Bound}{\text{gState}}}}\, \end{pmatrix}$    = $\begin{pmatrix} \,\href{Class.Convertible.Core.html#228}{\htmlId{885}{\htmlClass{Field}{\text{to}}}}\, \,\href{Ledger.Conway.Foreign.Cert.html#849}{\htmlId{888}{\htmlClass{Bound}{\text{dState}}}}\, \\ \,\href{Ledger.Conway.Foreign.Cert.html#858}{\htmlId{897}{\htmlClass{Bound}{\text{pState}}}}\, \\ \,\href{Class.Convertible.Core.html#228}{\htmlId{906}{\htmlClass{Field}{\text{to}}}}\, \,\href{Ledger.Conway.Foreign.Cert.html#867}{\htmlId{909}{\htmlClass{Bound}{\text{gState}}}}\, \end{pmatrix}$
  Conv-CertState-CertState' .from $\begin{pmatrix} \,\href{Ledger.Conway.Foreign.Cert.html#957}{\htmlId{957}{\htmlClass{Bound}{\text{dState}}}}\, \\ \,\href{Ledger.Conway.Foreign.Cert.html#966}{\htmlId{966}{\htmlClass{Bound}{\text{pState}}}}\, \\ \,\href{Ledger.Conway.Foreign.Cert.html#975}{\htmlId{975}{\htmlClass{Bound}{\text{gState}}}}\, \end{pmatrix}$ = $\begin{pmatrix} \,\href{Class.Convertible.Core.html#249}{\htmlId{991}{\htmlClass{Field}{\text{from}}}}\, \,\href{Ledger.Conway.Foreign.Cert.html#957}{\htmlId{996}{\htmlClass{Bound}{\text{dState}}}}\, \\ \,\href{Ledger.Conway.Foreign.Cert.html#966}{\htmlId{1005}{\htmlClass{Bound}{\text{pState}}}}\, \\ \,\href{Class.Convertible.Core.html#249}{\htmlId{1014}{\htmlClass{Field}{\text{from}}}}\, \,\href{Ledger.Conway.Foreign.Cert.html#975}{\htmlId{1019}{\htmlClass{Bound}{\text{gState}}}}\, \end{pmatrix}$

certs-step : HsType (CertEnv  CertState  List DCert  ComputationResult String CertState)
certs-step = to (compute Computational-CERTS)

{-# COMPILE GHC certs-step as certsStep #-}

cert-step : HsType (CertEnv  CertState  DCert  ComputationResult String CertState)
cert-step = to (compute Computational-CERT)

{-# COMPILE GHC cert-step as certStep #-}