From 377f8c4c2a1c5bbb0047469b6c4e9e226a4bea6a Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Wed, 8 Apr 2026 23:05:33 +0300 Subject: [PATCH 01/16] Tmp --- .../src/UntypedPlutusCore/Simplify/Opts.hs | 2 ++ plutus-metatheory/src/VerifiedCompilation.lagda.md | 1 + plutus-tx-plugin/src/PlutusTx/Options.hs | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify/Opts.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify/Opts.hs index ff78d22fe86..79ff7737649 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify/Opts.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify/Opts.hs @@ -31,6 +31,7 @@ data SimplifyOpts name a = SimplifyOpts , _soInlineCallsiteGrowth :: AstSize , _soPreserveLogging :: Bool , _soApplyToCase :: Bool + , _soSafeOpts :: Bool } deriving stock (Show) @@ -48,4 +49,5 @@ defaultSimplifyOpts = , _soInlineCallsiteGrowth = 5 , _soPreserveLogging = True , _soApplyToCase = True + , _soSafeOpts = False } diff --git a/plutus-metatheory/src/VerifiedCompilation.lagda.md b/plutus-metatheory/src/VerifiedCompilation.lagda.md index bc7d8c16603..f7f33b0ea6f 100644 --- a/plutus-metatheory/src/VerifiedCompilation.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation.lagda.md @@ -89,6 +89,7 @@ RelationOf = fromMaybe (NotImplemented accept) ∘ mRelationOf hasRelation : SimplifierTag → Bool hasRelation = is-just ∘ mRelationOf +{-# COMPILE GHC hasRelation as certifierImplements #-} ``` The corresponding certifier can then be called for a given pass: diff --git a/plutus-tx-plugin/src/PlutusTx/Options.hs b/plutus-tx-plugin/src/PlutusTx/Options.hs index b06cfd36189..167e06e1523 100644 --- a/plutus-tx-plugin/src/PlutusTx/Options.hs +++ b/plutus-tx-plugin/src/PlutusTx/Options.hs @@ -85,6 +85,7 @@ data PluginOptions = PluginOptions _posRemoveTrace :: Bool , _posDumpCompilationTrace :: Bool , _posCertify :: Maybe String + , _posSafeOpts :: Bool } makeLenses ''PluginOptions @@ -339,6 +340,11 @@ pluginOptions = rest <- many (alphaNumChar <|> char '_' <|> char '\\') pure (firstC : rest) in (k, PluginOption typeRep (plcParserOption p k) posCertify desc []) + , let k = "safe-optimisation" + desc = + "Run only those optimisation passes which are certified to preserve the functional " + <> "behavior of the original program." + in (k, PluginOption typeRep (setTrue k) posSafeOpts desc []) ] flag :: (a -> a) -> OptionKey -> Maybe OptionValue -> Validation ParseError (a -> a) @@ -414,6 +420,7 @@ defaultPluginOptions = , _posRemoveTrace = False , _posDumpCompilationTrace = False , _posCertify = Nothing + , _posSafeOpts = False } processOne From 67b142a0218c1467c6b61ff123e5f4c3709a34f7 Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Thu, 9 Apr 2026 21:00:49 +0300 Subject: [PATCH 02/16] Absolute mess --- plutus-core/plutus-core.cabal | 1 - .../Transform/Certify/Trace.hs | 61 ++++++++-- .../UntypedPlutusCore/Transform/Simplifier.hs | 8 +- .../testlib/Transform/Simplify/Lib.hs | 5 +- .../src/MAlonzo/Code/Certifier.hs | 4 +- .../src/MAlonzo/Code/VerifiedCompilation.hs | 113 +++++++++++++++--- .../src/VerifiedCompilation.lagda.md | 91 +++++++++----- .../VerifiedCompilation/Certificate.lagda.md | 21 ++-- .../src/VerifiedCompilation/Trace.lagda.md | 94 ++++++++++++--- .../UntypedTranslation.lagda.md | 8 +- 10 files changed, 302 insertions(+), 104 deletions(-) diff --git a/plutus-core/plutus-core.cabal b/plutus-core/plutus-core.cabal index 17d33d9577b..b298bc4c8f4 100644 --- a/plutus-core/plutus-core.cabal +++ b/plutus-core/plutus-core.cabal @@ -489,7 +489,6 @@ library untyped-plutus-core-testlib , cardano-crypto-class , data-default-class , dlist - , extra , filepath , hedgehog , lens diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs index c75c6e4f17f..aaf785a948f 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} module UntypedPlutusCore.Transform.Certify.Trace where @@ -9,23 +10,59 @@ import UntypedPlutusCore.Transform.Certify.Hints qualified as Certify import Control.DeepSeq import GHC.Generics -data SimplifierStage - = FloatDelay - | ForceDelay - | ForceCaseDelay - | CaseOfCase - | CaseReduce - | Inline - | CSE - | ApplyToCase - | Unknown +data Certified = Certified deriving stock (Show, Generic) deriving anyclass (NFData) +data NotCertified = NotCertified + deriving stock (Show, Generic) + deriving anyclass (NFData) + +data SimplifierStage a where + FloatDelay :: SimplifierStage Certified + ForceDelay :: SimplifierStage Certified + ForceCaseDelay :: SimplifierStage Certified + CaseOfCase :: SimplifierStage NotCertified + CaseReduce :: SimplifierStage Certified + Inline :: SimplifierStage Certified + CSE :: SimplifierStage Certified + ApplyToCase :: SimplifierStage Certified + Unknown :: SimplifierStage NotCertified + +deriving instance Show a => Show (SimplifierStage a) + +instance Generic a => Generic (SimplifierStage a) + +instance (Generic a, NFData a) => NFData (SimplifierStage a) where + rnf = undefined + +data Yes = Yes + +data No = No + +-- this is much simpler, why did i go with something so complicated :( +-- data ImplTags = A | B | C +-- +-- data NotImplTags = D +-- +-- data Tags = Impl ImplTags | NotImpl NotImplTags + +data CertifierImplements a where + CertFloatDelay :: CertifierImplements Yes + CertForceDelay :: CertifierImplements Yes + CertCaseOfCase :: CertifierImplements No + CertCaseReduce :: CertifierImplements Yes + CertInline :: CertifierImplements Yes + CertCSE :: CertifierImplements Yes + CertApplyToCase :: CertifierImplements Yes + CertUnknown :: CertifierImplements No + data Simplification name uni fun a - = Simplification + = forall isCertified. + Show isCertified => + Simplification { beforeAST :: Term name uni fun a - , stage :: SimplifierStage + , stage :: SimplifierStage isCertified , hints :: Certify.Hints , afterAST :: Term name uni fun a } diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs index 5d907ff5ea0..79eb6770b39 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs @@ -57,18 +57,18 @@ execSimplifier :: Simplifier name uni fun ann a -> Trace.SimplifierTrace name un execSimplifier = runIdentity . execSimplifierT recordSimplification - :: Monad m + :: (Show isCertified, Monad m) => Term name uni fun a - -> Trace.SimplifierStage + -> Trace.SimplifierStage isCertified -> Term name uni fun a -> SimplifierT name uni fun a m () recordSimplification = recordSimplificationWithHints Hints.NoHints recordSimplificationWithHints - :: Monad m + :: (Show isCertified, Monad m) => Hints.Hints -> Term name uni fun a - -> Trace.SimplifierStage + -> Trace.SimplifierStage isCertified -> Term name uni fun a -> SimplifierT name uni fun a m () recordSimplificationWithHints hints before stage after = diff --git a/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs b/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs index 5ee70434654..d686fbfc966 100644 --- a/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs +++ b/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs @@ -8,7 +8,6 @@ import Data.ByteString.Lazy qualified as BSL import Data.Text (Text) import Data.Text qualified as T import Data.Text.Encoding (encodeUtf8) -import Data.Tuple.Extra ((&&&)) import PlutusCore qualified as PLC import PlutusCore.Builtin (BuiltinSemanticsVariant) import PlutusCore.Pretty (PrettyPlc, Render (render), prettyPlcReadableSimple) @@ -62,10 +61,10 @@ renderCertifierHints (Trace.SimplifierTrace ss) zipWith renderHintsWithIdx [(1 :: Int) ..] - ((Trace.stage &&& Trace.hints) <$> reverse ss) + ((\(Trace.Simplification _ stage hints _) -> (show stage, hints)) <$> reverse ss) where renderHintsWithIdx i (st, h) = - ("-- Certifier hints #" <> T.pack (show i) <> " (" <> T.pack (show st) <> ") --\n") + ("-- Certifier hints #" <> T.pack (show i) <> " (" <> T.pack st <> ") --\n") <> renderHints h <> "\n" diff --git a/plutus-metatheory/src/MAlonzo/Code/Certifier.hs b/plutus-metatheory/src/MAlonzo/Code/Certifier.hs index 4db1e142761..6a048e9d88d 100644 --- a/plutus-metatheory/src/MAlonzo/Code/Certifier.hs +++ b/plutus-metatheory/src/MAlonzo/Code/Certifier.hs @@ -54,13 +54,13 @@ d_runCertifier_2 v0 (coe MAlonzo.Code.Utils.du_try_94 (coe - MAlonzo.Code.VerifiedCompilation.d_checkScope'7511'_100 (coe v1)) + MAlonzo.Code.VerifiedCompilation.d_checkScope'7511'_130 (coe v1)) (coe MAlonzo.Code.VerifiedCompilation.C_illScoped_6)) (coe (\ v2 -> coe MAlonzo.Code.Utils.du_eitherBind_54 - (coe MAlonzo.Code.VerifiedCompilation.d_certify_44 (coe v2)) + (coe MAlonzo.Code.VerifiedCompilation.d_certify_74 (coe v2)) (coe (\ v3 -> coe diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs index 5a7cfe8f28a..56cd34942c5 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs @@ -9,6 +9,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# OPTIONS_GHC -Wno-overlapping-patterns #-} +{-# LANGUAGE GADTs #-} module MAlonzo.Code.VerifiedCompilation where @@ -34,6 +35,7 @@ import qualified MAlonzo.Code.VerifiedCompilation.UForceCaseDelay import qualified MAlonzo.Code.VerifiedCompilation.UForceDelay import qualified MAlonzo.Code.VerifiedCompilation.UInline +import UntypedPlutusCore.Transform.Certify.Trace -- VerifiedCompilation.Error d_Error_2 = () data T_Error_2 @@ -80,14 +82,87 @@ d_hasRelation_16 v0 = coe MAlonzo.Code.Data.Maybe.Base.du_is'45'just_20 (coe d_mRelationOf_12 (coe v0)) +-- VerifiedCompilation.Yes +d_Yes_18 = () +type T_Yes_18 = Yes +pattern C_yes_20 = Yes +check_yes_20 :: T_Yes_18 +check_yes_20 = Yes +cover_Yes_18 :: Yes -> () +cover_Yes_18 x + = case x of + Yes -> () +-- VerifiedCompilation.No +d_No_22 = () +type T_No_22 = No +pattern C_no_24 = No +check_no_24 :: T_No_22 +check_no_24 = No +cover_No_22 :: No -> () +cover_No_22 x + = case x of + No -> () +-- VerifiedCompilation.CertifierImplements +d_CertifierImplements_26 a0 = () +type T_CertifierImplements_26 = CertifierImplements +pattern C_certFloatDelay_28 = CertFloatDelay +pattern C_certForceDelay_30 = CertForceDelay +pattern C_certCaseOfCase_32 = CertCaseOfCase +pattern C_certCaseReduce_34 = CertCaseReduce +pattern C_certInline_36 = CertInline +pattern C_certCSE_38 = CertCSE +pattern C_certApplyToCase_40 = CertApplyToCase +pattern C_certUnknown_42 = CertUnknown +check_certFloatDelay_28 :: T_CertifierImplements_26 T_Yes_18 +check_certFloatDelay_28 = CertFloatDelay +check_certForceDelay_30 :: T_CertifierImplements_26 T_Yes_18 +check_certForceDelay_30 = CertForceDelay +check_certCaseOfCase_32 :: T_CertifierImplements_26 T_No_22 +check_certCaseOfCase_32 = CertCaseOfCase +check_certCaseReduce_34 :: T_CertifierImplements_26 T_Yes_18 +check_certCaseReduce_34 = CertCaseReduce +check_certInline_36 :: T_CertifierImplements_26 T_Yes_18 +check_certInline_36 = CertInline +check_certCSE_38 :: T_CertifierImplements_26 T_Yes_18 +check_certCSE_38 = CertCSE +check_certApplyToCase_40 :: T_CertifierImplements_26 T_Yes_18 +check_certApplyToCase_40 = CertApplyToCase +check_certUnknown_42 :: T_CertifierImplements_26 T_No_22 +check_certUnknown_42 = CertUnknown +cover_CertifierImplements_26 :: CertifierImplements a1 -> () +cover_CertifierImplements_26 x + = case x of + CertFloatDelay -> () + CertForceDelay -> () + CertCaseOfCase -> () + CertCaseReduce -> () + CertInline -> () + CertCSE -> () + CertApplyToCase -> () + CertUnknown -> () +-- VerifiedCompilation.f +d_f_46 :: () -> T_CertifierImplements_26 AgdaAny -> AgdaAny +d_f_46 ~v0 v1 = du_f_46 v1 +du_f_46 :: T_CertifierImplements_26 AgdaAny -> AgdaAny +du_f_46 v0 + = case coe v0 of + C_certFloatDelay_28 -> coe C_yes_20 + C_certForceDelay_30 -> coe C_yes_20 + C_certCaseOfCase_32 -> coe C_no_24 + C_certCaseReduce_34 -> coe C_yes_20 + C_certInline_36 -> coe C_yes_20 + C_certCSE_38 -> coe C_yes_20 + C_certApplyToCase_40 -> coe C_yes_20 + C_certUnknown_42 -> coe C_no_24 + _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.certifyPass -d_certifyPass_24 :: +d_certifyPass_54 :: MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_52 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.VerifiedCompilation.Certificate.T_CertResult_12 -d_certifyPass_24 v0 v1 +d_certifyPass_54 v0 v1 = case coe v0 of MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_6 -> coe @@ -149,25 +224,25 @@ d_certifyPass_24 v0 v1 MAlonzo.Code.VerifiedCompilation.NotImplemented.du_certNotImplemented_22) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.Certificate -d_Certificate_32 :: +d_Certificate_62 :: MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -> () -d_Certificate_32 = erased +d_Certificate_62 = erased -- VerifiedCompilation.certify -d_certify_44 :: +d_certify_74 :: MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -> MAlonzo.Code.Utils.T_Either_6 T_Error_2 AgdaAny -d_certify_44 v0 +d_certify_74 v0 = case coe v0 of MAlonzo.Code.VerifiedCompilation.Trace.C_step_64 v1 v2 v3 v4 -> let v5 = coe - d_certifyPass_24 v1 v2 v3 + d_certifyPass_54 v1 v2 v3 (MAlonzo.Code.VerifiedCompilation.Trace.d_head_70 (coe v4)) in coe (case coe v5 of MAlonzo.Code.VerifiedCompilation.Certificate.C_proof_18 v6 -> coe - MAlonzo.Code.Utils.du_eitherBind_54 (coe d_certify_44 (coe v4)) + MAlonzo.Code.Utils.du_eitherBind_54 (coe d_certify_74 (coe v4)) (coe (\ v7 -> coe @@ -185,41 +260,41 @@ d_certify_44 v0 (coe MAlonzo.Code.Agda.Builtin.Unit.C_tt_8) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.cert -d_cert_94 :: +d_cert_124 :: MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -> MAlonzo.Code.Utils.T_Either_6 T_Error_2 AgdaAny -> AgdaAny -> AgdaAny -d_cert_94 ~v0 v1 v2 = du_cert_94 v1 v2 -du_cert_94 :: +d_cert_124 ~v0 v1 v2 = du_cert_124 v1 v2 +du_cert_124 :: MAlonzo.Code.Utils.T_Either_6 T_Error_2 AgdaAny -> AgdaAny -> AgdaAny -du_cert_94 v0 v1 +du_cert_124 v0 v1 = case coe v0 of MAlonzo.Code.Utils.C_inj'8322'_14 v2 -> coe seq (coe v1) (coe v2) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.checkScope -d_checkScope_98 :: +d_checkScope_128 :: MAlonzo.Code.RawU.T_Untyped_208 -> Maybe MAlonzo.Code.Untyped.T__'8866'_14 -d_checkScope_98 v0 +d_checkScope_128 v0 = coe MAlonzo.Code.Utils.du_eitherToMaybe_104 (coe MAlonzo.Code.Untyped.d_scopeCheckU0_276 (coe v0)) -- VerifiedCompilation.checkScopeᵗ -d_checkScope'7511'_100 :: +d_checkScope'7511'_130 :: MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -> Maybe MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -d_checkScope'7511'_100 v0 +d_checkScope'7511'_130 v0 = case coe v0 of MAlonzo.Code.VerifiedCompilation.Trace.C_step_64 v1 v2 v3 v4 -> coe MAlonzo.Code.Data.Maybe.Base.du__'62''62''61'__72 - (coe d_checkScope_98 (coe v3)) + (coe d_checkScope_128 (coe v3)) (coe (\ v5 -> coe MAlonzo.Code.Data.Maybe.Base.du__'62''62''61'__72 - (coe d_checkScope'7511'_100 (coe v4)) + (coe d_checkScope'7511'_130 (coe v4)) (coe (\ v6 -> coe @@ -230,7 +305,7 @@ d_checkScope'7511'_100 v0 MAlonzo.Code.VerifiedCompilation.Trace.C_done_66 v1 -> coe MAlonzo.Code.Data.Maybe.Base.du__'62''62''61'__72 - (coe d_checkScope_98 (coe v1)) + (coe d_checkScope_128 (coe v1)) (coe (\ v2 -> coe diff --git a/plutus-metatheory/src/VerifiedCompilation.lagda.md b/plutus-metatheory/src/VerifiedCompilation.lagda.md index f7f33b0ea6f..d48311bbf7f 100644 --- a/plutus-metatheory/src/VerifiedCompilation.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation.lagda.md @@ -59,8 +59,8 @@ open import VerifiedCompilation.Certificate hiding (_>>=_) data Error : Set where emptyDump : Error illScoped : Error - counterExample : SimplifierTag → Error - abort : SimplifierTag → Error + counterExample : SimplifierTag Certified → Error + abort : SimplifierTag Certified → Error ``` ## Translation Relations and Certifiers @@ -69,40 +69,65 @@ We map a `SimplifierTag` to the corresponding translation relation, or `nothing` if we don't have a translation relation. ``` -mRelationOf : SimplifierTag → Maybe (0 ⊢ → 0 ⊢ → Set) -mRelationOf floatDelayT = just UFlD.FloatDelay -mRelationOf forceDelayT = just UFD.ForceDelay -mRelationOf caseReduceT = just UCR.UCaseReduce -mRelationOf cseT = just UCSE.UntypedCSE -mRelationOf inlineT = just (UInline.Inline (λ()) UInline.□) -mRelationOf unknown = nothing -mRelationOf caseOfCaseT = nothing -- FIXME: https://github.com/IntersectMBO/plutus-private/issues/2054 -mRelationOf forceCaseDelayT = just UFCD.ForceCaseDelay -mRelationOf applyToCaseT = just UA2C.UApplyToCase + + +mRelationOf : {isCertified : Set} → SimplifierTag isCertified → Maybe (0 ⊢ → 0 ⊢ → Set) +mRelationOf floatDelayT with isCertified? floatDelayT +... | certified = just UFlD.FloatDelay +mRelationOf forceDelayT with isCertified? forceDelayT +... | certified = just UFD.ForceDelay +mRelationOf forceCaseDelayT with isCertified? forceCaseDelayT +... | certified = just UFCD.ForceCaseDelay +mRelationOf caseOfCaseT with isCertified? caseOfCaseT +... | notCertified = nothing -- FIXME: https://github.com/IntersectMBO/plutus-private/issues/2054 +mRelationOf caseReduceT with isCertified? caseReduceT +... | certified = just UCR.UCaseReduce +mRelationOf inlineT with isCertified? inlineT +... | certified = just (UInline.Inline (λ()) UInline.□) +mRelationOf cseT with isCertified? cseT +... | certified = just UCSE.UntypedCSE +mRelationOf applyToCaseT with isCertified? applyToCaseT +... | certified = just UA2C.ApplyToCase +mRelationOf unknown with isCertified? unknown +... | notCertified = nothing + + +go : DumpStep → (0 ⊢ → 0 ⊢ → Set) +go (dumpStep _ floatDelayT hints x y) with isCertified? floatDelayT +... | certified = UFlD.FloatDelay +go (dumpStep _ forceDelayT hints x y) = {! !} +go (dumpStep _ forceCaseDelayT hints x y) = {! !} +go (dumpStep _ caseOfCaseT hints x y) = {! !} +go (dumpStep _ caseReduceT hints x y) = {! !} +go (dumpStep _ inlineT hints x y) = {! !} +go (dumpStep _ cseT hints x y) = {! !} +go (dumpStep _ applyToCaseT hints x y) = {! !} +go (dumpStep _ unknown hints x y) = {! !} + ``` We default to the `NotImplemented` relation to give each `SimplifierTag` a relation: ``` -RelationOf : SimplifierTag → (0 ⊢ → 0 ⊢ → Set) +RelationOf : {isCertified : Set} → SimplifierTag isCertified → (0 ⊢ → 0 ⊢ → Set) RelationOf = fromMaybe (NotImplemented accept) ∘ mRelationOf -hasRelation : SimplifierTag → Bool +hasRelation : {isCertified : Set} → SimplifierTag isCertified → Bool hasRelation = is-just ∘ mRelationOf -{-# COMPILE GHC hasRelation as certifierImplements #-} + ``` The corresponding certifier can then be called for a given pass: ``` -certifyPass : (pass : SimplifierTag) → Hints → (M M' : 0 ⊢) → CertResult (RelationOf pass M M') +certifyPass : {isCertified : Set} → (pass : SimplifierTag isCertified) → Hints → (M M' : 0 ⊢) → CertResult (RelationOf pass M M') certifyPass floatDelayT _ = decider UFlD.isFloatDelay? certifyPass forceDelayT _ = decider UFD.isForceDelay? certifyPass caseReduceT _ = decider UCR.isCaseReduce? certifyPass cseT _ = decider UCSE.isUntypedCSE? certifyPass caseOfCaseT _ = certNotImplemented certifyPass forceCaseDelayT _ = decider UFCD.isForceCaseDelay? -certifyPass applyToCaseT _ = decider UA2C.a2c?ᶜᶜ +-- certifyPass applyToCaseT _ = decider UA2C.a2c?ᶜᶜ certifyPass inlineT (inline hs) = checker (UInline.top-check hs) certifyPass inlineT none = λ M M' → abort inlineT M M' certifyPass unknown _ = certNotImplemented @@ -116,17 +141,17 @@ corresponding certifiers of each pass. ``` Certificate : Trace (0 ⊢) → Set Certificate (done _) = ⊤ -Certificate (step pass hints t ts) = RelationOf pass t (head ts) × Certificate ts +-- Certificate (step (certifierStep ty pass hints t) ts) = RelationOf pass t (head ts) × Certificate ts certify : (trace : Trace (0 ⊢)) → Either Error (Certificate trace) certify (done _) = inj₂ tt -certify (step pass hints x xs) with certifyPass pass hints x (head xs) -... | ce _ tag _ _ = inj₁ (counterExample tag) -... | abort tag _ _ = inj₁ (abort tag) -... | proof p = - do - ps ← certify xs - return (p , ps) +-- certify (step (certifierStep ty pass hints x) xs) with certifyPass pass hints x (head xs) +-- ... | ce _ tag _ _ = inj₁ (counterExample tag) +-- ... | abort tag _ _ = inj₁ (abort tag) +-- ... | proof p = +-- do +-- ps ← certify xs +-- return (p , ps) ``` If the certifier succeeds, we can produce the certificate: @@ -146,12 +171,12 @@ checkScope : Untyped → Maybe (0 ⊢) checkScope = eitherToMaybe ∘ scopeCheckU0 -- Scope-check all terms in a trace -checkScopeᵗ : Trace Untyped → Maybe (Trace (0 ⊢)) -checkScopeᵗ (done x) = do - x' ← checkScope x - return (done x') -checkScopeᵗ (step pass hints t ts) = do - t' ← checkScope t - ts' ← checkScopeᵗ ts - return (step pass hints t' ts') +-- checkScopeᵗ : Trace Untyped → ? (Trace (0 ⊢)) +-- checkScopeᵗ (done x) = do +-- x' ← checkScope x +-- return (done x') +-- checkScopeᵗ (step pass hints t ts) = do +-- t' ← checkScope t +-- ts' ← checkScopeᵗ ts +-- return (step pass hints t' ts') ``` diff --git a/plutus-metatheory/src/VerifiedCompilation/Certificate.lagda.md b/plutus-metatheory/src/VerifiedCompilation/Certificate.lagda.md index a5e14cb4a15..f38c88cba78 100644 --- a/plutus-metatheory/src/VerifiedCompilation/Certificate.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/Certificate.lagda.md @@ -45,13 +45,13 @@ variable data CertResult (P : Set 𝓁) : Set (suc 𝓁) where proof : (p : P) → CertResult P - ce : (¬p : ¬ P) → {X X' : Set} → SimplifierTag → X → X' → CertResult P - abort : {X X' : Set} → SimplifierTag → X → X' → CertResult P + ce : (¬p : ¬ P) → {X X' isCertified : Set} → SimplifierTag isCertified → X → X' → CertResult P + abort : {X X' isCertified : Set} → SimplifierTag isCertified → X → X' → CertResult P -- | Result of a decision procedure: either a proof or a counterexample data ProofOrCE (P : Set 𝓁) : Set (suc 𝓁) where proof : (p : P) → ProofOrCE P - ce : (¬p : ¬ P) → {X X' : Set} → SimplifierTag → X → X' → ProofOrCE P + ce : (¬p : ¬ P) → {X X' isCertified : Set} → SimplifierTag isCertified → X → X' → ProofOrCE P isProof? : {P : Set 𝓁} → ProofOrCE P → Bool isProof? (proof _) = true @@ -63,7 +63,7 @@ isCE? = not ∘ isProof? -- | Result of a checking procedure: either a proof or a failure data Proof? (P : Set 𝓁) : Set (suc 𝓁) where proof : (p : P) → Proof? P - abort : {X X' : Set} → SimplifierTag → X → X' → Proof? P + abort : {X X' isCertified : Set} → SimplifierTag isCertified → X → X' → Proof? P infixl 1 _>>=_ @@ -94,7 +94,9 @@ decider f x y with f x y ... | proof p = proof p ... | ce ¬p tag a b = ce ¬p tag a b -decToPCE : {X : Set} {P : Set} → SimplifierTag → Dec P → {before after : X} → ProofOrCE P +decToPCE + : {X : Set} {P : Set} {isCertified : Set} + → SimplifierTag isCertified → Dec P → {before after : X} → ProofOrCE P decToPCE _ (yes p) = proof p decToPCE tag (no ¬p) {before} {after} = ce ¬p tag before after @@ -102,12 +104,17 @@ pceToDec : {P : Set} → ProofOrCE P → Dec P pceToDec (proof p) = yes p pceToDec (ce ¬p _ _ _) = no ¬p -matchOrCE : {X X' : Set} {𝓁 : Level} → {P : X → X' → Set 𝓁} → SimplifierTag → Binary.Decidable P → DecidableCE P +matchOrCE + : {X X' isCertified : Set} {𝓁 : Level} + → {P : X → X' → Set 𝓁} + → SimplifierTag isCertified → Binary.Decidable P → DecidableCE P matchOrCE tag P a b with P a b ... | yes p = proof p ... | no ¬p = ce ¬p tag a b -pcePointwise : {X X' : Set} {𝓁 : Level} {P : X → X' → Set 𝓁} → SimplifierTag → DecidableCE P → DecidableCE (Pointwise P) +pcePointwise + : {X X' isCertified : Set} {𝓁 : Level} {P : X → X' → Set 𝓁} + → SimplifierTag isCertified → DecidableCE P → DecidableCE (Pointwise P) pcePointwise tag isP? [] [] = proof Pointwise.[] pcePointwise {X = X} tag isP? [] (y ∷ ys) = ce (λ ()) {X = List X} tag [] ys pcePointwise {X' = X'} tag isP? (x ∷ xs) [] = ce (λ ()) {X' = List X'} tag xs [] diff --git a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md index 11ff91b17c7..aa99b3e43b8 100644 --- a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md @@ -8,6 +8,7 @@ operates on. It contains all the ASTs of the performed passes together with some information about that pass. ``` +{-# OPTIONS --allow-unsolved-metas #-} module VerifiedCompilation.Trace where open import RawU using (Untyped) @@ -22,19 +23,39 @@ open Maybe We enumerate the known passes: ``` -data SimplifierTag : Set where - floatDelayT : SimplifierTag - forceDelayT : SimplifierTag - forceCaseDelayT : SimplifierTag - caseOfCaseT : SimplifierTag - caseReduceT : SimplifierTag - inlineT : SimplifierTag - cseT : SimplifierTag - applyToCaseT : SimplifierTag - unknown : SimplifierTag -- a placeholder for passes that we don't yet know of, so the certifier doesn't break if a pass was added + +data Certified : Set where + certified : Certified + +data NotCertified : Set where + notCertified : NotCertified + +data SimplifierTag : Set → Set where + floatDelayT : SimplifierTag Certified + forceDelayT : SimplifierTag Certified + forceCaseDelayT : SimplifierTag Certified + caseOfCaseT : SimplifierTag NotCertified + caseReduceT : SimplifierTag Certified + inlineT : SimplifierTag Certified + cseT : SimplifierTag Certified + applyToCaseT : SimplifierTag Certified + unknown : SimplifierTag NotCertified -- a placeholder for passes that we don't yet know of, so the certifier doesn't break if a pass was added {-# FOREIGN GHC import UntypedPlutusCore.Transform.Simplifier #-} +{-# FOREIGN GHC {-# LANGUAGE GADTs #-} #-} {-# COMPILE GHC SimplifierTag = data SimplifierStage (FloatDelay | ForceDelay | ForceCaseDelay | CaseOfCase | CaseReduce | Inline | CSE | ApplyToCase | Unknown) #-} + +isCertified? : {isCertified : Set} → SimplifierTag isCertified → isCertified +isCertified? floatDelayT = certified +isCertified? forceDelayT = certified +isCertified? forceCaseDelayT = certified +isCertified? caseOfCaseT = notCertified +isCertified? caseReduceT = certified +isCertified? inlineT = certified +isCertified? cseT = certified +isCertified? applyToCaseT = certified +isCertified? unknown = notCertified + ``` ## Hints @@ -74,16 +95,29 @@ information about which pass was performed. ``` -data Trace (A : Set) : Set where +-- record Step (A : Set) : Set₁ where +-- constructor certifierStep +-- field +-- isCertified : Set +-- tag : SimplifierTag isCertified +-- hints : Hints +-- inputTerm : A + +data Step (A : Set) : Set where + implementedStep : SimplifierTag Certified → Hints → A → Step A + notImplementedStep : SimplifierTag NotCertified → Hints → A → Step A + +data Trace (A : Set) : Set₁ where -- One step in the pipeline, with its pass and input term - step : SimplifierTag → Hints → A → Trace A → Trace A + step : Step A → Trace A → Trace A -- Final AST in the trace done : A → Trace A -- Get the first term in the trace head : ∀{A} → Trace A → A -head (done x) = x -head (step _ _ x _) = x +head (done term) = term +head (step (implementedStep _ _ x) _) = x +head (step (notImplementedStep _ _ x) _) = x ``` @@ -91,10 +125,17 @@ head (step _ _ x _) = x ``` +record DumpStep : Set₁ where + constructor dumpStep + field + isCertified : Set + tag : SimplifierTag isCertified + hints : Hints + inputTerm : Untyped + outputTerm : Untyped -- The current trace structure dumped from Haskell -Dump : Set -Dump = List (SimplifierTag × Hints × Untyped × Untyped) +Dump = List DumpStep -- -- Since there is duplication in the dump, i.e. it is of the form @@ -108,9 +149,24 @@ toTrace : Dump → Maybe (Trace Untyped) toTrace [] = nothing toTrace (x ∷ xs) = just (go x xs) where - go : SimplifierTag × Hints × Untyped × Untyped → Dump → Trace Untyped - go (pass , hints , x , y) [] = step pass hints x (done y) - go (pass , hints , x , y) ((pass' , hints' , _ , z) ∷ xs) = step pass hints x (go (pass' , hints' , y , z) xs) + go : DumpStep → Dump → Trace Untyped + go bl fl = {! !} + -- go (dumpStep _ floatDelayT hints x y) [] with isCertified? floatDelayT + -- ... | certified = {! UFlD.FloatDelay !} + -- go (dumpStep _ forceDelayT hints x y) [] = {! !} + -- go (dumpStep _ forceCaseDelayT hints x y) [] = {! !} + -- go (dumpStep _ caseOfCaseT hints x y) [] = {! !} + -- go (dumpStep _ caseReduceT hints x y) [] = {! !} + -- go (dumpStep _ inlineT hints x y) [] = {! !} + -- go (dumpStep _ cseT hints x y) [] = {! !} + -- go (dumpStep _ applyToCaseT hints x y) [] = {! !} + -- go (dumpStep _ unknown hints x y) [] = {! !} -- with isCertified? pass + -- ... | certified = + -- step (implementedStep pass hints x) (done y) + -- ... | notCertified = + -- step (notImplementedStep pass hints x) (done y) + -- go (dumpStep ty pass hints x y) ((dumpStep ty' pass' hints' _ z) ∷ xs) = + -- step (certifierStep ty pass hints x) (go (dumpStep ty' pass' hints' y z) xs) ``` `EvalResult` is used to report script execution costs, before and after an optimisation (or optimisations). diff --git a/plutus-metatheory/src/VerifiedCompilation/UntypedTranslation.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UntypedTranslation.lagda.md index a051b8b3d86..4347cb0a1b1 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UntypedTranslation.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UntypedTranslation.lagda.md @@ -105,14 +105,14 @@ matchIx builtin = refl matchIx error = refl translation? - : {X' : ℕ} {R : Relation} - → SimplifierTag + : {X' : ℕ} {R : Relation} {isCertified : Set} + → SimplifierTag isCertified → ({ X : ℕ } → DecidableCE (R {X})) → (p q : X' ⊢) → ProofOrCE (Translation R {X'} p q) decPointwiseTranslation? - : {X' : ℕ} {R : Relation} - → SimplifierTag + : {X' : ℕ} {R : Relation} {isCertified : Set} + → SimplifierTag isCertified → ({ X : ℕ } → DecidableCE (R {X})) → (p q : List (X' ⊢)) → ProofOrCE (Pointwise (Translation R {X'}) p q) decPointwiseTranslation? _ _ [] [] = proof Pointwise.[] From e53ac4bbfa1145a21154d824f5f50d9f212c384f Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Tue, 14 Apr 2026 19:17:57 +0300 Subject: [PATCH 03/16] Revert "Absolute mess" This reverts commit 67b142a0218c1467c6b61ff123e5f4c3709a34f7. --- plutus-core/plutus-core.cabal | 1 + .../Transform/Certify/Trace.hs | 61 ++-------- .../UntypedPlutusCore/Transform/Simplifier.hs | 8 +- .../testlib/Transform/Simplify/Lib.hs | 5 +- .../src/MAlonzo/Code/Certifier.hs | 4 +- .../src/MAlonzo/Code/VerifiedCompilation.hs | 113 +++--------------- .../src/VerifiedCompilation.lagda.md | 91 +++++--------- .../VerifiedCompilation/Certificate.lagda.md | 21 ++-- .../src/VerifiedCompilation/Trace.lagda.md | 94 +++------------ .../UntypedTranslation.lagda.md | 8 +- 10 files changed, 104 insertions(+), 302 deletions(-) diff --git a/plutus-core/plutus-core.cabal b/plutus-core/plutus-core.cabal index b298bc4c8f4..17d33d9577b 100644 --- a/plutus-core/plutus-core.cabal +++ b/plutus-core/plutus-core.cabal @@ -489,6 +489,7 @@ library untyped-plutus-core-testlib , cardano-crypto-class , data-default-class , dlist + , extra , filepath , hedgehog , lens diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs index aaf785a948f..c75c6e4f17f 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs @@ -1,5 +1,4 @@ {-# LANGUAGE DeriveAnyClass #-} -{-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} module UntypedPlutusCore.Transform.Certify.Trace where @@ -10,59 +9,23 @@ import UntypedPlutusCore.Transform.Certify.Hints qualified as Certify import Control.DeepSeq import GHC.Generics -data Certified = Certified +data SimplifierStage + = FloatDelay + | ForceDelay + | ForceCaseDelay + | CaseOfCase + | CaseReduce + | Inline + | CSE + | ApplyToCase + | Unknown deriving stock (Show, Generic) deriving anyclass (NFData) -data NotCertified = NotCertified - deriving stock (Show, Generic) - deriving anyclass (NFData) - -data SimplifierStage a where - FloatDelay :: SimplifierStage Certified - ForceDelay :: SimplifierStage Certified - ForceCaseDelay :: SimplifierStage Certified - CaseOfCase :: SimplifierStage NotCertified - CaseReduce :: SimplifierStage Certified - Inline :: SimplifierStage Certified - CSE :: SimplifierStage Certified - ApplyToCase :: SimplifierStage Certified - Unknown :: SimplifierStage NotCertified - -deriving instance Show a => Show (SimplifierStage a) - -instance Generic a => Generic (SimplifierStage a) - -instance (Generic a, NFData a) => NFData (SimplifierStage a) where - rnf = undefined - -data Yes = Yes - -data No = No - --- this is much simpler, why did i go with something so complicated :( --- data ImplTags = A | B | C --- --- data NotImplTags = D --- --- data Tags = Impl ImplTags | NotImpl NotImplTags - -data CertifierImplements a where - CertFloatDelay :: CertifierImplements Yes - CertForceDelay :: CertifierImplements Yes - CertCaseOfCase :: CertifierImplements No - CertCaseReduce :: CertifierImplements Yes - CertInline :: CertifierImplements Yes - CertCSE :: CertifierImplements Yes - CertApplyToCase :: CertifierImplements Yes - CertUnknown :: CertifierImplements No - data Simplification name uni fun a - = forall isCertified. - Show isCertified => - Simplification + = Simplification { beforeAST :: Term name uni fun a - , stage :: SimplifierStage isCertified + , stage :: SimplifierStage , hints :: Certify.Hints , afterAST :: Term name uni fun a } diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs index 79eb6770b39..5d907ff5ea0 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs @@ -57,18 +57,18 @@ execSimplifier :: Simplifier name uni fun ann a -> Trace.SimplifierTrace name un execSimplifier = runIdentity . execSimplifierT recordSimplification - :: (Show isCertified, Monad m) + :: Monad m => Term name uni fun a - -> Trace.SimplifierStage isCertified + -> Trace.SimplifierStage -> Term name uni fun a -> SimplifierT name uni fun a m () recordSimplification = recordSimplificationWithHints Hints.NoHints recordSimplificationWithHints - :: (Show isCertified, Monad m) + :: Monad m => Hints.Hints -> Term name uni fun a - -> Trace.SimplifierStage isCertified + -> Trace.SimplifierStage -> Term name uni fun a -> SimplifierT name uni fun a m () recordSimplificationWithHints hints before stage after = diff --git a/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs b/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs index d686fbfc966..5ee70434654 100644 --- a/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs +++ b/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs @@ -8,6 +8,7 @@ import Data.ByteString.Lazy qualified as BSL import Data.Text (Text) import Data.Text qualified as T import Data.Text.Encoding (encodeUtf8) +import Data.Tuple.Extra ((&&&)) import PlutusCore qualified as PLC import PlutusCore.Builtin (BuiltinSemanticsVariant) import PlutusCore.Pretty (PrettyPlc, Render (render), prettyPlcReadableSimple) @@ -61,10 +62,10 @@ renderCertifierHints (Trace.SimplifierTrace ss) zipWith renderHintsWithIdx [(1 :: Int) ..] - ((\(Trace.Simplification _ stage hints _) -> (show stage, hints)) <$> reverse ss) + ((Trace.stage &&& Trace.hints) <$> reverse ss) where renderHintsWithIdx i (st, h) = - ("-- Certifier hints #" <> T.pack (show i) <> " (" <> T.pack st <> ") --\n") + ("-- Certifier hints #" <> T.pack (show i) <> " (" <> T.pack (show st) <> ") --\n") <> renderHints h <> "\n" diff --git a/plutus-metatheory/src/MAlonzo/Code/Certifier.hs b/plutus-metatheory/src/MAlonzo/Code/Certifier.hs index 6a048e9d88d..4db1e142761 100644 --- a/plutus-metatheory/src/MAlonzo/Code/Certifier.hs +++ b/plutus-metatheory/src/MAlonzo/Code/Certifier.hs @@ -54,13 +54,13 @@ d_runCertifier_2 v0 (coe MAlonzo.Code.Utils.du_try_94 (coe - MAlonzo.Code.VerifiedCompilation.d_checkScope'7511'_130 (coe v1)) + MAlonzo.Code.VerifiedCompilation.d_checkScope'7511'_100 (coe v1)) (coe MAlonzo.Code.VerifiedCompilation.C_illScoped_6)) (coe (\ v2 -> coe MAlonzo.Code.Utils.du_eitherBind_54 - (coe MAlonzo.Code.VerifiedCompilation.d_certify_74 (coe v2)) + (coe MAlonzo.Code.VerifiedCompilation.d_certify_44 (coe v2)) (coe (\ v3 -> coe diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs index 56cd34942c5..5a7cfe8f28a 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs @@ -9,7 +9,6 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# OPTIONS_GHC -Wno-overlapping-patterns #-} -{-# LANGUAGE GADTs #-} module MAlonzo.Code.VerifiedCompilation where @@ -35,7 +34,6 @@ import qualified MAlonzo.Code.VerifiedCompilation.UForceCaseDelay import qualified MAlonzo.Code.VerifiedCompilation.UForceDelay import qualified MAlonzo.Code.VerifiedCompilation.UInline -import UntypedPlutusCore.Transform.Certify.Trace -- VerifiedCompilation.Error d_Error_2 = () data T_Error_2 @@ -82,87 +80,14 @@ d_hasRelation_16 v0 = coe MAlonzo.Code.Data.Maybe.Base.du_is'45'just_20 (coe d_mRelationOf_12 (coe v0)) --- VerifiedCompilation.Yes -d_Yes_18 = () -type T_Yes_18 = Yes -pattern C_yes_20 = Yes -check_yes_20 :: T_Yes_18 -check_yes_20 = Yes -cover_Yes_18 :: Yes -> () -cover_Yes_18 x - = case x of - Yes -> () --- VerifiedCompilation.No -d_No_22 = () -type T_No_22 = No -pattern C_no_24 = No -check_no_24 :: T_No_22 -check_no_24 = No -cover_No_22 :: No -> () -cover_No_22 x - = case x of - No -> () --- VerifiedCompilation.CertifierImplements -d_CertifierImplements_26 a0 = () -type T_CertifierImplements_26 = CertifierImplements -pattern C_certFloatDelay_28 = CertFloatDelay -pattern C_certForceDelay_30 = CertForceDelay -pattern C_certCaseOfCase_32 = CertCaseOfCase -pattern C_certCaseReduce_34 = CertCaseReduce -pattern C_certInline_36 = CertInline -pattern C_certCSE_38 = CertCSE -pattern C_certApplyToCase_40 = CertApplyToCase -pattern C_certUnknown_42 = CertUnknown -check_certFloatDelay_28 :: T_CertifierImplements_26 T_Yes_18 -check_certFloatDelay_28 = CertFloatDelay -check_certForceDelay_30 :: T_CertifierImplements_26 T_Yes_18 -check_certForceDelay_30 = CertForceDelay -check_certCaseOfCase_32 :: T_CertifierImplements_26 T_No_22 -check_certCaseOfCase_32 = CertCaseOfCase -check_certCaseReduce_34 :: T_CertifierImplements_26 T_Yes_18 -check_certCaseReduce_34 = CertCaseReduce -check_certInline_36 :: T_CertifierImplements_26 T_Yes_18 -check_certInline_36 = CertInline -check_certCSE_38 :: T_CertifierImplements_26 T_Yes_18 -check_certCSE_38 = CertCSE -check_certApplyToCase_40 :: T_CertifierImplements_26 T_Yes_18 -check_certApplyToCase_40 = CertApplyToCase -check_certUnknown_42 :: T_CertifierImplements_26 T_No_22 -check_certUnknown_42 = CertUnknown -cover_CertifierImplements_26 :: CertifierImplements a1 -> () -cover_CertifierImplements_26 x - = case x of - CertFloatDelay -> () - CertForceDelay -> () - CertCaseOfCase -> () - CertCaseReduce -> () - CertInline -> () - CertCSE -> () - CertApplyToCase -> () - CertUnknown -> () --- VerifiedCompilation.f -d_f_46 :: () -> T_CertifierImplements_26 AgdaAny -> AgdaAny -d_f_46 ~v0 v1 = du_f_46 v1 -du_f_46 :: T_CertifierImplements_26 AgdaAny -> AgdaAny -du_f_46 v0 - = case coe v0 of - C_certFloatDelay_28 -> coe C_yes_20 - C_certForceDelay_30 -> coe C_yes_20 - C_certCaseOfCase_32 -> coe C_no_24 - C_certCaseReduce_34 -> coe C_yes_20 - C_certInline_36 -> coe C_yes_20 - C_certCSE_38 -> coe C_yes_20 - C_certApplyToCase_40 -> coe C_yes_20 - C_certUnknown_42 -> coe C_no_24 - _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.certifyPass -d_certifyPass_54 :: +d_certifyPass_24 :: MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_52 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.VerifiedCompilation.Certificate.T_CertResult_12 -d_certifyPass_54 v0 v1 +d_certifyPass_24 v0 v1 = case coe v0 of MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_6 -> coe @@ -224,25 +149,25 @@ d_certifyPass_54 v0 v1 MAlonzo.Code.VerifiedCompilation.NotImplemented.du_certNotImplemented_22) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.Certificate -d_Certificate_62 :: +d_Certificate_32 :: MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -> () -d_Certificate_62 = erased +d_Certificate_32 = erased -- VerifiedCompilation.certify -d_certify_74 :: +d_certify_44 :: MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -> MAlonzo.Code.Utils.T_Either_6 T_Error_2 AgdaAny -d_certify_74 v0 +d_certify_44 v0 = case coe v0 of MAlonzo.Code.VerifiedCompilation.Trace.C_step_64 v1 v2 v3 v4 -> let v5 = coe - d_certifyPass_54 v1 v2 v3 + d_certifyPass_24 v1 v2 v3 (MAlonzo.Code.VerifiedCompilation.Trace.d_head_70 (coe v4)) in coe (case coe v5 of MAlonzo.Code.VerifiedCompilation.Certificate.C_proof_18 v6 -> coe - MAlonzo.Code.Utils.du_eitherBind_54 (coe d_certify_74 (coe v4)) + MAlonzo.Code.Utils.du_eitherBind_54 (coe d_certify_44 (coe v4)) (coe (\ v7 -> coe @@ -260,41 +185,41 @@ d_certify_74 v0 (coe MAlonzo.Code.Agda.Builtin.Unit.C_tt_8) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.cert -d_cert_124 :: +d_cert_94 :: MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -> MAlonzo.Code.Utils.T_Either_6 T_Error_2 AgdaAny -> AgdaAny -> AgdaAny -d_cert_124 ~v0 v1 v2 = du_cert_124 v1 v2 -du_cert_124 :: +d_cert_94 ~v0 v1 v2 = du_cert_94 v1 v2 +du_cert_94 :: MAlonzo.Code.Utils.T_Either_6 T_Error_2 AgdaAny -> AgdaAny -> AgdaAny -du_cert_124 v0 v1 +du_cert_94 v0 v1 = case coe v0 of MAlonzo.Code.Utils.C_inj'8322'_14 v2 -> coe seq (coe v1) (coe v2) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.checkScope -d_checkScope_128 :: +d_checkScope_98 :: MAlonzo.Code.RawU.T_Untyped_208 -> Maybe MAlonzo.Code.Untyped.T__'8866'_14 -d_checkScope_128 v0 +d_checkScope_98 v0 = coe MAlonzo.Code.Utils.du_eitherToMaybe_104 (coe MAlonzo.Code.Untyped.d_scopeCheckU0_276 (coe v0)) -- VerifiedCompilation.checkScopeᵗ -d_checkScope'7511'_130 :: +d_checkScope'7511'_100 :: MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -> Maybe MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -d_checkScope'7511'_130 v0 +d_checkScope'7511'_100 v0 = case coe v0 of MAlonzo.Code.VerifiedCompilation.Trace.C_step_64 v1 v2 v3 v4 -> coe MAlonzo.Code.Data.Maybe.Base.du__'62''62''61'__72 - (coe d_checkScope_128 (coe v3)) + (coe d_checkScope_98 (coe v3)) (coe (\ v5 -> coe MAlonzo.Code.Data.Maybe.Base.du__'62''62''61'__72 - (coe d_checkScope'7511'_130 (coe v4)) + (coe d_checkScope'7511'_100 (coe v4)) (coe (\ v6 -> coe @@ -305,7 +230,7 @@ d_checkScope'7511'_130 v0 MAlonzo.Code.VerifiedCompilation.Trace.C_done_66 v1 -> coe MAlonzo.Code.Data.Maybe.Base.du__'62''62''61'__72 - (coe d_checkScope_128 (coe v1)) + (coe d_checkScope_98 (coe v1)) (coe (\ v2 -> coe diff --git a/plutus-metatheory/src/VerifiedCompilation.lagda.md b/plutus-metatheory/src/VerifiedCompilation.lagda.md index d48311bbf7f..f7f33b0ea6f 100644 --- a/plutus-metatheory/src/VerifiedCompilation.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation.lagda.md @@ -59,8 +59,8 @@ open import VerifiedCompilation.Certificate hiding (_>>=_) data Error : Set where emptyDump : Error illScoped : Error - counterExample : SimplifierTag Certified → Error - abort : SimplifierTag Certified → Error + counterExample : SimplifierTag → Error + abort : SimplifierTag → Error ``` ## Translation Relations and Certifiers @@ -69,65 +69,40 @@ We map a `SimplifierTag` to the corresponding translation relation, or `nothing` if we don't have a translation relation. ``` - - -mRelationOf : {isCertified : Set} → SimplifierTag isCertified → Maybe (0 ⊢ → 0 ⊢ → Set) -mRelationOf floatDelayT with isCertified? floatDelayT -... | certified = just UFlD.FloatDelay -mRelationOf forceDelayT with isCertified? forceDelayT -... | certified = just UFD.ForceDelay -mRelationOf forceCaseDelayT with isCertified? forceCaseDelayT -... | certified = just UFCD.ForceCaseDelay -mRelationOf caseOfCaseT with isCertified? caseOfCaseT -... | notCertified = nothing -- FIXME: https://github.com/IntersectMBO/plutus-private/issues/2054 -mRelationOf caseReduceT with isCertified? caseReduceT -... | certified = just UCR.UCaseReduce -mRelationOf inlineT with isCertified? inlineT -... | certified = just (UInline.Inline (λ()) UInline.□) -mRelationOf cseT with isCertified? cseT -... | certified = just UCSE.UntypedCSE -mRelationOf applyToCaseT with isCertified? applyToCaseT -... | certified = just UA2C.ApplyToCase -mRelationOf unknown with isCertified? unknown -... | notCertified = nothing - - -go : DumpStep → (0 ⊢ → 0 ⊢ → Set) -go (dumpStep _ floatDelayT hints x y) with isCertified? floatDelayT -... | certified = UFlD.FloatDelay -go (dumpStep _ forceDelayT hints x y) = {! !} -go (dumpStep _ forceCaseDelayT hints x y) = {! !} -go (dumpStep _ caseOfCaseT hints x y) = {! !} -go (dumpStep _ caseReduceT hints x y) = {! !} -go (dumpStep _ inlineT hints x y) = {! !} -go (dumpStep _ cseT hints x y) = {! !} -go (dumpStep _ applyToCaseT hints x y) = {! !} -go (dumpStep _ unknown hints x y) = {! !} - +mRelationOf : SimplifierTag → Maybe (0 ⊢ → 0 ⊢ → Set) +mRelationOf floatDelayT = just UFlD.FloatDelay +mRelationOf forceDelayT = just UFD.ForceDelay +mRelationOf caseReduceT = just UCR.UCaseReduce +mRelationOf cseT = just UCSE.UntypedCSE +mRelationOf inlineT = just (UInline.Inline (λ()) UInline.□) +mRelationOf unknown = nothing +mRelationOf caseOfCaseT = nothing -- FIXME: https://github.com/IntersectMBO/plutus-private/issues/2054 +mRelationOf forceCaseDelayT = just UFCD.ForceCaseDelay +mRelationOf applyToCaseT = just UA2C.UApplyToCase ``` We default to the `NotImplemented` relation to give each `SimplifierTag` a relation: ``` -RelationOf : {isCertified : Set} → SimplifierTag isCertified → (0 ⊢ → 0 ⊢ → Set) +RelationOf : SimplifierTag → (0 ⊢ → 0 ⊢ → Set) RelationOf = fromMaybe (NotImplemented accept) ∘ mRelationOf -hasRelation : {isCertified : Set} → SimplifierTag isCertified → Bool +hasRelation : SimplifierTag → Bool hasRelation = is-just ∘ mRelationOf - +{-# COMPILE GHC hasRelation as certifierImplements #-} ``` The corresponding certifier can then be called for a given pass: ``` -certifyPass : {isCertified : Set} → (pass : SimplifierTag isCertified) → Hints → (M M' : 0 ⊢) → CertResult (RelationOf pass M M') +certifyPass : (pass : SimplifierTag) → Hints → (M M' : 0 ⊢) → CertResult (RelationOf pass M M') certifyPass floatDelayT _ = decider UFlD.isFloatDelay? certifyPass forceDelayT _ = decider UFD.isForceDelay? certifyPass caseReduceT _ = decider UCR.isCaseReduce? certifyPass cseT _ = decider UCSE.isUntypedCSE? certifyPass caseOfCaseT _ = certNotImplemented certifyPass forceCaseDelayT _ = decider UFCD.isForceCaseDelay? --- certifyPass applyToCaseT _ = decider UA2C.a2c?ᶜᶜ +certifyPass applyToCaseT _ = decider UA2C.a2c?ᶜᶜ certifyPass inlineT (inline hs) = checker (UInline.top-check hs) certifyPass inlineT none = λ M M' → abort inlineT M M' certifyPass unknown _ = certNotImplemented @@ -141,17 +116,17 @@ corresponding certifiers of each pass. ``` Certificate : Trace (0 ⊢) → Set Certificate (done _) = ⊤ --- Certificate (step (certifierStep ty pass hints t) ts) = RelationOf pass t (head ts) × Certificate ts +Certificate (step pass hints t ts) = RelationOf pass t (head ts) × Certificate ts certify : (trace : Trace (0 ⊢)) → Either Error (Certificate trace) certify (done _) = inj₂ tt --- certify (step (certifierStep ty pass hints x) xs) with certifyPass pass hints x (head xs) --- ... | ce _ tag _ _ = inj₁ (counterExample tag) --- ... | abort tag _ _ = inj₁ (abort tag) --- ... | proof p = --- do --- ps ← certify xs --- return (p , ps) +certify (step pass hints x xs) with certifyPass pass hints x (head xs) +... | ce _ tag _ _ = inj₁ (counterExample tag) +... | abort tag _ _ = inj₁ (abort tag) +... | proof p = + do + ps ← certify xs + return (p , ps) ``` If the certifier succeeds, we can produce the certificate: @@ -171,12 +146,12 @@ checkScope : Untyped → Maybe (0 ⊢) checkScope = eitherToMaybe ∘ scopeCheckU0 -- Scope-check all terms in a trace --- checkScopeᵗ : Trace Untyped → ? (Trace (0 ⊢)) --- checkScopeᵗ (done x) = do --- x' ← checkScope x --- return (done x') --- checkScopeᵗ (step pass hints t ts) = do --- t' ← checkScope t --- ts' ← checkScopeᵗ ts --- return (step pass hints t' ts') +checkScopeᵗ : Trace Untyped → Maybe (Trace (0 ⊢)) +checkScopeᵗ (done x) = do + x' ← checkScope x + return (done x') +checkScopeᵗ (step pass hints t ts) = do + t' ← checkScope t + ts' ← checkScopeᵗ ts + return (step pass hints t' ts') ``` diff --git a/plutus-metatheory/src/VerifiedCompilation/Certificate.lagda.md b/plutus-metatheory/src/VerifiedCompilation/Certificate.lagda.md index f38c88cba78..a5e14cb4a15 100644 --- a/plutus-metatheory/src/VerifiedCompilation/Certificate.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/Certificate.lagda.md @@ -45,13 +45,13 @@ variable data CertResult (P : Set 𝓁) : Set (suc 𝓁) where proof : (p : P) → CertResult P - ce : (¬p : ¬ P) → {X X' isCertified : Set} → SimplifierTag isCertified → X → X' → CertResult P - abort : {X X' isCertified : Set} → SimplifierTag isCertified → X → X' → CertResult P + ce : (¬p : ¬ P) → {X X' : Set} → SimplifierTag → X → X' → CertResult P + abort : {X X' : Set} → SimplifierTag → X → X' → CertResult P -- | Result of a decision procedure: either a proof or a counterexample data ProofOrCE (P : Set 𝓁) : Set (suc 𝓁) where proof : (p : P) → ProofOrCE P - ce : (¬p : ¬ P) → {X X' isCertified : Set} → SimplifierTag isCertified → X → X' → ProofOrCE P + ce : (¬p : ¬ P) → {X X' : Set} → SimplifierTag → X → X' → ProofOrCE P isProof? : {P : Set 𝓁} → ProofOrCE P → Bool isProof? (proof _) = true @@ -63,7 +63,7 @@ isCE? = not ∘ isProof? -- | Result of a checking procedure: either a proof or a failure data Proof? (P : Set 𝓁) : Set (suc 𝓁) where proof : (p : P) → Proof? P - abort : {X X' isCertified : Set} → SimplifierTag isCertified → X → X' → Proof? P + abort : {X X' : Set} → SimplifierTag → X → X' → Proof? P infixl 1 _>>=_ @@ -94,9 +94,7 @@ decider f x y with f x y ... | proof p = proof p ... | ce ¬p tag a b = ce ¬p tag a b -decToPCE - : {X : Set} {P : Set} {isCertified : Set} - → SimplifierTag isCertified → Dec P → {before after : X} → ProofOrCE P +decToPCE : {X : Set} {P : Set} → SimplifierTag → Dec P → {before after : X} → ProofOrCE P decToPCE _ (yes p) = proof p decToPCE tag (no ¬p) {before} {after} = ce ¬p tag before after @@ -104,17 +102,12 @@ pceToDec : {P : Set} → ProofOrCE P → Dec P pceToDec (proof p) = yes p pceToDec (ce ¬p _ _ _) = no ¬p -matchOrCE - : {X X' isCertified : Set} {𝓁 : Level} - → {P : X → X' → Set 𝓁} - → SimplifierTag isCertified → Binary.Decidable P → DecidableCE P +matchOrCE : {X X' : Set} {𝓁 : Level} → {P : X → X' → Set 𝓁} → SimplifierTag → Binary.Decidable P → DecidableCE P matchOrCE tag P a b with P a b ... | yes p = proof p ... | no ¬p = ce ¬p tag a b -pcePointwise - : {X X' isCertified : Set} {𝓁 : Level} {P : X → X' → Set 𝓁} - → SimplifierTag isCertified → DecidableCE P → DecidableCE (Pointwise P) +pcePointwise : {X X' : Set} {𝓁 : Level} {P : X → X' → Set 𝓁} → SimplifierTag → DecidableCE P → DecidableCE (Pointwise P) pcePointwise tag isP? [] [] = proof Pointwise.[] pcePointwise {X = X} tag isP? [] (y ∷ ys) = ce (λ ()) {X = List X} tag [] ys pcePointwise {X' = X'} tag isP? (x ∷ xs) [] = ce (λ ()) {X' = List X'} tag xs [] diff --git a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md index aa99b3e43b8..11ff91b17c7 100644 --- a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md @@ -8,7 +8,6 @@ operates on. It contains all the ASTs of the performed passes together with some information about that pass. ``` -{-# OPTIONS --allow-unsolved-metas #-} module VerifiedCompilation.Trace where open import RawU using (Untyped) @@ -23,39 +22,19 @@ open Maybe We enumerate the known passes: ``` - -data Certified : Set where - certified : Certified - -data NotCertified : Set where - notCertified : NotCertified - -data SimplifierTag : Set → Set where - floatDelayT : SimplifierTag Certified - forceDelayT : SimplifierTag Certified - forceCaseDelayT : SimplifierTag Certified - caseOfCaseT : SimplifierTag NotCertified - caseReduceT : SimplifierTag Certified - inlineT : SimplifierTag Certified - cseT : SimplifierTag Certified - applyToCaseT : SimplifierTag Certified - unknown : SimplifierTag NotCertified -- a placeholder for passes that we don't yet know of, so the certifier doesn't break if a pass was added +data SimplifierTag : Set where + floatDelayT : SimplifierTag + forceDelayT : SimplifierTag + forceCaseDelayT : SimplifierTag + caseOfCaseT : SimplifierTag + caseReduceT : SimplifierTag + inlineT : SimplifierTag + cseT : SimplifierTag + applyToCaseT : SimplifierTag + unknown : SimplifierTag -- a placeholder for passes that we don't yet know of, so the certifier doesn't break if a pass was added {-# FOREIGN GHC import UntypedPlutusCore.Transform.Simplifier #-} -{-# FOREIGN GHC {-# LANGUAGE GADTs #-} #-} {-# COMPILE GHC SimplifierTag = data SimplifierStage (FloatDelay | ForceDelay | ForceCaseDelay | CaseOfCase | CaseReduce | Inline | CSE | ApplyToCase | Unknown) #-} - -isCertified? : {isCertified : Set} → SimplifierTag isCertified → isCertified -isCertified? floatDelayT = certified -isCertified? forceDelayT = certified -isCertified? forceCaseDelayT = certified -isCertified? caseOfCaseT = notCertified -isCertified? caseReduceT = certified -isCertified? inlineT = certified -isCertified? cseT = certified -isCertified? applyToCaseT = certified -isCertified? unknown = notCertified - ``` ## Hints @@ -95,29 +74,16 @@ information about which pass was performed. ``` --- record Step (A : Set) : Set₁ where --- constructor certifierStep --- field --- isCertified : Set --- tag : SimplifierTag isCertified --- hints : Hints --- inputTerm : A - -data Step (A : Set) : Set where - implementedStep : SimplifierTag Certified → Hints → A → Step A - notImplementedStep : SimplifierTag NotCertified → Hints → A → Step A - -data Trace (A : Set) : Set₁ where +data Trace (A : Set) : Set where -- One step in the pipeline, with its pass and input term - step : Step A → Trace A → Trace A + step : SimplifierTag → Hints → A → Trace A → Trace A -- Final AST in the trace done : A → Trace A -- Get the first term in the trace head : ∀{A} → Trace A → A -head (done term) = term -head (step (implementedStep _ _ x) _) = x -head (step (notImplementedStep _ _ x) _) = x +head (done x) = x +head (step _ _ x _) = x ``` @@ -125,17 +91,10 @@ head (step (notImplementedStep _ _ x) _) = x ``` -record DumpStep : Set₁ where - constructor dumpStep - field - isCertified : Set - tag : SimplifierTag isCertified - hints : Hints - inputTerm : Untyped - outputTerm : Untyped -- The current trace structure dumped from Haskell -Dump = List DumpStep +Dump : Set +Dump = List (SimplifierTag × Hints × Untyped × Untyped) -- -- Since there is duplication in the dump, i.e. it is of the form @@ -149,24 +108,9 @@ toTrace : Dump → Maybe (Trace Untyped) toTrace [] = nothing toTrace (x ∷ xs) = just (go x xs) where - go : DumpStep → Dump → Trace Untyped - go bl fl = {! !} - -- go (dumpStep _ floatDelayT hints x y) [] with isCertified? floatDelayT - -- ... | certified = {! UFlD.FloatDelay !} - -- go (dumpStep _ forceDelayT hints x y) [] = {! !} - -- go (dumpStep _ forceCaseDelayT hints x y) [] = {! !} - -- go (dumpStep _ caseOfCaseT hints x y) [] = {! !} - -- go (dumpStep _ caseReduceT hints x y) [] = {! !} - -- go (dumpStep _ inlineT hints x y) [] = {! !} - -- go (dumpStep _ cseT hints x y) [] = {! !} - -- go (dumpStep _ applyToCaseT hints x y) [] = {! !} - -- go (dumpStep _ unknown hints x y) [] = {! !} -- with isCertified? pass - -- ... | certified = - -- step (implementedStep pass hints x) (done y) - -- ... | notCertified = - -- step (notImplementedStep pass hints x) (done y) - -- go (dumpStep ty pass hints x y) ((dumpStep ty' pass' hints' _ z) ∷ xs) = - -- step (certifierStep ty pass hints x) (go (dumpStep ty' pass' hints' y z) xs) + go : SimplifierTag × Hints × Untyped × Untyped → Dump → Trace Untyped + go (pass , hints , x , y) [] = step pass hints x (done y) + go (pass , hints , x , y) ((pass' , hints' , _ , z) ∷ xs) = step pass hints x (go (pass' , hints' , y , z) xs) ``` `EvalResult` is used to report script execution costs, before and after an optimisation (or optimisations). diff --git a/plutus-metatheory/src/VerifiedCompilation/UntypedTranslation.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UntypedTranslation.lagda.md index 4347cb0a1b1..a051b8b3d86 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UntypedTranslation.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UntypedTranslation.lagda.md @@ -105,14 +105,14 @@ matchIx builtin = refl matchIx error = refl translation? - : {X' : ℕ} {R : Relation} {isCertified : Set} - → SimplifierTag isCertified + : {X' : ℕ} {R : Relation} + → SimplifierTag → ({ X : ℕ } → DecidableCE (R {X})) → (p q : X' ⊢) → ProofOrCE (Translation R {X'} p q) decPointwiseTranslation? - : {X' : ℕ} {R : Relation} {isCertified : Set} - → SimplifierTag isCertified + : {X' : ℕ} {R : Relation} + → SimplifierTag → ({ X : ℕ } → DecidableCE (R {X})) → (p q : List (X' ⊢)) → ProofOrCE (Pointwise (Translation R {X'}) p q) decPointwiseTranslation? _ _ [] [] = proof Pointwise.[] From 8a6d3e8b1e2b4a9eba860847ef3a7964c48f92ee Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Wed, 15 Apr 2026 16:35:45 +0300 Subject: [PATCH 04/16] Use a simple sum type to indicate whether a pass is implemented or not --- .../Transform/ApplyToCase.hs | 6 +- .../UntypedPlutusCore/Transform/CaseOfCase.hs | 6 +- .../UntypedPlutusCore/Transform/CaseReduce.hs | 6 +- .../Transform/Certify/Trace.hs | 30 +- .../src/UntypedPlutusCore/Transform/Cse.hs | 6 +- .../UntypedPlutusCore/Transform/FloatDelay.hs | 6 +- .../Transform/ForceCaseDelay.hs | 6 +- .../UntypedPlutusCore/Transform/ForceDelay.hs | 6 +- .../src/UntypedPlutusCore/Transform/Inline.hs | 10 +- .../UntypedPlutusCore/Transform/Simplifier.hs | 11 +- .../src/PlutusCore/Executable/Parsers.hs | 8 + .../src/CertifierReport.lagda.md | 52 +-- plutus-metatheory/src/FFI/AgdaUnparse.hs | 27 +- .../src/MAlonzo/Code/Certifier.hs | 34 +- .../src/MAlonzo/Code/CertifierReport.hs | 413 +++++++++--------- .../src/MAlonzo/Code/VerifiedCompilation.hs | 233 +++++----- .../Code/VerifiedCompilation/Certificate.hs | 41 +- .../MAlonzo/Code/VerifiedCompilation/Trace.hs | 353 +++++++++------ .../Code/VerifiedCompilation/UApplyToCase.hs | 37 +- .../MAlonzo/Code/VerifiedCompilation/UCSE.hs | 9 +- .../Code/VerifiedCompilation/UCaseOfCase.hs | 27 +- .../Code/VerifiedCompilation/UCaseReduce.hs | 13 +- .../Code/VerifiedCompilation/UFloatDelay.hs | 19 +- .../VerifiedCompilation/UForceCaseDelay.hs | 29 +- .../Code/VerifiedCompilation/UForceDelay.hs | 145 +++--- .../Code/VerifiedCompilation/UInline.hs | 107 +++-- .../VerifiedCompilation/UntypedTranslation.hs | 17 +- .../src/VerifiedCompilation.lagda.md | 45 +- .../src/VerifiedCompilation/Trace.lagda.md | 48 +- .../VerifiedCompilation/UApplyToCase.lagda.md | 6 +- .../src/VerifiedCompilation/UCSE.lagda.md | 6 +- .../VerifiedCompilation/UCaseOfCase.lagda.md | 14 +- .../VerifiedCompilation/UCaseReduce.lagda.md | 8 +- .../VerifiedCompilation/UFloatDelay.lagda.md | 10 +- .../UForceCaseDelay.lagda.md | 16 +- .../VerifiedCompilation/UForceDelay.lagda.md | 66 +-- .../src/VerifiedCompilation/UInline.lagda.md | 16 +- .../test/certifier/Test/Certifier/AST.hs | 8 +- .../Test/Certifier/AST/ForceDelay.hs | 20 +- 39 files changed, 1073 insertions(+), 847 deletions(-) diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ApplyToCase.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ApplyToCase.hs index f699f52cb51..16061872feb 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ApplyToCase.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ApplyToCase.hs @@ -17,8 +17,8 @@ import Control.Lens (over) import Data.Vector qualified as V import UntypedPlutusCore.Core import UntypedPlutusCore.Transform.Simplifier - ( SimplifierStage (ApplyToCase) - , SimplifierT + ( SimplifierT + , applyToCaseStage , recordSimplification ) @@ -32,7 +32,7 @@ applyToCase -> SimplifierT name uni fun a m (Term name uni fun a) applyToCase term = do let result = processTerm term - recordSimplification term ApplyToCase result + recordSimplification term applyToCaseStage result pure result processTerm :: Term name uni fun a -> Term name uni fun a diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseOfCase.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseOfCase.hs index 2c20e0ba42c..42be468ec03 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseOfCase.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseOfCase.hs @@ -43,8 +43,8 @@ import PlutusCore.MkPlc (mkIterApp) import UntypedPlutusCore.Core import UntypedPlutusCore.Transform.CaseReduce qualified as CaseReduce import UntypedPlutusCore.Transform.Simplifier - ( SimplifierStage (CaseOfCase) - , SimplifierT + ( SimplifierT + , caseOfCaseStage , recordSimplification ) @@ -63,7 +63,7 @@ caseOfCase -> SimplifierT name uni fun a m (Term name uni fun a) caseOfCase term = do let result = transformOf termSubterms processTerm term - recordSimplification term CaseOfCase result + recordSimplification term caseOfCaseStage result return result processTerm diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseReduce.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseReduce.hs index d907688e33c..3414669b166 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseReduce.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseReduce.hs @@ -13,8 +13,8 @@ import PlutusCore.Builtin (CaseBuiltin (..)) import PlutusCore.MkPlc import UntypedPlutusCore.Core import UntypedPlutusCore.Transform.Simplifier - ( SimplifierStage (CaseReduce) - , SimplifierT + ( SimplifierT + , caseReduceStage , recordSimplification ) @@ -24,7 +24,7 @@ caseReduce -> SimplifierT name uni fun a m (Term name uni fun a) caseReduce term = do let result = transformOf termSubterms processTerm term - recordSimplification term CaseReduce result + recordSimplification term caseReduceStage result return result processTerm :: CaseBuiltin uni => Term name uni fun a -> Term name uni fun a diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs index c75c6e4f17f..8fdacb99b27 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs @@ -9,19 +9,45 @@ import UntypedPlutusCore.Transform.Certify.Hints qualified as Certify import Control.DeepSeq import GHC.Generics -data SimplifierStage +data ICSimplifierStage = FloatDelay | ForceDelay | ForceCaseDelay - | CaseOfCase | CaseReduce | Inline | CSE | ApplyToCase + deriving stock (Show, Generic) + deriving anyclass (NFData) + +data NICSimplifierStage + = CaseOfCase | Unknown deriving stock (Show, Generic) deriving anyclass (NFData) +type SimplifierStage = Either NICSimplifierStage ICSimplifierStage + +floatDelayStage + , forceDelayStage + , forceCaseDelayStage + , caseReduceStage + , inlineStage + , cseStage + , applyToCaseStage + , caseOfCaseStage + , unknownStage + :: SimplifierStage +floatDelayStage = Right FloatDelay +forceDelayStage = Right ForceDelay +forceCaseDelayStage = Right ForceCaseDelay +caseReduceStage = Right CaseReduce +inlineStage = Right Inline +cseStage = Right CSE +applyToCaseStage = Right ApplyToCase +caseOfCaseStage = Left CaseOfCase +unknownStage = Left Unknown + data Simplification name uni fun a = Simplification { beforeAST :: Term name uni fun a diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Cse.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Cse.hs index 43a5167962e..135bb5e01fd 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Cse.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Cse.hs @@ -14,8 +14,8 @@ import UntypedPlutusCore.AstSize (termAstSize) import UntypedPlutusCore.Core import UntypedPlutusCore.Purity (isWorkFree) import UntypedPlutusCore.Transform.Simplifier - ( SimplifierStage (CSE) - , SimplifierT + ( SimplifierT + , cseStage , recordSimplification ) @@ -244,7 +244,7 @@ cse whichSubterms builtinSemanticsVariant t0 = do . Map.elems $ countOccs whichSubterms builtinSemanticsVariant annotated result <- mkCseTerm commonSubexprs annotated - recordSimplification t0 CSE result + recordSimplification t0 cseStage result return result -- | The second pass. See Note [CSE]. diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/FloatDelay.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/FloatDelay.hs index f30e193efec..0c6c7a01675 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/FloatDelay.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/FloatDelay.hs @@ -61,8 +61,8 @@ import PlutusCore.Name.UniqueSet qualified as USet import UntypedPlutusCore.Core.Plated (termSubterms) import UntypedPlutusCore.Core.Type (Term (..)) import UntypedPlutusCore.Transform.Simplifier - ( SimplifierStage (FloatDelay) - , SimplifierT + ( SimplifierT + , floatDelayStage , recordSimplification ) @@ -80,7 +80,7 @@ floatDelay term = do result <- PLC.rename term >>= \t -> pure . uncurry (flip simplifyBodies) $ simplifyArgs (unforcedVars t) t - recordSimplification term FloatDelay result + recordSimplification term floatDelayStage result return result {-| First pass. Returns the names of all variables, at least one occurrence diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceCaseDelay.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceCaseDelay.hs index 4b8e4be9133..136f75b124d 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceCaseDelay.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceCaseDelay.hs @@ -36,8 +36,8 @@ where import UntypedPlutusCore.Core import UntypedPlutusCore.Transform.Simplifier - ( SimplifierStage (ForceCaseDelay) - , SimplifierT + ( SimplifierT + , forceCaseDelayStage , recordSimplification ) @@ -49,7 +49,7 @@ forceCaseDelay -> SimplifierT name uni fun a m (Term name uni fun a) forceCaseDelay term = do let result = transformOf termSubterms processTerm term - recordSimplification term ForceCaseDelay result + recordSimplification term forceCaseDelayStage result return result processTerm :: Term name uni fun a -> Term name uni fun a diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceDelay.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceDelay.hs index 677cca24e83..ca356547fe4 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceDelay.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceDelay.hs @@ -155,8 +155,8 @@ import PlutusCore.MkPlc (mkIterApp) import UntypedPlutusCore.Core import UntypedPlutusCore.Purity (isPure, isWorkFree) import UntypedPlutusCore.Transform.Simplifier - ( SimplifierStage (ForceDelay) - , SimplifierT + ( SimplifierT + , forceDelayStage , recordSimplification ) @@ -173,7 +173,7 @@ forceDelay -> SimplifierT name uni fun a m (Term name uni fun a) forceDelay semVar term = do let result = transformOf termSubterms (processTerm semVar) term - recordSimplification term ForceDelay result + recordSimplification term forceDelayStage result return result {-| Checks whether the term is of the right form, and "pushes" diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Inline.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Inline.hs index 04a45651b03..9ef2e22dc41 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Inline.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Inline.hs @@ -70,8 +70,8 @@ import UntypedPlutusCore.Rename () import UntypedPlutusCore.Subst (termSubstNamesM) import UntypedPlutusCore.Transform.Certify.Hints qualified as CertifierHints import UntypedPlutusCore.Transform.Simplifier - ( SimplifierStage (Inline) - , SimplifierT + ( SimplifierT + , inlineStage , recordSimplificationWithHints ) @@ -236,7 +236,11 @@ inline , _iiPreserveLogging = preserveLogging } let result = snd <$> decoratedResult - recordSimplificationWithHints (CertifierHints.Inline (mkHints decoratedResult)) t Inline result + recordSimplificationWithHints + (CertifierHints.Inline (mkHints decoratedResult)) + t + inlineStage + result return result -- See Note [Differences from PIR inliner] 3 diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs index 5d907ff5ea0..f827ca6e2ef 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs @@ -1,7 +1,16 @@ module UntypedPlutusCore.Transform.Simplifier ( SimplifierT (..) + , Trace.SimplifierStage + , Trace.floatDelayStage + , Trace.forceDelayStage + , Trace.forceCaseDelayStage + , Trace.caseReduceStage + , Trace.inlineStage + , Trace.cseStage + , Trace.applyToCaseStage + , Trace.caseOfCaseStage + , Trace.unknownStage , Trace.SimplifierTrace (..) - , Trace.SimplifierStage (..) , Trace.Simplification (..) , runSimplifierT , evalSimplifierT diff --git a/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs b/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs index 5f92bb87e8f..ba5c4503c43 100644 --- a/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs +++ b/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs @@ -270,6 +270,14 @@ simplifyOpts = do ( long "opt-no-apply-to-case" <> help "Disable apply-to-case optimization" ) + _soSafeOpts <- + flag + False + True + ( long "safe-optimisation" + <> help + "Run only those optimisation passes which are certified to preserve the functional behavior of the original program." + ) pure UPLC.SimplifyOpts {..} optimiseEvalOpts :: Parser OptimiseEvalOpts diff --git a/plutus-metatheory/src/CertifierReport.lagda.md b/plutus-metatheory/src/CertifierReport.lagda.md index 6ab1b969279..f98f6dac5bd 100644 --- a/plutus-metatheory/src/CertifierReport.lagda.md +++ b/plutus-metatheory/src/CertifierReport.lagda.md @@ -13,7 +13,7 @@ open import VerifiedCompilation.UntypedTranslation open import VerifiedCompilation.UInline open import Untyped open import Untyped.RenamingSubstitution using (Sub) -open import Utils as U using (_×_; _,_; Either; either) +open import Utils as U using (_×_; _,_; Either; either; inj₁; inj₂) open import Agda.Builtin.Sigma using (Σ; _,_; snd) open import Data.Bool using (if_then_else_) @@ -35,16 +35,22 @@ nl = "\n" hl : String hl = "\n──────────────────────────────────────────────────────\n" +showICTag : ICSimplifierTag → String +showICTag floatDelayT = "Float Delay" +showICTag forceDelayT = "Force-Delay Cancellation" +showICTag forceCaseDelayT = "Float Force into Case Branches" +showICTag caseReduceT = "Case-Constr and Case-Constant Cancellation" +showICTag inlineT = "Inlining" +showICTag cseT = "Common Subexpression Elimination" +showICTag applyToCaseT = "Transform multi-argument applications into case-constr form" + +showNICTag : NICSimplifierTag → String +showNICTag caseOfCaseT = "Case-of-Case" +showNICTag unknown = "Unknown Pass" + showTag : SimplifierTag → String -showTag floatDelayT = "Float Delay" -showTag forceDelayT = "Force-Delay Cancellation" -showTag forceCaseDelayT = "Float Force into Case Branches" -showTag caseOfCaseT = "Case-of-Case" -showTag caseReduceT = "Case-Constr and Case-Constant Cancellation" -showTag inlineT = "Inlining" -showTag cseT = "Common Subexpression Elimination" -showTag applyToCaseT = "Transform multi-argument applications into case-constr form" -showTag unknown = "Unknown Pass" +showTag (inj₁ tag) = showNICTag tag ++ " ⚠ (certifier unavailable)" +showTag (inj₂ tag) = showICTag tag ++ " ✅" ``` Number of times an optimization is applied on the given term in one compiler pass: @@ -107,21 +113,18 @@ numSitesInline (case r rs) = numSitesInline r + numSitesInlineᵖʷ rs numSitesInlineᵖʷ Pointwise.[] = 0 numSitesInlineᵖʷ (x Pointwise.∷ xs) = numSitesInline x + numSitesInlineᵖʷ xs -numSites : {M N : 0 ⊢} (tag : SimplifierTag) → RelationOf tag M N → Maybe ℕ -numSites forceDelayT p = just (numSites′ p) -numSites floatDelayT p = just (numSites′ p) -numSites cseT p = just (numSites′ p) -numSites caseReduceT p = just (numSites′ p) -numSites inlineT p = just (numSitesInline p) -numSites forceCaseDelayT _ = nothing -numSites caseOfCaseT _ = nothing -numSites applyToCaseT p = just (numSites′ p) -numSites unknown _ = nothing +numSites : {M N : 0 ⊢} (tag : ICSimplifierTag) → RelationOf (inj₂ tag) M N → ℕ +numSites forceDelayT p = numSites′ p +numSites floatDelayT p = numSites′ p +numSites cseT p = numSites′ p +numSites caseReduceT p = numSites′ p +numSites inlineT p = numSitesInline p +numSites forceCaseDelayT p = numSites′ p +numSites applyToCaseT p = numSites′ p showSites : {M N : 0 ⊢} → (tag : SimplifierTag) → RelationOf tag M N → String -showSites t p with numSites t p -... | just n = ⇉ "Optimization sites: " ++ showℕ n -... | nothing = "" +showSites (inj₁ _) _ = "" +showSites (inj₂ t) p = ⇉ "Optimization sites: " ++ showℕ (numSites t p) termSize : {X : ℕ} → X ⊢ → ℕ termSizeᵖʷ : {X : ℕ} → List (X ⊢) → ℕ @@ -172,8 +175,7 @@ reportPasses : reportPasses _ (done _) _ _ = "" reportPasses n (step tag _ x trace) (p , proofs) costs = hl ++ - "Pass " ++ showℕ n ++ ": " ++ showTag tag - ++ (if hasRelation tag then " ✅" else " ⚠ (certifier unavailable)") ++ + "Pass " ++ showℕ n ++ ": " ++ showTag tag ++ hl ++ (⇉ "Program Size: ") ++ showℕ (termSize x) ++ " (before)" ++ nl ++ diff --git a/plutus-metatheory/src/FFI/AgdaUnparse.hs b/plutus-metatheory/src/FFI/AgdaUnparse.hs index 9d28ed6312f..772da550ef0 100644 --- a/plutus-metatheory/src/FFI/AgdaUnparse.hs +++ b/plutus-metatheory/src/FFI/AgdaUnparse.hs @@ -19,7 +19,7 @@ import PlutusCore.Value (Value) import PlutusPrelude import UntypedPlutusCore qualified as UPLC import UntypedPlutusCore.Transform.Certify.Hints qualified as Hints -import UntypedPlutusCore.Transform.Simplifier +import UntypedPlutusCore.Transform.Certify.Trace usToHyphen :: String -> String usToHyphen = map (\c -> if c == '_' then '-' else c) @@ -50,16 +50,18 @@ instance AgdaUnparse AgdaFFI.UTerm where instance AgdaUnparse UPLC.DefaultFun where agdaUnparse = usToHyphen . lowerInitialChar . show -instance AgdaUnparse SimplifierStage where - agdaUnparse FloatDelay = "floatDelayT" - agdaUnparse ForceDelay = "forceDelayT" - agdaUnparse ForceCaseDelay = "forceCaseDelayT" - agdaUnparse CaseOfCase = "caseOfCaseT" - agdaUnparse CaseReduce = "caseReduceT" - agdaUnparse Inline = "inlineT" - agdaUnparse CSE = "cseT" - agdaUnparse ApplyToCase = "applyToCaseT" - agdaUnparse Unknown = "unknown" +instance AgdaUnparse ICSimplifierStage where + agdaUnparse FloatDelay = "(inj₂ floatDelayT)" + agdaUnparse ForceDelay = "(inj₂ forceDelayT)" + agdaUnparse ForceCaseDelay = "(inj₂ forceCaseDelayT)" + agdaUnparse CaseReduce = "(inj₂ caseReduceT)" + agdaUnparse Inline = "(inj₂ inlineT)" + agdaUnparse CSE = "(inj₂ cseT)" + agdaUnparse ApplyToCase = "(inj₂ applyToCaseT)" + +instance AgdaUnparse NICSimplifierStage where + agdaUnparse CaseOfCase = "(inj₁ caseOfCaseT)" + agdaUnparse Unknown = "(inj₁ unknown)" instance AgdaUnparse Hints.Hints where agdaUnparse = \case @@ -117,6 +119,9 @@ instance (AgdaUnparse a, AgdaUnparse b) => AgdaUnparse (a, b) where instance AgdaUnparse a => AgdaUnparse (Vector a) where agdaUnparse v = "(mkArray (" ++ agdaUnfold v ++ "))" +instance (AgdaUnparse a, AgdaUnparse b) => AgdaUnparse (Either a b) where + agdaUnparse (Left a) = "(inj₁ " ++ agdaUnparse a ++ ")" + agdaUnparse (Right b) = "(inj₂ " ++ agdaUnparse b ++ ")" instance AgdaUnparse Data where agdaUnparse (Data.Constr i args) = "(ConstrDATA " ++ agdaUnparse i ++ " " ++ agdaUnparse args ++ ")" diff --git a/plutus-metatheory/src/MAlonzo/Code/Certifier.hs b/plutus-metatheory/src/MAlonzo/Code/Certifier.hs index 4db1e142761..cbf1ccf6402 100644 --- a/plutus-metatheory/src/MAlonzo/Code/Certifier.hs +++ b/plutus-metatheory/src/MAlonzo/Code/Certifier.hs @@ -31,9 +31,11 @@ import qualified MAlonzo.Code.VerifiedCompilation.Trace -- Certifier.runCertifier d_runCertifier_2 :: [MAlonzo.Code.Utils.T__'215'__428 - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 + (MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) (MAlonzo.Code.Utils.T__'215'__428 - MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_52 + MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_74 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> @@ -45,7 +47,7 @@ d_runCertifier_2 v0 MAlonzo.Code.Utils.du_eitherBind_54 (coe MAlonzo.Code.Utils.du_try_94 - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_toTrace_78 (coe v0)) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_toTrace_100 (coe v0)) (coe MAlonzo.Code.VerifiedCompilation.C_emptyDump_4)) (coe (\ v1 -> @@ -54,13 +56,13 @@ d_runCertifier_2 v0 (coe MAlonzo.Code.Utils.du_try_94 (coe - MAlonzo.Code.VerifiedCompilation.d_checkScope'7511'_100 (coe v1)) + MAlonzo.Code.VerifiedCompilation.d_checkScope'7511'_102 (coe v1)) (coe MAlonzo.Code.VerifiedCompilation.C_illScoped_6)) (coe (\ v2 -> coe MAlonzo.Code.Utils.du_eitherBind_54 - (coe MAlonzo.Code.VerifiedCompilation.d_certify_44 (coe v2)) + (coe MAlonzo.Code.VerifiedCompilation.d_certify_46 (coe v2)) (coe (\ v3 -> coe @@ -73,14 +75,16 @@ runCertifierMain :: MAlonzo.Code.Agda.Builtin.List.T_List_10 () (MAlonzo.Code.Utils.T__'215'__428 - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 + (MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) (MAlonzo.Code.Utils.T__'215'__428 - MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_52 + MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_74 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))) -> MAlonzo.Code.Agda.Builtin.List.T_List_10 - () MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_114 -> + () MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_136 -> MAlonzo.Code.Agda.Builtin.Maybe.T_Maybe_10 () (MAlonzo.Code.Utils.T__'215'__428 @@ -88,13 +92,15 @@ runCertifierMain :: runCertifierMain = coe d_runCertifierMain_12 d_runCertifierMain_12 :: [MAlonzo.Code.Utils.T__'215'__428 - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 + (MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) (MAlonzo.Code.Utils.T__'215'__428 - MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_52 + MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_74 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_114] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_136] -> Maybe (MAlonzo.Code.Utils.T__'215'__428 Bool MAlonzo.Code.Agda.Builtin.String.T_String_6) @@ -115,7 +121,7 @@ d_runCertifierMain_12 v0 v1 MAlonzo.Code.Utils.C__'44'__442 (coe MAlonzo.Code.Agda.Builtin.Bool.C_false_8) (coe - MAlonzo.Code.CertifierReport.d_makeReport_290 (coe v2) (coe v1))) + MAlonzo.Code.CertifierReport.d_makeReport_286 (coe v2) (coe v1))) MAlonzo.Code.VerifiedCompilation.C_abort_10 v4 -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 @@ -123,7 +129,7 @@ d_runCertifierMain_12 v0 v1 MAlonzo.Code.Utils.C__'44'__442 (coe MAlonzo.Code.Agda.Builtin.Bool.C_false_8) (coe - MAlonzo.Code.CertifierReport.d_makeReport_290 (coe v2) (coe v1))) + MAlonzo.Code.CertifierReport.d_makeReport_286 (coe v2) (coe v1))) _ -> MAlonzo.RTE.mazUnreachableError MAlonzo.Code.Utils.C_inj'8322'_14 v3 -> coe @@ -134,5 +140,5 @@ d_runCertifierMain_12 v0 v1 MAlonzo.Code.Utils.C__'44'__442 (coe MAlonzo.Code.Agda.Builtin.Bool.C_true_10) (coe - MAlonzo.Code.CertifierReport.d_makeReport_290 (coe v2) (coe v1)))) + MAlonzo.Code.CertifierReport.d_makeReport_286 (coe v2) (coe v1)))) _ -> MAlonzo.RTE.mazUnreachableError) diff --git a/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs b/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs index 29c8563cbdd..aee1b96ff37 100644 --- a/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs +++ b/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs @@ -17,10 +17,8 @@ import MAlonzo.RTE (coe, erased, AgdaAny, addInt, subInt, mulInt, rem64, lt64, eq64, word64FromNat, word64ToNat) import qualified MAlonzo.RTE import qualified Data.Text -import qualified MAlonzo.Code.Agda.Builtin.Maybe import qualified MAlonzo.Code.Agda.Builtin.Sigma import qualified MAlonzo.Code.Agda.Builtin.String -import qualified MAlonzo.Code.Data.Bool.Base import qualified MAlonzo.Code.Data.Fin.Base import qualified MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base import qualified MAlonzo.Code.Data.Nat.Show @@ -51,37 +49,62 @@ d_hl_8 ("\n\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\n" :: Data.Text.Text) --- CertifierReport.showTag -d_showTag_10 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> +-- CertifierReport.showICTag +d_showICTag_10 :: + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_showTag_10 v0 +d_showICTag_10 v0 = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_6 + MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_12 -> coe ("Float Delay" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_14 -> coe ("Force-Delay Cancellation" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_10 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_16 -> coe ("Float Force into Case Branches" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_caseOfCaseT_12 - -> coe ("Case-of-Case" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_14 + MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_18 -> coe ("Case-Constr and Case-Constant Cancellation" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_16 + MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_20 -> coe ("Inlining" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_18 + MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_22 -> coe ("Common Subexpression Elimination" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20 + MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_24 -> coe ("Transform multi-argument applications into case-constr form" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_unknown_22 + _ -> MAlonzo.RTE.mazUnreachableError +-- CertifierReport.showNICTag +d_showNICTag_12 :: + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 -> + MAlonzo.Code.Agda.Builtin.String.T_String_6 +d_showNICTag_12 v0 + = case coe v0 of + MAlonzo.Code.VerifiedCompilation.Trace.C_caseOfCaseT_6 + -> coe ("Case-of-Case" :: Data.Text.Text) + MAlonzo.Code.VerifiedCompilation.Trace.C_unknown_8 -> coe ("Unknown Pass" :: Data.Text.Text) _ -> MAlonzo.RTE.mazUnreachableError +-- CertifierReport.showTag +d_showTag_14 :: + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.Agda.Builtin.String.T_String_6 +d_showTag_14 v0 + = case coe v0 of + MAlonzo.Code.Utils.C_inj'8321'_12 v1 + -> coe + MAlonzo.Code.Data.String.Base.d__'43''43'__20 + (d_showNICTag_12 (coe v1)) + (" \9888 (certifier unavailable)" :: Data.Text.Text) + MAlonzo.Code.Utils.C_inj'8322'_14 v1 + -> coe + MAlonzo.Code.Data.String.Base.d__'43''43'__20 + (d_showICTag_10 (coe v1)) (" \9989" :: Data.Text.Text) + _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.numSites′ -d_numSites'8242'_18 :: +d_numSites'8242'_26 :: (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> ()) -> @@ -89,18 +112,18 @@ d_numSites'8242'_18 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.VerifiedCompilation.UntypedTranslation.T_Translation_12 -> Integer -d_numSites'8242'_18 ~v0 v1 v2 = du_numSites'8242'_18 v1 v2 -du_numSites'8242'_18 :: +d_numSites'8242'_26 ~v0 v1 v2 = du_numSites'8242'_26 v1 v2 +du_numSites'8242'_26 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.VerifiedCompilation.UntypedTranslation.T_Translation_12 -> Integer -du_numSites'8242'_18 v0 v1 +du_numSites'8242'_26 v0 v1 = coe - du_go_32 (coe v0) (coe v1) (coe (0 :: Integer)) (coe v0) (coe v1) + du_go_40 (coe v0) (coe v1) (coe (0 :: Integer)) (coe v0) (coe v1) (coe (0 :: Integer)) -- CertifierReport._.go -d_go_32 :: +d_go_40 :: (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> ()) -> @@ -115,9 +138,9 @@ d_go_32 :: Integer -> MAlonzo.Code.VerifiedCompilation.UntypedTranslation.T_Translation_12 -> Integer -d_go_32 ~v0 v1 v2 ~v3 v4 v5 v6 v7 v8 - = du_go_32 v1 v2 v4 v5 v6 v7 v8 -du_go_32 :: +d_go_40 ~v0 v1 v2 ~v3 v4 v5 v6 v7 v8 + = du_go_40 v1 v2 v4 v5 v6 v7 v8 +du_go_40 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> Integer -> @@ -126,17 +149,17 @@ du_go_32 :: Integer -> MAlonzo.Code.VerifiedCompilation.UntypedTranslation.T_Translation_12 -> Integer -du_go_32 v0 v1 v2 v3 v4 v5 v6 +du_go_40 v0 v1 v2 v3 v4 v5 v6 = case coe v6 of MAlonzo.Code.VerifiedCompilation.UntypedTranslation.C_istranslation_92 v9 -> coe addInt (coe (1 :: Integer)) (coe v5) MAlonzo.Code.VerifiedCompilation.UntypedTranslation.C_match_98 v9 -> coe - du_go'7504'_42 (coe v0) (coe v1) (coe v2) (coe v3) (coe v4) + du_go'7504'_50 (coe v0) (coe v1) (coe v2) (coe v3) (coe v4) (coe v5) (coe v9) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport._.goᵐ -d_go'7504'_42 :: +d_go'7504'_50 :: (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> ()) -> @@ -151,9 +174,9 @@ d_go'7504'_42 :: Integer -> MAlonzo.Code.VerifiedCompilation.UntypedTranslation.T_TransMatch_18 -> Integer -d_go'7504'_42 ~v0 v1 v2 ~v3 v4 v5 v6 v7 v8 - = du_go'7504'_42 v1 v2 v4 v5 v6 v7 v8 -du_go'7504'_42 :: +d_go'7504'_50 ~v0 v1 v2 ~v3 v4 v5 v6 v7 v8 + = du_go'7504'_50 v1 v2 v4 v5 v6 v7 v8 +du_go'7504'_50 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> Integer -> @@ -162,7 +185,7 @@ du_go'7504'_42 :: Integer -> MAlonzo.Code.VerifiedCompilation.UntypedTranslation.T_TransMatch_18 -> Integer -du_go'7504'_42 v0 v1 v2 v3 v4 v5 v6 +du_go'7504'_50 v0 v1 v2 v3 v4 v5 v6 = case coe v6 of MAlonzo.Code.VerifiedCompilation.UntypedTranslation.C_var_26 -> coe v5 @@ -172,7 +195,7 @@ du_go'7504'_42 v0 v1 v2 v3 v4 v5 v6 -> case coe v4 of MAlonzo.Code.Untyped.C_ƛ_20 v11 -> coe - du_go_32 (coe v0) (coe v1) + du_go_40 (coe v0) (coe v1) (coe addInt (coe (1 :: Integer)) (coe v2)) (coe v10) (coe v11) (coe v5) (coe v9) _ -> MAlonzo.RTE.mazUnreachableError @@ -183,9 +206,9 @@ du_go'7504'_42 v0 v1 v2 v3 v4 v5 v6 -> case coe v4 of MAlonzo.Code.Untyped.C__'183'__22 v15 v16 -> coe - du_go_32 (coe v0) (coe v1) (coe v2) (coe v14) (coe v16) + du_go_40 (coe v0) (coe v1) (coe v2) (coe v14) (coe v16) (coe - du_go_32 (coe v0) (coe v1) (coe v2) (coe v13) (coe v15) (coe v5) + du_go_40 (coe v0) (coe v1) (coe v2) (coe v13) (coe v15) (coe v5) (coe v11)) (coe v12) _ -> MAlonzo.RTE.mazUnreachableError @@ -196,7 +219,7 @@ du_go'7504'_42 v0 v1 v2 v3 v4 v5 v6 -> case coe v4 of MAlonzo.Code.Untyped.C_force_24 v11 -> coe - du_go_32 (coe v0) (coe v1) (coe v2) (coe v10) (coe v11) (coe v5) + du_go_40 (coe v0) (coe v1) (coe v2) (coe v10) (coe v11) (coe v5) (coe v9) _ -> MAlonzo.RTE.mazUnreachableError _ -> MAlonzo.RTE.mazUnreachableError @@ -206,7 +229,7 @@ du_go'7504'_42 v0 v1 v2 v3 v4 v5 v6 -> case coe v4 of MAlonzo.Code.Untyped.C_delay_26 v11 -> coe - du_go_32 (coe v0) (coe v1) (coe v2) (coe v10) (coe v11) (coe v5) + du_go_40 (coe v0) (coe v1) (coe v2) (coe v10) (coe v11) (coe v5) (coe v9) _ -> MAlonzo.RTE.mazUnreachableError _ -> MAlonzo.RTE.mazUnreachableError @@ -218,7 +241,7 @@ du_go'7504'_42 v0 v1 v2 v3 v4 v5 v6 -> case coe v4 of MAlonzo.Code.Untyped.C_constr_34 v13 v14 -> coe - du_go'7510''695'_52 (coe v0) (coe v1) (coe v2) (coe v12) (coe v14) + du_go'7510''695'_60 (coe v0) (coe v1) (coe v2) (coe v12) (coe v14) (coe v5) (coe v10) _ -> MAlonzo.RTE.mazUnreachableError _ -> MAlonzo.RTE.mazUnreachableError @@ -228,9 +251,9 @@ du_go'7504'_42 v0 v1 v2 v3 v4 v5 v6 -> case coe v4 of MAlonzo.Code.Untyped.C_case_40 v15 v16 -> coe - du_go_32 (coe v0) (coe v1) (coe v2) (coe v13) (coe v15) + du_go_40 (coe v0) (coe v1) (coe v2) (coe v13) (coe v15) (coe - du_go'7510''695'_52 (coe v0) (coe v1) (coe v2) (coe v14) (coe v16) + du_go'7510''695'_60 (coe v0) (coe v1) (coe v2) (coe v14) (coe v16) (coe v5) (coe v11)) (coe v12) _ -> MAlonzo.RTE.mazUnreachableError @@ -241,7 +264,7 @@ du_go'7504'_42 v0 v1 v2 v3 v4 v5 v6 -> coe v5 _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport._.goᵖʷ -d_go'7510''695'_52 :: +d_go'7510''695'_60 :: (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> ()) -> @@ -256,9 +279,9 @@ d_go'7510''695'_52 :: Integer -> MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base.T_Pointwise_48 -> Integer -d_go'7510''695'_52 ~v0 v1 v2 ~v3 v4 v5 v6 v7 v8 - = du_go'7510''695'_52 v1 v2 v4 v5 v6 v7 v8 -du_go'7510''695'_52 :: +d_go'7510''695'_60 ~v0 v1 v2 ~v3 v4 v5 v6 v7 v8 + = du_go'7510''695'_60 v1 v2 v4 v5 v6 v7 v8 +du_go'7510''695'_60 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> Integer -> @@ -267,7 +290,7 @@ du_go'7510''695'_52 :: Integer -> MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base.T_Pointwise_48 -> Integer -du_go'7510''695'_52 v0 v1 v2 v3 v4 v5 v6 +du_go'7510''695'_60 v0 v1 v2 v3 v4 v5 v6 = case coe v6 of MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base.C_'91''93'_56 -> coe v5 @@ -277,16 +300,16 @@ du_go'7510''695'_52 v0 v1 v2 v3 v4 v5 v6 -> case coe v4 of (:) v15 v16 -> coe - du_go'7510''695'_52 (coe v0) (coe v1) (coe v2) (coe v14) (coe v16) + du_go'7510''695'_60 (coe v0) (coe v1) (coe v2) (coe v14) (coe v16) (coe - du_go_32 (coe v0) (coe v1) (coe v2) (coe v13) (coe v15) (coe v5) + du_go_40 (coe v0) (coe v1) (coe v2) (coe v13) (coe v15) (coe v5) (coe v11)) (coe v12) _ -> MAlonzo.RTE.mazUnreachableError _ -> MAlonzo.RTE.mazUnreachableError _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.numSitesInlineᵖʷ -d_numSitesInline'7510''695'_114 :: +d_numSitesInline'7510''695'_122 :: Integer -> (MAlonzo.Code.Data.Fin.Base.T_Fin_10 -> MAlonzo.Code.Untyped.T__'8866'_14) -> @@ -294,7 +317,7 @@ d_numSitesInline'7510''695'_114 :: [MAlonzo.Code.Untyped.T__'8866'_14] -> MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base.T_Pointwise_48 -> Integer -d_numSitesInline'7510''695'_114 v0 v1 v2 v3 v4 +d_numSitesInline'7510''695'_122 v0 v1 v2 v3 v4 = case coe v4 of MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base.C_'91''93'_56 -> coe (0 :: Integer) @@ -306,19 +329,19 @@ d_numSitesInline'7510''695'_114 v0 v1 v2 v3 v4 -> coe addInt (coe - d_numSitesInline_132 (coe v0) (coe v1) + d_numSitesInline_140 (coe v0) (coe v1) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_106) (coe v11) (coe v13) (coe v9)) (coe - d_numSitesInline'7510''695'_114 (coe v0) (coe v1) (coe v12) + d_numSitesInline'7510''695'_122 (coe v0) (coe v1) (coe v12) (coe v14) (coe v10)) _ -> MAlonzo.RTE.mazUnreachableError _ -> MAlonzo.RTE.mazUnreachableError _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.numSitesInline -d_numSitesInline_132 :: +d_numSitesInline_140 :: Integer -> (MAlonzo.Code.Data.Fin.Base.T_Fin_10 -> MAlonzo.Code.Untyped.T__'8866'_14) -> @@ -328,7 +351,7 @@ d_numSitesInline_132 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.VerifiedCompilation.UInline.T_Inline_224 -> Integer -d_numSitesInline_132 v0 v1 v2 v3 v4 v5 v6 v7 +d_numSitesInline_140 v0 v1 v2 v3 v4 v5 v6 v7 = case coe v7 of MAlonzo.Code.VerifiedCompilation.UInline.C_'96'_230 -> coe (0 :: Integer) @@ -338,7 +361,7 @@ d_numSitesInline_132 v0 v1 v2 v3 v4 v5 v6 v7 -> coe addInt (coe (1 :: Integer)) (coe - d_numSitesInline_132 (coe v0) (coe v1) (coe v2) (coe v3) (coe v4) + d_numSitesInline_140 (coe v0) (coe v1) (coe v2) (coe v3) (coe v4) (coe v1 v15) (coe v6) (coe v14)) _ -> MAlonzo.RTE.mazUnreachableError MAlonzo.Code.VerifiedCompilation.UInline.C_ƛ'9633'_236 v11 @@ -347,7 +370,7 @@ d_numSitesInline_132 v0 v1 v2 v3 v4 v5 v6 v7 -> case coe v6 of MAlonzo.Code.Untyped.C_ƛ_20 v13 -> coe - d_numSitesInline_132 (coe addInt (coe (1 :: Integer)) (coe v0)) + d_numSitesInline_140 (coe addInt (coe (1 :: Integer)) (coe v0)) (coe MAlonzo.Code.Untyped.RenamingSubstitution.du_lifts_378 (coe v0) (coe v1)) @@ -369,7 +392,7 @@ d_numSitesInline_132 v0 v1 v2 v3 v4 v5 v6 v7 -> case coe v6 of MAlonzo.Code.Untyped.C_ƛ_20 v25 -> coe - d_numSitesInline_132 + d_numSitesInline_140 (coe addInt (coe (1 :: Integer)) (coe v0)) (coe MAlonzo.Code.Untyped.RenamingSubstitution.du_extend_454 @@ -404,7 +427,7 @@ d_numSitesInline_132 v0 v1 v2 v3 v4 v5 v6 v7 -> case coe v5 of MAlonzo.Code.Untyped.C_ƛ_20 v24 -> coe - d_numSitesInline_132 + d_numSitesInline_140 (coe addInt (coe (1 :: Integer)) (coe v0)) (coe MAlonzo.Code.Untyped.RenamingSubstitution.du_extend_454 @@ -440,13 +463,13 @@ d_numSitesInline_132 v0 v1 v2 v3 v4 v5 v6 v7 -> coe addInt (coe - d_numSitesInline_132 (coe v0) (coe v1) + d_numSitesInline_140 (coe v0) (coe v1) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_106) (coe v19) (coe v21) (coe v17)) (coe - d_numSitesInline_132 (coe v0) (coe v1) + d_numSitesInline_140 (coe v0) (coe v1) (coe MAlonzo.Code.VerifiedCompilation.UInline.C__'183'__34 (coe v2) (coe v19)) @@ -461,7 +484,7 @@ d_numSitesInline_132 v0 v1 v2 v3 v4 v5 v6 v7 -> case coe v5 of MAlonzo.Code.Untyped.C__'183'__22 v16 v17 -> coe - d_numSitesInline_132 (coe v0) (coe v1) + d_numSitesInline_140 (coe v0) (coe v1) (coe MAlonzo.Code.VerifiedCompilation.UInline.C__'183'__34 (coe v2) (coe v17)) @@ -477,7 +500,7 @@ d_numSitesInline_132 v0 v1 v2 v3 v4 v5 v6 v7 -> case coe v6 of MAlonzo.Code.Untyped.C_force_24 v16 -> coe - d_numSitesInline_132 (coe v0) (coe v1) + d_numSitesInline_140 (coe v0) (coe v1) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_106) @@ -490,7 +513,7 @@ d_numSitesInline_132 v0 v1 v2 v3 v4 v5 v6 v7 -> case coe v6 of MAlonzo.Code.Untyped.C_delay_26 v16 -> coe - d_numSitesInline_132 (coe v0) (coe v1) + d_numSitesInline_140 (coe v0) (coe v1) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_106) @@ -507,7 +530,7 @@ d_numSitesInline_132 v0 v1 v2 v3 v4 v5 v6 v7 -> case coe v6 of MAlonzo.Code.Untyped.C_constr_34 v18 v19 -> coe - d_numSitesInline'7510''695'_114 (coe v0) (coe v1) (coe v17) + d_numSitesInline'7510''695'_122 (coe v0) (coe v1) (coe v17) (coe v19) (coe v15) _ -> MAlonzo.RTE.mazUnreachableError _ -> MAlonzo.RTE.mazUnreachableError @@ -519,13 +542,13 @@ d_numSitesInline_132 v0 v1 v2 v3 v4 v5 v6 v7 -> coe addInt (coe - d_numSitesInline_132 (coe v0) (coe v1) + d_numSitesInline_140 (coe v0) (coe v1) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_106) (coe v18) (coe v20) (coe v16)) (coe - d_numSitesInline'7510''695'_114 (coe v0) (coe v1) (coe v19) + d_numSitesInline'7510''695'_122 (coe v0) (coe v1) (coe v19) (coe v21) (coe v17)) _ -> MAlonzo.RTE.mazUnreachableError _ -> MAlonzo.RTE.mazUnreachableError @@ -533,125 +556,110 @@ d_numSitesInline_132 v0 v1 v2 v3 v4 v5 v6 v7 -> coe (0 :: Integer) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.numSites -d_numSites_170 :: +d_numSites_178 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> - AgdaAny -> Maybe Integer -d_numSites_170 v0 v1 v2 v3 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + AgdaAny -> Integer +d_numSites_178 v0 v1 v2 v3 = case coe v2 of - MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_6 - -> coe - MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 - (coe du_numSites'8242'_18 v0 v1 v3) - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8 - -> coe - MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 - (coe du_numSites'8242'_18 v0 v1 v3) - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_10 - -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 - MAlonzo.Code.VerifiedCompilation.Trace.C_caseOfCaseT_12 - -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 - MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_14 - -> coe - MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 - (coe du_numSites'8242'_18 v0 v1 v3) - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_16 - -> coe - MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 - (coe - d_numSitesInline_132 (coe (0 :: Integer)) erased - (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) - (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) - (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_106) - (coe v0) (coe v1) (coe v3)) - MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_18 - -> coe - MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 - (coe du_numSites'8242'_18 v0 v1 v3) - MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20 + MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_12 + -> coe du_numSites'8242'_26 v0 v1 v3 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_14 + -> coe du_numSites'8242'_26 v0 v1 v3 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_16 + -> coe du_numSites'8242'_26 v0 v1 v3 + MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_18 + -> coe du_numSites'8242'_26 v0 v1 v3 + MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_20 -> coe - MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 - (coe du_numSites'8242'_18 v0 v1 v3) - MAlonzo.Code.VerifiedCompilation.Trace.C_unknown_22 - -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 + d_numSitesInline_140 (coe (0 :: Integer)) erased + (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) + (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) + (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_106) + (coe v0) (coe v1) (coe v3) + MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_22 + -> coe du_numSites'8242'_26 v0 v1 v3 + MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_24 + -> coe du_numSites'8242'_26 v0 v1 v3 _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.showSites -d_showSites_190 :: +d_showSites_200 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_showSites_190 v0 v1 v2 v3 - = let v4 = d_numSites_170 (coe v0) (coe v1) (coe v2) (coe v3) in - coe - (case coe v4 of - MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 v5 - -> coe - d_'8649'__2 +d_showSites_200 v0 v1 v2 v3 + = case coe v2 of + MAlonzo.Code.Utils.C_inj'8321'_12 v4 -> coe ("" :: Data.Text.Text) + MAlonzo.Code.Utils.C_inj'8322'_14 v4 + -> coe + d_'8649'__2 + (coe + MAlonzo.Code.Data.String.Base.d__'43''43'__20 + ("Optimization sites: " :: Data.Text.Text) (coe - MAlonzo.Code.Data.String.Base.d__'43''43'__20 - ("Optimization sites: " :: Data.Text.Text) - (coe MAlonzo.Code.Data.Nat.Show.d_show_56 v5)) - MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 - -> coe ("" :: Data.Text.Text) - _ -> MAlonzo.RTE.mazUnreachableError) + MAlonzo.Code.Data.Nat.Show.d_show_56 + (d_numSites_178 (coe v0) (coe v1) (coe v4) (coe v3)))) + _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.termSize -d_termSize_212 :: +d_termSize_208 :: Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> Integer -d_termSize_212 v0 v1 +d_termSize_208 v0 v1 = case coe v1 of MAlonzo.Code.Untyped.C_'96'_18 v2 -> coe (1 :: Integer) MAlonzo.Code.Untyped.C_ƛ_20 v2 -> coe addInt (coe (1 :: Integer)) (coe - d_termSize_212 (coe addInt (coe (1 :: Integer)) (coe v0)) (coe v2)) + d_termSize_208 (coe addInt (coe (1 :: Integer)) (coe v0)) (coe v2)) MAlonzo.Code.Untyped.C__'183'__22 v2 v3 -> coe addInt (coe - addInt (coe (1 :: Integer)) (coe d_termSize_212 (coe v0) (coe v2))) - (coe d_termSize_212 (coe v0) (coe v3)) + addInt (coe (1 :: Integer)) (coe d_termSize_208 (coe v0) (coe v2))) + (coe d_termSize_208 (coe v0) (coe v3)) MAlonzo.Code.Untyped.C_force_24 v2 -> coe - addInt (coe (1 :: Integer)) (coe d_termSize_212 (coe v0) (coe v2)) + addInt (coe (1 :: Integer)) (coe d_termSize_208 (coe v0) (coe v2)) MAlonzo.Code.Untyped.C_delay_26 v2 -> coe - addInt (coe (1 :: Integer)) (coe d_termSize_212 (coe v0) (coe v2)) + addInt (coe (1 :: Integer)) (coe d_termSize_208 (coe v0) (coe v2)) MAlonzo.Code.Untyped.C_con_28 v2 -> coe (1 :: Integer) MAlonzo.Code.Untyped.C_constr_34 v2 v3 -> coe addInt (coe (1 :: Integer)) - (coe d_termSize'7510''695'_216 (coe v0) (coe v3)) + (coe d_termSize'7510''695'_212 (coe v0) (coe v3)) MAlonzo.Code.Untyped.C_case_40 v2 v3 -> coe addInt (coe addInt (coe (1 :: Integer)) - (coe d_termSize'7510''695'_216 (coe v0) (coe v3))) - (coe d_termSize_212 (coe v0) (coe v2)) + (coe d_termSize'7510''695'_212 (coe v0) (coe v3))) + (coe d_termSize_208 (coe v0) (coe v2)) MAlonzo.Code.Untyped.C_builtin_44 v2 -> coe (1 :: Integer) MAlonzo.Code.Untyped.C_error_46 -> coe (1 :: Integer) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.termSizeᵖʷ -d_termSize'7510''695'_216 :: +d_termSize'7510''695'_212 :: Integer -> [MAlonzo.Code.Untyped.T__'8866'_14] -> Integer -d_termSize'7510''695'_216 v0 v1 +d_termSize'7510''695'_212 v0 v1 = case coe v1 of [] -> coe (0 :: Integer) (:) v2 v3 -> coe - addInt (coe d_termSize'7510''695'_216 (coe v0) (coe v3)) - (coe d_termSize_212 (coe v0) (coe v2)) + addInt (coe d_termSize'7510''695'_212 (coe v0) (coe v3)) + (coe d_termSize_208 (coe v0) (coe v2)) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.showEvalResult -d_showEvalResult_238 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_114 -> +d_showEvalResult_234 :: + MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_136 -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_showEvalResult_238 v0 +d_showEvalResult_234 v0 = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_success_116 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.C_success_138 v1 v2 -> coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 (d_'8649'__2 (coe ("Execution Cost: CPU = " :: Data.Text.Text))) @@ -662,7 +670,7 @@ d_showEvalResult_238 v0 MAlonzo.Code.Data.String.Base.d__'43''43'__20 (", MEM = " :: Data.Text.Text) (coe MAlonzo.Code.Data.Nat.Show.d_show_56 v2))) - MAlonzo.Code.VerifiedCompilation.Trace.C_failure_118 v1 v2 v3 + MAlonzo.Code.VerifiedCompilation.Trace.C_failure_140 v1 v2 v3 -> coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 (d_'8649'__2 (coe ("Evaluation FAILED: " :: Data.Text.Text))) @@ -682,10 +690,10 @@ d_showEvalResult_238 v0 (coe MAlonzo.Code.Data.Nat.Show.d_show_56 v3)))))) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.showCostPair -d_showCostPair_250 :: - [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_114] -> +d_showCostPair_246 :: + [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_136] -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_showCostPair_250 v0 +d_showCostPair_246 v0 = let v1 = "" :: Data.Text.Text in coe (case coe v0 of @@ -694,7 +702,7 @@ d_showCostPair_250 v0 (:) v4 v5 -> coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_showEvalResult_238 (coe v2)) + (d_showEvalResult_234 (coe v2)) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 (" (before)" :: Data.Text.Text) @@ -702,28 +710,28 @@ d_showCostPair_250 v0 MAlonzo.Code.Data.String.Base.d__'43''43'__20 d_nl_6 (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_showEvalResult_238 (coe v4)) (" (after)" :: Data.Text.Text)))) + (d_showEvalResult_234 (coe v4)) (" (after)" :: Data.Text.Text)))) _ -> coe v1 _ -> coe v1) -- CertifierReport.tail -d_tail_258 :: () -> [AgdaAny] -> [AgdaAny] -d_tail_258 ~v0 v1 = du_tail_258 v1 -du_tail_258 :: [AgdaAny] -> [AgdaAny] -du_tail_258 v0 +d_tail_254 :: () -> [AgdaAny] -> [AgdaAny] +d_tail_254 ~v0 v1 = du_tail_254 v1 +du_tail_254 :: [AgdaAny] -> [AgdaAny] +du_tail_254 v0 = case coe v0 of [] -> coe v0 (:) v1 v2 -> coe v2 _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.reportPasses -d_reportPasses_268 :: +d_reportPasses_264 :: Integer -> - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_82 -> AgdaAny -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_114] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_136] -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_reportPasses_268 v0 v1 v2 v3 +d_reportPasses_264 v0 v1 v2 v3 = case coe v1 of - MAlonzo.Code.VerifiedCompilation.Trace.C_step_64 v4 v5 v6 v7 + MAlonzo.Code.VerifiedCompilation.Trace.C_step_86 v4 v5 v6 v7 -> case coe v2 of MAlonzo.Code.Utils.C__'44'__442 v8 v9 -> coe @@ -739,86 +747,77 @@ d_reportPasses_268 v0 v1 v2 v3 (": " :: Data.Text.Text) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_showTag_10 (coe v4)) + (d_showTag_14 (coe v4)) (coe - MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (coe - MAlonzo.Code.Data.Bool.Base.du_if_then_else__44 - (coe - MAlonzo.Code.VerifiedCompilation.d_hasRelation_16 (coe v4)) - (coe (" \9989" :: Data.Text.Text)) - (coe (" \9888 (certifier unavailable)" :: Data.Text.Text))) + MAlonzo.Code.Data.String.Base.d__'43''43'__20 d_hl_8 (coe - MAlonzo.Code.Data.String.Base.d__'43''43'__20 d_hl_8 + MAlonzo.Code.Data.String.Base.d__'43''43'__20 + (d_'8649'__2 (coe ("Program Size: " :: Data.Text.Text))) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_'8649'__2 (coe ("Program Size: " :: Data.Text.Text))) + (coe + MAlonzo.Code.Data.Nat.Show.d_show_56 + (d_termSize_208 (coe (0 :: Integer)) (coe v6))) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 + (" (before)" :: Data.Text.Text) (coe - MAlonzo.Code.Data.Nat.Show.d_show_56 - (d_termSize_212 (coe (0 :: Integer)) (coe v6))) - (coe - MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (" (before)" :: Data.Text.Text) + MAlonzo.Code.Data.String.Base.d__'43''43'__20 d_nl_6 (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - d_nl_6 + (d_'8649'__2 + (coe ("Program Size: " :: Data.Text.Text))) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_'8649'__2 - (coe ("Program Size: " :: Data.Text.Text))) + (coe + MAlonzo.Code.Data.Nat.Show.d_show_56 + (d_termSize_208 + (coe (0 :: Integer)) + (coe + MAlonzo.Code.VerifiedCompilation.Trace.d_head_92 + (coe v7)))) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (coe - MAlonzo.Code.Data.Nat.Show.d_show_56 - (d_termSize_212 - (coe (0 :: Integer)) - (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_head_70 - (coe v7)))) + (" (after)" :: Data.Text.Text) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (" (after)" :: Data.Text.Text) + d_nl_6 (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - d_nl_6 + (d_showCostPair_246 (coe v3)) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_showCostPair_250 (coe v3)) + d_nl_6 (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - d_nl_6 + (d_showSites_200 + (coe v6) + (coe + MAlonzo.Code.VerifiedCompilation.Trace.d_head_92 + (coe v7)) + (coe v4) (coe v8)) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_showSites_190 - (coe v6) + d_nl_6 + (d_reportPasses_264 (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_head_70 - (coe v7)) - (coe v4) (coe v8)) - (coe - MAlonzo.Code.Data.String.Base.d__'43''43'__20 - d_nl_6 - (d_reportPasses_268 - (coe - addInt - (coe (1 :: Integer)) - (coe v0)) - (coe v7) (coe v9) + addInt + (coe (1 :: Integer)) + (coe v0)) + (coe v7) (coe v9) + (coe + du_tail_254 (coe - du_tail_258 - (coe - v3))))))))))))))))))))) + v3)))))))))))))))))))) _ -> MAlonzo.RTE.mazUnreachableError - MAlonzo.Code.VerifiedCompilation.Trace.C_done_66 v4 + MAlonzo.Code.VerifiedCompilation.Trace.C_done_88 v4 -> coe ("" :: Data.Text.Text) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.reportFailure -d_reportFailure_284 :: +d_reportFailure_280 :: MAlonzo.Code.VerifiedCompilation.T_Error_2 -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_reportFailure_284 v0 +d_reportFailure_280 v0 = case coe v0 of MAlonzo.Code.VerifiedCompilation.C_emptyDump_4 -> coe @@ -844,7 +843,7 @@ d_reportFailure_284 v0 ("Pass " :: Data.Text.Text) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_showTag_10 (coe v1)) + (d_showTag_14 (coe v1)) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 (" \10060 FAILED" :: Data.Text.Text) d_hl_8))) @@ -856,30 +855,30 @@ d_reportFailure_284 v0 ("Pass " :: Data.Text.Text) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_showTag_10 (coe v1)) + (d_showTag_14 (coe v1)) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 (" \10060 FAILED" :: Data.Text.Text) d_hl_8))) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.makeReport -d_makeReport_290 :: +d_makeReport_286 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.T_Error_2 MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_114] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_136] -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_makeReport_290 v0 v1 +d_makeReport_286 v0 v1 = coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 ("UPLC OPTIMIZATION: CERTIFIER REPORT" :: Data.Text.Text) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 d_nl_6 (coe - MAlonzo.Code.Utils.du_either_22 (coe v0) (coe d_reportFailure_284) + MAlonzo.Code.Utils.du_either_22 (coe v0) (coe d_reportFailure_280) (coe (\ v2 -> case coe v2 of MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 v3 v4 -> coe - d_reportPasses_268 (coe (1 :: Integer)) (coe v3) (coe v4) (coe v1) + d_reportPasses_264 (coe (1 :: Integer)) (coe v3) (coe v4) (coe v1) _ -> MAlonzo.RTE.mazUnreachableError)))) diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs index 5a7cfe8f28a..c79bd628e75 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs @@ -17,6 +17,7 @@ import MAlonzo.RTE (coe, erased, AgdaAny, addInt, subInt, mulInt, rem64, lt64, eq64, word64FromNat, word64ToNat) import qualified MAlonzo.RTE import qualified Data.Text +import qualified MAlonzo.Code.Agda.Builtin.Bool import qualified MAlonzo.Code.Agda.Builtin.Maybe import qualified MAlonzo.Code.Agda.Builtin.Unit import qualified MAlonzo.Code.Data.Maybe.Base @@ -38,136 +39,128 @@ import qualified MAlonzo.Code.VerifiedCompilation.UInline d_Error_2 = () data T_Error_2 = C_emptyDump_4 | C_illScoped_6 | - C_counterExample_8 MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 | - C_abort_10 MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 --- VerifiedCompilation.mRelationOf -d_mRelationOf_12 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> - Maybe - (MAlonzo.Code.Untyped.T__'8866'_14 -> - MAlonzo.Code.Untyped.T__'8866'_14 -> ()) -d_mRelationOf_12 v0 - = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_6 - -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 erased - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8 - -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 erased - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_10 - -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 erased - MAlonzo.Code.VerifiedCompilation.Trace.C_caseOfCaseT_12 - -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 - MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_14 - -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 erased - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_16 - -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 erased - MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_18 - -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 erased - MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20 - -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 erased - MAlonzo.Code.VerifiedCompilation.Trace.C_unknown_22 - -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 - _ -> MAlonzo.RTE.mazUnreachableError + C_counterExample_8 (MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) | + C_abort_10 (MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) +-- VerifiedCompilation.f +d_f_12 :: + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.Untyped.T__'8866'_14 -> + MAlonzo.Code.Untyped.T__'8866'_14 -> () +d_f_12 = erased -- VerifiedCompilation.RelationOf d_RelationOf_14 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> () d_RelationOf_14 = erased -- VerifiedCompilation.hasRelation -d_hasRelation_16 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> Bool -d_hasRelation_16 v0 - = coe - MAlonzo.Code.Data.Maybe.Base.du_is'45'just_20 - (coe d_mRelationOf_12 (coe v0)) +d_hasRelation_18 :: + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + Bool +d_hasRelation_18 v0 + = case coe v0 of + MAlonzo.Code.Utils.C_inj'8321'_12 v1 + -> coe MAlonzo.Code.Agda.Builtin.Bool.C_false_8 + MAlonzo.Code.Utils.C_inj'8322'_14 v1 + -> coe MAlonzo.Code.Agda.Builtin.Bool.C_true_10 + _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.certifyPass -d_certifyPass_24 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_52 -> +d_certifyPass_26 :: + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_74 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.VerifiedCompilation.Certificate.T_CertResult_12 -d_certifyPass_24 v0 v1 +d_certifyPass_26 v0 v1 = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_6 - -> coe - MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 - (coe - MAlonzo.Code.VerifiedCompilation.UFloatDelay.d_isFloatDelay'63'_488 - (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8 - -> coe - MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 - (coe - MAlonzo.Code.VerifiedCompilation.UForceDelay.d_isForceDelay'63'_178 - (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_10 - -> coe - MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 - (coe - MAlonzo.Code.VerifiedCompilation.UForceCaseDelay.d_isForceCaseDelay'63'_94 - (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_caseOfCaseT_12 + MAlonzo.Code.Utils.C_inj'8321'_12 v2 -> coe - (\ v2 v3 -> + (\ v3 v4 -> coe MAlonzo.Code.VerifiedCompilation.NotImplemented.du_certNotImplemented_22) - MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_14 - -> coe - MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 - (coe - MAlonzo.Code.VerifiedCompilation.UCaseReduce.d_isCaseReduce'63'_26 - (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_16 - -> case coe v1 of - MAlonzo.Code.VerifiedCompilation.Trace.C_inline_54 v2 + MAlonzo.Code.Utils.C_inj'8322'_14 v2 + -> case coe v2 of + MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_12 -> coe - MAlonzo.Code.VerifiedCompilation.Certificate.du_checker_156 + MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 (coe - MAlonzo.Code.VerifiedCompilation.UInline.d_top'45'check_718 - (coe v2)) - MAlonzo.Code.VerifiedCompilation.Trace.C_none_56 + MAlonzo.Code.VerifiedCompilation.UFloatDelay.d_isFloatDelay'63'_488 + (coe (0 :: Integer))) + MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_14 -> coe - MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_32 (coe v0) + MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 + (coe + MAlonzo.Code.VerifiedCompilation.UForceDelay.d_isForceDelay'63'_178 + (coe (0 :: Integer))) + MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_16 + -> coe + MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 + (coe + MAlonzo.Code.VerifiedCompilation.UForceCaseDelay.d_isForceCaseDelay'63'_94 + (coe (0 :: Integer))) + MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_18 + -> coe + MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 + (coe + MAlonzo.Code.VerifiedCompilation.UCaseReduce.d_isCaseReduce'63'_26 + (coe (0 :: Integer))) + MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_20 + -> case coe v1 of + MAlonzo.Code.VerifiedCompilation.Trace.C_inline_76 v3 + -> coe + MAlonzo.Code.VerifiedCompilation.Certificate.du_checker_156 + (coe + MAlonzo.Code.VerifiedCompilation.UInline.d_top'45'check_718 + (coe v3)) + MAlonzo.Code.VerifiedCompilation.Trace.C_none_78 + -> coe + MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_32 + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36) + _ -> MAlonzo.RTE.mazUnreachableError + MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_22 + -> coe + MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 + (coe + MAlonzo.Code.VerifiedCompilation.UCSE.d_isUntypedCSE'63'_26 + (coe (0 :: Integer))) + MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_24 + -> coe + MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 + (coe + MAlonzo.Code.VerifiedCompilation.UApplyToCase.d_a2c'63''7580''7580'_24 + (coe (0 :: Integer))) _ -> MAlonzo.RTE.mazUnreachableError - MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_18 - -> coe - MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 - (coe - MAlonzo.Code.VerifiedCompilation.UCSE.d_isUntypedCSE'63'_26 - (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20 - -> coe - MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 - (coe - MAlonzo.Code.VerifiedCompilation.UApplyToCase.d_a2c'63''7580''7580'_24 - (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_unknown_22 - -> coe - (\ v2 v3 -> - coe - MAlonzo.Code.VerifiedCompilation.NotImplemented.du_certNotImplemented_22) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.Certificate -d_Certificate_32 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -> () -d_Certificate_32 = erased +d_Certificate_34 :: + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_82 -> () +d_Certificate_34 = erased -- VerifiedCompilation.certify -d_certify_44 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -> +d_certify_46 :: + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_82 -> MAlonzo.Code.Utils.T_Either_6 T_Error_2 AgdaAny -d_certify_44 v0 +d_certify_46 v0 = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_step_64 v1 v2 v3 v4 + MAlonzo.Code.VerifiedCompilation.Trace.C_step_86 v1 v2 v3 v4 -> let v5 = coe - d_certifyPass_24 v1 v2 v3 - (MAlonzo.Code.VerifiedCompilation.Trace.d_head_70 (coe v4)) in + d_certifyPass_26 v1 v2 v3 + (MAlonzo.Code.VerifiedCompilation.Trace.d_head_92 (coe v4)) in coe (case coe v5 of MAlonzo.Code.VerifiedCompilation.Certificate.C_proof_18 v6 -> coe - MAlonzo.Code.Utils.du_eitherBind_54 (coe d_certify_44 (coe v4)) + MAlonzo.Code.Utils.du_eitherBind_54 (coe d_certify_46 (coe v4)) (coe (\ v7 -> coe @@ -179,61 +172,61 @@ d_certify_44 v0 MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_32 v8 v9 v10 -> coe MAlonzo.Code.Utils.C_inj'8321'_12 (coe C_abort_10 (coe v8)) _ -> MAlonzo.RTE.mazUnreachableError) - MAlonzo.Code.VerifiedCompilation.Trace.C_done_66 v1 + MAlonzo.Code.VerifiedCompilation.Trace.C_done_88 v1 -> coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe MAlonzo.Code.Agda.Builtin.Unit.C_tt_8) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.cert -d_cert_94 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -> +d_cert_96 :: + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_82 -> MAlonzo.Code.Utils.T_Either_6 T_Error_2 AgdaAny -> AgdaAny -> AgdaAny -d_cert_94 ~v0 v1 v2 = du_cert_94 v1 v2 -du_cert_94 :: +d_cert_96 ~v0 v1 v2 = du_cert_96 v1 v2 +du_cert_96 :: MAlonzo.Code.Utils.T_Either_6 T_Error_2 AgdaAny -> AgdaAny -> AgdaAny -du_cert_94 v0 v1 +du_cert_96 v0 v1 = case coe v0 of MAlonzo.Code.Utils.C_inj'8322'_14 v2 -> coe seq (coe v1) (coe v2) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.checkScope -d_checkScope_98 :: +d_checkScope_100 :: MAlonzo.Code.RawU.T_Untyped_208 -> Maybe MAlonzo.Code.Untyped.T__'8866'_14 -d_checkScope_98 v0 +d_checkScope_100 v0 = coe MAlonzo.Code.Utils.du_eitherToMaybe_104 (coe MAlonzo.Code.Untyped.d_scopeCheckU0_276 (coe v0)) -- VerifiedCompilation.checkScopeᵗ -d_checkScope'7511'_100 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -> - Maybe MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_60 -d_checkScope'7511'_100 v0 +d_checkScope'7511'_102 :: + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_82 -> + Maybe MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_82 +d_checkScope'7511'_102 v0 = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_step_64 v1 v2 v3 v4 + MAlonzo.Code.VerifiedCompilation.Trace.C_step_86 v1 v2 v3 v4 -> coe MAlonzo.Code.Data.Maybe.Base.du__'62''62''61'__72 - (coe d_checkScope_98 (coe v3)) + (coe d_checkScope_100 (coe v3)) (coe (\ v5 -> coe MAlonzo.Code.Data.Maybe.Base.du__'62''62''61'__72 - (coe d_checkScope'7511'_100 (coe v4)) + (coe d_checkScope'7511'_102 (coe v4)) (coe (\ v6 -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_step_64 (coe v1) (coe v2) + MAlonzo.Code.VerifiedCompilation.Trace.C_step_86 (coe v1) (coe v2) (coe v5) (coe v6)))))) - MAlonzo.Code.VerifiedCompilation.Trace.C_done_66 v1 + MAlonzo.Code.VerifiedCompilation.Trace.C_done_88 v1 -> coe MAlonzo.Code.Data.Maybe.Base.du__'62''62''61'__72 - (coe d_checkScope_98 (coe v1)) + (coe d_checkScope_100 (coe v1)) (coe (\ v2 -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_done_66 (coe v2)))) + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_done_88 (coe v2)))) _ -> MAlonzo.RTE.mazUnreachableError diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs index 9d0eb9371a4..9a216cf34fe 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs @@ -24,21 +24,28 @@ import qualified MAlonzo.Code.Data.Irrelevant import qualified MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base import qualified MAlonzo.Code.Relation.Nullary.Decidable.Core import qualified MAlonzo.Code.Relation.Nullary.Reflects +import qualified MAlonzo.Code.Utils import qualified MAlonzo.Code.VerifiedCompilation.Trace -- VerifiedCompilation.Certificate.CertResult d_CertResult_12 a0 a1 = () data T_CertResult_12 = C_proof_18 AgdaAny | - C_ce_26 MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 + C_ce_26 (MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) AgdaAny AgdaAny | - C_abort_32 MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 + C_abort_32 (MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) AgdaAny AgdaAny -- VerifiedCompilation.Certificate.ProofOrCE d_ProofOrCE_38 a0 a1 = () data T_ProofOrCE_38 = C_proof_44 AgdaAny | - C_ce_52 MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 + C_ce_52 (MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) AgdaAny AgdaAny -- VerifiedCompilation.Certificate.isProof? d_isProof'63'_56 :: @@ -65,7 +72,9 @@ du_isCE'63'_60 v0 d_Proof'63'_66 a0 a1 = () data T_Proof'63'_66 = C_proof_72 AgdaAny | - C_abort_78 MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 + C_abort_78 (MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) AgdaAny AgdaAny -- VerifiedCompilation.Certificate._>>=_ d__'62''62''61'__88 :: @@ -134,12 +143,16 @@ du_decider_192 v0 v1 v2 d_decToPCE_234 :: () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20 -> AgdaAny -> AgdaAny -> T_ProofOrCE_38 d_decToPCE_234 ~v0 ~v1 v2 v3 v4 v5 = du_decToPCE_234 v2 v3 v4 v5 du_decToPCE_234 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20 -> AgdaAny -> AgdaAny -> T_ProofOrCE_38 du_decToPCE_234 v0 v1 v2 v3 @@ -180,7 +193,9 @@ d_matchOrCE_262 :: () -> MAlonzo.Code.Agda.Primitive.T_Level_18 -> (AgdaAny -> AgdaAny -> ()) -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> (AgdaAny -> AgdaAny -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20) -> @@ -188,7 +203,9 @@ d_matchOrCE_262 :: d_matchOrCE_262 ~v0 ~v1 ~v2 ~v3 v4 v5 v6 v7 = du_matchOrCE_262 v4 v5 v6 v7 du_matchOrCE_262 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> (AgdaAny -> AgdaAny -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20) -> @@ -211,13 +228,17 @@ d_pcePointwise_304 :: () -> MAlonzo.Code.Agda.Primitive.T_Level_18 -> (AgdaAny -> AgdaAny -> ()) -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> (AgdaAny -> AgdaAny -> T_ProofOrCE_38) -> [AgdaAny] -> [AgdaAny] -> T_ProofOrCE_38 d_pcePointwise_304 ~v0 ~v1 ~v2 ~v3 v4 v5 v6 v7 = du_pcePointwise_304 v4 v5 v6 v7 du_pcePointwise_304 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> (AgdaAny -> AgdaAny -> T_ProofOrCE_38) -> [AgdaAny] -> [AgdaAny] -> T_ProofOrCE_38 du_pcePointwise_304 v0 v1 v2 v3 diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs index 7e9b4e99a1c..ac0e4862e72 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs @@ -27,98 +27,160 @@ import UntypedPlutusCore.Transform.Simplifier import UntypedPlutusCore.Transform.Certify.Trace import qualified UntypedPlutusCore.Transform.Certify.Hints as Hints import FFI.CostInfo --- VerifiedCompilation.Trace.SimplifierTag -d_SimplifierTag_4 = () -type T_SimplifierTag_4 = SimplifierStage -pattern C_floatDelayT_6 = FloatDelay -pattern C_forceDelayT_8 = ForceDelay -pattern C_forceCaseDelayT_10 = ForceCaseDelay -pattern C_caseOfCaseT_12 = CaseOfCase -pattern C_caseReduceT_14 = CaseReduce -pattern C_inlineT_16 = Inline -pattern C_cseT_18 = CSE -pattern C_applyToCaseT_20 = ApplyToCase -pattern C_unknown_22 = Unknown -check_floatDelayT_6 :: T_SimplifierTag_4 -check_floatDelayT_6 = FloatDelay -check_forceDelayT_8 :: T_SimplifierTag_4 -check_forceDelayT_8 = ForceDelay -check_forceCaseDelayT_10 :: T_SimplifierTag_4 -check_forceCaseDelayT_10 = ForceCaseDelay -check_caseOfCaseT_12 :: T_SimplifierTag_4 -check_caseOfCaseT_12 = CaseOfCase -check_caseReduceT_14 :: T_SimplifierTag_4 -check_caseReduceT_14 = CaseReduce -check_inlineT_16 :: T_SimplifierTag_4 -check_inlineT_16 = Inline -check_cseT_18 :: T_SimplifierTag_4 -check_cseT_18 = CSE -check_applyToCaseT_20 :: T_SimplifierTag_4 -check_applyToCaseT_20 = ApplyToCase -check_unknown_22 :: T_SimplifierTag_4 -check_unknown_22 = Unknown -cover_SimplifierTag_4 :: SimplifierStage -> () -cover_SimplifierTag_4 x +-- VerifiedCompilation.Trace.NICSimplifierTag +d_NICSimplifierTag_4 = () +type T_NICSimplifierTag_4 = NICSimplifierStage +pattern C_caseOfCaseT_6 = CaseOfCase +pattern C_unknown_8 = Unknown +check_caseOfCaseT_6 :: T_NICSimplifierTag_4 +check_caseOfCaseT_6 = CaseOfCase +check_unknown_8 :: T_NICSimplifierTag_4 +check_unknown_8 = Unknown +cover_NICSimplifierTag_4 :: NICSimplifierStage -> () +cover_NICSimplifierTag_4 x + = case x of + CaseOfCase -> () + Unknown -> () +-- VerifiedCompilation.Trace.ICSimplifierTag +d_ICSimplifierTag_10 = () +type T_ICSimplifierTag_10 = ICSimplifierStage +pattern C_floatDelayT_12 = FloatDelay +pattern C_forceDelayT_14 = ForceDelay +pattern C_forceCaseDelayT_16 = ForceCaseDelay +pattern C_caseReduceT_18 = CaseReduce +pattern C_inlineT_20 = Inline +pattern C_cseT_22 = CSE +pattern C_applyToCaseT_24 = ApplyToCase +check_floatDelayT_12 :: T_ICSimplifierTag_10 +check_floatDelayT_12 = FloatDelay +check_forceDelayT_14 :: T_ICSimplifierTag_10 +check_forceDelayT_14 = ForceDelay +check_forceCaseDelayT_16 :: T_ICSimplifierTag_10 +check_forceCaseDelayT_16 = ForceCaseDelay +check_caseReduceT_18 :: T_ICSimplifierTag_10 +check_caseReduceT_18 = CaseReduce +check_inlineT_20 :: T_ICSimplifierTag_10 +check_inlineT_20 = Inline +check_cseT_22 :: T_ICSimplifierTag_10 +check_cseT_22 = CSE +check_applyToCaseT_24 :: T_ICSimplifierTag_10 +check_applyToCaseT_24 = ApplyToCase +cover_ICSimplifierTag_10 :: ICSimplifierStage -> () +cover_ICSimplifierTag_10 x = case x of FloatDelay -> () ForceDelay -> () ForceCaseDelay -> () - CaseOfCase -> () CaseReduce -> () Inline -> () CSE -> () ApplyToCase -> () - Unknown -> () +-- VerifiedCompilation.Trace.SimplifierTag +d_SimplifierTag_26 :: () +d_SimplifierTag_26 = erased +-- VerifiedCompilation.Trace.floatDelayTag +d_floatDelayTag_28 :: + MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10 +d_floatDelayTag_28 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_floatDelayT_12) +-- VerifiedCompilation.Trace.forceDelayTag +d_forceDelayTag_30 :: + MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10 +d_forceDelayTag_30 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_forceDelayT_14) +-- VerifiedCompilation.Trace.forceCaseDelayTag +d_forceCaseDelayTag_32 :: + MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10 +d_forceCaseDelayTag_32 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_forceCaseDelayT_16) +-- VerifiedCompilation.Trace.caseReduceTag +d_caseReduceTag_34 :: + MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10 +d_caseReduceTag_34 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_caseReduceT_18) +-- VerifiedCompilation.Trace.inlineTag +d_inlineTag_36 :: + MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10 +d_inlineTag_36 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_inlineT_20) +-- VerifiedCompilation.Trace.cseTag +d_cseTag_38 :: + MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10 +d_cseTag_38 = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_cseT_22) +-- VerifiedCompilation.Trace.applyToCaseTag +d_applyToCaseTag_40 :: + MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10 +d_applyToCaseTag_40 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_applyToCaseT_24) +-- VerifiedCompilation.Trace.caseOfCaseTag +d_caseOfCaseTag_42 :: + MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10 +d_caseOfCaseTag_42 + = coe MAlonzo.Code.Utils.C_inj'8321'_12 (coe C_caseOfCaseT_6) +-- VerifiedCompilation.Trace.unknownTag +d_unknownTag_44 :: + MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10 +d_unknownTag_44 + = coe MAlonzo.Code.Utils.C_inj'8321'_12 (coe C_unknown_8) -- VerifiedCompilation.Trace.InlineHints -d_InlineHints_24 = () -type T_InlineHints_24 = Hints.Inline -pattern C_var_26 = Hints.InlVar -pattern C_expand_28 a0 = Hints.InlExpand a0 -pattern C_ƛ_30 a0 = Hints.InlLam a0 -pattern C_ƛ'8595'_32 a0 = Hints.InlLamDrop a0 -pattern C__'183'__34 a0 a1 = Hints.InlApply a0 a1 -pattern C__'183''8595'_36 a0 = Hints.InlDrop a0 -pattern C_force_38 a0 = Hints.InlForce a0 -pattern C_delay_40 a0 = Hints.InlDelay a0 -pattern C_con_42 = Hints.InlCon -pattern C_builtin_44 = Hints.InlBuiltin -pattern C_error_46 = Hints.InlError -pattern C_constr_48 a0 = Hints.InlConstr a0 -pattern C_case_50 a0 a1 = Hints.InlCase a0 a1 -check_var_26 :: T_InlineHints_24 -check_var_26 = Hints.InlVar -check_expand_28 :: T_InlineHints_24 -> T_InlineHints_24 -check_expand_28 = Hints.InlExpand -check_ƛ_30 :: T_InlineHints_24 -> T_InlineHints_24 -check_ƛ_30 = Hints.InlLam -check_ƛ'8595'_32 :: T_InlineHints_24 -> T_InlineHints_24 -check_ƛ'8595'_32 = Hints.InlLamDrop -check__'183'__34 :: - T_InlineHints_24 -> T_InlineHints_24 -> T_InlineHints_24 -check__'183'__34 = Hints.InlApply -check__'183''8595'_36 :: T_InlineHints_24 -> T_InlineHints_24 -check__'183''8595'_36 = Hints.InlDrop -check_force_38 :: T_InlineHints_24 -> T_InlineHints_24 -check_force_38 = Hints.InlForce -check_delay_40 :: T_InlineHints_24 -> T_InlineHints_24 -check_delay_40 = Hints.InlDelay -check_con_42 :: T_InlineHints_24 -check_con_42 = Hints.InlCon -check_builtin_44 :: T_InlineHints_24 -check_builtin_44 = Hints.InlBuiltin -check_error_46 :: T_InlineHints_24 -check_error_46 = Hints.InlError -check_constr_48 :: - MAlonzo.Code.Agda.Builtin.List.T_List_10 () T_InlineHints_24 -> - T_InlineHints_24 -check_constr_48 = Hints.InlConstr -check_case_50 :: - T_InlineHints_24 -> - MAlonzo.Code.Agda.Builtin.List.T_List_10 () T_InlineHints_24 -> - T_InlineHints_24 -check_case_50 = Hints.InlCase -cover_InlineHints_24 :: Hints.Inline -> () -cover_InlineHints_24 x +d_InlineHints_46 = () +type T_InlineHints_46 = Hints.Inline +pattern C_var_48 = Hints.InlVar +pattern C_expand_50 a0 = Hints.InlExpand a0 +pattern C_ƛ_52 a0 = Hints.InlLam a0 +pattern C_ƛ'8595'_54 a0 = Hints.InlLamDrop a0 +pattern C__'183'__56 a0 a1 = Hints.InlApply a0 a1 +pattern C__'183''8595'_58 a0 = Hints.InlDrop a0 +pattern C_force_60 a0 = Hints.InlForce a0 +pattern C_delay_62 a0 = Hints.InlDelay a0 +pattern C_con_64 = Hints.InlCon +pattern C_builtin_66 = Hints.InlBuiltin +pattern C_error_68 = Hints.InlError +pattern C_constr_70 a0 = Hints.InlConstr a0 +pattern C_case_72 a0 a1 = Hints.InlCase a0 a1 +check_var_48 :: T_InlineHints_46 +check_var_48 = Hints.InlVar +check_expand_50 :: T_InlineHints_46 -> T_InlineHints_46 +check_expand_50 = Hints.InlExpand +check_ƛ_52 :: T_InlineHints_46 -> T_InlineHints_46 +check_ƛ_52 = Hints.InlLam +check_ƛ'8595'_54 :: T_InlineHints_46 -> T_InlineHints_46 +check_ƛ'8595'_54 = Hints.InlLamDrop +check__'183'__56 :: + T_InlineHints_46 -> T_InlineHints_46 -> T_InlineHints_46 +check__'183'__56 = Hints.InlApply +check__'183''8595'_58 :: T_InlineHints_46 -> T_InlineHints_46 +check__'183''8595'_58 = Hints.InlDrop +check_force_60 :: T_InlineHints_46 -> T_InlineHints_46 +check_force_60 = Hints.InlForce +check_delay_62 :: T_InlineHints_46 -> T_InlineHints_46 +check_delay_62 = Hints.InlDelay +check_con_64 :: T_InlineHints_46 +check_con_64 = Hints.InlCon +check_builtin_66 :: T_InlineHints_46 +check_builtin_66 = Hints.InlBuiltin +check_error_68 :: T_InlineHints_46 +check_error_68 = Hints.InlError +check_constr_70 :: + MAlonzo.Code.Agda.Builtin.List.T_List_10 () T_InlineHints_46 -> + T_InlineHints_46 +check_constr_70 = Hints.InlConstr +check_case_72 :: + T_InlineHints_46 -> + MAlonzo.Code.Agda.Builtin.List.T_List_10 () T_InlineHints_46 -> + T_InlineHints_46 +check_case_72 = Hints.InlCase +cover_InlineHints_46 :: Hints.Inline -> () +cover_InlineHints_46 x = case x of Hints.InlVar -> () Hints.InlExpand _ -> () @@ -134,101 +196,110 @@ cover_InlineHints_24 x Hints.InlConstr _ -> () Hints.InlCase _ _ -> () -- VerifiedCompilation.Trace.Hints -d_Hints_52 = () -type T_Hints_52 = Hints.Hints -pattern C_inline_54 a0 = Hints.Inline a0 -pattern C_none_56 = Hints.NoHints -check_inline_54 :: T_InlineHints_24 -> T_Hints_52 -check_inline_54 = Hints.Inline -check_none_56 :: T_Hints_52 -check_none_56 = Hints.NoHints -cover_Hints_52 :: Hints.Hints -> () -cover_Hints_52 x +d_Hints_74 = () +type T_Hints_74 = Hints.Hints +pattern C_inline_76 a0 = Hints.Inline a0 +pattern C_none_78 = Hints.NoHints +check_inline_76 :: T_InlineHints_46 -> T_Hints_74 +check_inline_76 = Hints.Inline +check_none_78 :: T_Hints_74 +check_none_78 = Hints.NoHints +cover_Hints_74 :: Hints.Hints -> () +cover_Hints_74 x = case x of Hints.Inline _ -> () Hints.NoHints -> () -- VerifiedCompilation.Trace.Trace -d_Trace_60 a0 = () -data T_Trace_60 - = C_step_64 T_SimplifierTag_4 T_Hints_52 AgdaAny T_Trace_60 | - C_done_66 AgdaAny +d_Trace_82 a0 = () +data T_Trace_82 + = C_step_86 (MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_Hints_74 AgdaAny T_Trace_82 | + C_done_88 AgdaAny -- VerifiedCompilation.Trace.head -d_head_70 :: T_Trace_60 -> AgdaAny -d_head_70 v0 +d_head_92 :: T_Trace_82 -> AgdaAny +d_head_92 v0 = case coe v0 of - C_step_64 v1 v2 v3 v4 -> coe v3 - C_done_66 v1 -> coe v1 + C_step_86 v1 v2 v3 v4 -> coe v3 + C_done_88 v1 -> coe v1 _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.Trace.Dump -d_Dump_76 :: () -d_Dump_76 = erased +d_Dump_98 :: () +d_Dump_98 = erased -- VerifiedCompilation.Trace.toTrace -d_toTrace_78 :: +d_toTrace_100 :: [MAlonzo.Code.Utils.T__'215'__428 - T_SimplifierTag_4 + (MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_52 + T_Hints_74 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> - Maybe T_Trace_60 -d_toTrace_78 v0 + Maybe T_Trace_82 +d_toTrace_100 v0 = case coe v0 of [] -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 (:) v1 v2 -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 - (coe du_go_88 (coe v1) (coe v2)) + (coe du_go_110 (coe v1) (coe v2)) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.Trace._.go -d_go_88 :: +d_go_110 :: MAlonzo.Code.Utils.T__'215'__428 - T_SimplifierTag_4 + (MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_52 + T_Hints_74 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208)) -> [MAlonzo.Code.Utils.T__'215'__428 - T_SimplifierTag_4 + (MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_52 + T_Hints_74 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> MAlonzo.Code.Utils.T__'215'__428 - T_SimplifierTag_4 + (MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_52 + T_Hints_74 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208)) -> [MAlonzo.Code.Utils.T__'215'__428 - T_SimplifierTag_4 + (MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_52 + T_Hints_74 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> - T_Trace_60 -d_go_88 ~v0 ~v1 v2 v3 = du_go_88 v2 v3 -du_go_88 :: + T_Trace_82 +d_go_110 ~v0 ~v1 v2 v3 = du_go_110 v2 v3 +du_go_110 :: MAlonzo.Code.Utils.T__'215'__428 - T_SimplifierTag_4 + (MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_52 + T_Hints_74 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208)) -> [MAlonzo.Code.Utils.T__'215'__428 - T_SimplifierTag_4 + (MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_10) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_52 + T_Hints_74 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> - T_Trace_60 -du_go_88 v0 v1 + T_Trace_82 +du_go_110 v0 v1 = case coe v0 of MAlonzo.Code.Utils.C__'44'__442 v2 v3 -> case coe v3 of @@ -238,7 +309,7 @@ du_go_88 v0 v1 -> case coe v1 of [] -> coe - C_step_64 (coe v2) (coe v4) (coe v6) (coe C_done_66 (coe v7)) + C_step_86 (coe v2) (coe v4) (coe v6) (coe C_done_88 (coe v7)) (:) v8 v9 -> case coe v8 of MAlonzo.Code.Utils.C__'44'__442 v10 v11 @@ -247,9 +318,9 @@ du_go_88 v0 v1 -> case coe v13 of MAlonzo.Code.Utils.C__'44'__442 v14 v15 -> coe - C_step_64 (coe v2) (coe v4) (coe v6) + C_step_86 (coe v2) (coe v4) (coe v6) (coe - du_go_88 + du_go_110 (coe MAlonzo.Code.Utils.C__'44'__442 (coe v10) @@ -268,18 +339,18 @@ du_go_88 v0 v1 _ -> MAlonzo.RTE.mazUnreachableError _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.Trace.EvalResult -d_EvalResult_114 = () -type T_EvalResult_114 = EvalResult -pattern C_success_116 a0 a1 = EvalSuccess a0 a1 -pattern C_failure_118 a0 a1 a2 = EvalFailure a0 a1 a2 -check_success_116 :: Integer -> Integer -> T_EvalResult_114 -check_success_116 = EvalSuccess -check_failure_118 :: +d_EvalResult_136 = () +type T_EvalResult_136 = EvalResult +pattern C_success_138 a0 a1 = EvalSuccess a0 a1 +pattern C_failure_140 a0 a1 a2 = EvalFailure a0 a1 a2 +check_success_138 :: Integer -> Integer -> T_EvalResult_136 +check_success_138 = EvalSuccess +check_failure_140 :: MAlonzo.Code.Agda.Builtin.String.T_String_6 -> - Integer -> Integer -> T_EvalResult_114 -check_failure_118 = EvalFailure -cover_EvalResult_114 :: EvalResult -> () -cover_EvalResult_114 x + Integer -> Integer -> T_EvalResult_136 +check_failure_140 = EvalFailure +cover_EvalResult_136 :: EvalResult -> () +cover_EvalResult_136 x = case x of EvalSuccess _ _ -> () EvalFailure _ _ _ -> () diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs index 590cf608646..f58c0107bde 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs @@ -24,6 +24,7 @@ import qualified MAlonzo.Code.Relation.Nullary.Decidable.Core import qualified MAlonzo.Code.Relation.Nullary.Reflects import qualified MAlonzo.Code.Untyped import qualified MAlonzo.Code.Untyped.Reduction +import qualified MAlonzo.Code.Utils import qualified MAlonzo.Code.VerifiedCompilation.Certificate import qualified MAlonzo.Code.VerifiedCompilation.Trace import qualified MAlonzo.Code.VerifiedCompilation.UntypedTranslation @@ -43,7 +44,7 @@ d_a2c'63''7580''7580'_24 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40) (coe d_a2c'63'_32) -- VerifiedCompilation.UApplyToCase.a2c? d_a2c'63'_32 :: @@ -74,38 +75,31 @@ d_a2c'63'_32 v0 v1 v2 MAlonzo.Code.Untyped.C_'96'_18 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20) v1 - v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 MAlonzo.Code.Untyped.C_ƛ_20 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20) v1 - v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 MAlonzo.Code.Untyped.C__'183'__22 v5 v6 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20) v1 - v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 MAlonzo.Code.Untyped.C_force_24 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20) v1 - v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 MAlonzo.Code.Untyped.C_delay_26 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20) v1 - v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 MAlonzo.Code.Untyped.C_con_28 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20) v1 - v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 MAlonzo.Code.Untyped.C_constr_34 v5 v6 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20) v1 - v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 MAlonzo.Code.Untyped.C_case_40 v5 v6 -> let v7 = coe @@ -247,21 +241,18 @@ d_a2c'63'_32 v0 v1 v2 seq (coe v12) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20) + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError) MAlonzo.Code.Untyped.C_builtin_44 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20) v1 - v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 MAlonzo.Code.Untyped.C_error_46 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_20) v1 - v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError)) -- VerifiedCompilation.UApplyToCase..extendedlambda0 d_'46'extendedlambda0_48 :: @@ -283,7 +274,9 @@ d_'46'extendedlambda1_94 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> T_ApplyToCase_4 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs index bae548fe205..5470b645dbb 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs @@ -22,6 +22,7 @@ import qualified MAlonzo.Code.Relation.Nullary.Decidable.Core import qualified MAlonzo.Code.Relation.Nullary.Reflects import qualified MAlonzo.Code.Untyped import qualified MAlonzo.Code.Untyped.RenamingSubstitution +import qualified MAlonzo.Code.Utils import qualified MAlonzo.Code.VerifiedCompilation.Certificate import qualified MAlonzo.Code.VerifiedCompilation.Trace import qualified MAlonzo.Code.VerifiedCompilation.UntypedTranslation @@ -46,7 +47,7 @@ d_isUntypedCSE'63'_26 :: d_isUntypedCSE'63'_26 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 - (coe v0) (coe MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_18) + (coe v0) (coe MAlonzo.Code.VerifiedCompilation.Trace.d_cseTag_38) (coe d_isUCSE'63'_30) -- VerifiedCompilation.UCSE.isUCSE? d_isUCSE'63'_30 :: @@ -115,7 +116,7 @@ d_isUCSE'63'_30 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_18) v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_cseTag_38 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UCSE..extendedlambda0 d_'46'extendedlambda0_46 :: @@ -136,7 +137,9 @@ d_'46'extendedlambda1_78 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> T_UCSE_4 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda1_78 = erased diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs index 9be5cf8da35..6381378e2cc 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs @@ -26,6 +26,7 @@ import qualified MAlonzo.Code.Relation.Nullary.Decidable.Core import qualified MAlonzo.Code.Relation.Nullary.Reflects import qualified MAlonzo.Code.Untyped import qualified MAlonzo.Code.Untyped.Equality +import qualified MAlonzo.Code.Utils import qualified MAlonzo.Code.VerifiedCompilation.Certificate import qualified MAlonzo.Code.VerifiedCompilation.Trace import qualified MAlonzo.Code.VerifiedCompilation.UntypedTranslation @@ -473,7 +474,7 @@ d_isCaseOfCase'63'_256 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_caseOfCaseT_12) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42) (coe d_isCoC'63'_264) -- VerifiedCompilation.UCaseOfCase.isCoC? d_isCoC'63'_264 :: @@ -584,7 +585,7 @@ d_isCoC'63'_264 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_caseOfCaseT_12) + MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42) (coe d_isCaseOfCase'63'_256 (coe @@ -601,7 +602,7 @@ d_isCoC'63'_264 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_caseOfCaseT_12) + MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42) (coe d_isCaseOfCase'63'_256 (coe @@ -618,7 +619,7 @@ d_isCoC'63'_264 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_caseOfCaseT_12) + MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42) (coe d_isCaseOfCase'63'_256 (coe @@ -667,8 +668,7 @@ d_isCoC'63'_264 v0 v1 v2 v40) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_caseOfCaseT_12) + MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42 (coe MAlonzo.Code.Untyped.C_case_40 (coe @@ -740,8 +740,7 @@ d_isCoC'63'_264 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_caseOfCaseT_12) v1 - v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UCaseOfCase..extendedlambda4 d_'46'extendedlambda4_280 :: @@ -780,7 +779,9 @@ d_'46'extendedlambda6_444 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -801,7 +802,9 @@ d_'46'extendedlambda7_524 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> @@ -823,7 +826,9 @@ d_'46'extendedlambda8_608 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs index f3a5c043e91..0d61b226ee6 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs @@ -29,6 +29,7 @@ import qualified MAlonzo.Code.Relation.Nullary.Reflects import qualified MAlonzo.Code.Untyped import qualified MAlonzo.Code.Untyped.CEK import qualified MAlonzo.Code.Untyped.Reduction +import qualified MAlonzo.Code.Utils import qualified MAlonzo.Code.VerifiedCompilation.Certificate import qualified MAlonzo.Code.VerifiedCompilation.Trace import qualified MAlonzo.Code.VerifiedCompilation.UntypedTranslation @@ -49,7 +50,7 @@ d_isCaseReduce'63'_26 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_14) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_caseReduceTag_34) (coe d_isCR'63'_42) -- VerifiedCompilation.UCaseReduce.justEq d_justEq_34 :: @@ -132,8 +133,7 @@ d_isCR'63'_42 v0 v1 v2 MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_14) + MAlonzo.Code.VerifiedCompilation.Trace.d_caseReduceTag_34 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError))) _ -> MAlonzo.RTE.mazUnreachableError @@ -145,8 +145,7 @@ d_isCR'63'_42 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_14) v1 - v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_caseReduceTag_34 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UCaseReduce..extendedlambda0 d_'46'extendedlambda0_58 :: @@ -191,7 +190,9 @@ d_'46'extendedlambda3_142 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs index 4b110408696..b2b79403104 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs @@ -31,6 +31,7 @@ import qualified MAlonzo.Code.Relation.Nullary.Decidable.Core import qualified MAlonzo.Code.Relation.Nullary.Reflects import qualified MAlonzo.Code.Untyped import qualified MAlonzo.Code.Untyped.Purity +import qualified MAlonzo.Code.Utils import qualified MAlonzo.Code.VerifiedCompilation.Certificate import qualified MAlonzo.Code.VerifiedCompilation.Trace import qualified MAlonzo.Code.VerifiedCompilation.UntypedTranslation @@ -540,7 +541,7 @@ d_isFloatDelay'63'_488 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_6) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_28) (coe d_isFlD'63'_492) -- VerifiedCompilation.UFloatDelay.isFlD? d_isFlD'63'_492 :: @@ -696,8 +697,7 @@ d_isFlD'63'_492 v0 v1 v2 v38) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_6) + MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_28 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) @@ -726,8 +726,7 @@ d_isFlD'63'_492 v0 v1 v2 v21) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_6) + MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_28 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -742,7 +741,7 @@ d_isFlD'63'_492 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_6) v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_28 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UFloatDelay..extendedlambda8 d_'46'extendedlambda8_508 :: @@ -772,7 +771,9 @@ d_'46'extendedlambda10_582 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -788,7 +789,9 @@ d_'46'extendedlambda11_630 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs index 0ea9d7c7a96..871ee8402b8 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs @@ -27,6 +27,7 @@ import qualified MAlonzo.Code.Data.List.Relation.Unary.All import qualified MAlonzo.Code.Relation.Nullary.Decidable.Core import qualified MAlonzo.Code.Relation.Nullary.Reflects import qualified MAlonzo.Code.Untyped +import qualified MAlonzo.Code.Utils import qualified MAlonzo.Code.VerifiedCompilation.Certificate import qualified MAlonzo.Code.VerifiedCompilation.Trace import qualified MAlonzo.Code.VerifiedCompilation.UntypedTranslation @@ -166,7 +167,7 @@ d_isForceCaseDelay'63'_94 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_10) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32) (coe d_isFCD'63'_96) -- VerifiedCompilation.UForceCaseDelay.isFCD? d_isFCD'63'_96 :: @@ -270,7 +271,7 @@ d_isFCD'63'_96 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_10) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32) (coe d_isForceCaseDelay'63'_94 (coe @@ -297,16 +298,14 @@ d_isFCD'63'_96 v0 v1 v2 MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 v36 v37 v38 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_10) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError) MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 v34 v35 v36 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_10) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError) @@ -317,8 +316,7 @@ d_isFCD'63'_96 v0 v1 v2 v28) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_10) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError))) @@ -329,8 +327,7 @@ d_isFCD'63'_96 v0 v1 v2 seq (coe v18) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_10) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError))) _ -> MAlonzo.RTE.mazUnreachableError @@ -342,8 +339,8 @@ d_isFCD'63'_96 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_10) - v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 v1 + v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UForceCaseDelay..extendedlambda1 d_'46'extendedlambda1_112 :: @@ -384,7 +381,9 @@ d_'46'extendedlambda4_228 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> @@ -401,7 +400,9 @@ d_'46'extendedlambda5_280 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs index 0ba426e9771..fc14f306035 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs @@ -26,6 +26,7 @@ import qualified MAlonzo.Code.Relation.Nullary.Reflects import qualified MAlonzo.Code.Untyped import qualified MAlonzo.Code.Untyped.Purity import qualified MAlonzo.Code.Untyped.RenamingSubstitution +import qualified MAlonzo.Code.Utils import qualified MAlonzo.Code.VerifiedCompilation.Certificate import qualified MAlonzo.Code.VerifiedCompilation.Trace import qualified MAlonzo.Code.VerifiedCompilation.UntypedTranslation @@ -582,7 +583,7 @@ d_isForceDelay'63'_178 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30) (coe (\ v1 -> d_isFD'63'_184 (coe v1) (coe C_'9633'_82))) -- VerifiedCompilation.UForceDelay.isFD? d_isFD'63'_184 :: @@ -744,8 +745,7 @@ d_isFD'63'_184 v0 v1 v2 v3 seq (coe v9) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError) @@ -1114,8 +1114,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v87) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError) @@ -1147,8 +1146,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v80) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 v16 v22) _ -> MAlonzo.RTE.mazUnreachableError @@ -1159,8 +1157,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v77) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 v43 v59) _ -> MAlonzo.RTE.mazUnreachableError))))) @@ -1332,8 +1329,7 @@ d_isFD'63'_184 v0 v1 v2 v3 seq (coe v13) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -1855,8 +1851,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v98) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 v15 v3) _ -> MAlonzo.RTE.mazUnreachableError) @@ -1888,8 +1883,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v91) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 v27 v33) _ -> MAlonzo.RTE.mazUnreachableError @@ -1900,8 +1894,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v88) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 v54 v70) _ -> MAlonzo.RTE.mazUnreachableError))))) @@ -2092,8 +2085,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v24) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 v15 v3) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -2236,8 +2228,7 @@ d_isFD'63'_184 v0 v1 v2 v3 seq (coe v14) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_8) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -2262,7 +2253,9 @@ d_'46'extendedlambda2_246 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda2_246 = erased @@ -2278,7 +2271,9 @@ d_'46'extendedlambda3_320 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.VerifiedCompilation.UntypedViews.T_isForce_270 -> @@ -2295,7 +2290,9 @@ d_'46'extendedlambda4_348 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2323,7 +2320,9 @@ d_'46'extendedlambda6_476 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2333,7 +2332,9 @@ d_'46'extendedlambda6_476 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda6_476 = erased @@ -2351,7 +2352,9 @@ d_'46'extendedlambda7_518 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda7_518 = erased @@ -2376,7 +2379,9 @@ d_'46'extendedlambda8_634 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2403,7 +2408,9 @@ d_'46'extendedlambda9_688 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2425,7 +2432,9 @@ d_'46'extendedlambda10_750 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2435,7 +2444,9 @@ d_'46'extendedlambda10_750 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2457,7 +2468,9 @@ d_'46'extendedlambda11_814 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2466,7 +2479,9 @@ d_'46'extendedlambda11_814 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2489,7 +2504,9 @@ d_'46'extendedlambda12_880 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Builtin.T_Builtin_2 -> @@ -2497,7 +2514,9 @@ d_'46'extendedlambda12_880 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2525,7 +2544,9 @@ d_'46'extendedlambda13_1034 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2544,7 +2565,9 @@ d_'46'extendedlambda14_1074 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2559,13 +2582,17 @@ d_'46'extendedlambda15_1190 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2581,7 +2608,9 @@ d_'46'extendedlambda16_1214 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2598,7 +2627,9 @@ d_'46'extendedlambda17_1238 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2628,7 +2659,9 @@ d_'46'extendedlambda19_1340 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.VerifiedCompilation.UntypedViews.T_isDelay_356 -> @@ -2646,13 +2679,17 @@ d_'46'extendedlambda20_1454 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2667,7 +2704,9 @@ d_'46'extendedlambda21_1480 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2683,7 +2722,9 @@ d_'46'extendedlambda22_1506 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2699,7 +2740,9 @@ d_'46'extendedlambda23_1574 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2735,7 +2778,9 @@ d_'46'extendedlambda25_1698 :: MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.VerifiedCompilation.UntypedViews.T_isForce_270 -> @@ -2756,7 +2801,9 @@ d_'46'extendedlambda26_1732 :: (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs index ab7d12d0933..fec8c09e8d0 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs @@ -297,7 +297,7 @@ d_checkPointwise_304 :: Integer -> T__'8605'_28 -> T__'8605'_28 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46] -> (MAlonzo.Code.Data.Fin.Base.T_Fin_10 -> MAlonzo.Code.Untyped.T__'8866'_14) -> T__'8829'__102 -> @@ -308,7 +308,7 @@ d_checkPointwise_304 v0 v1 v2 v3 v4 v5 v6 v7 = let v8 = coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_16) v6 v7 in + MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 v6 v7 in coe (case coe v3 of [] @@ -354,7 +354,7 @@ d_check_316 :: Integer -> T__'8605'_28 -> T__'8605'_28 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> (MAlonzo.Code.Data.Fin.Base.T_Fin_10 -> MAlonzo.Code.Untyped.T__'8866'_14) -> T__'8829'__102 -> @@ -365,10 +365,10 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 = let v8 = coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_16) v6 v7 in + MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 v6 v7 in coe (case coe v3 of - MAlonzo.Code.VerifiedCompilation.Trace.C_var_26 + MAlonzo.Code.VerifiedCompilation.Trace.C_var_48 -> case coe v6 of MAlonzo.Code.Untyped.C_'96'_18 v9 -> case coe v7 of @@ -385,8 +385,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 -> let v15 = coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_16) + MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 v6 v7 in coe (case coe v13 of @@ -419,8 +418,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_16) + MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 v6 v6 _ -> MAlonzo.RTE.mazUnreachableError) _ -> coe v15 @@ -431,7 +429,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> MAlonzo.RTE.mazUnreachableError)) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_expand_28 v9 + MAlonzo.Code.VerifiedCompilation.Trace.C_expand_50 v9 -> case coe v6 of MAlonzo.Code.Untyped.C_'96'_18 v10 -> coe @@ -445,7 +443,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 MAlonzo.Code.VerifiedCompilation.Certificate.C_proof_72 (coe C_'96''8595'_234 v11))) _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_30 v9 + MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_52 v9 -> case coe v5 of C_'9633'_106 -> case coe v6 of @@ -507,7 +505,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> coe v8 _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ'8595'_32 v9 + MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ'8595'_54 v9 -> case coe v5 of C_drop_122 v13 -> case coe v1 of @@ -547,7 +545,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> coe v8 _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C__'183'__34 v9 v10 + MAlonzo.Code.VerifiedCompilation.Trace.C__'183'__56 v9 v10 -> case coe v6 of MAlonzo.Code.Untyped.C__'183'__22 v11 v12 -> case coe v7 of @@ -572,7 +570,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 (coe C__'183'__250 v15 v16))))) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C__'183''8595'_36 v9 + MAlonzo.Code.VerifiedCompilation.Trace.C__'183''8595'_58 v9 -> case coe v6 of MAlonzo.Code.Untyped.C__'183'__22 v10 v11 -> coe @@ -587,7 +585,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 MAlonzo.Code.VerifiedCompilation.Certificate.C_proof_72 (coe C__'183''8595'_254 v12))) _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_force_38 v9 + MAlonzo.Code.VerifiedCompilation.Trace.C_force_60 v9 -> case coe v6 of MAlonzo.Code.Untyped.C_force_24 v10 -> case coe v7 of @@ -604,7 +602,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 (coe C_force_258 v12))) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_delay_40 v9 + MAlonzo.Code.VerifiedCompilation.Trace.C_delay_62 v9 -> case coe v6 of MAlonzo.Code.Untyped.C_delay_26 v10 -> case coe v7 of @@ -621,7 +619,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 (coe C_delay_262 v12))) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_con_42 + MAlonzo.Code.VerifiedCompilation.Trace.C_con_64 -> case coe v6 of MAlonzo.Code.Untyped.C_con_28 v9 -> case coe v7 of @@ -642,13 +640,12 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v13) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_16) + MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 v6 v7) _ -> MAlonzo.RTE.mazUnreachableError) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_builtin_44 + MAlonzo.Code.VerifiedCompilation.Trace.C_builtin_66 -> case coe v6 of MAlonzo.Code.Untyped.C_builtin_44 v9 -> case coe v7 of @@ -668,13 +665,12 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v13) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_16) + MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 v6 v7) _ -> MAlonzo.RTE.mazUnreachableError) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_error_46 + MAlonzo.Code.VerifiedCompilation.Trace.C_error_68 -> case coe v6 of MAlonzo.Code.Untyped.C_error_46 -> case coe v7 of @@ -684,7 +680,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 (coe C_error_292) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_constr_48 v9 + MAlonzo.Code.VerifiedCompilation.Trace.C_constr_70 v9 -> case coe v6 of MAlonzo.Code.Untyped.C_constr_34 v10 v11 -> case coe v7 of @@ -721,13 +717,12 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v16) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_16) + MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 v6 v7) _ -> MAlonzo.RTE.mazUnreachableError) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_case_50 v9 v10 + MAlonzo.Code.VerifiedCompilation.Trace.C_case_72 v9 v10 -> case coe v6 of MAlonzo.Code.Untyped.C_case_40 v11 v12 -> case coe v7 of @@ -755,7 +750,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UInline.top-check d_top'45'check_718 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.VerifiedCompilation.Certificate.T_Proof'63'_66 @@ -845,7 +840,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 C_'96'_230 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_var_26) erased + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_var_48) erased C_'96''8595'_234 v14 -> case coe v5 of MAlonzo.Code.Untyped.C_'96'_18 v15 @@ -858,7 +853,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 v17 v18 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_expand_28 (coe v17)) + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_expand_50 (coe v17)) erased _ -> MAlonzo.RTE.mazUnreachableError) _ -> MAlonzo.RTE.mazUnreachableError @@ -883,7 +878,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_30 (coe v15)) + MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_52 (coe v15)) erased _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError @@ -922,7 +917,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_30 + MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_52 (coe v27)) erased _ -> MAlonzo.RTE.mazUnreachableError) @@ -967,7 +962,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ'8595'_32 + MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ'8595'_54 (coe v26)) erased _ -> MAlonzo.RTE.mazUnreachableError) @@ -998,7 +993,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C__'183'__34 + MAlonzo.Code.VerifiedCompilation.Trace.C__'183'__56 (coe v24) (coe v26)) erased _ -> MAlonzo.RTE.mazUnreachableError @@ -1019,7 +1014,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C__'183''8595'_36 (coe v19)) + MAlonzo.Code.VerifiedCompilation.Trace.C__'183''8595'_58 (coe v19)) erased _ -> MAlonzo.RTE.mazUnreachableError) _ -> MAlonzo.RTE.mazUnreachableError @@ -1038,7 +1033,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_force_38 (coe v18)) + MAlonzo.Code.VerifiedCompilation.Trace.C_force_60 (coe v18)) erased _ -> MAlonzo.RTE.mazUnreachableError) _ -> MAlonzo.RTE.mazUnreachableError @@ -1058,7 +1053,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_delay_40 (coe v18)) + MAlonzo.Code.VerifiedCompilation.Trace.C_delay_62 (coe v18)) erased _ -> MAlonzo.RTE.mazUnreachableError) _ -> MAlonzo.RTE.mazUnreachableError @@ -1066,11 +1061,11 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 C_con_266 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_con_42) erased + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_con_64) erased C_builtin_270 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_builtin_44) erased + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_builtin_66) erased C_constr_280 v15 -> case coe v5 of MAlonzo.Code.Untyped.C_constr_34 v16 v17 @@ -1086,7 +1081,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_constr_48 + MAlonzo.Code.VerifiedCompilation.Trace.C_constr_70 (coe v21)) erased _ -> MAlonzo.RTE.mazUnreachableError) @@ -1114,7 +1109,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_case_50 + MAlonzo.Code.VerifiedCompilation.Trace.C_case_72 (coe v24) (coe v26)) erased _ -> MAlonzo.RTE.mazUnreachableError @@ -1128,7 +1123,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v6) (coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_error_46) erased)) + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_error_68) erased)) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.UInline._.e′ d_e'8242'_844 :: @@ -1142,7 +1137,7 @@ d_e'8242'_844 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_844 = erased @@ -1166,7 +1161,7 @@ d_e'8242'_906 :: MAlonzo.Code.Data.Fin.Base.T_Fin_10 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_906 = erased @@ -1178,7 +1173,7 @@ d_e'8242'_940 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_940 = erased @@ -1194,7 +1189,7 @@ d_e'8242'_982 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_982 = erased @@ -1212,9 +1207,9 @@ d_e'8243'_1036 :: MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8243'_1036 = erased @@ -1226,7 +1221,7 @@ d_e'8242'_1078 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> T__'8605'_28 -> T__'8605'_28 -> @@ -1240,7 +1235,7 @@ d_e'8242'_1116 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> T__'8605'_28 -> T__'8605'_28 -> @@ -1276,7 +1271,7 @@ d_e'8242'_1190 :: [MAlonzo.Code.Untyped.T__'8866'_14] -> [MAlonzo.Code.Untyped.T__'8866'_14] -> MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base.T_Pointwise_48 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46] -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> T__'8605'_28 -> T__'8605'_28 -> @@ -1294,9 +1289,9 @@ d_e'8243'_1248 :: [MAlonzo.Code.Untyped.T__'8866'_14] -> T_Inline_224 -> MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base.T_Pointwise_48 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46] -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> T__'8605'_28 -> T__'8605'_28 -> @@ -1314,7 +1309,7 @@ d_e'8242'_1298 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_1298 = erased @@ -1332,9 +1327,9 @@ d_e'8243'_1356 :: [MAlonzo.Code.Untyped.T__'8866'_14] -> T_Inline_224 -> MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base.T_Pointwise_48 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_24] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46] -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8243'_1356 = erased diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs index 57de8b26a42..2b0eeadfe3b 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs @@ -29,6 +29,7 @@ import qualified MAlonzo.Code.Relation.Nullary.Decidable.Core import qualified MAlonzo.Code.Relation.Nullary.Reflects import qualified MAlonzo.Code.Untyped import qualified MAlonzo.Code.Untyped.Equality +import qualified MAlonzo.Code.Utils import qualified MAlonzo.Code.VerifiedCompilation.Certificate import qualified MAlonzo.Code.VerifiedCompilation.Trace @@ -84,7 +85,9 @@ d_translation'63'_164 :: (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> ()) -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -96,7 +99,9 @@ d_translation'63'_164 v0 ~v1 v2 v3 v4 v5 = du_translation'63'_164 v0 v2 v3 v4 v5 du_translation'63'_164 :: Integer -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2826,7 +2831,9 @@ d_decPointwiseTranslation'63'_176 :: (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> ()) -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2838,7 +2845,9 @@ d_decPointwiseTranslation'63'_176 v0 ~v1 v2 v3 v4 v5 = du_decPointwiseTranslation'63'_176 v0 v2 v3 v4 v5 du_decPointwiseTranslation'63'_176 :: Integer -> - MAlonzo.Code.VerifiedCompilation.Trace.T_SimplifierTag_4 -> + MAlonzo.Code.Utils.T_Either_6 + MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> diff --git a/plutus-metatheory/src/VerifiedCompilation.lagda.md b/plutus-metatheory/src/VerifiedCompilation.lagda.md index f7f33b0ea6f..240b32a0871 100644 --- a/plutus-metatheory/src/VerifiedCompilation.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation.lagda.md @@ -69,43 +69,42 @@ We map a `SimplifierTag` to the corresponding translation relation, or `nothing` if we don't have a translation relation. ``` -mRelationOf : SimplifierTag → Maybe (0 ⊢ → 0 ⊢ → Set) -mRelationOf floatDelayT = just UFlD.FloatDelay -mRelationOf forceDelayT = just UFD.ForceDelay -mRelationOf caseReduceT = just UCR.UCaseReduce -mRelationOf cseT = just UCSE.UntypedCSE -mRelationOf inlineT = just (UInline.Inline (λ()) UInline.□) -mRelationOf unknown = nothing -mRelationOf caseOfCaseT = nothing -- FIXME: https://github.com/IntersectMBO/plutus-private/issues/2054 -mRelationOf forceCaseDelayT = just UFCD.ForceCaseDelay -mRelationOf applyToCaseT = just UA2C.UApplyToCase +-- TODO: this should be enforced at the type level somehow +f : ICSimplifierTag → (0 ⊢ → 0 ⊢ → Set) +f floatDelayT = UFlD.FloatDelay +f forceDelayT = UFD.ForceDelay +f forceCaseDelayT = UFCD.ForceCaseDelay +f caseReduceT = UCR.UCaseReduce +f inlineT = UInline.Inline (λ()) UInline.□ +f cseT = UCSE.UntypedCSE +f applyToCaseT = UA2C.UApplyToCase ``` We default to the `NotImplemented` relation to give each `SimplifierTag` a relation: ``` RelationOf : SimplifierTag → (0 ⊢ → 0 ⊢ → Set) -RelationOf = fromMaybe (NotImplemented accept) ∘ mRelationOf +RelationOf (inj₁ _) = NotImplemented accept +RelationOf (inj₂ tag) = f tag hasRelation : SimplifierTag → Bool -hasRelation = is-just ∘ mRelationOf -{-# COMPILE GHC hasRelation as certifierImplements #-} +hasRelation (inj₁ _) = false +hasRelation (inj₂ _) = true ``` The corresponding certifier can then be called for a given pass: ``` certifyPass : (pass : SimplifierTag) → Hints → (M M' : 0 ⊢) → CertResult (RelationOf pass M M') -certifyPass floatDelayT _ = decider UFlD.isFloatDelay? -certifyPass forceDelayT _ = decider UFD.isForceDelay? -certifyPass caseReduceT _ = decider UCR.isCaseReduce? -certifyPass cseT _ = decider UCSE.isUntypedCSE? -certifyPass caseOfCaseT _ = certNotImplemented -certifyPass forceCaseDelayT _ = decider UFCD.isForceCaseDelay? -certifyPass applyToCaseT _ = decider UA2C.a2c?ᶜᶜ -certifyPass inlineT (inline hs) = checker (UInline.top-check hs) -certifyPass inlineT none = λ M M' → abort inlineT M M' -certifyPass unknown _ = certNotImplemented +certifyPass (inj₁ _) _ = certNotImplemented +certifyPass (inj₂ floatDelayT) _ = decider UFlD.isFloatDelay? +certifyPass (inj₂ forceDelayT) _ = decider UFD.isForceDelay? +certifyPass (inj₂ forceCaseDelayT) _ = decider UFCD.isForceCaseDelay? +certifyPass (inj₂ caseReduceT) _ = decider UCR.isCaseReduce? +certifyPass (inj₂ inlineT) (inline hs) = checker (UInline.top-check hs) +certifyPass (inj₂ inlineT) none = λ M M' → abort inlineTag M M' +certifyPass (inj₂ cseT) _ = decider UCSE.isUntypedCSE? +certifyPass (inj₂ applyToCaseT) _ = decider UA2C.a2c?ᶜᶜ ``` A `Certificate t` states the main theorem of a trace `t`: a sequence (product) diff --git a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md index 11ff91b17c7..243efdb4669 100644 --- a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md @@ -22,19 +22,45 @@ open Maybe We enumerate the known passes: ``` -data SimplifierTag : Set where - floatDelayT : SimplifierTag - forceDelayT : SimplifierTag - forceCaseDelayT : SimplifierTag - caseOfCaseT : SimplifierTag - caseReduceT : SimplifierTag - inlineT : SimplifierTag - cseT : SimplifierTag - applyToCaseT : SimplifierTag - unknown : SimplifierTag -- a placeholder for passes that we don't yet know of, so the certifier doesn't break if a pass was added + +data NICSimplifierTag : Set where + caseOfCaseT : NICSimplifierTag + unknown : NICSimplifierTag -- a placeholder for passes that we don't yet know of, so the certifier doesn't break if a pass was added + +data ICSimplifierTag : Set where + floatDelayT : ICSimplifierTag + forceDelayT : ICSimplifierTag + forceCaseDelayT : ICSimplifierTag + caseReduceT : ICSimplifierTag + inlineT : ICSimplifierTag + cseT : ICSimplifierTag + applyToCaseT : ICSimplifierTag + +SimplifierTag = Utils.Either NICSimplifierTag ICSimplifierTag + +floatDelayTag : SimplifierTag +floatDelayTag = Utils.inj₂ floatDelayT +forceDelayTag : SimplifierTag +forceDelayTag = Utils.inj₂ forceDelayT +forceCaseDelayTag : SimplifierTag +forceCaseDelayTag = Utils.inj₂ forceCaseDelayT +caseReduceTag : SimplifierTag +caseReduceTag = Utils.inj₂ caseReduceT +inlineTag : SimplifierTag +inlineTag = Utils.inj₂ inlineT +cseTag : SimplifierTag +cseTag = Utils.inj₂ cseT +applyToCaseTag : SimplifierTag +applyToCaseTag = Utils.inj₂ applyToCaseT + +caseOfCaseTag : SimplifierTag +caseOfCaseTag = Utils.inj₁ caseOfCaseT +unknownTag : SimplifierTag +unknownTag = Utils.inj₁ unknown {-# FOREIGN GHC import UntypedPlutusCore.Transform.Simplifier #-} -{-# COMPILE GHC SimplifierTag = data SimplifierStage (FloatDelay | ForceDelay | ForceCaseDelay | CaseOfCase | CaseReduce | Inline | CSE | ApplyToCase | Unknown) #-} +{-# COMPILE GHC ICSimplifierTag = data ICSimplifierStage (FloatDelay | ForceDelay | ForceCaseDelay | CaseReduce | Inline | CSE | ApplyToCase) #-} +{-# COMPILE GHC NICSimplifierTag = data NICSimplifierStage (CaseOfCase | Unknown) #-} ``` ## Hints diff --git a/plutus-metatheory/src/VerifiedCompilation/UApplyToCase.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UApplyToCase.lagda.md index 07ef45abba2..20ac9cdedd7 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UApplyToCase.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UApplyToCase.lagda.md @@ -20,7 +20,7 @@ module VerifiedCompilation.UApplyToCase where ``` open import Untyped using (_⊢; case; constr) open import Untyped.Reduction using (iterApp) -open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; applyToCaseT) +open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; applyToCaseTag) open import VerifiedCompilation.UCaseReduce using (justEq) open import VerifiedCompilation.UntypedViews open import VerifiedCompilation.UntypedTranslation using (Translation; translation?; Relation) @@ -60,13 +60,13 @@ a2c?ᶜᶜ : {n : ℕ} → (M N : n ⊢) → ProofOrCE (Translation ApplyToCase a2c? : {n : ℕ} → (M N : n ⊢) → ProofOrCE (ApplyToCase M N) a2c? M N with (case? (constr? (_≟_ 0) (⋯ ∷? ⋯)) singleton?) N -... | no ¬p = ce (λ { (a2c _) → ¬p inhabitant } ) applyToCaseT M N +... | no ¬p = ce (λ { (a2c _) → ¬p inhabitant } ) applyToCaseTag M N ... | yes (case! (constr! refl (match! x ∷! match! xs)) (match! M' ∷! []!)) with a2c?ᶜᶜ M (iterApp M' (x ∷ xs)) ... | proof p = proof (a2c p) ... | ce ¬p tag L L′ = ce (λ { (a2c p) → ¬p p }) tag L L′ -a2c?ᶜᶜ = translation? applyToCaseT a2c? +a2c?ᶜᶜ = translation? applyToCaseTag a2c? UApplyToCase : Relation UApplyToCase = Translation ApplyToCase diff --git a/plutus-metatheory/src/VerifiedCompilation/UCSE.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UCSE.lagda.md index 04f0e42ebcb..021f6c09159 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UCSE.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UCSE.lagda.md @@ -27,7 +27,7 @@ open import Data.Empty using (⊥) open import Agda.Builtin.Maybe using (Maybe; just; nothing) open import Untyped.RenamingSubstitution using (_[_]) open import Untyped.Purity using (Pure; isPure?) -open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; cseT) +open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; cseTag) ``` ## Translation Relation @@ -61,9 +61,9 @@ isUntypedCSE? : {X : ℕ} → DecidableCE (Translation UCSE {X}) {-# TERMINATING #-} isUCSE? : {X : ℕ} → DecidableCE (UCSE {X}) isUCSE? ast ast' with (isApp? (isLambda? isTerm?) isTerm?) ast' -... | no ¬match = ce (λ { (cse pt) → ¬match (isapp (islambda (isterm _)) (isterm _))}) cseT ast ast' +... | no ¬match = ce (λ { (cse pt) → ¬match (isapp (islambda (isterm _)) (isterm _))}) cseTag ast ast' ... | yes (isapp (islambda (isterm x')) (isterm e)) with (isUntypedCSE? ast (x' [ e ])) ... | ce ¬p t b a = ce (λ { (cse pt) → ¬p pt}) t b a ... | proof p = proof (cse p) -isUntypedCSE? = translation? cseT isUCSE? +isUntypedCSE? = translation? cseTag isUCSE? ``` diff --git a/plutus-metatheory/src/VerifiedCompilation/UCaseOfCase.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UCaseOfCase.lagda.md index 25e4edacf7f..d1fbc30e0d7 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UCaseOfCase.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UCaseOfCase.lagda.md @@ -14,7 +14,7 @@ module VerifiedCompilation.UCaseOfCase where open import Untyped.Equality using (DecEq; _≟_; decPointwise) open import VerifiedCompilation.UntypedViews using (Pred; isCase?; isApp?; isForce?; isBuiltin?; isConstr?; isDelay?; isTerm?; allTerms?; iscase; isapp; isforce; isbuiltin; isconstr; isterm; allterms; isdelay) open import VerifiedCompilation.UntypedTranslation using (Translation; translation?; Relation) -open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; caseOfCaseT) +open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; caseOfCaseTag) import Relation.Binary as Binary using (Decidable) import Relation.Unary as Unary using (Decidable) @@ -104,18 +104,18 @@ isCaseOfCase? : {X : ℕ} (ast ast' : X ⊢) → ProofOrCE (Translation CoC {X} isCoC? : {X : ℕ} (ast ast' : X ⊢) → ProofOrCE (CoC {X} ast ast') isCoC? ast ast' with (isCoCCase? ast) ×-dec (isCoCForce? ast') ... | no ¬cf = ce (λ { (isCoC b tn fn tt tt' ft ft' alts alts' x x₁ x₂) → ¬cf - (isCoCCase b tn fn tt ft alts , isCoCForce b tn fn tt' ft' alts') } ) caseOfCaseT ast ast' + (isCoCCase b tn fn tt ft alts , isCoCForce b tn fn tt' ft' alts') } ) caseOfCaseTag ast ast' ... | yes (isCoCCase b tn fn tt ft alts , isCoCForce b₁ tn₁ fn₁ tt' ft' alts') with (b ≟ b₁) ×-dec (tn ≟ tn₁) ×-dec (fn ≟ fn₁) -... | no ¬p = ce (λ { (isCoC .b .tn .fn .tt .tt' .ft .ft' .alts .alts' x x₁ x₂) → ¬p (refl , refl , refl)}) caseOfCaseT ast ast' -... | yes (refl , refl , refl) with pcePointwise caseOfCaseT isCaseOfCase? tt tt' +... | no ¬p = ce (λ { (isCoC .b .tn .fn .tt .tt' .ft .ft' .alts .alts' x x₁ x₂) → ¬p (refl , refl , refl)}) caseOfCaseTag ast ast' +... | yes (refl , refl , refl) with pcePointwise caseOfCaseTag isCaseOfCase? tt tt' ... | ce ¬p t b a = ce (λ { (isCoC _ .tn .fn .tt .tt' .ft .ft' .alts .alts' x x₁ x₂) → ¬p x₁}) t b a -... | proof tt=tt' with pcePointwise caseOfCaseT isCaseOfCase? ft ft' +... | proof tt=tt' with pcePointwise caseOfCaseTag isCaseOfCase? ft ft' ... | ce ¬p t b a = ce (λ { (isCoC _ .tn .fn .tt .tt' .ft .ft' .alts .alts' x x₁ x₂) → ¬p x₂}) t b a -... | proof ft=ft' with pcePointwise caseOfCaseT isCaseOfCase? alts alts' +... | proof ft=ft' with pcePointwise caseOfCaseTag isCaseOfCase? alts alts' ... | ce ¬pp t b a = ce (λ { (isCoC _ .tn .fn .tt .tt' .ft .ft' .alts .alts' x x₁ x₂) → ¬pp x}) t b a ... | proof alts=alts' = proof (isCoC b tn fn tt tt' ft ft' alts alts' alts=alts' tt=tt' ft=ft') -isCaseOfCase? {X} = translation? {X} caseOfCaseT isCoC? +isCaseOfCase? {X} = translation? {X} caseOfCaseTag isCoC? ``` ## Semantic Equivalence diff --git a/plutus-metatheory/src/VerifiedCompilation/UCaseReduce.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UCaseReduce.lagda.md index 881084d5584..e99a50dcbb3 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UCaseReduce.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UCaseReduce.lagda.md @@ -32,7 +32,7 @@ open import RawU using (tag2TyTag; tmCon) open import Agda.Builtin.Int using (Int) open import Data.Empty using (⊥) open import Function using (case_of_) -open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; caseReduceT) +open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; caseReduceTag) open import Untyped.Reduction using (iterApp) ``` @@ -56,14 +56,14 @@ justEq refl = refl {-# TERMINATING #-} isCR? : {X : ℕ} → (ast ast' : X ⊢) → ProofOrCE (CaseReduce ast ast') isCR? ast ast' with (isCase? (isConstr? allTerms?) allTerms?) ast -... | no ¬p = ce (λ { (casereduce _ _) → ¬p (iscase (isconstr _ (allterms _)) (allterms _))} ) caseReduceT ast ast' +... | no ¬p = ce (λ { (casereduce _ _) → ¬p (iscase (isconstr _ (allterms _)) (allterms _))} ) caseReduceTag ast ast' ... | yes (iscase (isconstr i (allterms vs)) (allterms xs)) with lookup? i xs in xv -... | nothing = ce (λ { (casereduce p _) → case trans (sym xv) p of λ { () }} ) caseReduceT ast ast' +... | nothing = ce (λ { (casereduce p _) → case trans (sym xv) p of λ { () }} ) caseReduceTag ast ast' ... | just x with isCaseReduce? (iterApp x vs) ast' ... | proof p = proof (casereduce xv p) ... | ce ¬t t b a = ce (λ { (casereduce p t) → ¬t (subst (λ x → Translation CaseReduce (iterApp x vs) ast') (justEq (trans (sym p) xv)) t)}) t b a -isCaseReduce? = translation? caseReduceT isCR? +isCaseReduce? = translation? caseReduceTag isCR? UCaseReduce = Translation CaseReduce diff --git a/plutus-metatheory/src/VerifiedCompilation/UFloatDelay.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UFloatDelay.lagda.md index 9e88b8aa5db..8c8ed5a2d1d 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UFloatDelay.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UFloatDelay.lagda.md @@ -33,7 +33,7 @@ open import Builtin using (Builtin) open import RawU using (TmCon) open import Untyped.Purity using (Pure; isPure?) open import Data.List.Relation.Unary.All using (All; all?) -open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; floatDelayT) +open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; floatDelayTag) variable X : ℕ @@ -149,17 +149,17 @@ isFloatDelay? : {X : ℕ} → DecidableCE (FloatDelay {X}) {-# TERMINATING #-} isFlD? : {X : ℕ} → DecidableCE (FlD {X}) isFlD? ast ast' with (isApp? (isLambda? isTerm?) (isDelay? isTerm?)) ast -... | no ¬match = ce (λ { (floatdelay x x₁ x₂) → ¬match (isapp (islambda (isterm _)) (isdelay (isterm _)))}) floatDelayT ast ast' +... | no ¬match = ce (λ { (floatdelay x x₁ x₂) → ¬match (isapp (islambda (isterm _)) (isdelay (isterm _)))}) floatDelayTag ast ast' ... | yes (isapp (islambda (isterm t₁)) (isdelay (isterm t₂))) with (isApp? (isLambda? isTerm?) isTerm?) ast' -... | no ¬match = ce (λ { (floatdelay x x₁ x₂) → ¬match (isapp (islambda (isterm _)) (isterm _))}) floatDelayT ast ast' +... | no ¬match = ce (λ { (floatdelay x x₁ x₂) → ¬match (isapp (islambda (isterm _)) (isterm _))}) floatDelayTag ast ast' ... | yes (isapp (islambda (isterm t₁')) (isterm t₂')) with (isFloatDelay? (subs-delay zero t₁) t₁') ... | ce ¬p t b a = ce (λ { (floatdelay x x₁ x₂) → ¬p x}) t b a ... | proof t₁=t₁' with (isFloatDelay? t₂ t₂') ... | ce ¬p t b a = ce (λ { (floatdelay x x₁ x₂) → ¬p x₁}) t b a ... | proof t₂=t₂' with (isPure? t₂') -... | no ¬p = ce (λ { (floatdelay x x₁ x₂) → ¬p x₂} ) floatDelayT ast ast' +... | no ¬p = ce (λ { (floatdelay x x₁ x₂) → ¬p x₂} ) floatDelayTag ast ast' ... | yes puret₂' = proof (floatdelay t₁=t₁' t₂=t₂' puret₂') -isFloatDelay? = translation? floatDelayT isFlD? +isFloatDelay? = translation? floatDelayTag isFlD? ``` diff --git a/plutus-metatheory/src/VerifiedCompilation/UForceCaseDelay.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UForceCaseDelay.lagda.md index d523ada4eae..926bbcbf3d3 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UForceCaseDelay.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UForceCaseDelay.lagda.md @@ -17,7 +17,7 @@ module VerifiedCompilation.UForceCaseDelay where open import Data.Nat using (ℕ) open import Untyped open import VerifiedCompilation.UntypedTranslation using (Translation; translation?) -open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; forceCaseDelayT; isProof?; isCE?) +open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; forceCaseDelayTag; isProof?; isCE?) open import Data.List using (List; _∷_; []) open import VerifiedCompilation.UntypedViews using (Pred; isCase?; isApp?; isForce?; isBuiltin?; isConstr?; isDelay?; isTerm?; allTerms?; iscase; isapp; isforce; isbuiltin; isconstr; isterm; allterms; isdelay) open import Relation.Nullary using (Dec; yes; no; ¬_) @@ -112,18 +112,18 @@ isForceCaseDelay? : DecidableCE (ForceCaseDelay {n}) {-# TERMINATING #-} isFCD? : DecidableCE (FCD {n}) isFCD? t t' with isForce? (isCase? isTerm? allTerms?) t -... | no ¬matchLHS = ce (λ { (isFCD p1 p2 p3) → ¬matchLHS (isforce (iscase (isterm _) (allterms _))) } ) forceCaseDelayT t t' +... | no ¬matchLHS = ce (λ { (isFCD p1 p2 p3) → ¬matchLHS (isforce (iscase (isterm _) (allterms _))) } ) forceCaseDelayTag t t' ... | yes (isforce (iscase (isterm scrut) (allterms alts))) with isCase? isTerm? allTerms? t' -... | no ¬matchRHS = ce (λ { (isFCD p1 p2 p3) → ¬matchRHS (iscase (isterm _) (allterms _)) } ) forceCaseDelayT t t' +... | no ¬matchRHS = ce (λ { (isFCD p1 p2 p3) → ¬matchRHS (iscase (isterm _) (allterms _)) } ) forceCaseDelayTag t t' ... | yes (iscase (isterm scrut') (allterms alts')) with all? isBranch? alts -... | no ¬areBranches = ce (λ { (isFCD p1 p2 p3) → ¬areBranches p1 } ) forceCaseDelayT t t' +... | no ¬areBranches = ce (λ { (isFCD p1 p2 p3) → ¬areBranches p1 } ) forceCaseDelayTag t t' ... | yes areBranches with isForceCaseDelay? scrut scrut' -... | ce ¬fcdScrut tag lhs rhs = ce (λ { (isFCD p1 p2 p3) → ¬fcdScrut p2 } ) forceCaseDelayT t t' -... | proof fcdScrut with pcePointwise forceCaseDelayT isForceCaseDelay? (removeDelay alts) alts' -... | ce ¬fcdAlts tag lhs rhs = ce (λ { (isFCD p1 p2 p3) → ¬fcdAlts p3 } ) forceCaseDelayT t t' +... | ce ¬fcdScrut tag lhs rhs = ce (λ { (isFCD p1 p2 p3) → ¬fcdScrut p2 } ) forceCaseDelayTag t t' +... | proof fcdScrut with pcePointwise forceCaseDelayTag isForceCaseDelay? (removeDelay alts) alts' +... | ce ¬fcdAlts tag lhs rhs = ce (λ { (isFCD p1 p2 p3) → ¬fcdAlts p3 } ) forceCaseDelayTag t t' ... | proof fcdAlts = proof (isFCD areBranches fcdScrut fcdAlts) -isForceCaseDelay? = translation? forceCaseDelayT isFCD? +isForceCaseDelay? = translation? forceCaseDelayTag isFCD? ``` diff --git a/plutus-metatheory/src/VerifiedCompilation/UForceDelay.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UForceDelay.lagda.md index 8e223152bf8..488ea033b2f 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UForceDelay.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UForceDelay.lagda.md @@ -27,7 +27,7 @@ open import Data.Fin using (Fin; zero; suc) open import Data.Nat using (ℕ; zero; suc; _+_) open import Untyped.RenamingSubstitution using (weaken) open import Data.List using (List; _∷_; []) -open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; forceDelayT) +open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; forceDelayTag) open import Untyped.Purity using (Pure; isPure?) open import Builtin using (ifThenElse) ``` @@ -219,7 +219,7 @@ isFD? □ ast ast' | no ¬force with (isApp? isTerm? isTerm? ast) ×-dec (isApp? ... | proof p | proof ptv = proof (app p ptv) ... | proof p | ce ¬pv tag bf af = ce (λ { (app x x₁) → ¬pv x₁ } ) tag bf af ... | ce ¬p tag bf af | _ = ce (λ { (app x x₁) → ¬p x } ) tag bf af -isFD? □ ast ast' | no ¬force | no ¬app = ce (λ { (force x) → ¬force (isforce (isterm _)) ; (app x x₁) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _))} ) forceDelayT ast ast' +isFD? □ ast ast' | no ¬force | no ¬app = ce (λ { (force x) → ¬force (isforce (isterm _)) ; (app x x₁) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _))} ) forceDelayTag ast ast' isFD? (force z) ast ast' with (isApp? isTerm? isTerm? ast) ×-dec (isApp? isTerm? isTerm? ast') ... | yes (isapp (isterm t) (isterm y) , isapp (isterm t') (isterm y')) with isFD? ((force z) · y') t t' | isForceDelay? y y' ... | proof pt | proof py = proof (app pt py) @@ -228,14 +228,14 @@ isFD? (force z) ast ast' with (isApp? isTerm? isTerm? ast) ×-dec (isApp? isTerm ... | proof py = ce (λ { (app x x₁) → ¬pty x₁ ; (ifThenElse x x₁ x₂ x₃ x₄) → ForceFDNeverITE pt } ) tag bf af isFD? (force z) ast ast' | yes (isapp (isterm t) (isterm y) , isapp (isterm t') (isterm y')) | ce ¬papp tag₁ bf₁ af₁ | _ with (isApp? (isApp? (isForce? isBuiltin?) isTerm?) isTerm? t) ×-dec (isApp? (isApp? (isForce? isBuiltin?) isTerm?) isTerm? t') ... | yes (isapp (isapp (isforce (isbuiltin bi)) (isterm b)) (isterm x), isapp (isapp (isforce (isbuiltin bi')) (isterm b')) (isterm x')) with isPure? x' | isPure? y' | isForceDelay? b b' | isFD? (force z) x x' | isFD? (force z) y y' -... | no ¬purex | _ | _ | _ | _ = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬purex x} ) forceDelayT x x' -... | yes purex | no ¬purey | _ | _ | _ = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬purey x₁} ) forceDelayT y y' +... | no ¬purex | _ | _ | _ | _ = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬purex x} ) forceDelayTag x x' +... | yes purex | no ¬purey | _ | _ | _ = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬purey x₁} ) forceDelayTag y y' ... | yes purex | yes purey | ce ¬ptb tag bf af | _ | _ = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬ptb x₂} ) tag bf af ... | yes purex | yes purey | proof ptb | ce ¬px tag bf af | _ = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬px xx} ) tag bf af ... | yes purex | yes purey | proof ptb | proof px | ce ¬py tag bf af = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬py xx₁} ) tag bf af ... | yes purex | yes purey | proof ptb | proof px | proof py with (bi ≟ bi') ×-dec (bi ≟ ifThenElse) ... | yes (refl , refl) = proof (ifThenElse purex purey ptb px py) -... | no ¬bi=ite = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬bi=ite (refl , refl)} ) forceDelayT ast ast' +... | no ¬bi=ite = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬bi=ite (refl , refl)} ) forceDelayTag ast ast' isFD? (force z) ast ast' | yes (isapp (isterm t) (isterm y) , isapp (isterm t') (isterm y')) | ce ¬papp tag₁ bf₁ af₁ | _ | no ¬ifThenElse = ce (λ { (app x x₁) → ¬papp x ; (ifThenElse x x₁ x₂ x₃ x₄) → ¬ifThenElse (isapp (isapp (isforce (isbuiltin ifThenElse)) (isterm _)) @@ -252,7 +252,7 @@ isFD? (force □) ast ast' | no ¬app | yes (isdelay (isterm t)) | ce ¬p tag bf isFD? (force (force z)) ast ast' | no ¬app | yes (isdelay (isterm t)) | ce ¬p tag bf af = ce (λ { (delay x) → ¬p x } ) tag bf af isFD? (force (z · v)) ast ast' | no ¬app | yes (isdelay (isterm t)) | ce ¬p tag bf af = ce (λ { (delay x) → ¬p x } ) tag bf af isFD? (force z) ast ast' | no ¬app | no ¬delay with isForce? isTerm? ast -... | no ¬force = ce (λ { (force x) → ¬force (isforce (isterm _)) ; (delay x) → ¬delay (isdelay (isterm _)) ; (app x x₁) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _)) ; (last-delay x) → ¬delay (isdelay (isterm _)) ; (ifThenElse x x₁ x₂ x₃ x₄) → ¬app (isapp (isterm ((force (builtin ifThenElse) · _) · _)) (isterm _) , isapp (isterm ((force (builtin ifThenElse) · _) · _)) (isterm _))} ) forceDelayT ast ast' +... | no ¬force = ce (λ { (force x) → ¬force (isforce (isterm _)) ; (delay x) → ¬delay (isdelay (isterm _)) ; (app x x₁) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _)) ; (last-delay x) → ¬delay (isdelay (isterm _)) ; (ifThenElse x x₁ x₂ x₃ x₄) → ¬app (isapp (isterm ((force (builtin ifThenElse) · _) · _)) (isterm _) , isapp (isterm ((force (builtin ifThenElse) · _) · _)) (isterm _))} ) forceDelayTag ast ast' ... | yes (isforce (isterm t)) with isFD? (force (force z)) t ast' ... | proof p = proof (force p) ... | ce ¬p tag bf af = ce (λ { (force x) → ¬p x} ) tag bf af @@ -269,7 +269,7 @@ isFD? (z · x) ast ast' | no ¬lambda with isForce? isTerm? ast ... | proof p = proof (force p) ... | ce ¬p tag bf af = ce (λ { (force xx) → ¬p xx} ) tag bf af isFD? (z · x) ast ast' | no ¬lambda | no ¬force with (isApp? isTerm? isTerm? ast) ×-dec (isApp? isTerm? isTerm? ast') -... | no ¬app = ce (λ { (force xx) → ¬force (isforce (isterm _)) ; (app xx x) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _)) ; (abs xx) → ¬lambda (islambda (isterm _) , islambda (isterm _)) ; (last-abs x) → ¬lambda (islambda (isterm _) , islambda (isterm _))} ) forceDelayT ast ast' +... | no ¬app = ce (λ { (force xx) → ¬force (isforce (isterm _)) ; (app xx x) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _)) ; (abs xx) → ¬lambda (islambda (isterm _) , islambda (isterm _)) ; (last-abs x) → ¬lambda (islambda (isterm _) , islambda (isterm _))} ) forceDelayTag ast ast' ... | yes (isapp (isterm t) (isterm v) , isapp (isterm t') (isterm v')) with isFD? ((z · x) · v') t t' | isForceDelay? v v' ... | proof p | proof pvt = proof (app p pvt) ... | proof p | ce ¬pvt tag bf af = ce (λ { (app xx x) → ¬pvt x} ) tag bf af @@ -278,31 +278,31 @@ isFD? (z · x) ast ast' | no ¬lambda | no ¬force with (isApp? isTerm? isTerm? isFD? z ast ast' with isForce? isTerm? ast isFD? z ast ast' | yes (isforce (isterm t)) with ((isApp? (isApp? (isApp? (isForce? isBuiltin?) isTerm?) (isDelay? isTerm?)) (isDelay? isTerm?)) t) ×-dec ((isApp? (isApp? (isApp? (isForce? isBuiltin?) isTerm?) isTerm?) isTerm?) ast') isFD? □ (force t) ast' | yes (isforce (isterm _)) | yes ((isapp (isapp (isapp (isforce (isbuiltin bi)) (isterm b)) (isdelay (isterm x))) (isdelay (isterm y))) , (isapp (isapp (isapp (isforce (isbuiltin bi')) (isterm b')) (isterm x')) (isterm y'))) with bi ≟ bi' | bi ≟ ifThenElse | isForceDelay? b b' | isForceDelay? x x' | isForceDelay? y y' | isPure? x | isPure? y -... | no ¬bi≡bi' | _ | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬bi≡bi' refl ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡bi' refl} ) forceDelayT (force t) ast' -... | yes refl | no ¬bi≡ifThenElse | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬bi≡ifThenElse refl ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡ifThenElse refl} ) forceDelayT (force t) ast' -... | yes refl | yes refl | ce ¬pb tag bf af | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬pb x₂; (ifThenElse x x₁ xx xx₁ xx₂) → ¬pb (Translation.istranslation xx)} ) forceDelayT (force t) ast' -... | yes refl | yes refl | proof pb | ce ¬px tag bf af | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬px x₃; (ifThenElse x x₁ xx xx₁ xx₂) → ¬px (Translation.istranslation xx₁)} ) forceDelayT (force t) ast' -... | yes refl | yes refl | proof pb | proof px | ce ¬py tag bf af | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬py x₄; (ifThenElse x x₁ xx xx₁ xx₂) → ¬py (Translation.istranslation xx₂)} ) forceDelayT (force t) ast' -... | yes refl | yes refl | proof pb | proof px | proof py | no ¬purex | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬purex x; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purex x} ) forceDelayT (force t) ast' -... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | no ¬purey = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬purey x₁; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purey x₁} ) forceDelayT (force t) ast' +... | no ¬bi≡bi' | _ | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬bi≡bi' refl ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡bi' refl} ) forceDelayTag (force t) ast' +... | yes refl | no ¬bi≡ifThenElse | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬bi≡ifThenElse refl ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡ifThenElse refl} ) forceDelayTag (force t) ast' +... | yes refl | yes refl | ce ¬pb tag bf af | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬pb x₂; (ifThenElse x x₁ xx xx₁ xx₂) → ¬pb (Translation.istranslation xx)} ) forceDelayTag (force t) ast' +... | yes refl | yes refl | proof pb | ce ¬px tag bf af | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬px x₃; (ifThenElse x x₁ xx xx₁ xx₂) → ¬px (Translation.istranslation xx₁)} ) forceDelayTag (force t) ast' +... | yes refl | yes refl | proof pb | proof px | ce ¬py tag bf af | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬py x₄; (ifThenElse x x₁ xx xx₁ xx₂) → ¬py (Translation.istranslation xx₂)} ) forceDelayTag (force t) ast' +... | yes refl | yes refl | proof pb | proof px | proof py | no ¬purex | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬purex x; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purex x} ) forceDelayTag (force t) ast' +... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | no ¬purey = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬purey x₁; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purey x₁} ) forceDelayTag (force t) ast' ... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | yes purey = proof (force (lastIfThenElse purex purey pb px py)) isFD? (z · v) (force t) ast' | yes (isforce (isterm _)) | yes ((isapp (isapp (isapp (isforce (isbuiltin bi)) (isterm b)) (isdelay (isterm x))) (isdelay (isterm y))) , (isapp (isapp (isapp (isforce (isbuiltin bi')) (isterm b')) (isterm x')) (isterm y'))) with bi ≟ bi' | bi ≟ ifThenElse | isFD? (z · v) b b' | isFD? (z · v) x x' | isFD? (z · v) y y' | isPure? x | isPure? y -... | no ¬bi≡bi' | _ | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡bi' refl} ) forceDelayT (force t) ast' -... | yes refl | no ¬bi≡ifThenElse | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡ifThenElse refl} ) forceDelayT (force t) ast' -... | yes refl | yes refl | ce ¬pb tag bf af | _ | _ | _ | _ = ce (λ {(force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬pb xx} ) forceDelayT (force t) ast' -... | yes refl | yes refl | proof pb | ce ¬px tag bf af | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)); (ifThenElse x x₁ xx xx₁ xx₂) → ¬px xx₁ } ) forceDelayT (force t) ast' -... | yes refl | yes refl | proof pb | proof px | ce ¬py tag bf af | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)); (ifThenElse x x₁ xx xx₁ xx₂) → ¬py xx₂} ) forceDelayT (force t) ast' -... | yes refl | yes refl | proof pb | proof px | proof py | no ¬purex | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purex x} ) forceDelayT (force t) ast' -... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | no ¬purey = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purey x₁} ) forceDelayT (force t) ast' +... | no ¬bi≡bi' | _ | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡bi' refl} ) forceDelayTag (force t) ast' +... | yes refl | no ¬bi≡ifThenElse | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡ifThenElse refl} ) forceDelayTag (force t) ast' +... | yes refl | yes refl | ce ¬pb tag bf af | _ | _ | _ | _ = ce (λ {(force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬pb xx} ) forceDelayTag (force t) ast' +... | yes refl | yes refl | proof pb | ce ¬px tag bf af | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)); (ifThenElse x x₁ xx xx₁ xx₂) → ¬px xx₁ } ) forceDelayTag (force t) ast' +... | yes refl | yes refl | proof pb | proof px | ce ¬py tag bf af | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)); (ifThenElse x x₁ xx xx₁ xx₂) → ¬py xx₂} ) forceDelayTag (force t) ast' +... | yes refl | yes refl | proof pb | proof px | proof py | no ¬purex | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purex x} ) forceDelayTag (force t) ast' +... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | no ¬purey = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purey x₁} ) forceDelayTag (force t) ast' ... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | yes purey = proof (ifThenElse purex purey pb px py) isFD? (force z) (force t) ast' | yes (isforce (isterm _)) | yes ((isapp (isapp (isapp (isforce (isbuiltin bi)) (isterm b)) (isdelay (isterm x))) (isdelay (isterm y))) , (isapp (isapp (isapp (isforce (isbuiltin bi')) (isterm b')) (isterm x')) (isterm y'))) with bi ≟ bi' | bi ≟ ifThenElse | isFD? (force z) b b' | isFD? (force z) x x' | isFD? (force z) y y' | isPure? x | isPure? y -... | no ¬bi≡bi' | _ | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡bi' refl} ) forceDelayT (force t) ast' -... | yes refl | no ¬bi≡ifThenElse | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡ifThenElse refl} ) forceDelayT (force t) ast' -... | yes refl | yes refl | ce ¬pb tag bf af | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬pb xx} ) forceDelayT (force t) ast' -... | yes refl | yes refl | proof pb | ce ¬px tag bf af | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬px xx₁ } ) forceDelayT (force t) ast' -... | yes refl | yes refl | proof pb | proof px | ce ¬py tag bf af | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)); (ifThenElse x x₁ xx xx₁ xx₂) → ¬py xx₂} ) forceDelayT (force t) ast' -... | yes refl | yes refl | proof pb | proof px | proof py | no ¬purex | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purex x} ) forceDelayT (force t) ast' -... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | no ¬purey = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purey x₁} ) forceDelayT (force t) ast' +... | no ¬bi≡bi' | _ | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡bi' refl} ) forceDelayTag (force t) ast' +... | yes refl | no ¬bi≡ifThenElse | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡ifThenElse refl} ) forceDelayTag (force t) ast' +... | yes refl | yes refl | ce ¬pb tag bf af | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬pb xx} ) forceDelayTag (force t) ast' +... | yes refl | yes refl | proof pb | ce ¬px tag bf af | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬px xx₁ } ) forceDelayTag (force t) ast' +... | yes refl | yes refl | proof pb | proof px | ce ¬py tag bf af | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)); (ifThenElse x x₁ xx xx₁ xx₂) → ¬py xx₂} ) forceDelayTag (force t) ast' +... | yes refl | yes refl | proof pb | proof px | proof py | no ¬purex | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purex x} ) forceDelayTag (force t) ast' +... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | no ¬purey = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purey x₁} ) forceDelayTag (force t) ast' ... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | yes purey = proof (ifThenElse purex purey pb px py) isFD? z ast ast' | yes (isforce (isterm t)) | no ¬itepattern with isFD? (force z) t ast' ... | proof p = proof (force p) @@ -330,7 +330,7 @@ isFD? (force (z · x)) .(_ · _) .(_ · _) | no ¬force | yes (isapp (isterm _) isFD? z ast ast' | no ¬force | yes papp | ce ¬pp tag bf af | _ = ce (λ { (app x x₁) → ¬pp x ; (lastIfThenElse x x₁ x₂ x₃ x₄) → {!!}} ) tag bf af isFD? □ ast ast' | no ¬force | no ¬app = ce (λ { (force x) → ¬force (isforce (isterm _)) ; (app x x₁) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _)) ; (ifThenElse x x₁ x₂ x₃ x₄) → ¬force (isforce - (isterm (((force (builtin ifThenElse) · _) · delay _) · delay _)))} ) forceDelayT ast ast' + (isterm (((force (builtin ifThenElse) · _) · delay _) · delay _)))} ) forceDelayTag ast ast' isFD? (force z) ast ast' | no ¬force | no ¬app with isDelay? isTerm? ast ... | no ¬delay = ce (λ { (force x) → ¬force (isforce (isterm _)) ; (delay x) → ¬delay (isdelay (isterm _)) ; (app x x₁) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _)) ; (last-delay x) → ¬delay (isdelay (isterm _)) ; (ifThenElse x x₁ x₂ x₃ x₄) → ¬force (isforce @@ -339,7 +339,7 @@ isFD? (force z) ast ast' | no ¬force | no ¬app with isDelay? isTerm? ast (isterm (delay _)) , isapp (isterm ((force (builtin ifThenElse) · _) · _)) - (isterm _))} ) forceDelayT ast ast' + (isterm _))} ) forceDelayTag ast ast' ... | yes (isdelay (isterm t)) with isFD? z t ast' ... | proof p = proof (delay p) isFD? (force □) ast ast' | no ¬force | no ¬app | yes (isdelay (isterm t)) | ce ¬p tag bf af with isForceDelay? t ast' @@ -350,9 +350,9 @@ isFD? (force (z · v)) ast ast' | no ¬force | no ¬app | yes (isdelay (isterm t isFD? (z · v) ast ast' | no ¬force | no ¬app with isLambda? isTerm? ast ... | no ¬lambda = ce (λ { (force xx) → ¬force (isforce (isterm _)) ; (app xx x) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _)) ; (abs xx) → ¬lambda (islambda (isterm _)) ; (last-abs x) → ¬lambda (islambda (isterm _)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬force (isforce - (isterm (((force (builtin ifThenElse) · _) · delay _) · delay _)))} ) forceDelayT ast ast' + (isterm (((force (builtin ifThenElse) · _) · delay _) · delay _)))} ) forceDelayTag ast ast' ... | yes (islambda (isterm t)) with isLambda? isTerm? ast' -... | no ¬lamda' = ce (λ { (abs x) → ¬lamda' (islambda (isterm _)) ; (last-abs x) → ¬lamda' (islambda (isterm _))} ) forceDelayT ast ast' +... | no ¬lamda' = ce (λ { (abs x) → ¬lamda' (islambda (isterm _)) ; (last-abs x) → ¬lamda' (islambda (isterm _))} ) forceDelayTag ast ast' isFD? (z · v) ast ast' | no ¬force | no ¬app | yes (islambda (isterm t)) | yes (islambda (isterm t')) with isFD? (zipwk z) t t' ... | proof p = proof (abs p) isFD? (□ · v) ast ast' | no ¬force | no ¬app | yes (islambda (isterm t)) | yes (islambda (isterm t')) | ce ¬p tag bf af with isForceDelay? t t' @@ -363,7 +363,7 @@ isFD? ((z · v₁) · v) ast ast' | no ¬force | no ¬app | yes (islambda (ister -} -isForceDelay? = translation? forceDelayT (isFD? □) +isForceDelay? = translation? forceDelayTag (isFD? □) ``` diff --git a/plutus-metatheory/src/VerifiedCompilation/UInline.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UInline.lagda.md index 2cdb1ce154c..2c404f32c01 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UInline.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UInline.lagda.md @@ -36,7 +36,7 @@ open import Untyped.RenamingSubstitution using (weaken) open import Data.Empty using (⊥) import Relation.Binary.PropositionalEquality as Eq open Eq using (_≡_; refl) -open import VerifiedCompilation.Certificate using (Proof?; _>>=_; InlineHints; var; expand; ƛ; ƛ↓; _·_; _·↓; force; delay; con; builtin; error; constr; case; abort; proof; inlineT) +open import VerifiedCompilation.Certificate using (Proof?; _>>=_; InlineHints; var; expand; ƛ; ƛ↓; _·_; _·↓; force; delay; con; builtin; error; constr; case; abort; proof; inlineTag) ``` # Zippers, and relating two zippers @@ -219,9 +219,9 @@ check {z = z} {z′ = z′} var σ zz M@(` x) M′@(` x′) ... | yes refl | yes refl with zz ≟ᶻᶻ idᶻᶻ z ... | just refl = proof (` x) -... | nothing = abort inlineT M M′ +... | nothing = abort inlineTag M M′ check var σ zz M@(` x) M′@(` x′) - | _ | _ = abort inlineT M M′ + | _ | _ = abort inlineTag M M′ check (expand h) σ zz (` x) M′ = do r ← check h σ zz (σ x) M′ @@ -259,18 +259,18 @@ check (delay h) σ zz (delay M) (delay M′) = check con σ zz M@(con c) M′@(con c′) with c ≟ c′ ... | yes refl = proof con -... | no _ = abort inlineT M M′ +... | no _ = abort inlineTag M M′ check builtin σ zz M@(builtin b) M′@(builtin b′) with b ≟ b′ ... | yes refl = proof builtin -... | no _ = abort inlineT M M′ +... | no _ = abort inlineTag M M′ check (constr hs) σ zz M@(constr i Ms) M′@(constr i′ M′s) with i ≟ i′ ... | yes refl = do rs ← checkPointwise hs σ □ Ms M′s proof (constr rs) -... | no _ = abort inlineT M M′ +... | no _ = abort inlineTag M M′ check (case h hs) σ zz (case M Ms) (case M′ M′s) = do r ← check h σ □ M M′ @@ -279,14 +279,14 @@ check (case h hs) σ zz (case M Ms) (case M′ M′s) = check error σ zz error error = proof error -check h σ zz M M′ = abort inlineT M M′ +check h σ zz M M′ = abort inlineTag M M′ checkPointwise [] σ zz [] [] = proof Pointwise.[] checkPointwise (h ∷ hs) σ zz (M ∷ Ms) (M′ ∷ M′s) = do p ← check h σ zz M M′ ps ← checkPointwise hs σ zz Ms M′s proof (p Pointwise.∷ ps) -checkPointwise _ _ _ Ms M′s = abort inlineT Ms M′s +checkPointwise _ _ _ Ms M′s = abort inlineTag Ms M′s ``` # Top-level check diff --git a/plutus-metatheory/test/certifier/Test/Certifier/AST.hs b/plutus-metatheory/test/certifier/Test/Certifier/AST.hs index 525b1373a49..86ac5ac66fa 100644 --- a/plutus-metatheory/test/certifier/Test/Certifier/AST.hs +++ b/plutus-metatheory/test/certifier/Test/Certifier/AST.hs @@ -90,7 +90,7 @@ testTrivialSuccess1 :: TestTree testTrivialSuccess1 = testSuccess "Trivial success" - FloatDelay + floatDelayStage (mkConstant () (1 :: Integer)) (mkConstant () (1 :: Integer)) @@ -98,7 +98,7 @@ testTrivialFailure1 :: TestTree testTrivialFailure1 = testFailure "Trivial failure" - FloatDelay + floatDelayStage (mkConstant () (1 :: Integer)) (mkConstant () (2 :: Integer)) @@ -106,7 +106,7 @@ testByteStringEqSuccess :: TestTree testByteStringEqSuccess = testFailure "bytestrings expected to not be equal" - FloatDelay + floatDelayStage (mkConstant () (Text.encodeUtf8 "foo")) (mkConstant () (Text.encodeUtf8 "bar")) @@ -114,7 +114,7 @@ testByteStringEqFailure :: TestTree testByteStringEqFailure = testSuccess "bytestrings expected to be equal" - FloatDelay + floatDelayStage (mkConstant () (Text.encodeUtf8 "foo")) (mkConstant () (Text.encodeUtf8 "foo")) diff --git a/plutus-metatheory/test/certifier/Test/Certifier/AST/ForceDelay.hs b/plutus-metatheory/test/certifier/Test/Certifier/AST/ForceDelay.hs index 5dd673543ed..fd42f1eb22e 100644 --- a/plutus-metatheory/test/certifier/Test/Certifier/AST/ForceDelay.hs +++ b/plutus-metatheory/test/certifier/Test/Certifier/AST/ForceDelay.hs @@ -306,19 +306,19 @@ successItems successItems = [ ( "Simple one lambda" - , ForceDelay + , forceDelayStage , simpleSuccessBefore , simpleSuccessAfter ) , ( "Nested" - , ForceDelay + , forceDelayStage , nestedBefore , nestedAfter ) , ( "ifThenElse" - , ForceDelay + , forceDelayStage , ifThenElseSuccessBefore , ifThenElseSuccessAfter ) @@ -333,43 +333,43 @@ failItems failItems = [ ( "Simple extra delay" - , ForceDelay + , forceDelayStage , simpleFailBefore , simpleFailAfter ) , ( "Simple force break" - , ForceDelay + , forceDelayStage , simpleForceBreakBefore , simpleForceBreakAfter ) , ( "Simple app break" - , ForceDelay + , forceDelayStage , simpleAppBreakBefore , simpleAppBreakAfter ) , ( "App term break" - , ForceDelay + , forceDelayStage , appTermBreakBefore , appTermBreakAfter ) , ( "Lambda break" - , ForceDelay + , forceDelayStage , lambdaBreakBefore , lambdaBreakAfter ) , ( "Last delay break" - , ForceDelay + , forceDelayStage , lastDelayBreakBefore , lastDelayBreakAfter ) , ( "Last abs break" - , ForceDelay + , forceDelayStage , lastAbsBreakBefore , lastAbsBreakAfter ) From 9d83332eef2321028b509c5a7e26d1ac022cf991 Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Wed, 15 Apr 2026 17:21:06 +0300 Subject: [PATCH 05/16] Regenerate certifier report after fix --- .../golden/n-queens.golden.report | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/plutus-metatheory/test/certifier-report/golden/n-queens.golden.report b/plutus-metatheory/test/certifier-report/golden/n-queens.golden.report index 30efce230d0..72811f0c0ab 100644 --- a/plutus-metatheory/test/certifier-report/golden/n-queens.golden.report +++ b/plutus-metatheory/test/certifier-report/golden/n-queens.golden.report @@ -16,7 +16,7 @@ Pass 2: Float Force into Case Branches ✅ Program Size: 3504 (after) Execution Cost: CPU = 288404181782, MEM = 1752469055 (before) Execution Cost: CPU = 283210581782, MEM = 1720009055 (after) - + Optimization sites: 18 ────────────────────────────────────────────────────── Pass 3: Force-Delay Cancellation ✅ @@ -70,7 +70,7 @@ Pass 8: Float Force into Case Branches ✅ Program Size: 3176 (after) Execution Cost: CPU = 264858581782, MEM = 1605309055 (before) Execution Cost: CPU = 264858581782, MEM = 1605309055 (after) - + Optimization sites: 0 ────────────────────────────────────────────────────── Pass 9: Force-Delay Cancellation ✅ @@ -124,7 +124,7 @@ Pass 14: Float Force into Case Branches ✅ Program Size: 2467 (after) Execution Cost: CPU = 218067557782, MEM = 1312865155 (before) Execution Cost: CPU = 217316549782, MEM = 1308171355 (after) - + Optimization sites: 5 ────────────────────────────────────────────────────── Pass 15: Force-Delay Cancellation ✅ @@ -178,7 +178,7 @@ Pass 20: Float Force into Case Branches ✅ Program Size: 2305 (after) Execution Cost: CPU = 203028821782, MEM = 1218873055 (before) Execution Cost: CPU = 203028821782, MEM = 1218873055 (after) - + Optimization sites: 0 ────────────────────────────────────────────────────── Pass 21: Force-Delay Cancellation ✅ @@ -232,7 +232,7 @@ Pass 26: Float Force into Case Branches ✅ Program Size: 2405 (after) Execution Cost: CPU = 173898773782, MEM = 1036810255 (before) Execution Cost: CPU = 173898773782, MEM = 1036810255 (after) - + Optimization sites: 0 ────────────────────────────────────────────────────── Pass 27: Force-Delay Cancellation ✅ @@ -286,7 +286,7 @@ Pass 32: Float Force into Case Branches ✅ Program Size: 1852 (after) Execution Cost: CPU = 127574757782, MEM = 747285155 (before) Execution Cost: CPU = 120633541782, MEM = 703902555 (after) - + Optimization sites: 28 ────────────────────────────────────────────────────── Pass 33: Force-Delay Cancellation ✅ @@ -340,7 +340,7 @@ Pass 38: Float Force into Case Branches ✅ Program Size: 1838 (after) Execution Cost: CPU = 118993781782, MEM = 693654055 (before) Execution Cost: CPU = 118993781782, MEM = 693654055 (after) - + Optimization sites: 1 ────────────────────────────────────────────────────── Pass 39: Force-Delay Cancellation ✅ @@ -394,7 +394,7 @@ Pass 44: Float Force into Case Branches ✅ Program Size: 1770 (after) Execution Cost: CPU = 117353973782, MEM = 683405255 (before) Execution Cost: CPU = 117353973782, MEM = 683405255 (after) - + Optimization sites: 0 ────────────────────────────────────────────────────── Pass 45: Force-Delay Cancellation ✅ @@ -448,7 +448,7 @@ Pass 50: Float Force into Case Branches ✅ Program Size: 1770 (after) Execution Cost: CPU = 117353973782, MEM = 683405255 (before) Execution Cost: CPU = 117353973782, MEM = 683405255 (after) - + Optimization sites: 0 ────────────────────────────────────────────────────── Pass 51: Force-Delay Cancellation ✅ @@ -502,7 +502,7 @@ Pass 56: Float Force into Case Branches ✅ Program Size: 1770 (after) Execution Cost: CPU = 117353973782, MEM = 683405255 (before) Execution Cost: CPU = 117353973782, MEM = 683405255 (after) - + Optimization sites: 0 ────────────────────────────────────────────────────── Pass 57: Force-Delay Cancellation ✅ @@ -556,7 +556,7 @@ Pass 62: Float Force into Case Branches ✅ Program Size: 1770 (after) Execution Cost: CPU = 117353973782, MEM = 683405255 (before) Execution Cost: CPU = 117353973782, MEM = 683405255 (after) - + Optimization sites: 0 ────────────────────────────────────────────────────── Pass 63: Force-Delay Cancellation ✅ @@ -610,7 +610,7 @@ Pass 68: Float Force into Case Branches ✅ Program Size: 1770 (after) Execution Cost: CPU = 117353973782, MEM = 683405255 (before) Execution Cost: CPU = 117353973782, MEM = 683405255 (after) - + Optimization sites: 0 ────────────────────────────────────────────────────── Pass 69: Force-Delay Cancellation ✅ @@ -673,7 +673,7 @@ Pass 75: Float Force into Case Branches ✅ Program Size: 1779 (after) Execution Cost: CPU = 117353877782, MEM = 683404655 (before) Execution Cost: CPU = 117353877782, MEM = 683404655 (after) - + Optimization sites: 0 ────────────────────────────────────────────────────── Pass 76: Force-Delay Cancellation ✅ @@ -736,7 +736,7 @@ Pass 82: Float Force into Case Branches ✅ Program Size: 1780 (after) Execution Cost: CPU = 117353829782, MEM = 683404355 (before) Execution Cost: CPU = 117353829782, MEM = 683404355 (after) - + Optimization sites: 0 ────────────────────────────────────────────────────── Pass 83: Force-Delay Cancellation ✅ @@ -799,7 +799,7 @@ Pass 89: Float Force into Case Branches ✅ Program Size: 1762 (after) Execution Cost: CPU = 117353781782, MEM = 683404055 (before) Execution Cost: CPU = 117353781782, MEM = 683404055 (after) - + Optimization sites: 0 ────────────────────────────────────────────────────── Pass 90: Force-Delay Cancellation ✅ @@ -862,7 +862,7 @@ Pass 96: Float Force into Case Branches ✅ Program Size: 1762 (after) Execution Cost: CPU = 117353781782, MEM = 683404055 (before) Execution Cost: CPU = 117353781782, MEM = 683404055 (after) - + Optimization sites: 0 ────────────────────────────────────────────────────── Pass 97: Force-Delay Cancellation ✅ From de61d4a2ed698bdb67ff83e23e393456dceecb45 Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Wed, 15 Apr 2026 17:52:29 +0300 Subject: [PATCH 06/16] Remove unknown simplifier stage --- .../Transform/Certify/Trace.hs | 3 - .../UntypedPlutusCore/Transform/Simplifier.hs | 1 - .../src/CertifierReport.lagda.md | 1 - plutus-metatheory/src/FFI/AgdaUnparse.hs | 1 - .../src/MAlonzo/Code/Certifier.hs | 18 +- .../src/MAlonzo/Code/CertifierReport.hs | 65 ++-- .../src/MAlonzo/Code/VerifiedCompilation.hs | 58 +-- .../Code/VerifiedCompilation/Certificate.hs | 20 +- .../MAlonzo/Code/VerifiedCompilation/Trace.hs | 342 +++++++++--------- .../Code/VerifiedCompilation/UApplyToCase.hs | 24 +- .../MAlonzo/Code/VerifiedCompilation/UCSE.hs | 6 +- .../Code/VerifiedCompilation/UCaseOfCase.hs | 18 +- .../Code/VerifiedCompilation/UCaseReduce.hs | 8 +- .../Code/VerifiedCompilation/UFloatDelay.hs | 12 +- .../VerifiedCompilation/UForceCaseDelay.hs | 18 +- .../Code/VerifiedCompilation/UForceDelay.hs | 78 ++-- .../Code/VerifiedCompilation/UInline.hs | 102 +++--- .../VerifiedCompilation/UntypedTranslation.hs | 8 +- .../src/VerifiedCompilation/Trace.lagda.md | 5 +- 19 files changed, 382 insertions(+), 406 deletions(-) diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs index 8fdacb99b27..1370e2617d7 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs @@ -22,7 +22,6 @@ data ICSimplifierStage data NICSimplifierStage = CaseOfCase - | Unknown deriving stock (Show, Generic) deriving anyclass (NFData) @@ -36,7 +35,6 @@ floatDelayStage , cseStage , applyToCaseStage , caseOfCaseStage - , unknownStage :: SimplifierStage floatDelayStage = Right FloatDelay forceDelayStage = Right ForceDelay @@ -46,7 +44,6 @@ inlineStage = Right Inline cseStage = Right CSE applyToCaseStage = Right ApplyToCase caseOfCaseStage = Left CaseOfCase -unknownStage = Left Unknown data Simplification name uni fun a = Simplification diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs index f827ca6e2ef..5f465b051f1 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs @@ -9,7 +9,6 @@ module UntypedPlutusCore.Transform.Simplifier , Trace.cseStage , Trace.applyToCaseStage , Trace.caseOfCaseStage - , Trace.unknownStage , Trace.SimplifierTrace (..) , Trace.Simplification (..) , runSimplifierT diff --git a/plutus-metatheory/src/CertifierReport.lagda.md b/plutus-metatheory/src/CertifierReport.lagda.md index f98f6dac5bd..8864b62dcbe 100644 --- a/plutus-metatheory/src/CertifierReport.lagda.md +++ b/plutus-metatheory/src/CertifierReport.lagda.md @@ -46,7 +46,6 @@ showICTag applyToCaseT = "Transform multi-argument applications into case-constr showNICTag : NICSimplifierTag → String showNICTag caseOfCaseT = "Case-of-Case" -showNICTag unknown = "Unknown Pass" showTag : SimplifierTag → String showTag (inj₁ tag) = showNICTag tag ++ " ⚠ (certifier unavailable)" diff --git a/plutus-metatheory/src/FFI/AgdaUnparse.hs b/plutus-metatheory/src/FFI/AgdaUnparse.hs index 772da550ef0..c86459f3681 100644 --- a/plutus-metatheory/src/FFI/AgdaUnparse.hs +++ b/plutus-metatheory/src/FFI/AgdaUnparse.hs @@ -61,7 +61,6 @@ instance AgdaUnparse ICSimplifierStage where instance AgdaUnparse NICSimplifierStage where agdaUnparse CaseOfCase = "(inj₁ caseOfCaseT)" - agdaUnparse Unknown = "(inj₁ unknown)" instance AgdaUnparse Hints.Hints where agdaUnparse = \case diff --git a/plutus-metatheory/src/MAlonzo/Code/Certifier.hs b/plutus-metatheory/src/MAlonzo/Code/Certifier.hs index cbf1ccf6402..00fd910fb98 100644 --- a/plutus-metatheory/src/MAlonzo/Code/Certifier.hs +++ b/plutus-metatheory/src/MAlonzo/Code/Certifier.hs @@ -33,9 +33,9 @@ d_runCertifier_2 :: [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8) (MAlonzo.Code.Utils.T__'215'__428 - MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_74 + MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_70 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> @@ -47,7 +47,7 @@ d_runCertifier_2 v0 MAlonzo.Code.Utils.du_eitherBind_54 (coe MAlonzo.Code.Utils.du_try_94 - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_toTrace_100 (coe v0)) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_toTrace_96 (coe v0)) (coe MAlonzo.Code.VerifiedCompilation.C_emptyDump_4)) (coe (\ v1 -> @@ -77,14 +77,14 @@ runCertifierMain :: (MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8) (MAlonzo.Code.Utils.T__'215'__428 - MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_74 + MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_70 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))) -> MAlonzo.Code.Agda.Builtin.List.T_List_10 - () MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_136 -> + () MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_132 -> MAlonzo.Code.Agda.Builtin.Maybe.T_Maybe_10 () (MAlonzo.Code.Utils.T__'215'__428 @@ -94,13 +94,13 @@ d_runCertifierMain_12 :: [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8) (MAlonzo.Code.Utils.T__'215'__428 - MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_74 + MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_70 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_136] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_132] -> Maybe (MAlonzo.Code.Utils.T__'215'__428 Bool MAlonzo.Code.Agda.Builtin.String.T_String_6) diff --git a/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs b/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs index aee1b96ff37..6b6ed93e6dc 100644 --- a/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs +++ b/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs @@ -51,24 +51,24 @@ d_hl_8 Data.Text.Text) -- CertifierReport.showICTag d_showICTag_10 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> MAlonzo.Code.Agda.Builtin.String.T_String_6 d_showICTag_10 v0 = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_12 + MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_10 -> coe ("Float Delay" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_14 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_12 -> coe ("Force-Delay Cancellation" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_16 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_14 -> coe ("Float Force into Case Branches" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_18 + MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_16 -> coe ("Case-Constr and Case-Constant Cancellation" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_20 + MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_18 -> coe ("Inlining" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_22 + MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_20 -> coe ("Common Subexpression Elimination" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_24 + MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_22 -> coe ("Transform multi-argument applications into case-constr form" :: @@ -79,17 +79,12 @@ d_showNICTag_12 :: MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 -> MAlonzo.Code.Agda.Builtin.String.T_String_6 d_showNICTag_12 v0 - = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_caseOfCaseT_6 - -> coe ("Case-of-Case" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_unknown_8 - -> coe ("Unknown Pass" :: Data.Text.Text) - _ -> MAlonzo.RTE.mazUnreachableError + = coe seq (coe v0) (coe ("Case-of-Case" :: Data.Text.Text)) -- CertifierReport.showTag d_showTag_14 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> MAlonzo.Code.Agda.Builtin.String.T_String_6 d_showTag_14 v0 = case coe v0 of @@ -559,28 +554,28 @@ d_numSitesInline_140 v0 v1 v2 v3 v4 v5 v6 v7 d_numSites_178 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> Integer d_numSites_178 v0 v1 v2 v3 = case coe v2 of - MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_12 + MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_10 -> coe du_numSites'8242'_26 v0 v1 v3 - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_14 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_12 -> coe du_numSites'8242'_26 v0 v1 v3 - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_16 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_14 -> coe du_numSites'8242'_26 v0 v1 v3 - MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_18 + MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_16 -> coe du_numSites'8242'_26 v0 v1 v3 - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_20 + MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_18 -> coe d_numSitesInline_140 (coe (0 :: Integer)) erased (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_106) (coe v0) (coe v1) (coe v3) - MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_22 + MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_20 -> coe du_numSites'8242'_26 v0 v1 v3 - MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_24 + MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_22 -> coe du_numSites'8242'_26 v0 v1 v3 _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.showSites @@ -589,7 +584,7 @@ d_showSites_200 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> MAlonzo.Code.Agda.Builtin.String.T_String_6 d_showSites_200 v0 v1 v2 v3 = case coe v2 of @@ -655,11 +650,11 @@ d_termSize'7510''695'_212 v0 v1 _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.showEvalResult d_showEvalResult_234 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_136 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_132 -> MAlonzo.Code.Agda.Builtin.String.T_String_6 d_showEvalResult_234 v0 = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_success_138 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.C_success_134 v1 v2 -> coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 (d_'8649'__2 (coe ("Execution Cost: CPU = " :: Data.Text.Text))) @@ -670,7 +665,7 @@ d_showEvalResult_234 v0 MAlonzo.Code.Data.String.Base.d__'43''43'__20 (", MEM = " :: Data.Text.Text) (coe MAlonzo.Code.Data.Nat.Show.d_show_56 v2))) - MAlonzo.Code.VerifiedCompilation.Trace.C_failure_140 v1 v2 v3 + MAlonzo.Code.VerifiedCompilation.Trace.C_failure_136 v1 v2 v3 -> coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 (d_'8649'__2 (coe ("Evaluation FAILED: " :: Data.Text.Text))) @@ -691,7 +686,7 @@ d_showEvalResult_234 v0 _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.showCostPair d_showCostPair_246 :: - [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_136] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_132] -> MAlonzo.Code.Agda.Builtin.String.T_String_6 d_showCostPair_246 v0 = let v1 = "" :: Data.Text.Text in @@ -725,13 +720,13 @@ du_tail_254 v0 -- CertifierReport.reportPasses d_reportPasses_264 :: Integer -> - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_82 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_78 -> AgdaAny -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_136] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_132] -> MAlonzo.Code.Agda.Builtin.String.T_String_6 d_reportPasses_264 v0 v1 v2 v3 = case coe v1 of - MAlonzo.Code.VerifiedCompilation.Trace.C_step_86 v4 v5 v6 v7 + MAlonzo.Code.VerifiedCompilation.Trace.C_step_82 v4 v5 v6 v7 -> case coe v2 of MAlonzo.Code.Utils.C__'44'__442 v8 v9 -> coe @@ -774,7 +769,7 @@ d_reportPasses_264 v0 v1 v2 v3 (d_termSize_208 (coe (0 :: Integer)) (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_head_92 + MAlonzo.Code.VerifiedCompilation.Trace.d_head_88 (coe v7)))) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 @@ -793,7 +788,7 @@ d_reportPasses_264 v0 v1 v2 v3 (d_showSites_200 (coe v6) (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_head_92 + MAlonzo.Code.VerifiedCompilation.Trace.d_head_88 (coe v7)) (coe v4) (coe v8)) (coe @@ -810,7 +805,7 @@ d_reportPasses_264 v0 v1 v2 v3 (coe v3)))))))))))))))))))) _ -> MAlonzo.RTE.mazUnreachableError - MAlonzo.Code.VerifiedCompilation.Trace.C_done_88 v4 + MAlonzo.Code.VerifiedCompilation.Trace.C_done_84 v4 -> coe ("" :: Data.Text.Text) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.reportFailure @@ -865,7 +860,7 @@ d_makeReport_286 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.T_Error_2 MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_136] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_132] -> MAlonzo.Code.Agda.Builtin.String.T_String_6 d_makeReport_286 v0 v1 = coe diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs index c79bd628e75..bcdc503e089 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs @@ -41,13 +41,13 @@ data T_Error_2 = C_emptyDump_4 | C_illScoped_6 | C_counterExample_8 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) | + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8) | C_abort_10 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8) -- VerifiedCompilation.f d_f_12 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> () d_f_12 = erased @@ -55,7 +55,7 @@ d_f_12 = erased d_RelationOf_14 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> () d_RelationOf_14 = erased @@ -63,7 +63,7 @@ d_RelationOf_14 = erased d_hasRelation_18 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> Bool d_hasRelation_18 v0 = case coe v0 of @@ -76,8 +76,8 @@ d_hasRelation_18 v0 d_certifyPass_26 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_74 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_70 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.VerifiedCompilation.Certificate.T_CertResult_12 @@ -90,50 +90,50 @@ d_certifyPass_26 v0 v1 MAlonzo.Code.VerifiedCompilation.NotImplemented.du_certNotImplemented_22) MAlonzo.Code.Utils.C_inj'8322'_14 v2 -> case coe v2 of - MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_12 + MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_10 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 (coe MAlonzo.Code.VerifiedCompilation.UFloatDelay.d_isFloatDelay'63'_488 (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_14 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_12 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 (coe MAlonzo.Code.VerifiedCompilation.UForceDelay.d_isForceDelay'63'_178 (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_16 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_14 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 (coe MAlonzo.Code.VerifiedCompilation.UForceCaseDelay.d_isForceCaseDelay'63'_94 (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_18 + MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_16 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 (coe MAlonzo.Code.VerifiedCompilation.UCaseReduce.d_isCaseReduce'63'_26 (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_20 + MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_18 -> case coe v1 of - MAlonzo.Code.VerifiedCompilation.Trace.C_inline_76 v3 + MAlonzo.Code.VerifiedCompilation.Trace.C_inline_72 v3 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du_checker_156 (coe MAlonzo.Code.VerifiedCompilation.UInline.d_top'45'check_718 (coe v3)) - MAlonzo.Code.VerifiedCompilation.Trace.C_none_78 + MAlonzo.Code.VerifiedCompilation.Trace.C_none_74 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_34) _ -> MAlonzo.RTE.mazUnreachableError - MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_22 + MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_20 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 (coe MAlonzo.Code.VerifiedCompilation.UCSE.d_isUntypedCSE'63'_26 (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_24 + MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_22 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 (coe @@ -143,19 +143,19 @@ d_certifyPass_26 v0 v1 _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.Certificate d_Certificate_34 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_82 -> () + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_78 -> () d_Certificate_34 = erased -- VerifiedCompilation.certify d_certify_46 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_82 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_78 -> MAlonzo.Code.Utils.T_Either_6 T_Error_2 AgdaAny d_certify_46 v0 = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_step_86 v1 v2 v3 v4 + MAlonzo.Code.VerifiedCompilation.Trace.C_step_82 v1 v2 v3 v4 -> let v5 = coe d_certifyPass_26 v1 v2 v3 - (MAlonzo.Code.VerifiedCompilation.Trace.d_head_92 (coe v4)) in + (MAlonzo.Code.VerifiedCompilation.Trace.d_head_88 (coe v4)) in coe (case coe v5 of MAlonzo.Code.VerifiedCompilation.Certificate.C_proof_18 v6 @@ -172,14 +172,14 @@ d_certify_46 v0 MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_32 v8 v9 v10 -> coe MAlonzo.Code.Utils.C_inj'8321'_12 (coe C_abort_10 (coe v8)) _ -> MAlonzo.RTE.mazUnreachableError) - MAlonzo.Code.VerifiedCompilation.Trace.C_done_88 v1 + MAlonzo.Code.VerifiedCompilation.Trace.C_done_84 v1 -> coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe MAlonzo.Code.Agda.Builtin.Unit.C_tt_8) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.cert d_cert_96 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_82 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_78 -> MAlonzo.Code.Utils.T_Either_6 T_Error_2 AgdaAny -> AgdaAny -> AgdaAny d_cert_96 ~v0 v1 v2 = du_cert_96 v1 v2 @@ -200,11 +200,11 @@ d_checkScope_100 v0 (coe MAlonzo.Code.Untyped.d_scopeCheckU0_276 (coe v0)) -- VerifiedCompilation.checkScopeᵗ d_checkScope'7511'_102 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_82 -> - Maybe MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_82 + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_78 -> + Maybe MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_78 d_checkScope'7511'_102 v0 = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_step_86 v1 v2 v3 v4 + MAlonzo.Code.VerifiedCompilation.Trace.C_step_82 v1 v2 v3 v4 -> coe MAlonzo.Code.Data.Maybe.Base.du__'62''62''61'__72 (coe d_checkScope_100 (coe v3)) @@ -218,9 +218,9 @@ d_checkScope'7511'_102 v0 coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_step_86 (coe v1) (coe v2) + MAlonzo.Code.VerifiedCompilation.Trace.C_step_82 (coe v1) (coe v2) (coe v5) (coe v6)))))) - MAlonzo.Code.VerifiedCompilation.Trace.C_done_88 v1 + MAlonzo.Code.VerifiedCompilation.Trace.C_done_84 v1 -> coe MAlonzo.Code.Data.Maybe.Base.du__'62''62''61'__72 (coe d_checkScope_100 (coe v1)) @@ -228,5 +228,5 @@ d_checkScope'7511'_102 v0 (\ v2 -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_done_88 (coe v2)))) + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_done_84 (coe v2)))) _ -> MAlonzo.RTE.mazUnreachableError diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs index 9a216cf34fe..2b9bffee656 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs @@ -33,11 +33,11 @@ data T_CertResult_12 = C_proof_18 AgdaAny | C_ce_26 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8) AgdaAny AgdaAny | C_abort_32 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8) AgdaAny AgdaAny -- VerifiedCompilation.Certificate.ProofOrCE d_ProofOrCE_38 a0 a1 = () @@ -45,7 +45,7 @@ data T_ProofOrCE_38 = C_proof_44 AgdaAny | C_ce_52 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8) AgdaAny AgdaAny -- VerifiedCompilation.Certificate.isProof? d_isProof'63'_56 :: @@ -74,7 +74,7 @@ data T_Proof'63'_66 = C_proof_72 AgdaAny | C_abort_78 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8) AgdaAny AgdaAny -- VerifiedCompilation.Certificate._>>=_ d__'62''62''61'__88 :: @@ -145,14 +145,14 @@ d_decToPCE_234 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20 -> AgdaAny -> AgdaAny -> T_ProofOrCE_38 d_decToPCE_234 ~v0 ~v1 v2 v3 v4 v5 = du_decToPCE_234 v2 v3 v4 v5 du_decToPCE_234 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20 -> AgdaAny -> AgdaAny -> T_ProofOrCE_38 du_decToPCE_234 v0 v1 v2 v3 @@ -195,7 +195,7 @@ d_matchOrCE_262 :: (AgdaAny -> AgdaAny -> ()) -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> (AgdaAny -> AgdaAny -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20) -> @@ -205,7 +205,7 @@ d_matchOrCE_262 ~v0 ~v1 ~v2 ~v3 v4 v5 v6 v7 du_matchOrCE_262 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> (AgdaAny -> AgdaAny -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20) -> @@ -230,7 +230,7 @@ d_pcePointwise_304 :: (AgdaAny -> AgdaAny -> ()) -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> (AgdaAny -> AgdaAny -> T_ProofOrCE_38) -> [AgdaAny] -> [AgdaAny] -> T_ProofOrCE_38 d_pcePointwise_304 ~v0 ~v1 ~v2 ~v3 v4 v5 v6 v7 @@ -238,7 +238,7 @@ d_pcePointwise_304 ~v0 ~v1 ~v2 ~v3 v4 v5 v6 v7 du_pcePointwise_304 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> (AgdaAny -> AgdaAny -> T_ProofOrCE_38) -> [AgdaAny] -> [AgdaAny] -> T_ProofOrCE_38 du_pcePointwise_304 v0 v1 v2 v3 diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs index ac0e4862e72..f6775324188 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs @@ -31,42 +31,38 @@ import FFI.CostInfo d_NICSimplifierTag_4 = () type T_NICSimplifierTag_4 = NICSimplifierStage pattern C_caseOfCaseT_6 = CaseOfCase -pattern C_unknown_8 = Unknown check_caseOfCaseT_6 :: T_NICSimplifierTag_4 check_caseOfCaseT_6 = CaseOfCase -check_unknown_8 :: T_NICSimplifierTag_4 -check_unknown_8 = Unknown cover_NICSimplifierTag_4 :: NICSimplifierStage -> () cover_NICSimplifierTag_4 x = case x of CaseOfCase -> () - Unknown -> () -- VerifiedCompilation.Trace.ICSimplifierTag -d_ICSimplifierTag_10 = () -type T_ICSimplifierTag_10 = ICSimplifierStage -pattern C_floatDelayT_12 = FloatDelay -pattern C_forceDelayT_14 = ForceDelay -pattern C_forceCaseDelayT_16 = ForceCaseDelay -pattern C_caseReduceT_18 = CaseReduce -pattern C_inlineT_20 = Inline -pattern C_cseT_22 = CSE -pattern C_applyToCaseT_24 = ApplyToCase -check_floatDelayT_12 :: T_ICSimplifierTag_10 -check_floatDelayT_12 = FloatDelay -check_forceDelayT_14 :: T_ICSimplifierTag_10 -check_forceDelayT_14 = ForceDelay -check_forceCaseDelayT_16 :: T_ICSimplifierTag_10 -check_forceCaseDelayT_16 = ForceCaseDelay -check_caseReduceT_18 :: T_ICSimplifierTag_10 -check_caseReduceT_18 = CaseReduce -check_inlineT_20 :: T_ICSimplifierTag_10 -check_inlineT_20 = Inline -check_cseT_22 :: T_ICSimplifierTag_10 -check_cseT_22 = CSE -check_applyToCaseT_24 :: T_ICSimplifierTag_10 -check_applyToCaseT_24 = ApplyToCase -cover_ICSimplifierTag_10 :: ICSimplifierStage -> () -cover_ICSimplifierTag_10 x +d_ICSimplifierTag_8 = () +type T_ICSimplifierTag_8 = ICSimplifierStage +pattern C_floatDelayT_10 = FloatDelay +pattern C_forceDelayT_12 = ForceDelay +pattern C_forceCaseDelayT_14 = ForceCaseDelay +pattern C_caseReduceT_16 = CaseReduce +pattern C_inlineT_18 = Inline +pattern C_cseT_20 = CSE +pattern C_applyToCaseT_22 = ApplyToCase +check_floatDelayT_10 :: T_ICSimplifierTag_8 +check_floatDelayT_10 = FloatDelay +check_forceDelayT_12 :: T_ICSimplifierTag_8 +check_forceDelayT_12 = ForceDelay +check_forceCaseDelayT_14 :: T_ICSimplifierTag_8 +check_forceCaseDelayT_14 = ForceCaseDelay +check_caseReduceT_16 :: T_ICSimplifierTag_8 +check_caseReduceT_16 = CaseReduce +check_inlineT_18 :: T_ICSimplifierTag_8 +check_inlineT_18 = Inline +check_cseT_20 :: T_ICSimplifierTag_8 +check_cseT_20 = CSE +check_applyToCaseT_22 :: T_ICSimplifierTag_8 +check_applyToCaseT_22 = ApplyToCase +cover_ICSimplifierTag_8 :: ICSimplifierStage -> () +cover_ICSimplifierTag_8 x = case x of FloatDelay -> () ForceDelay -> () @@ -76,111 +72,105 @@ cover_ICSimplifierTag_10 x CSE -> () ApplyToCase -> () -- VerifiedCompilation.Trace.SimplifierTag -d_SimplifierTag_26 :: () -d_SimplifierTag_26 = erased +d_SimplifierTag_24 :: () +d_SimplifierTag_24 = erased -- VerifiedCompilation.Trace.floatDelayTag -d_floatDelayTag_28 :: +d_floatDelayTag_26 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_floatDelayTag_28 - = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_floatDelayT_12) + T_NICSimplifierTag_4 T_ICSimplifierTag_8 +d_floatDelayTag_26 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_floatDelayT_10) -- VerifiedCompilation.Trace.forceDelayTag -d_forceDelayTag_30 :: +d_forceDelayTag_28 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_forceDelayTag_30 - = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_forceDelayT_14) + T_NICSimplifierTag_4 T_ICSimplifierTag_8 +d_forceDelayTag_28 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_forceDelayT_12) -- VerifiedCompilation.Trace.forceCaseDelayTag -d_forceCaseDelayTag_32 :: +d_forceCaseDelayTag_30 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_forceCaseDelayTag_32 - = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_forceCaseDelayT_16) + T_NICSimplifierTag_4 T_ICSimplifierTag_8 +d_forceCaseDelayTag_30 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_forceCaseDelayT_14) -- VerifiedCompilation.Trace.caseReduceTag -d_caseReduceTag_34 :: +d_caseReduceTag_32 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_caseReduceTag_34 - = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_caseReduceT_18) + T_NICSimplifierTag_4 T_ICSimplifierTag_8 +d_caseReduceTag_32 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_caseReduceT_16) -- VerifiedCompilation.Trace.inlineTag -d_inlineTag_36 :: +d_inlineTag_34 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_inlineTag_36 - = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_inlineT_20) + T_NICSimplifierTag_4 T_ICSimplifierTag_8 +d_inlineTag_34 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_inlineT_18) -- VerifiedCompilation.Trace.cseTag -d_cseTag_38 :: +d_cseTag_36 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_cseTag_38 = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_cseT_22) + T_NICSimplifierTag_4 T_ICSimplifierTag_8 +d_cseTag_36 = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_cseT_20) -- VerifiedCompilation.Trace.applyToCaseTag -d_applyToCaseTag_40 :: +d_applyToCaseTag_38 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_applyToCaseTag_40 - = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_applyToCaseT_24) + T_NICSimplifierTag_4 T_ICSimplifierTag_8 +d_applyToCaseTag_38 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_applyToCaseT_22) -- VerifiedCompilation.Trace.caseOfCaseTag -d_caseOfCaseTag_42 :: +d_caseOfCaseTag_40 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_caseOfCaseTag_42 + T_NICSimplifierTag_4 T_ICSimplifierTag_8 +d_caseOfCaseTag_40 = coe MAlonzo.Code.Utils.C_inj'8321'_12 (coe C_caseOfCaseT_6) --- VerifiedCompilation.Trace.unknownTag -d_unknownTag_44 :: - MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_unknownTag_44 - = coe MAlonzo.Code.Utils.C_inj'8321'_12 (coe C_unknown_8) -- VerifiedCompilation.Trace.InlineHints -d_InlineHints_46 = () -type T_InlineHints_46 = Hints.Inline -pattern C_var_48 = Hints.InlVar -pattern C_expand_50 a0 = Hints.InlExpand a0 -pattern C_ƛ_52 a0 = Hints.InlLam a0 -pattern C_ƛ'8595'_54 a0 = Hints.InlLamDrop a0 -pattern C__'183'__56 a0 a1 = Hints.InlApply a0 a1 -pattern C__'183''8595'_58 a0 = Hints.InlDrop a0 -pattern C_force_60 a0 = Hints.InlForce a0 -pattern C_delay_62 a0 = Hints.InlDelay a0 -pattern C_con_64 = Hints.InlCon -pattern C_builtin_66 = Hints.InlBuiltin -pattern C_error_68 = Hints.InlError -pattern C_constr_70 a0 = Hints.InlConstr a0 -pattern C_case_72 a0 a1 = Hints.InlCase a0 a1 -check_var_48 :: T_InlineHints_46 -check_var_48 = Hints.InlVar -check_expand_50 :: T_InlineHints_46 -> T_InlineHints_46 -check_expand_50 = Hints.InlExpand -check_ƛ_52 :: T_InlineHints_46 -> T_InlineHints_46 -check_ƛ_52 = Hints.InlLam -check_ƛ'8595'_54 :: T_InlineHints_46 -> T_InlineHints_46 -check_ƛ'8595'_54 = Hints.InlLamDrop -check__'183'__56 :: - T_InlineHints_46 -> T_InlineHints_46 -> T_InlineHints_46 -check__'183'__56 = Hints.InlApply -check__'183''8595'_58 :: T_InlineHints_46 -> T_InlineHints_46 -check__'183''8595'_58 = Hints.InlDrop -check_force_60 :: T_InlineHints_46 -> T_InlineHints_46 -check_force_60 = Hints.InlForce -check_delay_62 :: T_InlineHints_46 -> T_InlineHints_46 -check_delay_62 = Hints.InlDelay -check_con_64 :: T_InlineHints_46 -check_con_64 = Hints.InlCon -check_builtin_66 :: T_InlineHints_46 -check_builtin_66 = Hints.InlBuiltin -check_error_68 :: T_InlineHints_46 -check_error_68 = Hints.InlError -check_constr_70 :: - MAlonzo.Code.Agda.Builtin.List.T_List_10 () T_InlineHints_46 -> - T_InlineHints_46 -check_constr_70 = Hints.InlConstr -check_case_72 :: - T_InlineHints_46 -> - MAlonzo.Code.Agda.Builtin.List.T_List_10 () T_InlineHints_46 -> - T_InlineHints_46 -check_case_72 = Hints.InlCase -cover_InlineHints_46 :: Hints.Inline -> () -cover_InlineHints_46 x +d_InlineHints_42 = () +type T_InlineHints_42 = Hints.Inline +pattern C_var_44 = Hints.InlVar +pattern C_expand_46 a0 = Hints.InlExpand a0 +pattern C_ƛ_48 a0 = Hints.InlLam a0 +pattern C_ƛ'8595'_50 a0 = Hints.InlLamDrop a0 +pattern C__'183'__52 a0 a1 = Hints.InlApply a0 a1 +pattern C__'183''8595'_54 a0 = Hints.InlDrop a0 +pattern C_force_56 a0 = Hints.InlForce a0 +pattern C_delay_58 a0 = Hints.InlDelay a0 +pattern C_con_60 = Hints.InlCon +pattern C_builtin_62 = Hints.InlBuiltin +pattern C_error_64 = Hints.InlError +pattern C_constr_66 a0 = Hints.InlConstr a0 +pattern C_case_68 a0 a1 = Hints.InlCase a0 a1 +check_var_44 :: T_InlineHints_42 +check_var_44 = Hints.InlVar +check_expand_46 :: T_InlineHints_42 -> T_InlineHints_42 +check_expand_46 = Hints.InlExpand +check_ƛ_48 :: T_InlineHints_42 -> T_InlineHints_42 +check_ƛ_48 = Hints.InlLam +check_ƛ'8595'_50 :: T_InlineHints_42 -> T_InlineHints_42 +check_ƛ'8595'_50 = Hints.InlLamDrop +check__'183'__52 :: + T_InlineHints_42 -> T_InlineHints_42 -> T_InlineHints_42 +check__'183'__52 = Hints.InlApply +check__'183''8595'_54 :: T_InlineHints_42 -> T_InlineHints_42 +check__'183''8595'_54 = Hints.InlDrop +check_force_56 :: T_InlineHints_42 -> T_InlineHints_42 +check_force_56 = Hints.InlForce +check_delay_58 :: T_InlineHints_42 -> T_InlineHints_42 +check_delay_58 = Hints.InlDelay +check_con_60 :: T_InlineHints_42 +check_con_60 = Hints.InlCon +check_builtin_62 :: T_InlineHints_42 +check_builtin_62 = Hints.InlBuiltin +check_error_64 :: T_InlineHints_42 +check_error_64 = Hints.InlError +check_constr_66 :: + MAlonzo.Code.Agda.Builtin.List.T_List_10 () T_InlineHints_42 -> + T_InlineHints_42 +check_constr_66 = Hints.InlConstr +check_case_68 :: + T_InlineHints_42 -> + MAlonzo.Code.Agda.Builtin.List.T_List_10 () T_InlineHints_42 -> + T_InlineHints_42 +check_case_68 = Hints.InlCase +cover_InlineHints_42 :: Hints.Inline -> () +cover_InlineHints_42 x = case x of Hints.InlVar -> () Hints.InlExpand _ -> () @@ -196,110 +186,110 @@ cover_InlineHints_46 x Hints.InlConstr _ -> () Hints.InlCase _ _ -> () -- VerifiedCompilation.Trace.Hints -d_Hints_74 = () -type T_Hints_74 = Hints.Hints -pattern C_inline_76 a0 = Hints.Inline a0 -pattern C_none_78 = Hints.NoHints -check_inline_76 :: T_InlineHints_46 -> T_Hints_74 -check_inline_76 = Hints.Inline -check_none_78 :: T_Hints_74 -check_none_78 = Hints.NoHints -cover_Hints_74 :: Hints.Hints -> () -cover_Hints_74 x +d_Hints_70 = () +type T_Hints_70 = Hints.Hints +pattern C_inline_72 a0 = Hints.Inline a0 +pattern C_none_74 = Hints.NoHints +check_inline_72 :: T_InlineHints_42 -> T_Hints_70 +check_inline_72 = Hints.Inline +check_none_74 :: T_Hints_70 +check_none_74 = Hints.NoHints +cover_Hints_70 :: Hints.Hints -> () +cover_Hints_70 x = case x of Hints.Inline _ -> () Hints.NoHints -> () -- VerifiedCompilation.Trace.Trace -d_Trace_82 a0 = () -data T_Trace_82 - = C_step_86 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) - T_Hints_74 AgdaAny T_Trace_82 | - C_done_88 AgdaAny +d_Trace_78 a0 = () +data T_Trace_78 + = C_step_82 (MAlonzo.Code.Utils.T_Either_6 + T_NICSimplifierTag_4 T_ICSimplifierTag_8) + T_Hints_70 AgdaAny T_Trace_78 | + C_done_84 AgdaAny -- VerifiedCompilation.Trace.head -d_head_92 :: T_Trace_82 -> AgdaAny -d_head_92 v0 +d_head_88 :: T_Trace_78 -> AgdaAny +d_head_88 v0 = case coe v0 of - C_step_86 v1 v2 v3 v4 -> coe v3 - C_done_88 v1 -> coe v1 + C_step_82 v1 v2 v3 v4 -> coe v3 + C_done_84 v1 -> coe v1 _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.Trace.Dump -d_Dump_98 :: () -d_Dump_98 = erased +d_Dump_94 :: () +d_Dump_94 = erased -- VerifiedCompilation.Trace.toTrace -d_toTrace_100 :: +d_toTrace_96 :: [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_NICSimplifierTag_4 T_ICSimplifierTag_8) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_74 + T_Hints_70 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> - Maybe T_Trace_82 -d_toTrace_100 v0 + Maybe T_Trace_78 +d_toTrace_96 v0 = case coe v0 of [] -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 (:) v1 v2 -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 - (coe du_go_110 (coe v1) (coe v2)) + (coe du_go_106 (coe v1) (coe v2)) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.Trace._.go -d_go_110 :: +d_go_106 :: MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_NICSimplifierTag_4 T_ICSimplifierTag_8) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_74 + T_Hints_70 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208)) -> [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_NICSimplifierTag_4 T_ICSimplifierTag_8) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_74 + T_Hints_70 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_NICSimplifierTag_4 T_ICSimplifierTag_8) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_74 + T_Hints_70 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208)) -> [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_NICSimplifierTag_4 T_ICSimplifierTag_8) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_74 + T_Hints_70 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> - T_Trace_82 -d_go_110 ~v0 ~v1 v2 v3 = du_go_110 v2 v3 -du_go_110 :: + T_Trace_78 +d_go_106 ~v0 ~v1 v2 v3 = du_go_106 v2 v3 +du_go_106 :: MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_NICSimplifierTag_4 T_ICSimplifierTag_8) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_74 + T_Hints_70 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208)) -> [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_NICSimplifierTag_4 T_ICSimplifierTag_8) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_74 + T_Hints_70 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> - T_Trace_82 -du_go_110 v0 v1 + T_Trace_78 +du_go_106 v0 v1 = case coe v0 of MAlonzo.Code.Utils.C__'44'__442 v2 v3 -> case coe v3 of @@ -309,7 +299,7 @@ du_go_110 v0 v1 -> case coe v1 of [] -> coe - C_step_86 (coe v2) (coe v4) (coe v6) (coe C_done_88 (coe v7)) + C_step_82 (coe v2) (coe v4) (coe v6) (coe C_done_84 (coe v7)) (:) v8 v9 -> case coe v8 of MAlonzo.Code.Utils.C__'44'__442 v10 v11 @@ -318,9 +308,9 @@ du_go_110 v0 v1 -> case coe v13 of MAlonzo.Code.Utils.C__'44'__442 v14 v15 -> coe - C_step_86 (coe v2) (coe v4) (coe v6) + C_step_82 (coe v2) (coe v4) (coe v6) (coe - du_go_110 + du_go_106 (coe MAlonzo.Code.Utils.C__'44'__442 (coe v10) @@ -339,18 +329,18 @@ du_go_110 v0 v1 _ -> MAlonzo.RTE.mazUnreachableError _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.Trace.EvalResult -d_EvalResult_136 = () -type T_EvalResult_136 = EvalResult -pattern C_success_138 a0 a1 = EvalSuccess a0 a1 -pattern C_failure_140 a0 a1 a2 = EvalFailure a0 a1 a2 -check_success_138 :: Integer -> Integer -> T_EvalResult_136 -check_success_138 = EvalSuccess -check_failure_140 :: +d_EvalResult_132 = () +type T_EvalResult_132 = EvalResult +pattern C_success_134 a0 a1 = EvalSuccess a0 a1 +pattern C_failure_136 a0 a1 a2 = EvalFailure a0 a1 a2 +check_success_134 :: Integer -> Integer -> T_EvalResult_132 +check_success_134 = EvalSuccess +check_failure_136 :: MAlonzo.Code.Agda.Builtin.String.T_String_6 -> - Integer -> Integer -> T_EvalResult_136 -check_failure_140 = EvalFailure -cover_EvalResult_136 :: EvalResult -> () -cover_EvalResult_136 x + Integer -> Integer -> T_EvalResult_132 +check_failure_136 = EvalFailure +cover_EvalResult_132 :: EvalResult -> () +cover_EvalResult_132 x = case x of EvalSuccess _ _ -> () EvalFailure _ _ _ -> () diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs index f58c0107bde..a688320ac63 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs @@ -44,7 +44,7 @@ d_a2c'63''7580''7580'_24 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_38) (coe d_a2c'63'_32) -- VerifiedCompilation.UApplyToCase.a2c? d_a2c'63'_32 :: @@ -75,31 +75,31 @@ d_a2c'63'_32 v0 v1 v2 MAlonzo.Code.Untyped.C_'96'_18 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_38 v1 v2 MAlonzo.Code.Untyped.C_ƛ_20 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_38 v1 v2 MAlonzo.Code.Untyped.C__'183'__22 v5 v6 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_38 v1 v2 MAlonzo.Code.Untyped.C_force_24 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_38 v1 v2 MAlonzo.Code.Untyped.C_delay_26 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_38 v1 v2 MAlonzo.Code.Untyped.C_con_28 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_38 v1 v2 MAlonzo.Code.Untyped.C_constr_34 v5 v6 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_38 v1 v2 MAlonzo.Code.Untyped.C_case_40 v5 v6 -> let v7 = coe @@ -241,18 +241,18 @@ d_a2c'63'_32 v0 v1 v2 seq (coe v12) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_38 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError) MAlonzo.Code.Untyped.C_builtin_44 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_38 v1 v2 MAlonzo.Code.Untyped.C_error_46 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_38 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError)) -- VerifiedCompilation.UApplyToCase..extendedlambda0 d_'46'extendedlambda0_48 :: @@ -276,7 +276,7 @@ d_'46'extendedlambda1_94 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> T_ApplyToCase_4 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs index 5470b645dbb..2cffb6cadba 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs @@ -47,7 +47,7 @@ d_isUntypedCSE'63'_26 :: d_isUntypedCSE'63'_26 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 - (coe v0) (coe MAlonzo.Code.VerifiedCompilation.Trace.d_cseTag_38) + (coe v0) (coe MAlonzo.Code.VerifiedCompilation.Trace.d_cseTag_36) (coe d_isUCSE'63'_30) -- VerifiedCompilation.UCSE.isUCSE? d_isUCSE'63'_30 :: @@ -116,7 +116,7 @@ d_isUCSE'63'_30 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_cseTag_38 v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_cseTag_36 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UCSE..extendedlambda0 d_'46'extendedlambda0_46 :: @@ -139,7 +139,7 @@ d_'46'extendedlambda1_78 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> T_UCSE_4 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda1_78 = erased diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs index 6381378e2cc..d5094859245 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs @@ -474,7 +474,7 @@ d_isCaseOfCase'63'_256 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_40) (coe d_isCoC'63'_264) -- VerifiedCompilation.UCaseOfCase.isCoC? d_isCoC'63'_264 :: @@ -585,7 +585,7 @@ d_isCoC'63'_264 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42) + MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_40) (coe d_isCaseOfCase'63'_256 (coe @@ -602,7 +602,7 @@ d_isCoC'63'_264 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42) + MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_40) (coe d_isCaseOfCase'63'_256 (coe @@ -619,7 +619,7 @@ d_isCoC'63'_264 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42) + MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_40) (coe d_isCaseOfCase'63'_256 (coe @@ -668,7 +668,7 @@ d_isCoC'63'_264 v0 v1 v2 v40) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42 + MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_40 (coe MAlonzo.Code.Untyped.C_case_40 (coe @@ -740,7 +740,7 @@ d_isCoC'63'_264 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42 v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_40 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UCaseOfCase..extendedlambda4 d_'46'extendedlambda4_280 :: @@ -781,7 +781,7 @@ d_'46'extendedlambda6_444 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -804,7 +804,7 @@ d_'46'extendedlambda7_524 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> @@ -828,7 +828,7 @@ d_'46'extendedlambda8_608 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs index 0d61b226ee6..8b0010cea8a 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs @@ -50,7 +50,7 @@ d_isCaseReduce'63'_26 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_caseReduceTag_34) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_caseReduceTag_32) (coe d_isCR'63'_42) -- VerifiedCompilation.UCaseReduce.justEq d_justEq_34 :: @@ -133,7 +133,7 @@ d_isCR'63'_42 v0 v1 v2 MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_caseReduceTag_34 + MAlonzo.Code.VerifiedCompilation.Trace.d_caseReduceTag_32 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError))) _ -> MAlonzo.RTE.mazUnreachableError @@ -145,7 +145,7 @@ d_isCR'63'_42 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_caseReduceTag_34 v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_caseReduceTag_32 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UCaseReduce..extendedlambda0 d_'46'extendedlambda0_58 :: @@ -192,7 +192,7 @@ d_'46'extendedlambda3_142 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs index b2b79403104..a91c5016ab6 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs @@ -541,7 +541,7 @@ d_isFloatDelay'63'_488 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_28) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_26) (coe d_isFlD'63'_492) -- VerifiedCompilation.UFloatDelay.isFlD? d_isFlD'63'_492 :: @@ -697,7 +697,7 @@ d_isFlD'63'_492 v0 v1 v2 v38) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_28 + MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_26 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) @@ -726,7 +726,7 @@ d_isFlD'63'_492 v0 v1 v2 v21) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_28 + MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_26 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -741,7 +741,7 @@ d_isFlD'63'_492 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_28 v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_26 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UFloatDelay..extendedlambda8 d_'46'extendedlambda8_508 :: @@ -773,7 +773,7 @@ d_'46'extendedlambda10_582 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -791,7 +791,7 @@ d_'46'extendedlambda11_630 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs index 871ee8402b8..ae5ad9f83a6 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs @@ -167,7 +167,7 @@ d_isForceCaseDelay'63'_94 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_30) (coe d_isFCD'63'_96) -- VerifiedCompilation.UForceCaseDelay.isFCD? d_isFCD'63'_96 :: @@ -271,7 +271,7 @@ d_isFCD'63'_96 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32) + MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_30) (coe d_isForceCaseDelay'63'_94 (coe @@ -298,14 +298,14 @@ d_isFCD'63'_96 v0 v1 v2 MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 v36 v37 v38 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_30 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError) MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 v34 v35 v36 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_30 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError) @@ -316,7 +316,7 @@ d_isFCD'63'_96 v0 v1 v2 v28) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_30 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError))) @@ -327,7 +327,7 @@ d_isFCD'63'_96 v0 v1 v2 seq (coe v18) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_30 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError))) _ -> MAlonzo.RTE.mazUnreachableError @@ -339,7 +339,7 @@ d_isFCD'63'_96 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 v1 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_30 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UForceCaseDelay..extendedlambda1 @@ -383,7 +383,7 @@ d_'46'extendedlambda4_228 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> @@ -402,7 +402,7 @@ d_'46'extendedlambda5_280 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs index fc14f306035..70c557dca76 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs @@ -583,7 +583,7 @@ d_isForceDelay'63'_178 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_28) (coe (\ v1 -> d_isFD'63'_184 (coe v1) (coe C_'9633'_82))) -- VerifiedCompilation.UForceDelay.isFD? d_isFD'63'_184 :: @@ -745,7 +745,7 @@ d_isFD'63'_184 v0 v1 v2 v3 seq (coe v9) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_28 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError) @@ -1114,7 +1114,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v87) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_28 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError) @@ -1146,7 +1146,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v80) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_28 v16 v22) _ -> MAlonzo.RTE.mazUnreachableError @@ -1157,7 +1157,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v77) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_28 v43 v59) _ -> MAlonzo.RTE.mazUnreachableError))))) @@ -1329,7 +1329,7 @@ d_isFD'63'_184 v0 v1 v2 v3 seq (coe v13) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_28 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -1851,7 +1851,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v98) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_28 v15 v3) _ -> MAlonzo.RTE.mazUnreachableError) @@ -1883,7 +1883,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v91) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_28 v27 v33) _ -> MAlonzo.RTE.mazUnreachableError @@ -1894,7 +1894,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v88) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_28 v54 v70) _ -> MAlonzo.RTE.mazUnreachableError))))) @@ -2085,7 +2085,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v24) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_28 v15 v3) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -2228,7 +2228,7 @@ d_isFD'63'_184 v0 v1 v2 v3 seq (coe v14) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_28 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -2255,7 +2255,7 @@ d_'46'extendedlambda2_246 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda2_246 = erased @@ -2273,7 +2273,7 @@ d_'46'extendedlambda3_320 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.VerifiedCompilation.UntypedViews.T_isForce_270 -> @@ -2292,7 +2292,7 @@ d_'46'extendedlambda4_348 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2322,7 +2322,7 @@ d_'46'extendedlambda6_476 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2334,7 +2334,7 @@ d_'46'extendedlambda6_476 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda6_476 = erased @@ -2354,7 +2354,7 @@ d_'46'extendedlambda7_518 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda7_518 = erased @@ -2381,7 +2381,7 @@ d_'46'extendedlambda8_634 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2410,7 +2410,7 @@ d_'46'extendedlambda9_688 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2434,7 +2434,7 @@ d_'46'extendedlambda10_750 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2446,7 +2446,7 @@ d_'46'extendedlambda10_750 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2470,7 +2470,7 @@ d_'46'extendedlambda11_814 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2481,7 +2481,7 @@ d_'46'extendedlambda11_814 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2506,7 +2506,7 @@ d_'46'extendedlambda12_880 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Builtin.T_Builtin_2 -> @@ -2516,7 +2516,7 @@ d_'46'extendedlambda12_880 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2546,7 +2546,7 @@ d_'46'extendedlambda13_1034 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2567,7 +2567,7 @@ d_'46'extendedlambda14_1074 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2584,7 +2584,7 @@ d_'46'extendedlambda15_1190 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> @@ -2592,7 +2592,7 @@ d_'46'extendedlambda15_1190 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2610,7 +2610,7 @@ d_'46'extendedlambda16_1214 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2629,7 +2629,7 @@ d_'46'extendedlambda17_1238 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2661,7 +2661,7 @@ d_'46'extendedlambda19_1340 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.VerifiedCompilation.UntypedViews.T_isDelay_356 -> @@ -2681,7 +2681,7 @@ d_'46'extendedlambda20_1454 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> @@ -2689,7 +2689,7 @@ d_'46'extendedlambda20_1454 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2706,7 +2706,7 @@ d_'46'extendedlambda21_1480 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2724,7 +2724,7 @@ d_'46'extendedlambda22_1506 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2742,7 +2742,7 @@ d_'46'extendedlambda23_1574 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2780,7 +2780,7 @@ d_'46'extendedlambda25_1698 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.VerifiedCompilation.UntypedViews.T_isForce_270 -> @@ -2803,7 +2803,7 @@ d_'46'extendedlambda26_1732 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs index fec8c09e8d0..bac9041c01c 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs @@ -297,7 +297,7 @@ d_checkPointwise_304 :: Integer -> T__'8605'_28 -> T__'8605'_28 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42] -> (MAlonzo.Code.Data.Fin.Base.T_Fin_10 -> MAlonzo.Code.Untyped.T__'8866'_14) -> T__'8829'__102 -> @@ -308,7 +308,7 @@ d_checkPointwise_304 v0 v1 v2 v3 v4 v5 v6 v7 = let v8 = coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 v6 v7 in + MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_34 v6 v7 in coe (case coe v3 of [] @@ -354,7 +354,7 @@ d_check_316 :: Integer -> T__'8605'_28 -> T__'8605'_28 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42 -> (MAlonzo.Code.Data.Fin.Base.T_Fin_10 -> MAlonzo.Code.Untyped.T__'8866'_14) -> T__'8829'__102 -> @@ -365,10 +365,10 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 = let v8 = coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 v6 v7 in + MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_34 v6 v7 in coe (case coe v3 of - MAlonzo.Code.VerifiedCompilation.Trace.C_var_48 + MAlonzo.Code.VerifiedCompilation.Trace.C_var_44 -> case coe v6 of MAlonzo.Code.Untyped.C_'96'_18 v9 -> case coe v7 of @@ -385,7 +385,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 -> let v15 = coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_34 v6 v7 in coe (case coe v13 of @@ -418,7 +418,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_34 v6 v6 _ -> MAlonzo.RTE.mazUnreachableError) _ -> coe v15 @@ -429,7 +429,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> MAlonzo.RTE.mazUnreachableError)) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_expand_50 v9 + MAlonzo.Code.VerifiedCompilation.Trace.C_expand_46 v9 -> case coe v6 of MAlonzo.Code.Untyped.C_'96'_18 v10 -> coe @@ -443,7 +443,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 MAlonzo.Code.VerifiedCompilation.Certificate.C_proof_72 (coe C_'96''8595'_234 v11))) _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_52 v9 + MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_48 v9 -> case coe v5 of C_'9633'_106 -> case coe v6 of @@ -505,7 +505,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> coe v8 _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ'8595'_54 v9 + MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ'8595'_50 v9 -> case coe v5 of C_drop_122 v13 -> case coe v1 of @@ -545,7 +545,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> coe v8 _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C__'183'__56 v9 v10 + MAlonzo.Code.VerifiedCompilation.Trace.C__'183'__52 v9 v10 -> case coe v6 of MAlonzo.Code.Untyped.C__'183'__22 v11 v12 -> case coe v7 of @@ -570,7 +570,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 (coe C__'183'__250 v15 v16))))) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C__'183''8595'_58 v9 + MAlonzo.Code.VerifiedCompilation.Trace.C__'183''8595'_54 v9 -> case coe v6 of MAlonzo.Code.Untyped.C__'183'__22 v10 v11 -> coe @@ -585,7 +585,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 MAlonzo.Code.VerifiedCompilation.Certificate.C_proof_72 (coe C__'183''8595'_254 v12))) _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_force_60 v9 + MAlonzo.Code.VerifiedCompilation.Trace.C_force_56 v9 -> case coe v6 of MAlonzo.Code.Untyped.C_force_24 v10 -> case coe v7 of @@ -602,7 +602,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 (coe C_force_258 v12))) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_delay_62 v9 + MAlonzo.Code.VerifiedCompilation.Trace.C_delay_58 v9 -> case coe v6 of MAlonzo.Code.Untyped.C_delay_26 v10 -> case coe v7 of @@ -619,7 +619,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 (coe C_delay_262 v12))) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_con_64 + MAlonzo.Code.VerifiedCompilation.Trace.C_con_60 -> case coe v6 of MAlonzo.Code.Untyped.C_con_28 v9 -> case coe v7 of @@ -640,12 +640,12 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v13) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_34 v6 v7) _ -> MAlonzo.RTE.mazUnreachableError) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_builtin_66 + MAlonzo.Code.VerifiedCompilation.Trace.C_builtin_62 -> case coe v6 of MAlonzo.Code.Untyped.C_builtin_44 v9 -> case coe v7 of @@ -665,12 +665,12 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v13) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_34 v6 v7) _ -> MAlonzo.RTE.mazUnreachableError) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_error_68 + MAlonzo.Code.VerifiedCompilation.Trace.C_error_64 -> case coe v6 of MAlonzo.Code.Untyped.C_error_46 -> case coe v7 of @@ -680,7 +680,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 (coe C_error_292) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_constr_70 v9 + MAlonzo.Code.VerifiedCompilation.Trace.C_constr_66 v9 -> case coe v6 of MAlonzo.Code.Untyped.C_constr_34 v10 v11 -> case coe v7 of @@ -717,12 +717,12 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v16) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_34 v6 v7) _ -> MAlonzo.RTE.mazUnreachableError) _ -> coe v8 _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_case_72 v9 v10 + MAlonzo.Code.VerifiedCompilation.Trace.C_case_68 v9 v10 -> case coe v6 of MAlonzo.Code.Untyped.C_case_40 v11 v12 -> case coe v7 of @@ -750,7 +750,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UInline.top-check d_top'45'check_718 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.VerifiedCompilation.Certificate.T_Proof'63'_66 @@ -840,7 +840,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 C_'96'_230 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_var_48) erased + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_var_44) erased C_'96''8595'_234 v14 -> case coe v5 of MAlonzo.Code.Untyped.C_'96'_18 v15 @@ -853,7 +853,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 v17 v18 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_expand_50 (coe v17)) + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_expand_46 (coe v17)) erased _ -> MAlonzo.RTE.mazUnreachableError) _ -> MAlonzo.RTE.mazUnreachableError @@ -878,7 +878,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_52 (coe v15)) + MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_48 (coe v15)) erased _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError @@ -917,7 +917,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_52 + MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_48 (coe v27)) erased _ -> MAlonzo.RTE.mazUnreachableError) @@ -962,7 +962,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ'8595'_54 + MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ'8595'_50 (coe v26)) erased _ -> MAlonzo.RTE.mazUnreachableError) @@ -993,7 +993,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C__'183'__56 + MAlonzo.Code.VerifiedCompilation.Trace.C__'183'__52 (coe v24) (coe v26)) erased _ -> MAlonzo.RTE.mazUnreachableError @@ -1014,7 +1014,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C__'183''8595'_58 (coe v19)) + MAlonzo.Code.VerifiedCompilation.Trace.C__'183''8595'_54 (coe v19)) erased _ -> MAlonzo.RTE.mazUnreachableError) _ -> MAlonzo.RTE.mazUnreachableError @@ -1033,7 +1033,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_force_60 (coe v18)) + MAlonzo.Code.VerifiedCompilation.Trace.C_force_56 (coe v18)) erased _ -> MAlonzo.RTE.mazUnreachableError) _ -> MAlonzo.RTE.mazUnreachableError @@ -1053,7 +1053,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_delay_62 (coe v18)) + MAlonzo.Code.VerifiedCompilation.Trace.C_delay_58 (coe v18)) erased _ -> MAlonzo.RTE.mazUnreachableError) _ -> MAlonzo.RTE.mazUnreachableError @@ -1061,11 +1061,11 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 C_con_266 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_con_64) erased + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_con_60) erased C_builtin_270 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_builtin_66) erased + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_builtin_62) erased C_constr_280 v15 -> case coe v5 of MAlonzo.Code.Untyped.C_constr_34 v16 v17 @@ -1081,7 +1081,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_constr_70 + MAlonzo.Code.VerifiedCompilation.Trace.C_constr_66 (coe v21)) erased _ -> MAlonzo.RTE.mazUnreachableError) @@ -1109,7 +1109,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_case_72 + MAlonzo.Code.VerifiedCompilation.Trace.C_case_68 (coe v24) (coe v26)) erased _ -> MAlonzo.RTE.mazUnreachableError @@ -1123,7 +1123,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v6) (coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_error_68) erased)) + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_error_64) erased)) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.UInline._.e′ d_e'8242'_844 :: @@ -1137,7 +1137,7 @@ d_e'8242'_844 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_844 = erased @@ -1161,7 +1161,7 @@ d_e'8242'_906 :: MAlonzo.Code.Data.Fin.Base.T_Fin_10 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_906 = erased @@ -1173,7 +1173,7 @@ d_e'8242'_940 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_940 = erased @@ -1189,7 +1189,7 @@ d_e'8242'_982 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_982 = erased @@ -1207,9 +1207,9 @@ d_e'8243'_1036 :: MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8243'_1036 = erased @@ -1221,7 +1221,7 @@ d_e'8242'_1078 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> T__'8605'_28 -> T__'8605'_28 -> @@ -1235,7 +1235,7 @@ d_e'8242'_1116 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> T__'8605'_28 -> T__'8605'_28 -> @@ -1271,7 +1271,7 @@ d_e'8242'_1190 :: [MAlonzo.Code.Untyped.T__'8866'_14] -> [MAlonzo.Code.Untyped.T__'8866'_14] -> MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base.T_Pointwise_48 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42] -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> T__'8605'_28 -> T__'8605'_28 -> @@ -1289,9 +1289,9 @@ d_e'8243'_1248 :: [MAlonzo.Code.Untyped.T__'8866'_14] -> T_Inline_224 -> MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base.T_Pointwise_48 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42] -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> T__'8605'_28 -> T__'8605'_28 -> @@ -1309,7 +1309,7 @@ d_e'8242'_1298 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_1298 = erased @@ -1327,9 +1327,9 @@ d_e'8243'_1356 :: [MAlonzo.Code.Untyped.T__'8866'_14] -> T_Inline_224 -> MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base.T_Pointwise_48 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_42] -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8243'_1356 = erased diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs index 2b0eeadfe3b..0f0137d3d1e 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs @@ -87,7 +87,7 @@ d_translation'63'_164 :: MAlonzo.Code.Untyped.T__'8866'_14 -> ()) -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -101,7 +101,7 @@ du_translation'63'_164 :: Integer -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2833,7 +2833,7 @@ d_decPointwiseTranslation'63'_176 :: MAlonzo.Code.Untyped.T__'8866'_14 -> ()) -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2847,7 +2847,7 @@ du_decPointwiseTranslation'63'_176 :: Integer -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> diff --git a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md index 243efdb4669..c52279cb69a 100644 --- a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md @@ -25,7 +25,6 @@ We enumerate the known passes: data NICSimplifierTag : Set where caseOfCaseT : NICSimplifierTag - unknown : NICSimplifierTag -- a placeholder for passes that we don't yet know of, so the certifier doesn't break if a pass was added data ICSimplifierTag : Set where floatDelayT : ICSimplifierTag @@ -55,12 +54,10 @@ applyToCaseTag = Utils.inj₂ applyToCaseT caseOfCaseTag : SimplifierTag caseOfCaseTag = Utils.inj₁ caseOfCaseT -unknownTag : SimplifierTag -unknownTag = Utils.inj₁ unknown {-# FOREIGN GHC import UntypedPlutusCore.Transform.Simplifier #-} {-# COMPILE GHC ICSimplifierTag = data ICSimplifierStage (FloatDelay | ForceDelay | ForceCaseDelay | CaseReduce | Inline | CSE | ApplyToCase) #-} -{-# COMPILE GHC NICSimplifierTag = data NICSimplifierStage (CaseOfCase | Unknown) #-} +{-# COMPILE GHC NICSimplifierTag = data NICSimplifierStage (CaseOfCase) #-} ``` ## Hints From 367c063bf001deebbe058e65b18f2fb5c162a7db Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Wed, 15 Apr 2026 20:29:43 +0300 Subject: [PATCH 07/16] Use the safeOpts option, refactor simplifier --- .../src/UntypedPlutusCore/Simplify.hs | 61 ++++++++++++++----- .../src/UntypedPlutusCore/Simplify/Opts.hs | 12 +++- .../Transform/ApplyToCase.hs | 6 +- .../UntypedPlutusCore/Transform/CaseOfCase.hs | 5 +- .../UntypedPlutusCore/Transform/CaseReduce.hs | 5 +- .../Transform/Certify/Trace.hs | 52 ++++++++++------ .../src/UntypedPlutusCore/Transform/Cse.hs | 17 ++---- .../UntypedPlutusCore/Transform/FloatDelay.hs | 5 +- .../Transform/ForceCaseDelay.hs | 5 +- .../UntypedPlutusCore/Transform/ForceDelay.hs | 5 +- .../src/UntypedPlutusCore/Transform/Inline.hs | 5 +- .../UntypedPlutusCore/Transform/Simplifier.hs | 28 ++++++--- .../src/PlutusCore/Executable/Parsers.hs | 9 ++- .../test/certifier/Test/Certifier/AST.hs | 8 +-- .../Test/Certifier/AST/ForceDelay.hs | 20 +++--- 15 files changed, 157 insertions(+), 86 deletions(-) diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify.hs index c01298cf661..67fdc43b536 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify.hs @@ -76,8 +76,8 @@ termSimplifier -> SimplifierT name uni fun a m (Term name uni fun a) termSimplifier opts builtinSemanticsVariant = simplifyNTimes (_soMaxSimplifierIterations opts) - >=> cseNTimes cseTimes - >=> (if _soApplyToCase opts then applyToCase else pure) + >=> runStage CseStage + >=> runStage ApplyToCaseStage where -- Run the simplifier @n@ times simplifyNTimes @@ -100,19 +100,50 @@ termSimplifier opts builtinSemanticsVariant = -> Term name uni fun a -> SimplifierT name uni fun a m (Term name uni fun a) simplifyStep _ = - floatDelay - >=> forceCaseDelay - >=> case (eqT @uni @PLC.DefaultUni, eqT @fun @DefaultFun) of - (Just Refl, Just Refl) -> forceDelay builtinSemanticsVariant - _ -> pure - >=> caseOfCase' - >=> caseReduce - >=> inline - (_soInlineCallsiteGrowth opts) - (_soInlineConstants opts) - (_soPreserveLogging opts) - (_soInlineHints opts) - builtinSemanticsVariant + runStage FloatDelayStage + >=> runStage ForceCaseDelayStage + >=> runStage ForceDelayStage + >=> runStage CaseOfCaseStage + >=> runStage CaseReduceStage + >=> runStage InlineStage + + runStage stage' = + let isIC = either (const False) (const True) stage' + withSafeOpts action + | _soSafeOpts opts + , isIC = + action + | _soSafeOpts opts + , not isIC = + return + | otherwise = action + in case stage' of + FloatDelayStage -> + withSafeOpts floatDelay + ForceCaseDelayStage -> + withSafeOpts forceCaseDelay + ForceDelayStage -> + withSafeOpts $ + case (eqT @uni @PLC.DefaultUni, eqT @fun @DefaultFun) of + (Just Refl, Just Refl) -> forceDelay builtinSemanticsVariant + _ -> pure + CaseOfCaseStage -> + withSafeOpts caseOfCase' + CaseReduceStage -> + withSafeOpts caseReduce + InlineStage -> + withSafeOpts $ + inline + (_soInlineCallsiteGrowth opts) + (_soInlineConstants opts) + (_soPreserveLogging opts) + (_soInlineHints opts) + builtinSemanticsVariant + CseStage -> + withSafeOpts $ cseNTimes cseTimes + ApplyToCaseStage -> + withSafeOpts $ + if _soApplyToCase opts then applyToCase else pure caseOfCase' :: Term name uni fun a diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify/Opts.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify/Opts.hs index 79ff7737649..503016c0002 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify/Opts.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify/Opts.hs @@ -11,7 +11,9 @@ module UntypedPlutusCore.Simplify.Opts , soInlineConstants , soInlineCallsiteGrowth , soPreserveLogging + , soSafeOpts , defaultSimplifyOpts + , CseWhichSubterms (..) ) where import Control.Lens.TH (makeLenses) @@ -19,7 +21,15 @@ import Data.Default.Class import PlutusCore.Annotation (InlineHints (..)) import PlutusCore.AstSize -import UntypedPlutusCore.Transform.Cse (CseWhichSubterms (..)) +import PlutusCore.Pretty +import Prettyprinter (viaShow) + +-- | Which subterms should be considered as candidates for CSE? +data CseWhichSubterms = AllSubterms | ExcludeWorkFree + deriving stock (Show, Read) + +instance Pretty CseWhichSubterms where + pretty = viaShow data SimplifyOpts name a = SimplifyOpts { _soMaxSimplifierIterations :: Int diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ApplyToCase.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ApplyToCase.hs index 16061872feb..0a91a8ce230 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ApplyToCase.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ApplyToCase.hs @@ -1,3 +1,5 @@ +{-# LANGUAGE PatternSynonyms #-} + {-| Transform multi-argument applications into case-constr form. @@ -18,8 +20,8 @@ import Data.Vector qualified as V import UntypedPlutusCore.Core import UntypedPlutusCore.Transform.Simplifier ( SimplifierT - , applyToCaseStage , recordSimplification + , pattern ApplyToCaseStage ) minArgs :: Int @@ -32,7 +34,7 @@ applyToCase -> SimplifierT name uni fun a m (Term name uni fun a) applyToCase term = do let result = processTerm term - recordSimplification term applyToCaseStage result + recordSimplification term ApplyToCaseStage result pure result processTerm :: Term name uni fun a -> Term name uni fun a diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseOfCase.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseOfCase.hs index 42be468ec03..71037818fc6 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseOfCase.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseOfCase.hs @@ -1,4 +1,5 @@ {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} @@ -44,8 +45,8 @@ import UntypedPlutusCore.Core import UntypedPlutusCore.Transform.CaseReduce qualified as CaseReduce import UntypedPlutusCore.Transform.Simplifier ( SimplifierT - , caseOfCaseStage , recordSimplification + , pattern CaseOfCaseStage ) import Control.Lens @@ -63,7 +64,7 @@ caseOfCase -> SimplifierT name uni fun a m (Term name uni fun a) caseOfCase term = do let result = transformOf termSubterms processTerm term - recordSimplification term caseOfCaseStage result + recordSimplification term CaseOfCaseStage result return result processTerm diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseReduce.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseReduce.hs index 3414669b166..0d247136b74 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseReduce.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseReduce.hs @@ -1,4 +1,5 @@ {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE TupleSections #-} module UntypedPlutusCore.Transform.CaseReduce @@ -14,8 +15,8 @@ import PlutusCore.MkPlc import UntypedPlutusCore.Core import UntypedPlutusCore.Transform.Simplifier ( SimplifierT - , caseReduceStage , recordSimplification + , pattern CaseReduceStage ) caseReduce @@ -24,7 +25,7 @@ caseReduce -> SimplifierT name uni fun a m (Term name uni fun a) caseReduce term = do let result = transformOf termSubterms processTerm term - recordSimplification term caseReduceStage result + recordSimplification term CaseReduceStage result return result processTerm :: CaseBuiltin uni => Term name uni fun a -> Term name uni fun a diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs index 1370e2617d7..d3437ef4ccc 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs @@ -1,5 +1,6 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE PatternSynonyms #-} module UntypedPlutusCore.Transform.Certify.Trace where @@ -27,23 +28,40 @@ data NICSimplifierStage type SimplifierStage = Either NICSimplifierStage ICSimplifierStage -floatDelayStage - , forceDelayStage - , forceCaseDelayStage - , caseReduceStage - , inlineStage - , cseStage - , applyToCaseStage - , caseOfCaseStage - :: SimplifierStage -floatDelayStage = Right FloatDelay -forceDelayStage = Right ForceDelay -forceCaseDelayStage = Right ForceCaseDelay -caseReduceStage = Right CaseReduce -inlineStage = Right Inline -cseStage = Right CSE -applyToCaseStage = Right ApplyToCase -caseOfCaseStage = Left CaseOfCase +pattern FloatDelayStage :: SimplifierStage +pattern FloatDelayStage = Right FloatDelay + +pattern ForceDelayStage :: SimplifierStage +pattern ForceDelayStage = Right ForceDelay + +pattern ForceCaseDelayStage :: SimplifierStage +pattern ForceCaseDelayStage = Right ForceCaseDelay + +pattern CaseReduceStage :: SimplifierStage +pattern CaseReduceStage = Right CaseReduce + +pattern InlineStage :: SimplifierStage +pattern InlineStage = Right Inline + +pattern CseStage :: SimplifierStage +pattern CseStage = Right CSE + +pattern ApplyToCaseStage :: SimplifierStage +pattern ApplyToCaseStage = Right ApplyToCase + +pattern CaseOfCaseStage :: SimplifierStage +pattern CaseOfCaseStage = Left CaseOfCase + +{-# COMPLETE + FloatDelayStage + , ForceDelayStage + , ForceCaseDelayStage + , CaseReduceStage + , InlineStage + , CseStage + , ApplyToCaseStage + , CaseOfCaseStage + #-} data Simplification name uni fun a = Simplification diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Cse.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Cse.hs index 135bb5e01fd..a49ff55320a 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Cse.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Cse.hs @@ -1,22 +1,22 @@ {-# LANGUAGE BlockArguments #-} {-# LANGUAGE LambdaCase #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} -module UntypedPlutusCore.Transform.Cse (cse, CseWhichSubterms (..)) where +module UntypedPlutusCore.Transform.Cse (cse) where import PlutusCore (MonadQuote, Name, Rename, freshName, rename) import PlutusCore.Builtin (ToBuiltinMeaning (BuiltinSemanticsVariant)) -import PlutusCore.Pretty -import Prettyprinter (viaShow) import UntypedPlutusCore.AstSize (termAstSize) import UntypedPlutusCore.Core import UntypedPlutusCore.Purity (isWorkFree) +import UntypedPlutusCore.Simplify.Opts (CseWhichSubterms (..)) import UntypedPlutusCore.Transform.Simplifier ( SimplifierT - , cseStage , recordSimplification + , pattern CseStage ) import Control.Arrow ((>>>)) @@ -205,13 +205,6 @@ type Path = [Int] isAncestorOrSelf :: Path -> Path -> Bool isAncestorOrSelf = isSuffixOf --- | Which subterms should be considered as candidates? -data CseWhichSubterms = AllSubterms | ExcludeWorkFree - deriving stock (Show, Read) - -instance Pretty CseWhichSubterms where - pretty = viaShow - data CseCandidate uni fun ann = CseCandidate { ccFreshName :: Name , ccTerm :: Term Name uni fun () @@ -244,7 +237,7 @@ cse whichSubterms builtinSemanticsVariant t0 = do . Map.elems $ countOccs whichSubterms builtinSemanticsVariant annotated result <- mkCseTerm commonSubexprs annotated - recordSimplification t0 cseStage result + recordSimplification t0 CseStage result return result -- | The second pass. See Note [CSE]. diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/FloatDelay.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/FloatDelay.hs index 0c6c7a01675..74e912593d9 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/FloatDelay.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/FloatDelay.hs @@ -1,4 +1,5 @@ {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE PatternSynonyms #-} {-| The Float Delay optimization floats `Delay` from arguments into function bodies, if possible. It turns @(\n -> ...Force n...Force n...) (Delay arg)@ into @@ -62,8 +63,8 @@ import UntypedPlutusCore.Core.Plated (termSubterms) import UntypedPlutusCore.Core.Type (Term (..)) import UntypedPlutusCore.Transform.Simplifier ( SimplifierT - , floatDelayStage , recordSimplification + , pattern FloatDelayStage ) import Control.Lens (forOf, forOf_, transformOf) @@ -80,7 +81,7 @@ floatDelay term = do result <- PLC.rename term >>= \t -> pure . uncurry (flip simplifyBodies) $ simplifyArgs (unforcedVars t) t - recordSimplification term floatDelayStage result + recordSimplification term FloatDelayStage result return result {-| First pass. Returns the names of all variables, at least one occurrence diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceCaseDelay.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceCaseDelay.hs index 136f75b124d..f3b33ce412e 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceCaseDelay.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceCaseDelay.hs @@ -1,4 +1,5 @@ {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE PatternSynonyms #-} {- Note [Applying force to delays in case branches] @@ -37,8 +38,8 @@ where import UntypedPlutusCore.Core import UntypedPlutusCore.Transform.Simplifier ( SimplifierT - , forceCaseDelayStage , recordSimplification + , pattern ForceCaseDelayStage ) import Control.Lens @@ -49,7 +50,7 @@ forceCaseDelay -> SimplifierT name uni fun a m (Term name uni fun a) forceCaseDelay term = do let result = transformOf termSubterms processTerm term - recordSimplification term forceCaseDelayStage result + recordSimplification term ForceCaseDelayStage result return result processTerm :: Term name uni fun a -> Term name uni fun a diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceDelay.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceDelay.hs index ca356547fe4..1d52783430f 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceDelay.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceDelay.hs @@ -141,6 +141,7 @@ if both @x@ and @y@ are pure and work-free. -} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE ViewPatterns #-} @@ -156,8 +157,8 @@ import UntypedPlutusCore.Core import UntypedPlutusCore.Purity (isPure, isWorkFree) import UntypedPlutusCore.Transform.Simplifier ( SimplifierT - , forceDelayStage , recordSimplification + , pattern ForceDelayStage ) import Control.Lens (transformOf) @@ -173,7 +174,7 @@ forceDelay -> SimplifierT name uni fun a m (Term name uni fun a) forceDelay semVar term = do let result = transformOf termSubterms (processTerm semVar) term - recordSimplification term forceDelayStage result + recordSimplification term ForceDelayStage result return result {-| Checks whether the term is of the right form, and "pushes" diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Inline.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Inline.hs index 9ef2e22dc41..ac9d0d2d916 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Inline.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Inline.hs @@ -2,6 +2,7 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE LambdaCase #-} +{-# LANGUAGE PatternSynonyms #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TupleSections #-} {-# LANGUAGE TypeFamilies #-} @@ -71,8 +72,8 @@ import UntypedPlutusCore.Subst (termSubstNamesM) import UntypedPlutusCore.Transform.Certify.Hints qualified as CertifierHints import UntypedPlutusCore.Transform.Simplifier ( SimplifierT - , inlineStage , recordSimplificationWithHints + , pattern InlineStage ) {- Note [Differences from PIR inliner] @@ -239,7 +240,7 @@ inline recordSimplificationWithHints (CertifierHints.Inline (mkHints decoratedResult)) t - inlineStage + InlineStage result return result diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs index 5f465b051f1..3d17b8a3d27 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs @@ -1,14 +1,16 @@ +{-# LANGUAGE PatternSynonyms #-} + module UntypedPlutusCore.Transform.Simplifier ( SimplifierT (..) , Trace.SimplifierStage - , Trace.floatDelayStage - , Trace.forceDelayStage - , Trace.forceCaseDelayStage - , Trace.caseReduceStage - , Trace.inlineStage - , Trace.cseStage - , Trace.applyToCaseStage - , Trace.caseOfCaseStage + , pattern FloatDelayStage + , pattern ForceDelayStage + , pattern ForceCaseDelayStage + , pattern CaseReduceStage + , pattern InlineStage + , pattern CseStage + , pattern ApplyToCaseStage + , pattern CaseOfCaseStage , Trace.SimplifierTrace (..) , Trace.Simplification (..) , runSimplifierT @@ -30,6 +32,16 @@ import Control.Monad.Identity (Identity, runIdentity) import PlutusCore.Quote (MonadQuote) import UntypedPlutusCore.Core.Type (Term) import UntypedPlutusCore.Transform.Certify.Hints qualified as Hints +import UntypedPlutusCore.Transform.Certify.Trace + ( pattern ApplyToCaseStage + , pattern CaseOfCaseStage + , pattern CaseReduceStage + , pattern CseStage + , pattern FloatDelayStage + , pattern ForceCaseDelayStage + , pattern ForceDelayStage + , pattern InlineStage + ) import UntypedPlutusCore.Transform.Certify.Trace qualified as Trace newtype SimplifierT name uni fun ann m a diff --git a/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs b/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs index ba5c4503c43..890c0f574c8 100644 --- a/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs +++ b/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs @@ -9,7 +9,6 @@ import PlutusCore.AstSize (AstSize (..)) import PlutusCore.Default (BuiltinSemanticsVariant (..), DefaultFun) import PlutusCore.Executable.Types import UntypedPlutusCore qualified as UPLC -import UntypedPlutusCore.Transform.Cse (CseWhichSubterms (..)) import Control.Lens ((^.)) import Data.Maybe @@ -222,15 +221,15 @@ simplifyOpts = do option ( maybeReader ( \case - "all" -> Just AllSubterms - "exclude-work-free" -> Just ExcludeWorkFree + "all" -> Just UPLC.AllSubterms + "exclude-work-free" -> Just UPLC.ExcludeWorkFree _ -> Nothing ) ) ( long "opt-cse-which-subterms" <> metavar "MODE" - <> value ExcludeWorkFree - <> showDefaultWith (\case AllSubterms -> "all"; ExcludeWorkFree -> "exclude-work-free") + <> value UPLC.ExcludeWorkFree + <> showDefaultWith (\case UPLC.AllSubterms -> "all"; UPLC.ExcludeWorkFree -> "exclude-work-free") <> help "CSE subterm selection: all | exclude-work-free" ) _soConservativeOpts <- diff --git a/plutus-metatheory/test/certifier/Test/Certifier/AST.hs b/plutus-metatheory/test/certifier/Test/Certifier/AST.hs index 86ac5ac66fa..ad384d1ed33 100644 --- a/plutus-metatheory/test/certifier/Test/Certifier/AST.hs +++ b/plutus-metatheory/test/certifier/Test/Certifier/AST.hs @@ -90,7 +90,7 @@ testTrivialSuccess1 :: TestTree testTrivialSuccess1 = testSuccess "Trivial success" - floatDelayStage + FloatDelayStage (mkConstant () (1 :: Integer)) (mkConstant () (1 :: Integer)) @@ -98,7 +98,7 @@ testTrivialFailure1 :: TestTree testTrivialFailure1 = testFailure "Trivial failure" - floatDelayStage + FloatDelayStage (mkConstant () (1 :: Integer)) (mkConstant () (2 :: Integer)) @@ -106,7 +106,7 @@ testByteStringEqSuccess :: TestTree testByteStringEqSuccess = testFailure "bytestrings expected to not be equal" - floatDelayStage + FloatDelayStage (mkConstant () (Text.encodeUtf8 "foo")) (mkConstant () (Text.encodeUtf8 "bar")) @@ -114,7 +114,7 @@ testByteStringEqFailure :: TestTree testByteStringEqFailure = testSuccess "bytestrings expected to be equal" - floatDelayStage + FloatDelayStage (mkConstant () (Text.encodeUtf8 "foo")) (mkConstant () (Text.encodeUtf8 "foo")) diff --git a/plutus-metatheory/test/certifier/Test/Certifier/AST/ForceDelay.hs b/plutus-metatheory/test/certifier/Test/Certifier/AST/ForceDelay.hs index fd42f1eb22e..55e5805fa2e 100644 --- a/plutus-metatheory/test/certifier/Test/Certifier/AST/ForceDelay.hs +++ b/plutus-metatheory/test/certifier/Test/Certifier/AST/ForceDelay.hs @@ -306,19 +306,19 @@ successItems successItems = [ ( "Simple one lambda" - , forceDelayStage + , ForceDelayStage , simpleSuccessBefore , simpleSuccessAfter ) , ( "Nested" - , forceDelayStage + , ForceDelayStage , nestedBefore , nestedAfter ) , ( "ifThenElse" - , forceDelayStage + , ForceDelayStage , ifThenElseSuccessBefore , ifThenElseSuccessAfter ) @@ -333,43 +333,43 @@ failItems failItems = [ ( "Simple extra delay" - , forceDelayStage + , ForceDelayStage , simpleFailBefore , simpleFailAfter ) , ( "Simple force break" - , forceDelayStage + , ForceDelayStage , simpleForceBreakBefore , simpleForceBreakAfter ) , ( "Simple app break" - , forceDelayStage + , ForceDelayStage , simpleAppBreakBefore , simpleAppBreakAfter ) , ( "App term break" - , forceDelayStage + , ForceDelayStage , appTermBreakBefore , appTermBreakAfter ) , ( "Lambda break" - , forceDelayStage + , ForceDelayStage , lambdaBreakBefore , lambdaBreakAfter ) , ( "Last delay break" - , forceDelayStage + , ForceDelayStage , lastDelayBreakBefore , lastDelayBreakAfter ) , ( "Last abs break" - , forceDelayStage + , ForceDelayStage , lastAbsBreakBefore , lastAbsBreakAfter ) From 9f71f90e04f82b0fd6b08715f45990c408d9897b Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Wed, 15 Apr 2026 20:57:49 +0300 Subject: [PATCH 08/16] Add documentation --- .../UntypedPlutusCore/Transform/Certify/Trace.hs | 13 +++++++++++++ .../src/VerifiedCompilation/Trace.lagda.md | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs index d3437ef4ccc..cea92a54abe 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs @@ -10,6 +10,12 @@ import UntypedPlutusCore.Transform.Certify.Hints qualified as Certify import Control.DeepSeq import GHC.Generics +{-| Datatype which represents optimization passes which are also +certified (__I__mplemented in the __C__ertifier). + +This means that these passes are formalized as part of the certifier, +and adding a new pass constructor to this type means that it is expected +the pass will be also certified in the same PR. -} data ICSimplifierStage = FloatDelay | ForceDelay @@ -21,6 +27,13 @@ data ICSimplifierStage deriving stock (Show, Generic) deriving anyclass (NFData) +{-| Datatype which represents optimization passes which are not yet +certified (__N__ot __I__mplemented in the __C__ertifier). + +IMPORTANT: if you add a new pass, or modify an existing pass, without +also modifying the certifier in the same PR, you must add/move its +corresponding constructor to this type. Please also open an issue +at https://github.com/IntersectMBO/plutus/issues. -} data NICSimplifierStage = CaseOfCase deriving stock (Show, Generic) diff --git a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md index c52279cb69a..4645b2251f0 100644 --- a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md @@ -19,7 +19,9 @@ open Maybe ``` ## Pass tags -We enumerate the known passes: +We enumerate the known passes and partition them into two categories: +- *N*ot *I*mplemented in the *C*ertifier +- *I*mplemented in the *C*ertifier ``` From 0f8c77ad93144080f8574b7b8f5b3b4a9ccc0130 Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Wed, 15 Apr 2026 21:14:33 +0300 Subject: [PATCH 09/16] Fixes --- .../src/MAlonzo/Code/VerifiedCompilation.hs | 15 +++-------- .../src/VerifiedCompilation.lagda.md | 26 +++++++++---------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs index bcdc503e089..7e085168c3a 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs @@ -17,7 +17,6 @@ import MAlonzo.RTE (coe, erased, AgdaAny, addInt, subInt, mulInt, rem64, lt64, eq64, word64FromNat, word64ToNat) import qualified MAlonzo.RTE import qualified Data.Text -import qualified MAlonzo.Code.Agda.Builtin.Bool import qualified MAlonzo.Code.Agda.Builtin.Maybe import qualified MAlonzo.Code.Agda.Builtin.Unit import qualified MAlonzo.Code.Data.Maybe.Base @@ -45,12 +44,12 @@ data T_Error_2 C_abort_10 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8) --- VerifiedCompilation.f -d_f_12 :: +-- VerifiedCompilation.tagToRelation +d_tagToRelation_12 :: MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> () -d_f_12 = erased +d_tagToRelation_12 = erased -- VerifiedCompilation.RelationOf d_RelationOf_14 :: MAlonzo.Code.Utils.T_Either_6 @@ -65,13 +64,7 @@ d_hasRelation_18 :: MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_8 -> Bool -d_hasRelation_18 v0 - = case coe v0 of - MAlonzo.Code.Utils.C_inj'8321'_12 v1 - -> coe MAlonzo.Code.Agda.Builtin.Bool.C_false_8 - MAlonzo.Code.Utils.C_inj'8322'_14 v1 - -> coe MAlonzo.Code.Agda.Builtin.Bool.C_true_10 - _ -> MAlonzo.RTE.mazUnreachableError +d_hasRelation_18 = coe MAlonzo.Code.Utils.du_is'45'inj'8322'_46 -- VerifiedCompilation.certifyPass d_certifyPass_26 :: MAlonzo.Code.Utils.T_Either_6 diff --git a/plutus-metatheory/src/VerifiedCompilation.lagda.md b/plutus-metatheory/src/VerifiedCompilation.lagda.md index 240b32a0871..f48d4b9ebcf 100644 --- a/plutus-metatheory/src/VerifiedCompilation.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation.lagda.md @@ -65,19 +65,20 @@ data Error : Set where ## Translation Relations and Certifiers -We map a `SimplifierTag` to the corresponding translation relation, or `nothing` -if we don't have a translation relation. +We map a `ICSimplifierTag` to the corresponding translation relation. ``` -- TODO: this should be enforced at the type level somehow -f : ICSimplifierTag → (0 ⊢ → 0 ⊢ → Set) -f floatDelayT = UFlD.FloatDelay -f forceDelayT = UFD.ForceDelay -f forceCaseDelayT = UFCD.ForceCaseDelay -f caseReduceT = UCR.UCaseReduce -f inlineT = UInline.Inline (λ()) UInline.□ -f cseT = UCSE.UntypedCSE -f applyToCaseT = UA2C.UApplyToCase +-- i.e. I shouldn't be able to associate 'forceDelayT' with +-- 'floatDelay'! +tagToRelation : ICSimplifierTag → (0 ⊢ → 0 ⊢ → Set) +tagToRelation floatDelayT = UFlD.FloatDelay +tagToRelation forceDelayT = UFD.ForceDelay +tagToRelation forceCaseDelayT = UFCD.ForceCaseDelay +tagToRelation caseReduceT = UCR.UCaseReduce +tagToRelation inlineT = UInline.Inline (λ()) UInline.□ +tagToRelation cseT = UCSE.UntypedCSE +tagToRelation applyToCaseT = UA2C.UApplyToCase ``` We default to the `NotImplemented` relation to give each `SimplifierTag` a relation: @@ -85,11 +86,10 @@ We default to the `NotImplemented` relation to give each `SimplifierTag` a relat ``` RelationOf : SimplifierTag → (0 ⊢ → 0 ⊢ → Set) RelationOf (inj₁ _) = NotImplemented accept -RelationOf (inj₂ tag) = f tag +RelationOf (inj₂ tag) = tagToRelation tag hasRelation : SimplifierTag → Bool -hasRelation (inj₁ _) = false -hasRelation (inj₂ _) = true +hasRelation = is-inj₂ ``` The corresponding certifier can then be called for a given pass: From 58a5c881736855416abf71aaeb418e1a7285c5ea Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Wed, 15 Apr 2026 22:01:28 +0300 Subject: [PATCH 10/16] Changelogs --- .../20260415_215659_ana.pantilie95_safe_opt_mode.md | 3 +++ .../20260415_215838_ana.pantilie95_safe_opt_mode.md | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 plutus-core/changelog.d/20260415_215659_ana.pantilie95_safe_opt_mode.md create mode 100644 plutus-metatheory/changelog.d/20260415_215838_ana.pantilie95_safe_opt_mode.md diff --git a/plutus-core/changelog.d/20260415_215659_ana.pantilie95_safe_opt_mode.md b/plutus-core/changelog.d/20260415_215659_ana.pantilie95_safe_opt_mode.md new file mode 100644 index 00000000000..d8aa835fe75 --- /dev/null +++ b/plutus-core/changelog.d/20260415_215659_ana.pantilie95_safe_opt_mode.md @@ -0,0 +1,3 @@ +### Added + +- Added a new command line option `--safe-optimization` which disables those optimization passes which are not certified. diff --git a/plutus-metatheory/changelog.d/20260415_215838_ana.pantilie95_safe_opt_mode.md b/plutus-metatheory/changelog.d/20260415_215838_ana.pantilie95_safe_opt_mode.md new file mode 100644 index 00000000000..9393b44623c --- /dev/null +++ b/plutus-metatheory/changelog.d/20260415_215838_ana.pantilie95_safe_opt_mode.md @@ -0,0 +1,3 @@ +### Fixed + +- The certifier reports now include the number of optimization sites for the force-case-delay pass as well. From 0f8d76aac0a5524da5a7737560e71328986a3faa Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Thu, 16 Apr 2026 16:04:33 +0300 Subject: [PATCH 11/16] Address review comments --- plutus-benchmark/certifier/bench/Main.hs | 2 +- .../certifier/src/Certifier/Common.hs | 6 +- plutus-benchmark/certifier/test/Main.hs | 2 +- .../plutus-core/src/PlutusCore/Compiler.hs | 2 +- .../src/UntypedPlutusCore/Simplify.hs | 2 +- .../Transform/Certify/Trace.hs | 50 +++---- .../UntypedPlutusCore/Transform/Simplifier.hs | 44 +++--- .../testlib/Transform/Simplify/Lib.hs | 10 +- plutus-executables/executables/uplc/Main.hs | 8 +- .../certifier/Test/Certifier/Executable.hs | 2 +- .../src/PlutusCore/Executable/Eval.hs | 6 +- .../src/PlutusCore/Executable/Parsers.hs | 2 +- plutus-metatheory/plutus-metatheory.cabal | 2 +- plutus-metatheory/src/Certifier.hs | 8 +- .../src/CertifierReport.lagda.md | 36 ++--- plutus-metatheory/src/FFI/AgdaUnparse.hs | 24 ++-- .../{SimplifierTrace.hs => OptimizerTrace.hs} | 14 +- .../src/MAlonzo/Code/Certifier.hs | 12 +- .../src/MAlonzo/Code/CertifierReport.hs | 30 ++-- .../src/MAlonzo/Code/VerifiedCompilation.hs | 24 ++-- .../Code/VerifiedCompilation/Certificate.hs | 40 +++--- .../MAlonzo/Code/VerifiedCompilation/Trace.hs | 133 +++++++++-------- .../Code/VerifiedCompilation/UApplyToCase.hs | 26 ++-- .../MAlonzo/Code/VerifiedCompilation/UCSE.hs | 8 +- .../Code/VerifiedCompilation/UCaseOfCase.hs | 24 ++-- .../Code/VerifiedCompilation/UCaseReduce.hs | 10 +- .../Code/VerifiedCompilation/UFloatDelay.hs | 16 +-- .../VerifiedCompilation/UForceCaseDelay.hs | 23 ++- .../Code/VerifiedCompilation/UForceDelay.hs | 134 +++++++++--------- .../Code/VerifiedCompilation/UInline.hs | 16 +-- .../VerifiedCompilation/UntypedTranslation.hs | 16 +-- .../src/VerifiedCompilation.lagda.md | 18 +-- .../VerifiedCompilation/Certificate.lagda.md | 14 +- .../src/VerifiedCompilation/Trace.lagda.md | 83 ++++++----- .../VerifiedCompilation/UApplyToCase.lagda.md | 6 +- .../src/VerifiedCompilation/UCSE.lagda.md | 6 +- .../VerifiedCompilation/UCaseOfCase.lagda.md | 14 +- .../VerifiedCompilation/UCaseReduce.lagda.md | 8 +- .../VerifiedCompilation/UFloatDelay.lagda.md | 10 +- .../UForceCaseDelay.lagda.md | 16 +-- .../VerifiedCompilation/UForceDelay.lagda.md | 66 ++++----- .../src/VerifiedCompilation/UInline.lagda.md | 16 +-- .../UntypedTranslation.lagda.md | 6 +- .../certifier-report/Test/Certifier/Report.hs | 10 +- .../test/certifier/Test/Certifier/AST.hs | 24 ++-- .../Test/Certifier/AST/ForceDelay.hs | 4 +- .../certifier/Test/Certifier/Optimizer.hs | 10 +- 47 files changed, 520 insertions(+), 523 deletions(-) rename plutus-metatheory/src/FFI/{SimplifierTrace.hs => OptimizerTrace.hs} (78%) diff --git a/plutus-benchmark/certifier/bench/Main.hs b/plutus-benchmark/certifier/bench/Main.hs index 2c5268d06f4..f19ef455ec8 100644 --- a/plutus-benchmark/certifier/bench/Main.hs +++ b/plutus-benchmark/certifier/bench/Main.hs @@ -5,7 +5,7 @@ import Control.DeepSeq (force) import Control.Exception (evaluate) import Control.Monad import Criterion.Main -import FFI.SimplifierTrace +import FFI.OptimizerTrace import FFI.Untyped (UTerm) import MAlonzo.Code.Certifier (runCertifierMain) diff --git a/plutus-benchmark/certifier/src/Certifier/Common.hs b/plutus-benchmark/certifier/src/Certifier/Common.hs index aacdfa134ed..aea21659b84 100644 --- a/plutus-benchmark/certifier/src/Certifier/Common.hs +++ b/plutus-benchmark/certifier/src/Certifier/Common.hs @@ -4,7 +4,7 @@ import Control.Lens ((&), (.~)) import Control.Monad.Trans.Except import Data.ByteString qualified as B import Data.ByteString.Short qualified as SBS -import FFI.SimplifierTrace +import FFI.OptimizerTrace import FFI.Untyped (UTerm) import PlutusBenchmark.Common (getDataDir) import PlutusCore.Default.Builtins @@ -32,13 +32,13 @@ loadFrom name = do . runQuote . runExceptT $ UPLC.unDeBruijnTerm (UPLC._progTerm prog) - pure . runQuote $ mkFfiSimplifierTrace . snd <$> simplify term + pure . runQuote $ mkFfiOptimizerTrace . snd <$> simplify term simplify :: Term Name DefaultUni DefaultFun () -> Quote ( Term Name DefaultUni DefaultFun () - , SimplifierTrace Name DefaultUni DefaultFun () + , OptimizerTrace Name DefaultUni DefaultFun () ) simplify = runSimplifierT diff --git a/plutus-benchmark/certifier/test/Main.hs b/plutus-benchmark/certifier/test/Main.hs index b41799b33b8..a592a05becd 100644 --- a/plutus-benchmark/certifier/test/Main.hs +++ b/plutus-benchmark/certifier/test/Main.hs @@ -4,7 +4,7 @@ import Certifier.Common (loadFrom, testScripts) import Control.DeepSeq (force) import Control.Exception (evaluate) import Control.Monad -import FFI.SimplifierTrace +import FFI.OptimizerTrace import FFI.Untyped (UTerm) import MAlonzo.Code.Certifier (runCertifierMain) import Test.Tasty (defaultMain, testGroup) diff --git a/plutus-core/plutus-core/src/PlutusCore/Compiler.hs b/plutus-core/plutus-core/src/PlutusCore/Compiler.hs index 638401228c7..307225a71ed 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Compiler.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Compiler.hs @@ -47,7 +47,7 @@ compileProgramWithTrace , MonadReader (CompilationOpts name fun a) m ) => Program tyname name uni fun a - -> m (UPLC.Program name uni fun a, UPLC.SimplifierTrace name uni fun a) + -> m (UPLC.Program name uni fun a, UPLC.OptimizerTrace name uni fun a) compileProgramWithTrace (Program a v t) = do simplOpts <- view coSimplifyOpts builtinSemanticsVariant <- view coBuiltinSemanticsVariant diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify.hs index 5dcdc96d990..7d7790801b1 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify.hs @@ -51,7 +51,7 @@ simplifyProgramWithTrace => SimplifyOpts name a -> BuiltinSemanticsVariant fun -> Program name uni fun a - -> m (Program name uni fun a, SimplifierTrace name uni fun a) + -> m (Program name uni fun a, OptimizerTrace name uni fun a) simplifyProgramWithTrace opts builtinSemanticsVariant (Program a v t) = do (result, trace) <- runSimplifierT $ diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs index 0d56aa164ee..2f6723a590f 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs @@ -16,7 +16,7 @@ certified (__I__mplemented in the __C__ertifier). This means that these passes are formalized as part of the certifier, and adding a new pass constructor to this type means that it is expected the pass will be also certified in the same PR. -} -data ICSimplifierStage +data CertifiedOptStage = FloatDelay | ForceDelay | ForceCaseDelay @@ -34,39 +34,39 @@ IMPORTANT: if you add a new pass, or modify an existing pass, without also modifying the certifier in the same PR, you must add/move its corresponding constructor to this type. Please also open an issue at https://github.com/IntersectMBO/plutus/issues. -} -data NICSimplifierStage +data UncertifiedOptStage = CaseOfCase | LetFloatOut deriving stock (Show, Generic) deriving anyclass (NFData) -type SimplifierStage = Either NICSimplifierStage ICSimplifierStage +type OptStage = Either UncertifiedOptStage CertifiedOptStage -pattern FloatDelayStage :: SimplifierStage +pattern FloatDelayStage :: OptStage pattern FloatDelayStage = Right FloatDelay -pattern ForceDelayStage :: SimplifierStage +pattern ForceDelayStage :: OptStage pattern ForceDelayStage = Right ForceDelay -pattern ForceCaseDelayStage :: SimplifierStage +pattern ForceCaseDelayStage :: OptStage pattern ForceCaseDelayStage = Right ForceCaseDelay -pattern CaseReduceStage :: SimplifierStage +pattern CaseReduceStage :: OptStage pattern CaseReduceStage = Right CaseReduce -pattern InlineStage :: SimplifierStage +pattern InlineStage :: OptStage pattern InlineStage = Right Inline -pattern CseStage :: SimplifierStage +pattern CseStage :: OptStage pattern CseStage = Right CSE -pattern ApplyToCaseStage :: SimplifierStage +pattern ApplyToCaseStage :: OptStage pattern ApplyToCaseStage = Right ApplyToCase -pattern CaseOfCaseStage :: SimplifierStage +pattern CaseOfCaseStage :: OptStage pattern CaseOfCaseStage = Left CaseOfCase -pattern LetFloatOutStage :: SimplifierStage +pattern LetFloatOutStage :: OptStage pattern LetFloatOutStage = Left LetFloatOut {-# COMPLETE @@ -81,28 +81,28 @@ pattern LetFloatOutStage = Left LetFloatOut , LetFloatOutStage #-} -data Simplification name uni fun a - = Simplification +data Optimization name uni fun a + = Optimization { beforeAST :: Term name uni fun a - , stage :: SimplifierStage + , stage :: OptStage , hints :: Certify.Hints , afterAST :: Term name uni fun a } -- TODO2: we probably don't want this in memory so after MVP -- we should consider serializing this to disk -newtype SimplifierTrace name uni fun a - = SimplifierTrace - { simplifierTrace - :: [Simplification name uni fun a] +newtype OptimizerTrace name uni fun a + = OptimizerTrace + { optimizerTrace + :: [Optimization name uni fun a] } -initSimplifierTrace :: SimplifierTrace name uni fun a -initSimplifierTrace = SimplifierTrace [] +initOptimizerTrace :: OptimizerTrace name uni fun a +initOptimizerTrace = OptimizerTrace [] -allASTs :: SimplifierTrace name uni fun a -> [Term name uni fun a] +allASTs :: OptimizerTrace name uni fun a -> [Term name uni fun a] allASTs = \case - SimplifierTrace [] -> [] - SimplifierTrace xs@(x : _) -> - -- `SimplifierTrace` is in reverse order: the first item is the last pass run. + OptimizerTrace [] -> [] + OptimizerTrace xs@(x : _) -> + -- `OptimizerTrace` is in reverse order: the first item is the last pass run. afterAST x : map beforeAST xs diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs index 4868c539972..7f41cb6998c 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs @@ -2,7 +2,7 @@ module UntypedPlutusCore.Transform.Simplifier ( SimplifierT (..) - , Trace.SimplifierStage + , Trace.OptStage , pattern Trace.FloatDelayStage , pattern Trace.ForceDelayStage , pattern Trace.ForceCaseDelayStage @@ -12,8 +12,8 @@ module UntypedPlutusCore.Transform.Simplifier , pattern Trace.ApplyToCaseStage , pattern Trace.CaseOfCaseStage , pattern Trace.LetFloatOutStage - , Trace.SimplifierTrace (..) - , Trace.Simplification (..) + , Trace.OptimizerTrace (..) + , Trace.Optimization (..) , runSimplifierT , evalSimplifierT , execSimplifierT @@ -21,9 +21,9 @@ module UntypedPlutusCore.Transform.Simplifier , runSimplifier , evalSimplifier , execSimplifier - , Trace.initSimplifierTrace - , recordSimplification - , recordSimplificationWithHints + , Trace.initOptimizerTrace + , recordOptimization + , recordOptimizationWithHints ) where import Control.Monad.State (MonadTrans, StateT) @@ -37,7 +37,7 @@ import UntypedPlutusCore.Transform.Certify.Trace qualified as Trace newtype SimplifierT name uni fun ann m a = SimplifierT - { getSimplifierT :: StateT (Trace.SimplifierTrace name uni fun ann) m a + { getSimplifierT :: StateT (Trace.OptimizerTrace name uni fun ann) m a } deriving newtype (Functor, Applicative, Monad, MonadTrans) @@ -45,44 +45,44 @@ instance MonadQuote m => MonadQuote (SimplifierT name uni fun ann m) runSimplifierT :: SimplifierT name uni fun ann m a - -> m (a, Trace.SimplifierTrace name uni fun ann) -runSimplifierT = flip State.runStateT Trace.initSimplifierTrace . getSimplifierT + -> m (a, Trace.OptimizerTrace name uni fun ann) +runSimplifierT = flip State.runStateT Trace.initOptimizerTrace . getSimplifierT evalSimplifierT :: Monad m => SimplifierT name uni fun ann m a -> m a -evalSimplifierT = flip State.evalStateT Trace.initSimplifierTrace . getSimplifierT +evalSimplifierT = flip State.evalStateT Trace.initOptimizerTrace . getSimplifierT execSimplifierT - :: Monad m => SimplifierT name uni fun ann m a -> m (Trace.SimplifierTrace name uni fun ann) -execSimplifierT = flip State.execStateT Trace.initSimplifierTrace . getSimplifierT + :: Monad m => SimplifierT name uni fun ann m a -> m (Trace.OptimizerTrace name uni fun ann) +execSimplifierT = flip State.execStateT Trace.initOptimizerTrace . getSimplifierT type Simplifier name uni fun ann = SimplifierT name uni fun ann Identity -runSimplifier :: Simplifier name uni fun ann a -> (a, Trace.SimplifierTrace name uni fun ann) +runSimplifier :: Simplifier name uni fun ann a -> (a, Trace.OptimizerTrace name uni fun ann) runSimplifier = runIdentity . runSimplifierT evalSimplifier :: Simplifier name uni fun ann a -> a evalSimplifier = runIdentity . evalSimplifierT -execSimplifier :: Simplifier name uni fun ann a -> Trace.SimplifierTrace name uni fun ann +execSimplifier :: Simplifier name uni fun ann a -> Trace.OptimizerTrace name uni fun ann execSimplifier = runIdentity . execSimplifierT -recordSimplification +recordOptimization :: Monad m => Term name uni fun a - -> Trace.SimplifierStage + -> Trace.OptStage -> Term name uni fun a -> SimplifierT name uni fun a m () -recordSimplification = recordSimplificationWithHints Hints.NoHints +recordOptimization = recordOptimizationWithHints Hints.NoHints -recordSimplificationWithHints +recordOptimizationWithHints :: Monad m => Hints.Hints -> Term name uni fun a - -> Trace.SimplifierStage + -> Trace.OptStage -> Term name uni fun a -> SimplifierT name uni fun a m () -recordSimplificationWithHints hints before stage after = - let simplification = Trace.Simplification before stage hints after +recordOptimizationWithHints hints before stage after = + let simplification = Trace.Optimization before stage hints after in SimplifierT . State.modify' $ \st -> - st {Trace.simplifierTrace = simplification : Trace.simplifierTrace st} + st {Trace.optimizerTrace = simplification : Trace.optimizerTrace st} diff --git a/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs b/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs index d78e01c17df..df67664fdcd 100644 --- a/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs +++ b/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs @@ -18,7 +18,7 @@ import Test.Tasty.Golden (goldenVsString) import UntypedPlutusCore ( CseWhichSubterms , Name - , SimplifierTrace + , OptimizerTrace , Term , defaultSimplifyOpts , runSimplifierT @@ -54,8 +54,8 @@ goldenVsSimplified name t = (t', trace) = PLC.runQuote (testSimplify t) hintsPath = "untyped-plutus-core/test/Transform/" ++ name ++ ".golden.certifier-hints" -renderCertifierHints :: Trace.SimplifierTrace Name PLC.DefaultUni PLC.DefaultFun () -> Text -renderCertifierHints (Trace.SimplifierTrace ss) +renderCertifierHints :: Trace.OptimizerTrace Name PLC.DefaultUni PLC.DefaultFun () -> Text +renderCertifierHints (Trace.OptimizerTrace ss) | null ss = "" | otherwise = T.unlines $ @@ -100,7 +100,7 @@ testSimplify :: Term Name PLC.DefaultUni PLC.DefaultFun () -> PLC.Quote ( Term Name PLC.DefaultUni PLC.DefaultFun () - , SimplifierTrace Name PLC.DefaultUni PLC.DefaultFun () + , OptimizerTrace Name PLC.DefaultUni PLC.DefaultFun () ) testSimplify = runSimplifierT @@ -130,7 +130,7 @@ testCse -> Term Name PLC.DefaultUni PLC.DefaultFun () -> PLC.Quote ( Term Name PLC.DefaultUni PLC.DefaultFun () - , SimplifierTrace Name PLC.DefaultUni PLC.DefaultFun () + , OptimizerTrace Name PLC.DefaultUni PLC.DefaultFun () ) testCse whichSubterms = runSimplifierT diff --git a/plutus-executables/executables/uplc/Main.hs b/plutus-executables/executables/uplc/Main.hs index c8d49051d28..1a99d7875b2 100644 --- a/plutus-executables/executables/uplc/Main.hs +++ b/plutus-executables/executables/uplc/Main.hs @@ -363,7 +363,7 @@ runOptimiseSingle inp ifmt outp ofmt mode mcert certifierOutput sopts eopts = do Nothing -> [] Just args -> let evalCtx = mkDefaultEvalCtx def - in evalSimplifierTrace evalCtx simplificationTrace args + in evalOptimizerTrace evalCtx simplificationTrace args certDir = cert <> "-" <> show time certOutput = case certifierOutput of CertBasic -> BasicOutput @@ -398,7 +398,7 @@ runOptimiseBlueprint inp outp ofmt mcert certifierOutput sopts eopts margs <- loadBlueprintArgs eopts validatorName let costs = case margs of Nothing -> [] - Just args -> evalSimplifierTrace evalCtx simplTrace args + Just args -> evalOptimizerTrace evalCtx simplTrace args certDir = cert <> "-" <> validatorName <> "-" <> show time certOutput = case certifierOutput of CertBasic -> BasicOutput @@ -415,7 +415,7 @@ optimiseProgram -> UPLC.Program name UPLC.DefaultUni UPLC.DefaultFun a -> m ( UPLC.Program name UPLC.DefaultUni UPLC.DefaultFun a - , UPLC.SimplifierTrace name UPLC.DefaultUni UPLC.DefaultFun a + , UPLC.OptimizerTrace name UPLC.DefaultUni UPLC.DefaultFun a ) optimiseProgram opts prog = PLC.runQuoteT $ do renamed <- PLC.rename prog @@ -424,7 +424,7 @@ optimiseProgram opts prog = PLC.runQuoteT $ do UPLC.simplifyProgramWithTrace opts defaultBuiltinSemanticsVariant renamed execCertifier - :: UPLC.SimplifierTrace UPLC.Name UPLC.DefaultUni UPLC.DefaultFun a + :: UPLC.OptimizerTrace UPLC.Name UPLC.DefaultUni UPLC.DefaultFun a -> CertName -> CertifierOutput -> [ ( Maybe diff --git a/plutus-executables/test/certifier/Test/Certifier/Executable.hs b/plutus-executables/test/certifier/Test/Certifier/Executable.hs index 31792e7255a..5694aa51fba 100644 --- a/plutus-executables/test/certifier/Test/Certifier/Executable.hs +++ b/plutus-executables/test/certifier/Test/Certifier/Executable.hs @@ -25,7 +25,7 @@ loadUplc path = UPLC._progTerm . void . snd <$> parseInput (FileInput path) simplify :: Term Name DefaultUni DefaultFun () - -> SimplifierTrace Name DefaultUni DefaultFun () + -> OptimizerTrace Name DefaultUni DefaultFun () simplify = runQuote . fmap snd diff --git a/plutus-ledger-api/executables/src/PlutusCore/Executable/Eval.hs b/plutus-ledger-api/executables/src/PlutusCore/Executable/Eval.hs index 9714a488479..a4ec9406931 100644 --- a/plutus-ledger-api/executables/src/PlutusCore/Executable/Eval.hs +++ b/plutus-ledger-api/executables/src/PlutusCore/Executable/Eval.hs @@ -52,9 +52,9 @@ mkDefaultEvalCtx semvar = {-| Evaluate all ASTs in the trace, each applied to the given arguments arguments, in counting mode. Returns @(Maybe error, budget)@. -} -evalSimplifierTrace +evalOptimizerTrace :: EvaluationContext - -> SimplifierTrace UPLC.Name UPLC.DefaultUni UPLC.DefaultFun a + -> OptimizerTrace UPLC.Name UPLC.DefaultUni UPLC.DefaultFun a -> [UPLC.Term UPLC.NamedDeBruijn UPLC.DefaultUni UPLC.DefaultFun ()] -- ^ Arguments to apply to each AST before evaluation -> [ ( Maybe @@ -62,7 +62,7 @@ evalSimplifierTrace , ExBudget ) ] -evalSimplifierTrace evalCtx trace args = +evalOptimizerTrace evalCtx trace args = first (either Just (const Nothing)) . evalCounting evalCtx newestPV <$> appliedTerms where diff --git a/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs b/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs index 890c0f574c8..fc9ab8e37d7 100644 --- a/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs +++ b/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs @@ -273,7 +273,7 @@ simplifyOpts = do flag False True - ( long "safe-optimisation" + ( long "certified-opts-only" <> help "Run only those optimisation passes which are certified to preserve the functional behavior of the original program." ) diff --git a/plutus-metatheory/plutus-metatheory.cabal b/plutus-metatheory/plutus-metatheory.cabal index f5aae713bcf..b34fcaf1a82 100644 --- a/plutus-metatheory/plutus-metatheory.cabal +++ b/plutus-metatheory/plutus-metatheory.cabal @@ -95,8 +95,8 @@ library Certifier FFI.AgdaUnparse FFI.CostInfo + FFI.OptimizerTrace FFI.Opts - FFI.SimplifierTrace FFI.Untyped Raw diff --git a/plutus-metatheory/src/Certifier.hs b/plutus-metatheory/src/Certifier.hs index 5cdd1dc5bc8..3d35b93eb6f 100644 --- a/plutus-metatheory/src/Certifier.hs +++ b/plutus-metatheory/src/Certifier.hs @@ -22,7 +22,7 @@ import System.FilePath (()) import FFI.AgdaUnparse (AgdaUnparse (..)) import FFI.CostInfo -import FFI.SimplifierTrace (Trace, mkFfiSimplifierTrace, toEvalResult) +import FFI.OptimizerTrace (Trace, mkFfiOptimizerTrace, toEvalResult) import FFI.Untyped (UTerm) import MAlonzo.Code.Certifier (runCertifierMain) import PlutusLedgerApi.Common @@ -73,7 +73,7 @@ runCertifier = runExceptT -- | Run the Agda certifier on the simplification trace, if requested mkCertifier - :: SimplifierTrace UPLC.Name UPLC.DefaultUni UPLC.DefaultFun a + :: OptimizerTrace UPLC.Name UPLC.DefaultUni UPLC.DefaultFun a -- ^ The trace produced by the simplification process -> CertName -- ^ The name of the certificate to be produced @@ -85,7 +85,7 @@ mkCertifier ] -> Certifier Bool mkCertifier simplTrace certName certOutput costs = do - let rawAgdaTrace = mkFfiSimplifierTrace simplTrace + let rawAgdaTrace = mkFfiOptimizerTrace simplTrace costs' :: [EvalResult] costs' = uncurry toEvalResult <$> reverse costs case runCertifierMain rawAgdaTrace costs' of @@ -300,7 +300,7 @@ mkCertificateModule certModule agdaTrace imports = <> unlines imports <> "\n" <> "\n\ - \\nasts : List (SimplifierTag × Hints × Untyped × Untyped)\ + \\nasts : List (OptTag × Hints × Untyped × Untyped)\ \\nasts = " <> agdaTrace <> "\n\ diff --git a/plutus-metatheory/src/CertifierReport.lagda.md b/plutus-metatheory/src/CertifierReport.lagda.md index 7c6da89b859..c79113c8be0 100644 --- a/plutus-metatheory/src/CertifierReport.lagda.md +++ b/plutus-metatheory/src/CertifierReport.lagda.md @@ -35,22 +35,22 @@ nl = "\n" hl : String hl = "\n──────────────────────────────────────────────────────\n" -showICTag : ICSimplifierTag → String -showICTag floatDelayT = "Float Delay" -showICTag forceDelayT = "Force-Delay Cancellation" -showICTag forceCaseDelayT = "Float Force into Case Branches" -showICTag caseReduceT = "Case-Constr and Case-Constant Cancellation" -showICTag inlineT = "Inlining" -showICTag cseT = "Common Subexpression Elimination" -showICTag applyToCaseT = "Transform multi-argument applications into case-constr form" - -showNICTag : NICSimplifierTag → String -showNICTag caseOfCaseT = "Case-of-Case" -showNICTag letFloatOutT = "Float bindings outwards" - -showTag : SimplifierTag → String -showTag (inj₁ tag) = showNICTag tag ++ " ⚠ (certifier unavailable)" -showTag (inj₂ tag) = showICTag tag ++ " ✅" +showCertifiedOptTag : CertifiedOptTag → String +showCertifiedOptTag floatDelayT = "Float Delay" +showCertifiedOptTag forceDelayT = "Force-Delay Cancellation" +showCertifiedOptTag forceCaseDelayT = "Float Force into Case Branches" +showCertifiedOptTag caseReduceT = "Case-Constr and Case-Constant Cancellation" +showCertifiedOptTag inlineT = "Inlining" +showCertifiedOptTag cseT = "Common Subexpression Elimination" +showCertifiedOptTag applyToCaseT = "Transform multi-argument applications into case-constr form" + +showUncertifiedOptTag : UncertifiedOptTag → String +showUncertifiedOptTag caseOfCaseT = "Case-of-Case" +showUncertifiedOptTag letFloatOutT = "Float bindings outwards" + +showTag : OptTag → String +showTag (inj₁ tag) = showUncertifiedOptTag tag ++ " ⚠ (certifier unavailable)" +showTag (inj₂ tag) = showCertifiedOptTag tag ++ " ✅" ``` Number of times an optimization is applied on the given term in one compiler pass: @@ -113,7 +113,7 @@ numSitesInline (case r rs) = numSitesInline r + numSitesInlineᵖʷ rs numSitesInlineᵖʷ Pointwise.[] = 0 numSitesInlineᵖʷ (x Pointwise.∷ xs) = numSitesInline x + numSitesInlineᵖʷ xs -numSites : {M N : 0 ⊢} (tag : ICSimplifierTag) → RelationOf (inj₂ tag) M N → ℕ +numSites : {M N : 0 ⊢} (tag : CertifiedOptTag) → RelationOf (inj₂ tag) M N → ℕ numSites forceDelayT p = numSites′ p numSites floatDelayT p = numSites′ p numSites cseT p = numSites′ p @@ -122,7 +122,7 @@ numSites inlineT p = numSitesInline p numSites forceCaseDelayT p = numSites′ p numSites applyToCaseT p = numSites′ p -showSites : {M N : 0 ⊢} → (tag : SimplifierTag) → RelationOf tag M N → String +showSites : {M N : 0 ⊢} → (tag : OptTag) → RelationOf tag M N → String showSites (inj₁ _) _ = "" showSites (inj₂ t) p = ⇉ "Optimization sites: " ++ showℕ (numSites t p) diff --git a/plutus-metatheory/src/FFI/AgdaUnparse.hs b/plutus-metatheory/src/FFI/AgdaUnparse.hs index a6d1a7599e2..efa4d270828 100644 --- a/plutus-metatheory/src/FFI/AgdaUnparse.hs +++ b/plutus-metatheory/src/FFI/AgdaUnparse.hs @@ -50,18 +50,18 @@ instance AgdaUnparse AgdaFFI.UTerm where instance AgdaUnparse UPLC.DefaultFun where agdaUnparse = usToHyphen . lowerInitialChar . show -instance AgdaUnparse ICSimplifierStage where - agdaUnparse FloatDelay = "(inj₂ floatDelayT)" - agdaUnparse ForceDelay = "(inj₂ forceDelayT)" - agdaUnparse ForceCaseDelay = "(inj₂ forceCaseDelayT)" - agdaUnparse CaseReduce = "(inj₂ caseReduceT)" - agdaUnparse Inline = "(inj₂ inlineT)" - agdaUnparse CSE = "(inj₂ cseT)" - agdaUnparse ApplyToCase = "(inj₂ applyToCaseT)" - -instance AgdaUnparse NICSimplifierStage where - agdaUnparse CaseOfCase = "(inj₁ caseOfCaseT)" - agdaUnparse LetFloatOut = "(inj₁ letFloatOutT)" +instance AgdaUnparse CertifiedOptStage where + agdaUnparse FloatDelay = "floatDelayT" + agdaUnparse ForceDelay = "forceDelayT" + agdaUnparse ForceCaseDelay = "forceCaseDelayT" + agdaUnparse CaseReduce = "caseReduceT" + agdaUnparse Inline = "inlineT" + agdaUnparse CSE = "cseT" + agdaUnparse ApplyToCase = "applyToCaseT" + +instance AgdaUnparse UncertifiedOptStage where + agdaUnparse CaseOfCase = "caseOfCaseT" + agdaUnparse LetFloatOut = "letFloatOutT" instance AgdaUnparse Hints.Hints where agdaUnparse = \case diff --git a/plutus-metatheory/src/FFI/SimplifierTrace.hs b/plutus-metatheory/src/FFI/OptimizerTrace.hs similarity index 78% rename from plutus-metatheory/src/FFI/SimplifierTrace.hs rename to plutus-metatheory/src/FFI/OptimizerTrace.hs index 24c397d7039..2ef9172d9e2 100644 --- a/plutus-metatheory/src/FFI/SimplifierTrace.hs +++ b/plutus-metatheory/src/FFI/OptimizerTrace.hs @@ -1,9 +1,9 @@ {-# OPTIONS_GHC -Wall #-} -module FFI.SimplifierTrace +module FFI.OptimizerTrace ( TraceElem , Trace - , mkFfiSimplifierTrace + , mkFfiOptimizerTrace , toEvalResult ) where @@ -21,15 +21,15 @@ import Data.Functor import Data.SatInt import Data.Text qualified as T -type TraceElem a = (SimplifierStage, (Certify.Hints, (a, a))) +type TraceElem a = (OptStage, (Certify.Hints, (a, a))) type Trace a = [TraceElem a] -mkFfiSimplifierTrace - :: SimplifierTrace UPLC.Name UPLC.DefaultUni UPLC.DefaultFun a +mkFfiOptimizerTrace + :: OptimizerTrace UPLC.Name UPLC.DefaultUni UPLC.DefaultFun a -> Trace FFI.UTerm -mkFfiSimplifierTrace (SimplifierTrace simplTrace) = reverse $ toFfiAst <$> simplTrace +mkFfiOptimizerTrace (OptimizerTrace simplTrace) = reverse $ toFfiAst <$> simplTrace where - toFfiAst (Simplification before stage hints after) = + toFfiAst (Optimization before stage hints after) = case (UPLC.deBruijnTerm before, UPLC.deBruijnTerm after) of (Right before', Right after') -> (stage, (hints, (FFI.conv (void before'), FFI.conv (void after')))) diff --git a/plutus-metatheory/src/MAlonzo/Code/Certifier.hs b/plutus-metatheory/src/MAlonzo/Code/Certifier.hs index d3d457e7223..0004333ff17 100644 --- a/plutus-metatheory/src/MAlonzo/Code/Certifier.hs +++ b/plutus-metatheory/src/MAlonzo/Code/Certifier.hs @@ -32,8 +32,8 @@ import qualified MAlonzo.Code.VerifiedCompilation.Trace d_runCertifier_2 :: [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_72 (MAlonzo.Code.Utils.T__'215'__428 @@ -76,8 +76,8 @@ runCertifierMain :: () (MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_72 (MAlonzo.Code.Utils.T__'215'__428 @@ -93,8 +93,8 @@ runCertifierMain = coe d_runCertifierMain_12 d_runCertifierMain_12 :: [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_72 (MAlonzo.Code.Utils.T__'215'__428 diff --git a/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs b/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs index d0bfe4b24d7..329edb15a1d 100644 --- a/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs +++ b/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs @@ -49,11 +49,11 @@ d_hl_8 ("\n\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\9472\n" :: Data.Text.Text) --- CertifierReport.showICTag -d_showICTag_10 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> +-- CertifierReport.showCertifiedOptTag +d_showCertifiedOptTag_10 :: + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_showICTag_10 v0 +d_showCertifiedOptTag_10 v0 = case coe v0 of MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_12 -> coe ("Float Delay" :: Data.Text.Text) @@ -74,11 +74,11 @@ d_showICTag_10 v0 :: Data.Text.Text) _ -> MAlonzo.RTE.mazUnreachableError --- CertifierReport.showNICTag -d_showNICTag_12 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 -> +-- CertifierReport.showUncertifiedOptTag +d_showUncertifiedOptTag_12 :: + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_showNICTag_12 v0 +d_showUncertifiedOptTag_12 v0 = case coe v0 of MAlonzo.Code.VerifiedCompilation.Trace.C_caseOfCaseT_6 -> coe ("Case-of-Case" :: Data.Text.Text) @@ -88,20 +88,20 @@ d_showNICTag_12 v0 -- CertifierReport.showTag d_showTag_14 :: MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> MAlonzo.Code.Agda.Builtin.String.T_String_6 d_showTag_14 v0 = case coe v0 of MAlonzo.Code.Utils.C_inj'8321'_12 v1 -> coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_showNICTag_12 (coe v1)) + (d_showUncertifiedOptTag_12 (coe v1)) (" \9888 (certifier unavailable)" :: Data.Text.Text) MAlonzo.Code.Utils.C_inj'8322'_14 v1 -> coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_showICTag_10 (coe v1)) (" \9989" :: Data.Text.Text) + (d_showCertifiedOptTag_10 (coe v1)) (" \9989" :: Data.Text.Text) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.numSites′ d_numSites'8242'_26 :: @@ -559,7 +559,7 @@ d_numSitesInline_140 v0 v1 v2 v3 v4 v5 v6 v7 d_numSites_178 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> Integer d_numSites_178 v0 v1 v2 v3 = case coe v2 of @@ -588,8 +588,8 @@ d_showSites_200 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> MAlonzo.Code.Agda.Builtin.String.T_String_6 d_showSites_200 v0 v1 v2 v3 = case coe v2 of diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs index 5c1c70ea437..6114833a616 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs @@ -39,37 +39,37 @@ d_Error_2 = () data T_Error_2 = C_emptyDump_4 | C_illScoped_6 | C_counterExample_8 (MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) | + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) | C_abort_10 (MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) -- VerifiedCompilation.tagToRelation d_tagToRelation_12 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> () d_tagToRelation_12 = erased -- VerifiedCompilation.RelationOf d_RelationOf_14 :: MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> () d_RelationOf_14 = erased -- VerifiedCompilation.hasRelation d_hasRelation_18 :: MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> Bool d_hasRelation_18 = coe MAlonzo.Code.Utils.du_is'45'inj'8322'_46 -- VerifiedCompilation.certifyPass d_certifyPass_26 :: MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_72 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -118,7 +118,7 @@ d_certifyPass_26 v0 v1 MAlonzo.Code.VerifiedCompilation.Trace.C_none_76 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36) _ -> MAlonzo.RTE.mazUnreachableError MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_22 -> coe diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs index 9a216cf34fe..74b444bfe0f 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs @@ -32,20 +32,20 @@ d_CertResult_12 a0 a1 = () data T_CertResult_12 = C_proof_18 AgdaAny | C_ce_26 (MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) AgdaAny AgdaAny | C_abort_32 (MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) AgdaAny AgdaAny -- VerifiedCompilation.Certificate.ProofOrCE d_ProofOrCE_38 a0 a1 = () data T_ProofOrCE_38 = C_proof_44 AgdaAny | C_ce_52 (MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) AgdaAny AgdaAny -- VerifiedCompilation.Certificate.isProof? d_isProof'63'_56 :: @@ -73,8 +73,8 @@ d_Proof'63'_66 a0 a1 = () data T_Proof'63'_66 = C_proof_72 AgdaAny | C_abort_78 (MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) AgdaAny AgdaAny -- VerifiedCompilation.Certificate._>>=_ d__'62''62''61'__88 :: @@ -144,15 +144,15 @@ d_decToPCE_234 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20 -> AgdaAny -> AgdaAny -> T_ProofOrCE_38 d_decToPCE_234 ~v0 ~v1 v2 v3 v4 v5 = du_decToPCE_234 v2 v3 v4 v5 du_decToPCE_234 :: MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20 -> AgdaAny -> AgdaAny -> T_ProofOrCE_38 du_decToPCE_234 v0 v1 v2 v3 @@ -194,8 +194,8 @@ d_matchOrCE_262 :: MAlonzo.Code.Agda.Primitive.T_Level_18 -> (AgdaAny -> AgdaAny -> ()) -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> (AgdaAny -> AgdaAny -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20) -> @@ -204,8 +204,8 @@ d_matchOrCE_262 ~v0 ~v1 ~v2 ~v3 v4 v5 v6 v7 = du_matchOrCE_262 v4 v5 v6 v7 du_matchOrCE_262 :: MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> (AgdaAny -> AgdaAny -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20) -> @@ -229,16 +229,16 @@ d_pcePointwise_304 :: MAlonzo.Code.Agda.Primitive.T_Level_18 -> (AgdaAny -> AgdaAny -> ()) -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> (AgdaAny -> AgdaAny -> T_ProofOrCE_38) -> [AgdaAny] -> [AgdaAny] -> T_ProofOrCE_38 d_pcePointwise_304 ~v0 ~v1 ~v2 ~v3 v4 v5 v6 v7 = du_pcePointwise_304 v4 v5 v6 v7 du_pcePointwise_304 :: MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> (AgdaAny -> AgdaAny -> T_ProofOrCE_38) -> [AgdaAny] -> [AgdaAny] -> T_ProofOrCE_38 du_pcePointwise_304 v0 v1 v2 v3 diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs index cecf4343fcd..93f9b1b72ab 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs @@ -23,27 +23,26 @@ import qualified MAlonzo.Code.Agda.Builtin.String import qualified MAlonzo.Code.RawU import qualified MAlonzo.Code.Utils -import UntypedPlutusCore.Transform.Simplifier import UntypedPlutusCore.Transform.Certify.Trace import qualified UntypedPlutusCore.Transform.Certify.Hints as Hints import FFI.CostInfo --- VerifiedCompilation.Trace.NICSimplifierTag -d_NICSimplifierTag_4 = () -type T_NICSimplifierTag_4 = NICSimplifierStage +-- VerifiedCompilation.Trace.UncertifiedOptTag +d_UncertifiedOptTag_4 = () +type T_UncertifiedOptTag_4 = UncertifiedOptStage pattern C_caseOfCaseT_6 = CaseOfCase pattern C_letFloatOutT_8 = LetFloatOut -check_caseOfCaseT_6 :: T_NICSimplifierTag_4 +check_caseOfCaseT_6 :: T_UncertifiedOptTag_4 check_caseOfCaseT_6 = CaseOfCase -check_letFloatOutT_8 :: T_NICSimplifierTag_4 +check_letFloatOutT_8 :: T_UncertifiedOptTag_4 check_letFloatOutT_8 = LetFloatOut -cover_NICSimplifierTag_4 :: NICSimplifierStage -> () -cover_NICSimplifierTag_4 x +cover_UncertifiedOptTag_4 :: UncertifiedOptStage -> () +cover_UncertifiedOptTag_4 x = case x of CaseOfCase -> () LetFloatOut -> () --- VerifiedCompilation.Trace.ICSimplifierTag -d_ICSimplifierTag_10 = () -type T_ICSimplifierTag_10 = ICSimplifierStage +-- VerifiedCompilation.Trace.CertifiedOptTag +d_CertifiedOptTag_10 = () +type T_CertifiedOptTag_10 = CertifiedOptStage pattern C_floatDelayT_12 = FloatDelay pattern C_forceDelayT_14 = ForceDelay pattern C_forceCaseDelayT_16 = ForceCaseDelay @@ -51,22 +50,22 @@ pattern C_caseReduceT_18 = CaseReduce pattern C_inlineT_20 = Inline pattern C_cseT_22 = CSE pattern C_applyToCaseT_24 = ApplyToCase -check_floatDelayT_12 :: T_ICSimplifierTag_10 +check_floatDelayT_12 :: T_CertifiedOptTag_10 check_floatDelayT_12 = FloatDelay -check_forceDelayT_14 :: T_ICSimplifierTag_10 +check_forceDelayT_14 :: T_CertifiedOptTag_10 check_forceDelayT_14 = ForceDelay -check_forceCaseDelayT_16 :: T_ICSimplifierTag_10 +check_forceCaseDelayT_16 :: T_CertifiedOptTag_10 check_forceCaseDelayT_16 = ForceCaseDelay -check_caseReduceT_18 :: T_ICSimplifierTag_10 +check_caseReduceT_18 :: T_CertifiedOptTag_10 check_caseReduceT_18 = CaseReduce -check_inlineT_20 :: T_ICSimplifierTag_10 +check_inlineT_20 :: T_CertifiedOptTag_10 check_inlineT_20 = Inline -check_cseT_22 :: T_ICSimplifierTag_10 +check_cseT_22 :: T_CertifiedOptTag_10 check_cseT_22 = CSE -check_applyToCaseT_24 :: T_ICSimplifierTag_10 +check_applyToCaseT_24 :: T_CertifiedOptTag_10 check_applyToCaseT_24 = ApplyToCase -cover_ICSimplifierTag_10 :: ICSimplifierStage -> () -cover_ICSimplifierTag_10 x +cover_CertifiedOptTag_10 :: CertifiedOptStage -> () +cover_CertifiedOptTag_10 x = case x of FloatDelay -> () ForceDelay -> () @@ -75,61 +74,61 @@ cover_ICSimplifierTag_10 x Inline -> () CSE -> () ApplyToCase -> () --- VerifiedCompilation.Trace.SimplifierTag -d_SimplifierTag_26 :: () -d_SimplifierTag_26 = erased --- VerifiedCompilation.Trace.floatDelayTag -d_floatDelayTag_28 :: +-- VerifiedCompilation.Trace.OptTag +d_OptTag_26 :: () +d_OptTag_26 = erased +-- VerifiedCompilation.Trace.FloatDelayT +d_FloatDelayT_28 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_floatDelayTag_28 + T_UncertifiedOptTag_4 T_CertifiedOptTag_10 +d_FloatDelayT_28 = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_floatDelayT_12) --- VerifiedCompilation.Trace.forceDelayTag -d_forceDelayTag_30 :: +-- VerifiedCompilation.Trace.ForceDelayT +d_ForceDelayT_30 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_forceDelayTag_30 + T_UncertifiedOptTag_4 T_CertifiedOptTag_10 +d_ForceDelayT_30 = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_forceDelayT_14) --- VerifiedCompilation.Trace.forceCaseDelayTag -d_forceCaseDelayTag_32 :: +-- VerifiedCompilation.Trace.ForceCaseDelayT +d_ForceCaseDelayT_32 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_forceCaseDelayTag_32 + T_UncertifiedOptTag_4 T_CertifiedOptTag_10 +d_ForceCaseDelayT_32 = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_forceCaseDelayT_16) --- VerifiedCompilation.Trace.caseReduceTag -d_caseReduceTag_34 :: +-- VerifiedCompilation.Trace.CaseReduceT +d_CaseReduceT_34 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_caseReduceTag_34 + T_UncertifiedOptTag_4 T_CertifiedOptTag_10 +d_CaseReduceT_34 = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_caseReduceT_18) --- VerifiedCompilation.Trace.inlineTag -d_inlineTag_36 :: +-- VerifiedCompilation.Trace.InlineT +d_InlineT_36 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_inlineTag_36 + T_UncertifiedOptTag_4 T_CertifiedOptTag_10 +d_InlineT_36 = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_inlineT_20) --- VerifiedCompilation.Trace.cseTag -d_cseTag_38 :: +-- VerifiedCompilation.Trace.CseT +d_CseT_38 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_cseTag_38 = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_cseT_22) --- VerifiedCompilation.Trace.applyToCaseTag -d_applyToCaseTag_40 :: + T_UncertifiedOptTag_4 T_CertifiedOptTag_10 +d_CseT_38 = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_cseT_22) +-- VerifiedCompilation.Trace.ApplyToCaseT +d_ApplyToCaseT_40 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_applyToCaseTag_40 + T_UncertifiedOptTag_4 T_CertifiedOptTag_10 +d_ApplyToCaseT_40 = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_applyToCaseT_24) --- VerifiedCompilation.Trace.caseOfCaseTag -d_caseOfCaseTag_42 :: +-- VerifiedCompilation.Trace.CaseOfCaseT +d_CaseOfCaseT_42 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_caseOfCaseTag_42 + T_UncertifiedOptTag_4 T_CertifiedOptTag_10 +d_CaseOfCaseT_42 = coe MAlonzo.Code.Utils.C_inj'8321'_12 (coe C_caseOfCaseT_6) --- VerifiedCompilation.Trace.letFloatOutTag -d_letFloatOutTag_44 :: +-- VerifiedCompilation.Trace.LetFloatOutT +d_LetFloatOutT_44 :: MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10 -d_letFloatOutTag_44 + T_UncertifiedOptTag_4 T_CertifiedOptTag_10 +d_LetFloatOutT_44 = coe MAlonzo.Code.Utils.C_inj'8321'_12 (coe C_letFloatOutT_8) -- VerifiedCompilation.Trace.InlineHints d_InlineHints_46 = () @@ -209,7 +208,7 @@ cover_Hints_72 x d_Trace_80 a0 = () data T_Trace_80 = C_step_84 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_10) T_Hints_72 AgdaAny T_Trace_80 | C_done_86 AgdaAny -- VerifiedCompilation.Trace.head @@ -226,7 +225,7 @@ d_Dump_96 = erased d_toTrace_98 :: [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_10) (MAlonzo.Code.Utils.T__'215'__428 T_Hints_72 (MAlonzo.Code.Utils.T__'215'__428 @@ -245,7 +244,7 @@ d_toTrace_98 v0 d_go_108 :: MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_10) (MAlonzo.Code.Utils.T__'215'__428 T_Hints_72 (MAlonzo.Code.Utils.T__'215'__428 @@ -253,7 +252,7 @@ d_go_108 :: MAlonzo.Code.RawU.T_Untyped_208)) -> [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_10) (MAlonzo.Code.Utils.T__'215'__428 T_Hints_72 (MAlonzo.Code.Utils.T__'215'__428 @@ -261,7 +260,7 @@ d_go_108 :: MAlonzo.Code.RawU.T_Untyped_208))] -> MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_10) (MAlonzo.Code.Utils.T__'215'__428 T_Hints_72 (MAlonzo.Code.Utils.T__'215'__428 @@ -269,7 +268,7 @@ d_go_108 :: MAlonzo.Code.RawU.T_Untyped_208)) -> [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_10) (MAlonzo.Code.Utils.T__'215'__428 T_Hints_72 (MAlonzo.Code.Utils.T__'215'__428 @@ -280,7 +279,7 @@ d_go_108 ~v0 ~v1 v2 v3 = du_go_108 v2 v3 du_go_108 :: MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_10) (MAlonzo.Code.Utils.T__'215'__428 T_Hints_72 (MAlonzo.Code.Utils.T__'215'__428 @@ -288,7 +287,7 @@ du_go_108 :: MAlonzo.Code.RawU.T_Untyped_208)) -> [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_NICSimplifierTag_4 T_ICSimplifierTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_10) (MAlonzo.Code.Utils.T__'215'__428 T_Hints_72 (MAlonzo.Code.Utils.T__'215'__428 diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs index f58c0107bde..5f9b7fb0e6e 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs @@ -44,7 +44,7 @@ d_a2c'63''7580''7580'_24 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40) (coe d_a2c'63'_32) -- VerifiedCompilation.UApplyToCase.a2c? d_a2c'63'_32 :: @@ -75,31 +75,31 @@ d_a2c'63'_32 v0 v1 v2 MAlonzo.Code.Untyped.C_'96'_18 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 MAlonzo.Code.Untyped.C_ƛ_20 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 MAlonzo.Code.Untyped.C__'183'__22 v5 v6 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 MAlonzo.Code.Untyped.C_force_24 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 MAlonzo.Code.Untyped.C_delay_26 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 MAlonzo.Code.Untyped.C_con_28 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 MAlonzo.Code.Untyped.C_constr_34 v5 v6 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 MAlonzo.Code.Untyped.C_case_40 v5 v6 -> let v7 = coe @@ -241,18 +241,18 @@ d_a2c'63'_32 v0 v1 v2 seq (coe v12) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError) MAlonzo.Code.Untyped.C_builtin_44 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 MAlonzo.Code.Untyped.C_error_46 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_applyToCaseTag_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError)) -- VerifiedCompilation.UApplyToCase..extendedlambda0 d_'46'extendedlambda0_48 :: @@ -275,8 +275,8 @@ d_'46'extendedlambda1_94 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> T_ApplyToCase_4 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs index 5470b645dbb..34d8e9b0985 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs @@ -47,7 +47,7 @@ d_isUntypedCSE'63'_26 :: d_isUntypedCSE'63'_26 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 - (coe v0) (coe MAlonzo.Code.VerifiedCompilation.Trace.d_cseTag_38) + (coe v0) (coe MAlonzo.Code.VerifiedCompilation.Trace.d_CseT_38) (coe d_isUCSE'63'_30) -- VerifiedCompilation.UCSE.isUCSE? d_isUCSE'63'_30 :: @@ -116,7 +116,7 @@ d_isUCSE'63'_30 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_cseTag_38 v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_CseT_38 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UCSE..extendedlambda0 d_'46'extendedlambda0_46 :: @@ -138,8 +138,8 @@ d_'46'extendedlambda1_78 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> T_UCSE_4 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda1_78 = erased diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs index b7adbd76223..b4bef7b61b0 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs @@ -560,7 +560,7 @@ d_isCaseOfCase'63'_256 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_42) (coe d_isCoC'63'_264) -- VerifiedCompilation.UCaseOfCase.isCoC? d_isCoC'63'_264 :: @@ -671,7 +671,7 @@ d_isCoC'63'_264 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42) + MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_42) (coe d_isCaseOfCase'63'_256 (coe @@ -688,7 +688,7 @@ d_isCoC'63'_264 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42) + MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_42) (coe d_isCaseOfCase'63'_256 (coe @@ -705,7 +705,7 @@ d_isCoC'63'_264 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42) + MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_42) (coe d_isCaseOfCase'63'_256 (coe @@ -754,7 +754,7 @@ d_isCoC'63'_264 v0 v1 v2 v40) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42 + MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_42 (coe MAlonzo.Code.Untyped.C_case_40 (coe @@ -826,7 +826,7 @@ d_isCoC'63'_264 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_caseOfCaseTag_42 v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_42 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UCaseOfCase..extendedlambda4 d_'46'extendedlambda4_280 :: @@ -866,8 +866,8 @@ d_'46'extendedlambda6_444 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -889,8 +889,8 @@ d_'46'extendedlambda7_524 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> @@ -913,8 +913,8 @@ d_'46'extendedlambda8_608 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs index 0d61b226ee6..cc4301735d6 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs @@ -50,7 +50,7 @@ d_isCaseReduce'63'_26 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_caseReduceTag_34) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_CaseReduceT_34) (coe d_isCR'63'_42) -- VerifiedCompilation.UCaseReduce.justEq d_justEq_34 :: @@ -133,7 +133,7 @@ d_isCR'63'_42 v0 v1 v2 MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_caseReduceTag_34 + MAlonzo.Code.VerifiedCompilation.Trace.d_CaseReduceT_34 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError))) _ -> MAlonzo.RTE.mazUnreachableError @@ -145,7 +145,7 @@ d_isCR'63'_42 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_caseReduceTag_34 v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_CaseReduceT_34 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UCaseReduce..extendedlambda0 d_'46'extendedlambda0_58 :: @@ -191,8 +191,8 @@ d_'46'extendedlambda3_142 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs index b2b79403104..e1319321942 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs @@ -541,7 +541,7 @@ d_isFloatDelay'63'_488 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_28) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_FloatDelayT_28) (coe d_isFlD'63'_492) -- VerifiedCompilation.UFloatDelay.isFlD? d_isFlD'63'_492 :: @@ -697,7 +697,7 @@ d_isFlD'63'_492 v0 v1 v2 v38) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_28 + MAlonzo.Code.VerifiedCompilation.Trace.d_FloatDelayT_28 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) @@ -726,7 +726,7 @@ d_isFlD'63'_492 v0 v1 v2 v21) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_28 + MAlonzo.Code.VerifiedCompilation.Trace.d_FloatDelayT_28 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -741,7 +741,7 @@ d_isFlD'63'_492 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_floatDelayTag_28 v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_FloatDelayT_28 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UFloatDelay..extendedlambda8 d_'46'extendedlambda8_508 :: @@ -772,8 +772,8 @@ d_'46'extendedlambda10_582 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -790,8 +790,8 @@ d_'46'extendedlambda11_630 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs index 871ee8402b8..ec4ae3b602d 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs @@ -167,7 +167,7 @@ d_isForceCaseDelay'63'_94 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_32) (coe d_isFCD'63'_96) -- VerifiedCompilation.UForceCaseDelay.isFCD? d_isFCD'63'_96 :: @@ -271,7 +271,7 @@ d_isFCD'63'_96 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32) + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_32) (coe d_isForceCaseDelay'63'_94 (coe @@ -298,14 +298,14 @@ d_isFCD'63'_96 v0 v1 v2 MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 v36 v37 v38 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_32 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError) MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 v34 v35 v36 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_32 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError) @@ -316,7 +316,7 @@ d_isFCD'63'_96 v0 v1 v2 v28) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_32 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError))) @@ -327,7 +327,7 @@ d_isFCD'63'_96 v0 v1 v2 seq (coe v18) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_32 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError))) _ -> MAlonzo.RTE.mazUnreachableError @@ -339,8 +339,7 @@ d_isFCD'63'_96 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceCaseDelayTag_32 v1 - v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_32 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UForceCaseDelay..extendedlambda1 d_'46'extendedlambda1_112 :: @@ -382,8 +381,8 @@ d_'46'extendedlambda4_228 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> @@ -401,8 +400,8 @@ d_'46'extendedlambda5_280 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs index 586b6db1300..b1d468a8d54 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs @@ -583,7 +583,7 @@ d_isForceDelay'63'_178 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30) (coe (\ v1 -> d_isFD'63'_184 (coe v1) (coe C_'9633'_82))) -- VerifiedCompilation.UForceDelay.isFD? d_isFD'63'_184 :: @@ -745,7 +745,7 @@ d_isFD'63'_184 v0 v1 v2 v3 seq (coe v9) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError) @@ -1114,7 +1114,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v87) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError) @@ -1146,7 +1146,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v80) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 v16 v22) _ -> MAlonzo.RTE.mazUnreachableError @@ -1157,7 +1157,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v77) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 v43 v59) _ -> MAlonzo.RTE.mazUnreachableError))))) @@ -1329,7 +1329,7 @@ d_isFD'63'_184 v0 v1 v2 v3 seq (coe v13) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -1851,7 +1851,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v98) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 v15 v3) _ -> MAlonzo.RTE.mazUnreachableError) @@ -1883,7 +1883,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v91) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 v27 v33) _ -> MAlonzo.RTE.mazUnreachableError @@ -1894,7 +1894,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v88) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 v54 v70) _ -> MAlonzo.RTE.mazUnreachableError))))) @@ -2085,7 +2085,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v24) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 v15 v3) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -2228,7 +2228,7 @@ d_isFD'63'_184 v0 v1 v2 v3 seq (coe v14) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_forceDelayTag_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -2254,8 +2254,8 @@ d_'46'extendedlambda2_246 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda2_246 = erased @@ -2272,8 +2272,8 @@ d_'46'extendedlambda3_320 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.VerifiedCompilation.UntypedViews.T_isForce_270 -> @@ -2291,8 +2291,8 @@ d_'46'extendedlambda4_348 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2321,8 +2321,8 @@ d_'46'extendedlambda6_476 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2333,8 +2333,8 @@ d_'46'extendedlambda6_476 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda6_476 = erased @@ -2353,8 +2353,8 @@ d_'46'extendedlambda7_518 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda7_518 = erased @@ -2380,8 +2380,8 @@ d_'46'extendedlambda8_634 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2409,8 +2409,8 @@ d_'46'extendedlambda9_688 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2433,8 +2433,8 @@ d_'46'extendedlambda10_750 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2445,8 +2445,8 @@ d_'46'extendedlambda10_750 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2469,8 +2469,8 @@ d_'46'extendedlambda11_814 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2480,8 +2480,8 @@ d_'46'extendedlambda11_814 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2505,8 +2505,8 @@ d_'46'extendedlambda12_880 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Builtin.T_Builtin_2 -> @@ -2515,8 +2515,8 @@ d_'46'extendedlambda12_880 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2545,8 +2545,8 @@ d_'46'extendedlambda13_1034 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2566,8 +2566,8 @@ d_'46'extendedlambda14_1074 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2583,16 +2583,16 @@ d_'46'extendedlambda15_1190 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2609,8 +2609,8 @@ d_'46'extendedlambda16_1214 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2628,8 +2628,8 @@ d_'46'extendedlambda17_1238 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2660,8 +2660,8 @@ d_'46'extendedlambda19_1340 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.VerifiedCompilation.UntypedViews.T_isDelay_356 -> @@ -2680,16 +2680,16 @@ d_'46'extendedlambda20_1454 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2705,8 +2705,8 @@ d_'46'extendedlambda21_1480 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2723,8 +2723,8 @@ d_'46'extendedlambda22_1506 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2741,8 +2741,8 @@ d_'46'extendedlambda23_1574 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2779,8 +2779,8 @@ d_'46'extendedlambda25_1698 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.VerifiedCompilation.UntypedViews.T_isForce_270 -> @@ -2802,8 +2802,8 @@ d_'46'extendedlambda26_1732 :: () -> () -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs index 5a9914147c7..3517ee796da 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs @@ -308,7 +308,7 @@ d_checkPointwise_304 v0 v1 v2 v3 v4 v5 v6 v7 = let v8 = coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 v6 v7 in + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 v6 v7 in coe (case coe v3 of [] @@ -365,7 +365,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 = let v8 = coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 v4 v7 in + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 v4 v7 in coe (case coe v4 of MAlonzo.Code.Untyped.C_'96'_18 v9 @@ -385,7 +385,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 -> let v15 = coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 v4 v7 in coe (case coe v13 of @@ -418,7 +418,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 v4 v4 _ -> MAlonzo.RTE.mazUnreachableError) _ -> coe v15 @@ -627,7 +627,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v13) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 v4 v7) _ -> MAlonzo.RTE.mazUnreachableError) _ -> coe v8 @@ -669,7 +669,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v16) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 v4 v7) _ -> MAlonzo.RTE.mazUnreachableError) _ -> coe v8 @@ -752,7 +752,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v16) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 v4 v7) _ -> MAlonzo.RTE.mazUnreachableError) else (let v14 @@ -776,7 +776,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v16) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_inlineTag_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 v4 v7) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError) diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs index b1b53222fd0..88993ed2554 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs @@ -86,8 +86,8 @@ d_translation'63'_164 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> ()) -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -100,8 +100,8 @@ d_translation'63'_164 v0 ~v1 v2 v3 v4 v5 du_translation'63'_164 :: Integer -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2926,8 +2926,8 @@ d_decPointwiseTranslation'63'_176 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> ()) -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2940,8 +2940,8 @@ d_decPointwiseTranslation'63'_176 v0 ~v1 v2 v3 v4 v5 du_decPointwiseTranslation'63'_176 :: Integer -> MAlonzo.Code.Utils.T_Either_6 - MAlonzo.Code.VerifiedCompilation.Trace.T_NICSimplifierTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_ICSimplifierTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> diff --git a/plutus-metatheory/src/VerifiedCompilation.lagda.md b/plutus-metatheory/src/VerifiedCompilation.lagda.md index f48d4b9ebcf..2f66ec4d1e7 100644 --- a/plutus-metatheory/src/VerifiedCompilation.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation.lagda.md @@ -59,19 +59,19 @@ open import VerifiedCompilation.Certificate hiding (_>>=_) data Error : Set where emptyDump : Error illScoped : Error - counterExample : SimplifierTag → Error - abort : SimplifierTag → Error + counterExample : OptTag → Error + abort : OptTag → Error ``` ## Translation Relations and Certifiers -We map a `ICSimplifierTag` to the corresponding translation relation. +We map a `CertifiedOptTag` to the corresponding translation relation. ``` -- TODO: this should be enforced at the type level somehow -- i.e. I shouldn't be able to associate 'forceDelayT' with -- 'floatDelay'! -tagToRelation : ICSimplifierTag → (0 ⊢ → 0 ⊢ → Set) +tagToRelation : CertifiedOptTag → (0 ⊢ → 0 ⊢ → Set) tagToRelation floatDelayT = UFlD.FloatDelay tagToRelation forceDelayT = UFD.ForceDelay tagToRelation forceCaseDelayT = UFCD.ForceCaseDelay @@ -81,28 +81,28 @@ tagToRelation cseT = UCSE.UntypedCSE tagToRelation applyToCaseT = UA2C.UApplyToCase ``` -We default to the `NotImplemented` relation to give each `SimplifierTag` a relation: +We default to the `NotImplemented` relation to give each `OptTag` a relation: ``` -RelationOf : SimplifierTag → (0 ⊢ → 0 ⊢ → Set) +RelationOf : OptTag → (0 ⊢ → 0 ⊢ → Set) RelationOf (inj₁ _) = NotImplemented accept RelationOf (inj₂ tag) = tagToRelation tag -hasRelation : SimplifierTag → Bool +hasRelation : OptTag → Bool hasRelation = is-inj₂ ``` The corresponding certifier can then be called for a given pass: ``` -certifyPass : (pass : SimplifierTag) → Hints → (M M' : 0 ⊢) → CertResult (RelationOf pass M M') +certifyPass : (pass : OptTag) → Hints → (M M' : 0 ⊢) → CertResult (RelationOf pass M M') certifyPass (inj₁ _) _ = certNotImplemented certifyPass (inj₂ floatDelayT) _ = decider UFlD.isFloatDelay? certifyPass (inj₂ forceDelayT) _ = decider UFD.isForceDelay? certifyPass (inj₂ forceCaseDelayT) _ = decider UFCD.isForceCaseDelay? certifyPass (inj₂ caseReduceT) _ = decider UCR.isCaseReduce? certifyPass (inj₂ inlineT) (inline hs) = checker (UInline.top-check hs) -certifyPass (inj₂ inlineT) none = λ M M' → abort inlineTag M M' +certifyPass (inj₂ inlineT) none = λ M M' → abort InlineT M M' certifyPass (inj₂ cseT) _ = decider UCSE.isUntypedCSE? certifyPass (inj₂ applyToCaseT) _ = decider UA2C.a2c?ᶜᶜ ``` diff --git a/plutus-metatheory/src/VerifiedCompilation/Certificate.lagda.md b/plutus-metatheory/src/VerifiedCompilation/Certificate.lagda.md index a5e14cb4a15..3d608efed4a 100644 --- a/plutus-metatheory/src/VerifiedCompilation/Certificate.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/Certificate.lagda.md @@ -45,13 +45,13 @@ variable data CertResult (P : Set 𝓁) : Set (suc 𝓁) where proof : (p : P) → CertResult P - ce : (¬p : ¬ P) → {X X' : Set} → SimplifierTag → X → X' → CertResult P - abort : {X X' : Set} → SimplifierTag → X → X' → CertResult P + ce : (¬p : ¬ P) → {X X' : Set} → OptTag → X → X' → CertResult P + abort : {X X' : Set} → OptTag → X → X' → CertResult P -- | Result of a decision procedure: either a proof or a counterexample data ProofOrCE (P : Set 𝓁) : Set (suc 𝓁) where proof : (p : P) → ProofOrCE P - ce : (¬p : ¬ P) → {X X' : Set} → SimplifierTag → X → X' → ProofOrCE P + ce : (¬p : ¬ P) → {X X' : Set} → OptTag → X → X' → ProofOrCE P isProof? : {P : Set 𝓁} → ProofOrCE P → Bool isProof? (proof _) = true @@ -63,7 +63,7 @@ isCE? = not ∘ isProof? -- | Result of a checking procedure: either a proof or a failure data Proof? (P : Set 𝓁) : Set (suc 𝓁) where proof : (p : P) → Proof? P - abort : {X X' : Set} → SimplifierTag → X → X' → Proof? P + abort : {X X' : Set} → OptTag → X → X' → Proof? P infixl 1 _>>=_ @@ -94,7 +94,7 @@ decider f x y with f x y ... | proof p = proof p ... | ce ¬p tag a b = ce ¬p tag a b -decToPCE : {X : Set} {P : Set} → SimplifierTag → Dec P → {before after : X} → ProofOrCE P +decToPCE : {X : Set} {P : Set} → OptTag → Dec P → {before after : X} → ProofOrCE P decToPCE _ (yes p) = proof p decToPCE tag (no ¬p) {before} {after} = ce ¬p tag before after @@ -102,12 +102,12 @@ pceToDec : {P : Set} → ProofOrCE P → Dec P pceToDec (proof p) = yes p pceToDec (ce ¬p _ _ _) = no ¬p -matchOrCE : {X X' : Set} {𝓁 : Level} → {P : X → X' → Set 𝓁} → SimplifierTag → Binary.Decidable P → DecidableCE P +matchOrCE : {X X' : Set} {𝓁 : Level} → {P : X → X' → Set 𝓁} → OptTag → Binary.Decidable P → DecidableCE P matchOrCE tag P a b with P a b ... | yes p = proof p ... | no ¬p = ce ¬p tag a b -pcePointwise : {X X' : Set} {𝓁 : Level} {P : X → X' → Set 𝓁} → SimplifierTag → DecidableCE P → DecidableCE (Pointwise P) +pcePointwise : {X X' : Set} {𝓁 : Level} {P : X → X' → Set 𝓁} → OptTag → DecidableCE P → DecidableCE (Pointwise P) pcePointwise tag isP? [] [] = proof Pointwise.[] pcePointwise {X = X} tag isP? [] (y ∷ ys) = ce (λ ()) {X = List X} tag [] ys pcePointwise {X' = X'} tag isP? (x ∷ xs) [] = ce (λ ()) {X' = List X'} tag xs [] diff --git a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md index b361fd5086c..04b0c09963d 100644 --- a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md @@ -25,44 +25,43 @@ We enumerate the known passes and partition them into two categories: ``` -data NICSimplifierTag : Set where - caseOfCaseT : NICSimplifierTag - letFloatOutT : NICSimplifierTag - -data ICSimplifierTag : Set where - floatDelayT : ICSimplifierTag - forceDelayT : ICSimplifierTag - forceCaseDelayT : ICSimplifierTag - caseReduceT : ICSimplifierTag - inlineT : ICSimplifierTag - cseT : ICSimplifierTag - applyToCaseT : ICSimplifierTag - -SimplifierTag = Utils.Either NICSimplifierTag ICSimplifierTag - -floatDelayTag : SimplifierTag -floatDelayTag = Utils.inj₂ floatDelayT -forceDelayTag : SimplifierTag -forceDelayTag = Utils.inj₂ forceDelayT -forceCaseDelayTag : SimplifierTag -forceCaseDelayTag = Utils.inj₂ forceCaseDelayT -caseReduceTag : SimplifierTag -caseReduceTag = Utils.inj₂ caseReduceT -inlineTag : SimplifierTag -inlineTag = Utils.inj₂ inlineT -cseTag : SimplifierTag -cseTag = Utils.inj₂ cseT -applyToCaseTag : SimplifierTag -applyToCaseTag = Utils.inj₂ applyToCaseT - -caseOfCaseTag : SimplifierTag -caseOfCaseTag = Utils.inj₁ caseOfCaseT -letFloatOutTag : SimplifierTag -letFloatOutTag = Utils.inj₁ letFloatOutT - -{-# FOREIGN GHC import UntypedPlutusCore.Transform.Simplifier #-} -{-# COMPILE GHC ICSimplifierTag = data ICSimplifierStage (FloatDelay | ForceDelay | ForceCaseDelay | CaseReduce | Inline | CSE | ApplyToCase) #-} -{-# COMPILE GHC NICSimplifierTag = data NICSimplifierStage (CaseOfCase | LetFloatOut) #-} +data UncertifiedOptTag : Set where + caseOfCaseT : UncertifiedOptTag + letFloatOutT : UncertifiedOptTag + +data CertifiedOptTag : Set where + floatDelayT : CertifiedOptTag + forceDelayT : CertifiedOptTag + forceCaseDelayT : CertifiedOptTag + caseReduceT : CertifiedOptTag + inlineT : CertifiedOptTag + cseT : CertifiedOptTag + applyToCaseT : CertifiedOptTag + +OptTag = Utils.Either UncertifiedOptTag CertifiedOptTag + +FloatDelayT : OptTag +FloatDelayT = Utils.inj₂ floatDelayT +ForceDelayT : OptTag +ForceDelayT = Utils.inj₂ forceDelayT +ForceCaseDelayT : OptTag +ForceCaseDelayT = Utils.inj₂ forceCaseDelayT +CaseReduceT : OptTag +CaseReduceT = Utils.inj₂ caseReduceT +InlineT : OptTag +InlineT = Utils.inj₂ inlineT +CseT : OptTag +CseT = Utils.inj₂ cseT +ApplyToCaseT : OptTag +ApplyToCaseT = Utils.inj₂ applyToCaseT + +CaseOfCaseT : OptTag +CaseOfCaseT = Utils.inj₁ caseOfCaseT +LetFloatOutT : OptTag +LetFloatOutT = Utils.inj₁ letFloatOutT + +{-# COMPILE GHC CertifiedOptTag = data CertifiedOptStage (FloatDelay | ForceDelay | ForceCaseDelay | CaseReduce | Inline | CSE | ApplyToCase) #-} +{-# COMPILE GHC UncertifiedOptTag = data UncertifiedOptStage (CaseOfCase | LetFloatOut) #-} ``` ## Hints @@ -96,14 +95,14 @@ data Hints : Set where ## Compiler traces A `Trace A` is a sequence of optimisation transformations applied to terms of -type `A`. Each transition is labeled with a `SimplifierTag` that contains +type `A`. Each transition is labeled with a `OptTag` that contains information about which pass was performed. ``` data Trace (A : Set) : Set where -- One step in the pipeline, with its pass and input term - step : SimplifierTag → Hints → A → Trace A → Trace A + step : OptTag → Hints → A → Trace A → Trace A -- Final AST in the trace done : A → Trace A @@ -121,7 +120,7 @@ head (step _ _ x _) = x -- The current trace structure dumped from Haskell Dump : Set -Dump = List (SimplifierTag × Hints × Untyped × Untyped) +Dump = List (OptTag × Hints × Untyped × Untyped) -- -- Since there is duplication in the dump, i.e. it is of the form @@ -135,7 +134,7 @@ toTrace : Dump → Maybe (Trace Untyped) toTrace [] = nothing toTrace (x ∷ xs) = just (go x xs) where - go : SimplifierTag × Hints × Untyped × Untyped → Dump → Trace Untyped + go : OptTag × Hints × Untyped × Untyped → Dump → Trace Untyped go (pass , hints , x , y) [] = step pass hints x (done y) go (pass , hints , x , y) ((pass' , hints' , _ , z) ∷ xs) = step pass hints x (go (pass' , hints' , y , z) xs) ``` diff --git a/plutus-metatheory/src/VerifiedCompilation/UApplyToCase.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UApplyToCase.lagda.md index 20ac9cdedd7..48cf226e45b 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UApplyToCase.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UApplyToCase.lagda.md @@ -20,7 +20,7 @@ module VerifiedCompilation.UApplyToCase where ``` open import Untyped using (_⊢; case; constr) open import Untyped.Reduction using (iterApp) -open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; applyToCaseTag) +open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; ApplyToCaseT) open import VerifiedCompilation.UCaseReduce using (justEq) open import VerifiedCompilation.UntypedViews open import VerifiedCompilation.UntypedTranslation using (Translation; translation?; Relation) @@ -60,13 +60,13 @@ a2c?ᶜᶜ : {n : ℕ} → (M N : n ⊢) → ProofOrCE (Translation ApplyToCase a2c? : {n : ℕ} → (M N : n ⊢) → ProofOrCE (ApplyToCase M N) a2c? M N with (case? (constr? (_≟_ 0) (⋯ ∷? ⋯)) singleton?) N -... | no ¬p = ce (λ { (a2c _) → ¬p inhabitant } ) applyToCaseTag M N +... | no ¬p = ce (λ { (a2c _) → ¬p inhabitant } ) ApplyToCaseT M N ... | yes (case! (constr! refl (match! x ∷! match! xs)) (match! M' ∷! []!)) with a2c?ᶜᶜ M (iterApp M' (x ∷ xs)) ... | proof p = proof (a2c p) ... | ce ¬p tag L L′ = ce (λ { (a2c p) → ¬p p }) tag L L′ -a2c?ᶜᶜ = translation? applyToCaseTag a2c? +a2c?ᶜᶜ = translation? ApplyToCaseT a2c? UApplyToCase : Relation UApplyToCase = Translation ApplyToCase diff --git a/plutus-metatheory/src/VerifiedCompilation/UCSE.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UCSE.lagda.md index 021f6c09159..312905c25c9 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UCSE.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UCSE.lagda.md @@ -27,7 +27,7 @@ open import Data.Empty using (⊥) open import Agda.Builtin.Maybe using (Maybe; just; nothing) open import Untyped.RenamingSubstitution using (_[_]) open import Untyped.Purity using (Pure; isPure?) -open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; cseTag) +open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; CseT) ``` ## Translation Relation @@ -61,9 +61,9 @@ isUntypedCSE? : {X : ℕ} → DecidableCE (Translation UCSE {X}) {-# TERMINATING #-} isUCSE? : {X : ℕ} → DecidableCE (UCSE {X}) isUCSE? ast ast' with (isApp? (isLambda? isTerm?) isTerm?) ast' -... | no ¬match = ce (λ { (cse pt) → ¬match (isapp (islambda (isterm _)) (isterm _))}) cseTag ast ast' +... | no ¬match = ce (λ { (cse pt) → ¬match (isapp (islambda (isterm _)) (isterm _))}) CseT ast ast' ... | yes (isapp (islambda (isterm x')) (isterm e)) with (isUntypedCSE? ast (x' [ e ])) ... | ce ¬p t b a = ce (λ { (cse pt) → ¬p pt}) t b a ... | proof p = proof (cse p) -isUntypedCSE? = translation? cseTag isUCSE? +isUntypedCSE? = translation? CseT isUCSE? ``` diff --git a/plutus-metatheory/src/VerifiedCompilation/UCaseOfCase.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UCaseOfCase.lagda.md index d1fbc30e0d7..b8b0d0dcb39 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UCaseOfCase.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UCaseOfCase.lagda.md @@ -14,7 +14,7 @@ module VerifiedCompilation.UCaseOfCase where open import Untyped.Equality using (DecEq; _≟_; decPointwise) open import VerifiedCompilation.UntypedViews using (Pred; isCase?; isApp?; isForce?; isBuiltin?; isConstr?; isDelay?; isTerm?; allTerms?; iscase; isapp; isforce; isbuiltin; isconstr; isterm; allterms; isdelay) open import VerifiedCompilation.UntypedTranslation using (Translation; translation?; Relation) -open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; caseOfCaseTag) +open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; CaseOfCaseT) import Relation.Binary as Binary using (Decidable) import Relation.Unary as Unary using (Decidable) @@ -104,18 +104,18 @@ isCaseOfCase? : {X : ℕ} (ast ast' : X ⊢) → ProofOrCE (Translation CoC {X} isCoC? : {X : ℕ} (ast ast' : X ⊢) → ProofOrCE (CoC {X} ast ast') isCoC? ast ast' with (isCoCCase? ast) ×-dec (isCoCForce? ast') ... | no ¬cf = ce (λ { (isCoC b tn fn tt tt' ft ft' alts alts' x x₁ x₂) → ¬cf - (isCoCCase b tn fn tt ft alts , isCoCForce b tn fn tt' ft' alts') } ) caseOfCaseTag ast ast' + (isCoCCase b tn fn tt ft alts , isCoCForce b tn fn tt' ft' alts') } ) CaseOfCaseT ast ast' ... | yes (isCoCCase b tn fn tt ft alts , isCoCForce b₁ tn₁ fn₁ tt' ft' alts') with (b ≟ b₁) ×-dec (tn ≟ tn₁) ×-dec (fn ≟ fn₁) -... | no ¬p = ce (λ { (isCoC .b .tn .fn .tt .tt' .ft .ft' .alts .alts' x x₁ x₂) → ¬p (refl , refl , refl)}) caseOfCaseTag ast ast' -... | yes (refl , refl , refl) with pcePointwise caseOfCaseTag isCaseOfCase? tt tt' +... | no ¬p = ce (λ { (isCoC .b .tn .fn .tt .tt' .ft .ft' .alts .alts' x x₁ x₂) → ¬p (refl , refl , refl)}) CaseOfCaseT ast ast' +... | yes (refl , refl , refl) with pcePointwise CaseOfCaseT isCaseOfCase? tt tt' ... | ce ¬p t b a = ce (λ { (isCoC _ .tn .fn .tt .tt' .ft .ft' .alts .alts' x x₁ x₂) → ¬p x₁}) t b a -... | proof tt=tt' with pcePointwise caseOfCaseTag isCaseOfCase? ft ft' +... | proof tt=tt' with pcePointwise CaseOfCaseT isCaseOfCase? ft ft' ... | ce ¬p t b a = ce (λ { (isCoC _ .tn .fn .tt .tt' .ft .ft' .alts .alts' x x₁ x₂) → ¬p x₂}) t b a -... | proof ft=ft' with pcePointwise caseOfCaseTag isCaseOfCase? alts alts' +... | proof ft=ft' with pcePointwise CaseOfCaseT isCaseOfCase? alts alts' ... | ce ¬pp t b a = ce (λ { (isCoC _ .tn .fn .tt .tt' .ft .ft' .alts .alts' x x₁ x₂) → ¬pp x}) t b a ... | proof alts=alts' = proof (isCoC b tn fn tt tt' ft ft' alts alts' alts=alts' tt=tt' ft=ft') -isCaseOfCase? {X} = translation? {X} caseOfCaseTag isCoC? +isCaseOfCase? {X} = translation? {X} CaseOfCaseT isCoC? ``` ## Semantic Equivalence diff --git a/plutus-metatheory/src/VerifiedCompilation/UCaseReduce.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UCaseReduce.lagda.md index e99a50dcbb3..d3b3b793a30 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UCaseReduce.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UCaseReduce.lagda.md @@ -32,7 +32,7 @@ open import RawU using (tag2TyTag; tmCon) open import Agda.Builtin.Int using (Int) open import Data.Empty using (⊥) open import Function using (case_of_) -open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; caseReduceTag) +open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; CaseReduceT) open import Untyped.Reduction using (iterApp) ``` @@ -56,14 +56,14 @@ justEq refl = refl {-# TERMINATING #-} isCR? : {X : ℕ} → (ast ast' : X ⊢) → ProofOrCE (CaseReduce ast ast') isCR? ast ast' with (isCase? (isConstr? allTerms?) allTerms?) ast -... | no ¬p = ce (λ { (casereduce _ _) → ¬p (iscase (isconstr _ (allterms _)) (allterms _))} ) caseReduceTag ast ast' +... | no ¬p = ce (λ { (casereduce _ _) → ¬p (iscase (isconstr _ (allterms _)) (allterms _))} ) CaseReduceT ast ast' ... | yes (iscase (isconstr i (allterms vs)) (allterms xs)) with lookup? i xs in xv -... | nothing = ce (λ { (casereduce p _) → case trans (sym xv) p of λ { () }} ) caseReduceTag ast ast' +... | nothing = ce (λ { (casereduce p _) → case trans (sym xv) p of λ { () }} ) CaseReduceT ast ast' ... | just x with isCaseReduce? (iterApp x vs) ast' ... | proof p = proof (casereduce xv p) ... | ce ¬t t b a = ce (λ { (casereduce p t) → ¬t (subst (λ x → Translation CaseReduce (iterApp x vs) ast') (justEq (trans (sym p) xv)) t)}) t b a -isCaseReduce? = translation? caseReduceTag isCR? +isCaseReduce? = translation? CaseReduceT isCR? UCaseReduce = Translation CaseReduce diff --git a/plutus-metatheory/src/VerifiedCompilation/UFloatDelay.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UFloatDelay.lagda.md index 8c8ed5a2d1d..19052fb2363 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UFloatDelay.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UFloatDelay.lagda.md @@ -33,7 +33,7 @@ open import Builtin using (Builtin) open import RawU using (TmCon) open import Untyped.Purity using (Pure; isPure?) open import Data.List.Relation.Unary.All using (All; all?) -open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; floatDelayTag) +open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; FloatDelayT) variable X : ℕ @@ -149,17 +149,17 @@ isFloatDelay? : {X : ℕ} → DecidableCE (FloatDelay {X}) {-# TERMINATING #-} isFlD? : {X : ℕ} → DecidableCE (FlD {X}) isFlD? ast ast' with (isApp? (isLambda? isTerm?) (isDelay? isTerm?)) ast -... | no ¬match = ce (λ { (floatdelay x x₁ x₂) → ¬match (isapp (islambda (isterm _)) (isdelay (isterm _)))}) floatDelayTag ast ast' +... | no ¬match = ce (λ { (floatdelay x x₁ x₂) → ¬match (isapp (islambda (isterm _)) (isdelay (isterm _)))}) FloatDelayT ast ast' ... | yes (isapp (islambda (isterm t₁)) (isdelay (isterm t₂))) with (isApp? (isLambda? isTerm?) isTerm?) ast' -... | no ¬match = ce (λ { (floatdelay x x₁ x₂) → ¬match (isapp (islambda (isterm _)) (isterm _))}) floatDelayTag ast ast' +... | no ¬match = ce (λ { (floatdelay x x₁ x₂) → ¬match (isapp (islambda (isterm _)) (isterm _))}) FloatDelayT ast ast' ... | yes (isapp (islambda (isterm t₁')) (isterm t₂')) with (isFloatDelay? (subs-delay zero t₁) t₁') ... | ce ¬p t b a = ce (λ { (floatdelay x x₁ x₂) → ¬p x}) t b a ... | proof t₁=t₁' with (isFloatDelay? t₂ t₂') ... | ce ¬p t b a = ce (λ { (floatdelay x x₁ x₂) → ¬p x₁}) t b a ... | proof t₂=t₂' with (isPure? t₂') -... | no ¬p = ce (λ { (floatdelay x x₁ x₂) → ¬p x₂} ) floatDelayTag ast ast' +... | no ¬p = ce (λ { (floatdelay x x₁ x₂) → ¬p x₂} ) FloatDelayT ast ast' ... | yes puret₂' = proof (floatdelay t₁=t₁' t₂=t₂' puret₂') -isFloatDelay? = translation? floatDelayTag isFlD? +isFloatDelay? = translation? FloatDelayT isFlD? ``` diff --git a/plutus-metatheory/src/VerifiedCompilation/UForceCaseDelay.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UForceCaseDelay.lagda.md index 926bbcbf3d3..9ee1bb7a8ee 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UForceCaseDelay.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UForceCaseDelay.lagda.md @@ -17,7 +17,7 @@ module VerifiedCompilation.UForceCaseDelay where open import Data.Nat using (ℕ) open import Untyped open import VerifiedCompilation.UntypedTranslation using (Translation; translation?) -open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; forceCaseDelayTag; isProof?; isCE?) +open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; ForceCaseDelayT; isProof?; isCE?) open import Data.List using (List; _∷_; []) open import VerifiedCompilation.UntypedViews using (Pred; isCase?; isApp?; isForce?; isBuiltin?; isConstr?; isDelay?; isTerm?; allTerms?; iscase; isapp; isforce; isbuiltin; isconstr; isterm; allterms; isdelay) open import Relation.Nullary using (Dec; yes; no; ¬_) @@ -112,18 +112,18 @@ isForceCaseDelay? : DecidableCE (ForceCaseDelay {n}) {-# TERMINATING #-} isFCD? : DecidableCE (FCD {n}) isFCD? t t' with isForce? (isCase? isTerm? allTerms?) t -... | no ¬matchLHS = ce (λ { (isFCD p1 p2 p3) → ¬matchLHS (isforce (iscase (isterm _) (allterms _))) } ) forceCaseDelayTag t t' +... | no ¬matchLHS = ce (λ { (isFCD p1 p2 p3) → ¬matchLHS (isforce (iscase (isterm _) (allterms _))) } ) ForceCaseDelayT t t' ... | yes (isforce (iscase (isterm scrut) (allterms alts))) with isCase? isTerm? allTerms? t' -... | no ¬matchRHS = ce (λ { (isFCD p1 p2 p3) → ¬matchRHS (iscase (isterm _) (allterms _)) } ) forceCaseDelayTag t t' +... | no ¬matchRHS = ce (λ { (isFCD p1 p2 p3) → ¬matchRHS (iscase (isterm _) (allterms _)) } ) ForceCaseDelayT t t' ... | yes (iscase (isterm scrut') (allterms alts')) with all? isBranch? alts -... | no ¬areBranches = ce (λ { (isFCD p1 p2 p3) → ¬areBranches p1 } ) forceCaseDelayTag t t' +... | no ¬areBranches = ce (λ { (isFCD p1 p2 p3) → ¬areBranches p1 } ) ForceCaseDelayT t t' ... | yes areBranches with isForceCaseDelay? scrut scrut' -... | ce ¬fcdScrut tag lhs rhs = ce (λ { (isFCD p1 p2 p3) → ¬fcdScrut p2 } ) forceCaseDelayTag t t' -... | proof fcdScrut with pcePointwise forceCaseDelayTag isForceCaseDelay? (removeDelay alts) alts' -... | ce ¬fcdAlts tag lhs rhs = ce (λ { (isFCD p1 p2 p3) → ¬fcdAlts p3 } ) forceCaseDelayTag t t' +... | ce ¬fcdScrut tag lhs rhs = ce (λ { (isFCD p1 p2 p3) → ¬fcdScrut p2 } ) ForceCaseDelayT t t' +... | proof fcdScrut with pcePointwise ForceCaseDelayT isForceCaseDelay? (removeDelay alts) alts' +... | ce ¬fcdAlts tag lhs rhs = ce (λ { (isFCD p1 p2 p3) → ¬fcdAlts p3 } ) ForceCaseDelayT t t' ... | proof fcdAlts = proof (isFCD areBranches fcdScrut fcdAlts) -isForceCaseDelay? = translation? forceCaseDelayTag isFCD? +isForceCaseDelay? = translation? ForceCaseDelayT isFCD? ``` diff --git a/plutus-metatheory/src/VerifiedCompilation/UForceDelay.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UForceDelay.lagda.md index 488ea033b2f..ea4087db286 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UForceDelay.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UForceDelay.lagda.md @@ -27,7 +27,7 @@ open import Data.Fin using (Fin; zero; suc) open import Data.Nat using (ℕ; zero; suc; _+_) open import Untyped.RenamingSubstitution using (weaken) open import Data.List using (List; _∷_; []) -open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; forceDelayTag) +open import VerifiedCompilation.Certificate using (ProofOrCE; ce; proof; pcePointwise; DecidableCE; ForceDelayT) open import Untyped.Purity using (Pure; isPure?) open import Builtin using (ifThenElse) ``` @@ -219,7 +219,7 @@ isFD? □ ast ast' | no ¬force with (isApp? isTerm? isTerm? ast) ×-dec (isApp? ... | proof p | proof ptv = proof (app p ptv) ... | proof p | ce ¬pv tag bf af = ce (λ { (app x x₁) → ¬pv x₁ } ) tag bf af ... | ce ¬p tag bf af | _ = ce (λ { (app x x₁) → ¬p x } ) tag bf af -isFD? □ ast ast' | no ¬force | no ¬app = ce (λ { (force x) → ¬force (isforce (isterm _)) ; (app x x₁) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _))} ) forceDelayTag ast ast' +isFD? □ ast ast' | no ¬force | no ¬app = ce (λ { (force x) → ¬force (isforce (isterm _)) ; (app x x₁) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _))} ) ForceDelayT ast ast' isFD? (force z) ast ast' with (isApp? isTerm? isTerm? ast) ×-dec (isApp? isTerm? isTerm? ast') ... | yes (isapp (isterm t) (isterm y) , isapp (isterm t') (isterm y')) with isFD? ((force z) · y') t t' | isForceDelay? y y' ... | proof pt | proof py = proof (app pt py) @@ -228,14 +228,14 @@ isFD? (force z) ast ast' with (isApp? isTerm? isTerm? ast) ×-dec (isApp? isTerm ... | proof py = ce (λ { (app x x₁) → ¬pty x₁ ; (ifThenElse x x₁ x₂ x₃ x₄) → ForceFDNeverITE pt } ) tag bf af isFD? (force z) ast ast' | yes (isapp (isterm t) (isterm y) , isapp (isterm t') (isterm y')) | ce ¬papp tag₁ bf₁ af₁ | _ with (isApp? (isApp? (isForce? isBuiltin?) isTerm?) isTerm? t) ×-dec (isApp? (isApp? (isForce? isBuiltin?) isTerm?) isTerm? t') ... | yes (isapp (isapp (isforce (isbuiltin bi)) (isterm b)) (isterm x), isapp (isapp (isforce (isbuiltin bi')) (isterm b')) (isterm x')) with isPure? x' | isPure? y' | isForceDelay? b b' | isFD? (force z) x x' | isFD? (force z) y y' -... | no ¬purex | _ | _ | _ | _ = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬purex x} ) forceDelayTag x x' -... | yes purex | no ¬purey | _ | _ | _ = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬purey x₁} ) forceDelayTag y y' +... | no ¬purex | _ | _ | _ | _ = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬purex x} ) ForceDelayT x x' +... | yes purex | no ¬purey | _ | _ | _ = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬purey x₁} ) ForceDelayT y y' ... | yes purex | yes purey | ce ¬ptb tag bf af | _ | _ = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬ptb x₂} ) tag bf af ... | yes purex | yes purey | proof ptb | ce ¬px tag bf af | _ = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬px xx} ) tag bf af ... | yes purex | yes purey | proof ptb | proof px | ce ¬py tag bf af = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬py xx₁} ) tag bf af ... | yes purex | yes purey | proof ptb | proof px | proof py with (bi ≟ bi') ×-dec (bi ≟ ifThenElse) ... | yes (refl , refl) = proof (ifThenElse purex purey ptb px py) -... | no ¬bi=ite = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬bi=ite (refl , refl)} ) forceDelayTag ast ast' +... | no ¬bi=ite = ce (λ { (app xx x) → ¬papp xx ; (ifThenElse x x₁ x₂ xx xx₁) → ¬bi=ite (refl , refl)} ) ForceDelayT ast ast' isFD? (force z) ast ast' | yes (isapp (isterm t) (isterm y) , isapp (isterm t') (isterm y')) | ce ¬papp tag₁ bf₁ af₁ | _ | no ¬ifThenElse = ce (λ { (app x x₁) → ¬papp x ; (ifThenElse x x₁ x₂ x₃ x₄) → ¬ifThenElse (isapp (isapp (isforce (isbuiltin ifThenElse)) (isterm _)) @@ -252,7 +252,7 @@ isFD? (force □) ast ast' | no ¬app | yes (isdelay (isterm t)) | ce ¬p tag bf isFD? (force (force z)) ast ast' | no ¬app | yes (isdelay (isterm t)) | ce ¬p tag bf af = ce (λ { (delay x) → ¬p x } ) tag bf af isFD? (force (z · v)) ast ast' | no ¬app | yes (isdelay (isterm t)) | ce ¬p tag bf af = ce (λ { (delay x) → ¬p x } ) tag bf af isFD? (force z) ast ast' | no ¬app | no ¬delay with isForce? isTerm? ast -... | no ¬force = ce (λ { (force x) → ¬force (isforce (isterm _)) ; (delay x) → ¬delay (isdelay (isterm _)) ; (app x x₁) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _)) ; (last-delay x) → ¬delay (isdelay (isterm _)) ; (ifThenElse x x₁ x₂ x₃ x₄) → ¬app (isapp (isterm ((force (builtin ifThenElse) · _) · _)) (isterm _) , isapp (isterm ((force (builtin ifThenElse) · _) · _)) (isterm _))} ) forceDelayTag ast ast' +... | no ¬force = ce (λ { (force x) → ¬force (isforce (isterm _)) ; (delay x) → ¬delay (isdelay (isterm _)) ; (app x x₁) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _)) ; (last-delay x) → ¬delay (isdelay (isterm _)) ; (ifThenElse x x₁ x₂ x₃ x₄) → ¬app (isapp (isterm ((force (builtin ifThenElse) · _) · _)) (isterm _) , isapp (isterm ((force (builtin ifThenElse) · _) · _)) (isterm _))} ) ForceDelayT ast ast' ... | yes (isforce (isterm t)) with isFD? (force (force z)) t ast' ... | proof p = proof (force p) ... | ce ¬p tag bf af = ce (λ { (force x) → ¬p x} ) tag bf af @@ -269,7 +269,7 @@ isFD? (z · x) ast ast' | no ¬lambda with isForce? isTerm? ast ... | proof p = proof (force p) ... | ce ¬p tag bf af = ce (λ { (force xx) → ¬p xx} ) tag bf af isFD? (z · x) ast ast' | no ¬lambda | no ¬force with (isApp? isTerm? isTerm? ast) ×-dec (isApp? isTerm? isTerm? ast') -... | no ¬app = ce (λ { (force xx) → ¬force (isforce (isterm _)) ; (app xx x) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _)) ; (abs xx) → ¬lambda (islambda (isterm _) , islambda (isterm _)) ; (last-abs x) → ¬lambda (islambda (isterm _) , islambda (isterm _))} ) forceDelayTag ast ast' +... | no ¬app = ce (λ { (force xx) → ¬force (isforce (isterm _)) ; (app xx x) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _)) ; (abs xx) → ¬lambda (islambda (isterm _) , islambda (isterm _)) ; (last-abs x) → ¬lambda (islambda (isterm _) , islambda (isterm _))} ) ForceDelayT ast ast' ... | yes (isapp (isterm t) (isterm v) , isapp (isterm t') (isterm v')) with isFD? ((z · x) · v') t t' | isForceDelay? v v' ... | proof p | proof pvt = proof (app p pvt) ... | proof p | ce ¬pvt tag bf af = ce (λ { (app xx x) → ¬pvt x} ) tag bf af @@ -278,31 +278,31 @@ isFD? (z · x) ast ast' | no ¬lambda | no ¬force with (isApp? isTerm? isTerm? isFD? z ast ast' with isForce? isTerm? ast isFD? z ast ast' | yes (isforce (isterm t)) with ((isApp? (isApp? (isApp? (isForce? isBuiltin?) isTerm?) (isDelay? isTerm?)) (isDelay? isTerm?)) t) ×-dec ((isApp? (isApp? (isApp? (isForce? isBuiltin?) isTerm?) isTerm?) isTerm?) ast') isFD? □ (force t) ast' | yes (isforce (isterm _)) | yes ((isapp (isapp (isapp (isforce (isbuiltin bi)) (isterm b)) (isdelay (isterm x))) (isdelay (isterm y))) , (isapp (isapp (isapp (isforce (isbuiltin bi')) (isterm b')) (isterm x')) (isterm y'))) with bi ≟ bi' | bi ≟ ifThenElse | isForceDelay? b b' | isForceDelay? x x' | isForceDelay? y y' | isPure? x | isPure? y -... | no ¬bi≡bi' | _ | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬bi≡bi' refl ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡bi' refl} ) forceDelayTag (force t) ast' -... | yes refl | no ¬bi≡ifThenElse | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬bi≡ifThenElse refl ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡ifThenElse refl} ) forceDelayTag (force t) ast' -... | yes refl | yes refl | ce ¬pb tag bf af | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬pb x₂; (ifThenElse x x₁ xx xx₁ xx₂) → ¬pb (Translation.istranslation xx)} ) forceDelayTag (force t) ast' -... | yes refl | yes refl | proof pb | ce ¬px tag bf af | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬px x₃; (ifThenElse x x₁ xx xx₁ xx₂) → ¬px (Translation.istranslation xx₁)} ) forceDelayTag (force t) ast' -... | yes refl | yes refl | proof pb | proof px | ce ¬py tag bf af | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬py x₄; (ifThenElse x x₁ xx xx₁ xx₂) → ¬py (Translation.istranslation xx₂)} ) forceDelayTag (force t) ast' -... | yes refl | yes refl | proof pb | proof px | proof py | no ¬purex | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬purex x; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purex x} ) forceDelayTag (force t) ast' -... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | no ¬purey = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬purey x₁; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purey x₁} ) forceDelayTag (force t) ast' +... | no ¬bi≡bi' | _ | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬bi≡bi' refl ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡bi' refl} ) ForceDelayT (force t) ast' +... | yes refl | no ¬bi≡ifThenElse | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬bi≡ifThenElse refl ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡ifThenElse refl} ) ForceDelayT (force t) ast' +... | yes refl | yes refl | ce ¬pb tag bf af | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬pb x₂; (ifThenElse x x₁ xx xx₁ xx₂) → ¬pb (Translation.istranslation xx)} ) ForceDelayT (force t) ast' +... | yes refl | yes refl | proof pb | ce ¬px tag bf af | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬px x₃; (ifThenElse x x₁ xx xx₁ xx₂) → ¬px (Translation.istranslation xx₁)} ) ForceDelayT (force t) ast' +... | yes refl | yes refl | proof pb | proof px | ce ¬py tag bf af | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬py x₄; (ifThenElse x x₁ xx xx₁ xx₂) → ¬py (Translation.istranslation xx₂)} ) ForceDelayT (force t) ast' +... | yes refl | yes refl | proof pb | proof px | proof py | no ¬purex | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬purex x; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purex x} ) ForceDelayT (force t) ast' +... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | no ¬purey = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (force (lastIfThenElse x x₁ x₂ x₃ x₄)) → ¬purey x₁; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purey x₁} ) ForceDelayT (force t) ast' ... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | yes purey = proof (force (lastIfThenElse purex purey pb px py)) isFD? (z · v) (force t) ast' | yes (isforce (isterm _)) | yes ((isapp (isapp (isapp (isforce (isbuiltin bi)) (isterm b)) (isdelay (isterm x))) (isdelay (isterm y))) , (isapp (isapp (isapp (isforce (isbuiltin bi')) (isterm b')) (isterm x')) (isterm y'))) with bi ≟ bi' | bi ≟ ifThenElse | isFD? (z · v) b b' | isFD? (z · v) x x' | isFD? (z · v) y y' | isPure? x | isPure? y -... | no ¬bi≡bi' | _ | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡bi' refl} ) forceDelayTag (force t) ast' -... | yes refl | no ¬bi≡ifThenElse | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡ifThenElse refl} ) forceDelayTag (force t) ast' -... | yes refl | yes refl | ce ¬pb tag bf af | _ | _ | _ | _ = ce (λ {(force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬pb xx} ) forceDelayTag (force t) ast' -... | yes refl | yes refl | proof pb | ce ¬px tag bf af | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)); (ifThenElse x x₁ xx xx₁ xx₂) → ¬px xx₁ } ) forceDelayTag (force t) ast' -... | yes refl | yes refl | proof pb | proof px | ce ¬py tag bf af | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)); (ifThenElse x x₁ xx xx₁ xx₂) → ¬py xx₂} ) forceDelayTag (force t) ast' -... | yes refl | yes refl | proof pb | proof px | proof py | no ¬purex | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purex x} ) forceDelayTag (force t) ast' -... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | no ¬purey = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purey x₁} ) forceDelayTag (force t) ast' +... | no ¬bi≡bi' | _ | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡bi' refl} ) ForceDelayT (force t) ast' +... | yes refl | no ¬bi≡ifThenElse | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡ifThenElse refl} ) ForceDelayT (force t) ast' +... | yes refl | yes refl | ce ¬pb tag bf af | _ | _ | _ | _ = ce (λ {(force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬pb xx} ) ForceDelayT (force t) ast' +... | yes refl | yes refl | proof pb | ce ¬px tag bf af | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)); (ifThenElse x x₁ xx xx₁ xx₂) → ¬px xx₁ } ) ForceDelayT (force t) ast' +... | yes refl | yes refl | proof pb | proof px | ce ¬py tag bf af | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)); (ifThenElse x x₁ xx xx₁ xx₂) → ¬py xx₂} ) ForceDelayT (force t) ast' +... | yes refl | yes refl | proof pb | proof px | proof py | no ¬purex | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purex x} ) ForceDelayT (force t) ast' +... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | no ¬purey = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purey x₁} ) ForceDelayT (force t) ast' ... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | yes purey = proof (ifThenElse purex purey pb px py) isFD? (force z) (force t) ast' | yes (isforce (isterm _)) | yes ((isapp (isapp (isapp (isforce (isbuiltin bi)) (isterm b)) (isdelay (isterm x))) (isdelay (isterm y))) , (isapp (isapp (isapp (isforce (isbuiltin bi')) (isterm b')) (isterm x')) (isterm y'))) with bi ≟ bi' | bi ≟ ifThenElse | isFD? (force z) b b' | isFD? (force z) x x' | isFD? (force z) y y' | isPure? x | isPure? y -... | no ¬bi≡bi' | _ | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡bi' refl} ) forceDelayTag (force t) ast' -... | yes refl | no ¬bi≡ifThenElse | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡ifThenElse refl} ) forceDelayTag (force t) ast' -... | yes refl | yes refl | ce ¬pb tag bf af | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬pb xx} ) forceDelayTag (force t) ast' -... | yes refl | yes refl | proof pb | ce ¬px tag bf af | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬px xx₁ } ) forceDelayTag (force t) ast' -... | yes refl | yes refl | proof pb | proof px | ce ¬py tag bf af | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)); (ifThenElse x x₁ xx xx₁ xx₂) → ¬py xx₂} ) forceDelayTag (force t) ast' -... | yes refl | yes refl | proof pb | proof px | proof py | no ¬purex | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purex x} ) forceDelayTag (force t) ast' -... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | no ¬purey = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purey x₁} ) forceDelayTag (force t) ast' +... | no ¬bi≡bi' | _ | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡bi' refl} ) ForceDelayT (force t) ast' +... | yes refl | no ¬bi≡ifThenElse | _ | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬bi≡ifThenElse refl} ) ForceDelayT (force t) ast' +... | yes refl | yes refl | ce ¬pb tag bf af | _ | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬pb xx} ) ForceDelayT (force t) ast' +... | yes refl | yes refl | proof pb | ce ¬px tag bf af | _ | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬px xx₁ } ) ForceDelayT (force t) ast' +... | yes refl | yes refl | proof pb | proof px | ce ¬py tag bf af | _ | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)); (ifThenElse x x₁ xx xx₁ xx₂) → ¬py xx₂} ) ForceDelayT (force t) ast' +... | yes refl | yes refl | proof pb | proof px | proof py | no ¬purex | _ = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purex x} ) ForceDelayT (force t) ast' +... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | no ¬purey = ce (λ { (force (app (app (app (force ()) x₂) x₁) x)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬purey x₁} ) ForceDelayT (force t) ast' ... | yes refl | yes refl | proof pb | proof px | proof py | yes purex | yes purey = proof (ifThenElse purex purey pb px py) isFD? z ast ast' | yes (isforce (isterm t)) | no ¬itepattern with isFD? (force z) t ast' ... | proof p = proof (force p) @@ -330,7 +330,7 @@ isFD? (force (z · x)) .(_ · _) .(_ · _) | no ¬force | yes (isapp (isterm _) isFD? z ast ast' | no ¬force | yes papp | ce ¬pp tag bf af | _ = ce (λ { (app x x₁) → ¬pp x ; (lastIfThenElse x x₁ x₂ x₃ x₄) → {!!}} ) tag bf af isFD? □ ast ast' | no ¬force | no ¬app = ce (λ { (force x) → ¬force (isforce (isterm _)) ; (app x x₁) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _)) ; (ifThenElse x x₁ x₂ x₃ x₄) → ¬force (isforce - (isterm (((force (builtin ifThenElse) · _) · delay _) · delay _)))} ) forceDelayTag ast ast' + (isterm (((force (builtin ifThenElse) · _) · delay _) · delay _)))} ) ForceDelayT ast ast' isFD? (force z) ast ast' | no ¬force | no ¬app with isDelay? isTerm? ast ... | no ¬delay = ce (λ { (force x) → ¬force (isforce (isterm _)) ; (delay x) → ¬delay (isdelay (isterm _)) ; (app x x₁) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _)) ; (last-delay x) → ¬delay (isdelay (isterm _)) ; (ifThenElse x x₁ x₂ x₃ x₄) → ¬force (isforce @@ -339,7 +339,7 @@ isFD? (force z) ast ast' | no ¬force | no ¬app with isDelay? isTerm? ast (isterm (delay _)) , isapp (isterm ((force (builtin ifThenElse) · _) · _)) - (isterm _))} ) forceDelayTag ast ast' + (isterm _))} ) ForceDelayT ast ast' ... | yes (isdelay (isterm t)) with isFD? z t ast' ... | proof p = proof (delay p) isFD? (force □) ast ast' | no ¬force | no ¬app | yes (isdelay (isterm t)) | ce ¬p tag bf af with isForceDelay? t ast' @@ -350,9 +350,9 @@ isFD? (force (z · v)) ast ast' | no ¬force | no ¬app | yes (isdelay (isterm t isFD? (z · v) ast ast' | no ¬force | no ¬app with isLambda? isTerm? ast ... | no ¬lambda = ce (λ { (force xx) → ¬force (isforce (isterm _)) ; (app xx x) → ¬app (isapp (isterm _) (isterm _) , isapp (isterm _) (isterm _)) ; (abs xx) → ¬lambda (islambda (isterm _)) ; (last-abs x) → ¬lambda (islambda (isterm _)) ; (ifThenElse x x₁ xx xx₁ xx₂) → ¬force (isforce - (isterm (((force (builtin ifThenElse) · _) · delay _) · delay _)))} ) forceDelayTag ast ast' + (isterm (((force (builtin ifThenElse) · _) · delay _) · delay _)))} ) ForceDelayT ast ast' ... | yes (islambda (isterm t)) with isLambda? isTerm? ast' -... | no ¬lamda' = ce (λ { (abs x) → ¬lamda' (islambda (isterm _)) ; (last-abs x) → ¬lamda' (islambda (isterm _))} ) forceDelayTag ast ast' +... | no ¬lamda' = ce (λ { (abs x) → ¬lamda' (islambda (isterm _)) ; (last-abs x) → ¬lamda' (islambda (isterm _))} ) ForceDelayT ast ast' isFD? (z · v) ast ast' | no ¬force | no ¬app | yes (islambda (isterm t)) | yes (islambda (isterm t')) with isFD? (zipwk z) t t' ... | proof p = proof (abs p) isFD? (□ · v) ast ast' | no ¬force | no ¬app | yes (islambda (isterm t)) | yes (islambda (isterm t')) | ce ¬p tag bf af with isForceDelay? t t' @@ -363,7 +363,7 @@ isFD? ((z · v₁) · v) ast ast' | no ¬force | no ¬app | yes (islambda (ister -} -isForceDelay? = translation? forceDelayTag (isFD? □) +isForceDelay? = translation? ForceDelayT (isFD? □) ``` diff --git a/plutus-metatheory/src/VerifiedCompilation/UInline.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UInline.lagda.md index 70992f400bd..b44a413f412 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UInline.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UInline.lagda.md @@ -36,7 +36,7 @@ open import Untyped.RenamingSubstitution using (weaken) open import Data.Empty using (⊥) import Relation.Binary.PropositionalEquality as Eq open Eq using (_≡_; refl) -open import VerifiedCompilation.Certificate using (Proof?; _>>=_; InlineHints; var; expand; ƛ; _·_; _·↓; force; delay; con; builtin; error; constr; case; abort; proof; inlineTag) +open import VerifiedCompilation.Certificate using (Proof?; _>>=_; InlineHints; var; expand; ƛ; _·_; _·↓; force; delay; con; builtin; error; constr; case; abort; proof; InlineT) ``` # Zippers, and relating two zippers @@ -233,9 +233,9 @@ check {z = z} {z′ = z′} σ M@(` x) zz var M′@(` x′) ... | yes refl | yes refl with zz ≟ᶻᶻ idᶻᶻ z ... | just refl = proof (` x) -... | nothing = abort inlineTag M M′ +... | nothing = abort InlineT M M′ check σ M@(` x) zz var M′@(` x′) - | _ | _ = abort inlineTag M M′ + | _ | _ = abort InlineT M M′ check σ (` x) zz (expand h) M′ = do r ← check σ (σ x) zz h M′ @@ -273,18 +273,18 @@ check σ (delay M) zz (delay h) (delay M′) = check σ M@(con c) zz con M′@(con c′) with c ≟ c′ ... | yes refl = proof con -... | no _ = abort inlineTag M M′ +... | no _ = abort InlineT M M′ check σ M@(builtin b) zz builtin M′@(builtin b′) with b ≟ b′ ... | yes refl = proof builtin -... | no _ = abort inlineTag M M′ +... | no _ = abort InlineT M M′ check σ M@(constr i Ms) zz (constr hs) M′@(constr i′ M′s) with i ≟ i′ ... | yes refl = do rs ← checkPointwise hs σ □ Ms M′s proof (constr rs) -... | no _ = abort inlineTag M M′ +... | no _ = abort InlineT M M′ check σ (case M Ms) zz (case h hs) (case M′ M′s) = do r ← check σ M □ h M′ @@ -293,14 +293,14 @@ check σ (case M Ms) zz (case h hs) (case M′ M′s) = check σ error zz error error = proof error -check σ M zz h M′ = abort inlineTag M M′ +check σ M zz h M′ = abort InlineT M M′ checkPointwise [] σ zz [] [] = proof Pointwise.[] checkPointwise (h ∷ hs) σ zz (M ∷ Ms) (M′ ∷ M′s) = do p ← check σ M zz h M′ ps ← checkPointwise hs σ zz Ms M′s proof (p Pointwise.∷ ps) -checkPointwise _ _ _ Ms M′s = abort inlineTag Ms M′s +checkPointwise _ _ _ Ms M′s = abort InlineT Ms M′s ``` # Top-level check diff --git a/plutus-metatheory/src/VerifiedCompilation/UntypedTranslation.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UntypedTranslation.lagda.md index a051b8b3d86..398fcd9b742 100644 --- a/plutus-metatheory/src/VerifiedCompilation/UntypedTranslation.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/UntypedTranslation.lagda.md @@ -26,7 +26,7 @@ open import Builtin using (Builtin) import Relation.Binary.PropositionalEquality as Eq open Eq using (_≡_; refl) open import Untyped.Equality using (DecEq; _≟_; decPointwise) -open import VerifiedCompilation.Certificate using (ProofOrCE; proof; ce; decToPCE; DecidableCE; SimplifierTag) +open import VerifiedCompilation.Certificate using (ProofOrCE; proof; ce; decToPCE; DecidableCE; OptTag) open import Data.Sum using (_⊎_;inj₁; inj₂) ``` @@ -106,13 +106,13 @@ matchIx error = refl translation? : {X' : ℕ} {R : Relation} - → SimplifierTag + → OptTag → ({ X : ℕ } → DecidableCE (R {X})) → (p q : X' ⊢) → ProofOrCE (Translation R {X'} p q) decPointwiseTranslation? : {X' : ℕ} {R : Relation} - → SimplifierTag + → OptTag → ({ X : ℕ } → DecidableCE (R {X})) → (p q : List (X' ⊢)) → ProofOrCE (Pointwise (Translation R {X'}) p q) decPointwiseTranslation? _ _ [] [] = proof Pointwise.[] diff --git a/plutus-metatheory/test/certifier-report/Test/Certifier/Report.hs b/plutus-metatheory/test/certifier-report/Test/Certifier/Report.hs index 41b3a3f9c09..e0f1ade203e 100644 --- a/plutus-metatheory/test/certifier-report/Test/Certifier/Report.hs +++ b/plutus-metatheory/test/certifier-report/Test/Certifier/Report.hs @@ -7,7 +7,7 @@ import Paths_plutus_metatheory (getDataDir) import PlutusCore qualified as PLC import PlutusCore.Default.Builtins import PlutusCore.Evaluation.Machine.ExBudget -import PlutusCore.Executable.Eval (evalCounting, evalSimplifierTrace, mkDefaultEvalCtx) +import PlutusCore.Executable.Eval (evalCounting, evalOptimizerTrace, mkDefaultEvalCtx) import PlutusCore.Quote import PlutusLedgerApi.Common import PlutusPrelude (def, unsafeFromRight) @@ -30,7 +30,7 @@ import System.IO.Extra import Test.Tasty import Test.Tasty.Golden -loadFrom :: FilePath -> IO (SimplifierTrace Name DefaultUni DefaultFun ()) +loadFrom :: FilePath -> IO (OptimizerTrace Name DefaultUni DefaultFun ()) loadFrom name = do root <- getDataDir prog <- @@ -55,7 +55,7 @@ simplify :: Term Name DefaultUni DefaultFun () -> Quote ( Term Name DefaultUni DefaultFun () - , SimplifierTrace Name DefaultUni DefaultFun () + , OptimizerTrace Name DefaultUni DefaultFun () ) simplify = runSimplifierT @@ -70,7 +70,7 @@ evalCtx = mkDefaultEvalCtx def {-# OPAQUE evalCtx #-} evalTrace - :: SimplifierTrace Name DefaultUni DefaultFun () + :: OptimizerTrace Name DefaultUni DefaultFun () -> [Term NamedDeBruijn DefaultUni DefaultFun ()] -> [ ( Maybe (CekEvaluationException UPLC.NamedDeBruijn UPLC.DefaultUni UPLC.DefaultFun) , ExBudget @@ -102,7 +102,7 @@ testNQueens :: IO TestTree testNQueens = withTempFile $ \actual -> pure $ goldenVsFile name golden actual $ do trace <- loadFrom $ name <.> "uplc" let costs = - evalSimplifierTrace + evalOptimizerTrace evalCtx trace [ snd $ lift PLC.latestVersion (5 :: Integer) diff --git a/plutus-metatheory/test/certifier/Test/Certifier/AST.hs b/plutus-metatheory/test/certifier/Test/Certifier/AST.hs index ad384d1ed33..2762f00b763 100644 --- a/plutus-metatheory/test/certifier/Test/Certifier/AST.hs +++ b/plutus-metatheory/test/certifier/Test/Certifier/AST.hs @@ -5,7 +5,7 @@ import PlutusCore.MkPlc (mkConstant) import UntypedPlutusCore import UntypedPlutusCore.Transform.Certify.Hints qualified as Hints -import FFI.SimplifierTrace (mkFfiSimplifierTrace) +import FFI.OptimizerTrace (mkFfiOptimizerTrace) import MAlonzo.Code.Certifier (runCertifierMain) import Data.Text.Encoding qualified as Text @@ -13,14 +13,14 @@ import Test.Tasty import Test.Tasty.HUnit mkMockTracePair - :: SimplifierStage + :: OptStage -> Term Name DefaultUni DefaultFun () -> Term Name DefaultUni DefaultFun () - -> SimplifierTrace Name DefaultUni DefaultFun () + -> OptimizerTrace Name DefaultUni DefaultFun () mkMockTracePair stage before' after' = - SimplifierTrace - { simplifierTrace = - [ Simplification + OptimizerTrace + { optimizerTrace = + [ Optimization { beforeAST = before' , stage = stage , hints = Hints.NoHints @@ -30,10 +30,10 @@ mkMockTracePair stage before' after' = } runCertifierWithMockTrace - :: SimplifierTrace Name DefaultUni DefaultFun () + :: OptimizerTrace Name DefaultUni DefaultFun () -> IO Bool runCertifierWithMockTrace trace = do - let rawAgdaTrace = mkFfiSimplifierTrace trace + let rawAgdaTrace = mkFfiOptimizerTrace trace case runCertifierMain rawAgdaTrace [] of Just (result, _report) -> pure result Nothing -> @@ -41,7 +41,7 @@ runCertifierWithMockTrace trace = do testSuccess :: String - -> SimplifierStage + -> OptStage -> Term Name PLC.DefaultUni PLC.DefaultFun () -> Term Name PLC.DefaultUni PLC.DefaultFun () -> TestTree @@ -55,7 +55,7 @@ testSuccess testName st bf af = testFailure :: String - -> SimplifierStage + -> OptStage -> Term Name PLC.DefaultUni PLC.DefaultFun () -> Term Name PLC.DefaultUni PLC.DefaultFun () -> TestTree @@ -70,7 +70,7 @@ testFailure testName st bf af = -- Helper functions for making lists of tests. testSuccessItem :: ( String - , SimplifierStage + , OptStage , Term Name PLC.DefaultUni PLC.DefaultFun () , Term Name PLC.DefaultUni PLC.DefaultFun () ) @@ -79,7 +79,7 @@ testSuccessItem (name, stage, before, after) = testSuccess name stage before aft testFailureItem :: ( String - , SimplifierStage + , OptStage , Term Name PLC.DefaultUni PLC.DefaultFun () , Term Name PLC.DefaultUni PLC.DefaultFun () ) diff --git a/plutus-metatheory/test/certifier/Test/Certifier/AST/ForceDelay.hs b/plutus-metatheory/test/certifier/Test/Certifier/AST/ForceDelay.hs index 55e5805fa2e..743397babf2 100644 --- a/plutus-metatheory/test/certifier/Test/Certifier/AST/ForceDelay.hs +++ b/plutus-metatheory/test/certifier/Test/Certifier/AST/ForceDelay.hs @@ -298,7 +298,7 @@ lastAbsBreakAfter = runQuote $ do successItems :: [ ( String - , SimplifierStage + , OptStage , Term Name PLC.DefaultUni PLC.DefaultFun () , Term Name PLC.DefaultUni PLC.DefaultFun () ) @@ -325,7 +325,7 @@ successItems = ] failItems :: [ ( String - , SimplifierStage + , OptStage , Term Name PLC.DefaultUni PLC.DefaultFun () , Term Name PLC.DefaultUni PLC.DefaultFun () ) diff --git a/plutus-metatheory/test/certifier/Test/Certifier/Optimizer.hs b/plutus-metatheory/test/certifier/Test/Certifier/Optimizer.hs index 5c511693f9d..7de4d60f24f 100644 --- a/plutus-metatheory/test/certifier/Test/Certifier/Optimizer.hs +++ b/plutus-metatheory/test/certifier/Test/Certifier/Optimizer.hs @@ -1,6 +1,6 @@ module Test.Certifier.Optimizer where -import FFI.SimplifierTrace (mkFfiSimplifierTrace) +import FFI.OptimizerTrace (mkFfiOptimizerTrace) import MAlonzo.Code.Certifier (runCertifierMain) import PlutusCore qualified as PLC import Test.Tasty (TestTree, testGroup) @@ -12,7 +12,7 @@ import UntypedPlutusCore , DefaultFun , DefaultUni , Name - , SimplifierTrace + , OptimizerTrace , Term ) @@ -20,7 +20,7 @@ type SimplifierFunc = Term Name PLC.DefaultUni PLC.DefaultFun () -> PLC.Quote ( Term Name PLC.DefaultUni PLC.DefaultFun () - , SimplifierTrace Name PLC.DefaultUni PLC.DefaultFun () + , OptimizerTrace Name PLC.DefaultUni PLC.DefaultFun () ) mkUPLCTest @@ -31,8 +31,8 @@ mkUPLCTest mkUPLCTest simplifierFunc name input = testCase name $ let rawAgdaTrace = PLC.runQuote $ do - simplifierTrace <- snd <$> simplifierFunc input - return $ mkFfiSimplifierTrace simplifierTrace + optimizerTrace <- snd <$> simplifierFunc input + return $ mkFfiOptimizerTrace optimizerTrace in case runCertifierMain rawAgdaTrace [] of Just (result, _report) -> assertBool "The certifier returned false." result From 58418278cc4349e3c51d23731c3fbfa7dae2593c Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Thu, 16 Apr 2026 17:55:00 +0300 Subject: [PATCH 12/16] Refactor Simplify -> Optimize + fix tests --- .../certifier/src/Certifier/Common.hs | 8 +- plutus-core/plutus-core.cabal | 6 +- .../plutus-core/src/PlutusCore/Compiler.hs | 12 +-- .../src/PlutusCore/Compiler/Opts.hs | 8 +- .../src/UntypedPlutusCore.hs | 2 +- .../{Simplify.hs => Optimize.hs} | 80 ++++++++--------- .../src/UntypedPlutusCore/Optimize/Opts.hs | 63 +++++++++++++ .../src/UntypedPlutusCore/Simplify/Opts.hs | 63 ------------- .../Transform/ApplyToCase.hs | 10 +-- .../UntypedPlutusCore/Transform/CaseOfCase.hs | 10 +-- .../UntypedPlutusCore/Transform/CaseReduce.hs | 10 +-- .../src/UntypedPlutusCore/Transform/Cse.hs | 12 +-- .../UntypedPlutusCore/Transform/FloatDelay.hs | 10 +-- .../Transform/ForceCaseDelay.hs | 10 +-- .../UntypedPlutusCore/Transform/ForceDelay.hs | 10 +-- .../src/UntypedPlutusCore/Transform/Inline.hs | 10 +-- .../Transform/LetFloatOut.hs | 10 +-- .../UntypedPlutusCore/Transform/Optimizer.hs | 88 +++++++++++++++++++ .../UntypedPlutusCore/Transform/Simplifier.hs | 88 ------------------- .../Transform/basic.golden.certifier-hints | 16 ++-- .../basicInline.golden.certifier-hints | 16 ++-- .../callsiteInline.golden.certifier-hints | 16 ++-- .../extraDelays.golden.certifier-hints | 16 ++-- .../floatDelay1.golden.certifier-hints | 16 ++-- .../floatDelay2.golden.certifier-hints | 16 ++-- .../floatDelay3.golden.certifier-hints | 16 ++-- ...rceCaseDelayNoApps1.golden.certifier-hints | 16 ++-- ...rceCaseDelayNoApps2.golden.certifier-hints | 16 ++-- ...aseDelayNoApps2Fail.golden.certifier-hints | 16 ++-- ...eCaseDelayWithApps1.golden.certifier-hints | 16 ++-- ...eCaseDelayWithApps2.golden.certifier-hints | 16 ++-- ...eDelayWithApps2Fail.golden.certifier-hints | 16 ++-- .../forceDelayComplex.golden.certifier-hints | 16 ++-- ...orceDelayMultiApply.golden.certifier-hints | 16 ++-- ...orceDelayMultiForce.golden.certifier-hints | 16 ++-- .../forceDelayNoApps.golden.certifier-hints | 16 ++-- ...eDelayNoAppsLayered.golden.certifier-hints | 16 ++-- .../forceDelaySimple.golden.certifier-hints | 16 ++-- .../inlineImpure1.golden.certifier-hints | 16 ++-- .../inlineImpure2.golden.certifier-hints | 16 ++-- .../inlineImpure3.golden.certifier-hints | 16 ++-- .../inlineImpure4.golden.certifier-hints | 16 ++-- .../inlinePure1.golden.certifier-hints | 16 ++-- .../inlinePure2.golden.certifier-hints | 16 ++-- .../inlinePure3.golden.certifier-hints | 16 ++-- .../inlinePure4.golden.certifier-hints | 16 ++-- .../interveningLambda.golden.certifier-hints | 16 ++-- .../letFloatOutCase1.golden.certifier-hints | 16 ++-- .../letFloatOutCase2.golden.certifier-hints | 16 ++-- .../letFloatOutForce.golden.certifier-hints | 16 ++-- .../Transform/multiApp.golden.certifier-hints | 16 ++-- .../Transform/nested.golden.certifier-hints | 16 ++-- .../testlib/Scoping/Spec.hs | 14 +-- .../testlib/Transform/CaseOfCase/Spec.hs | 4 +- .../testlib/Transform/Simplify/Lib.hs | 56 ++++++------ .../testlib/Transform/Simplify/Spec.hs | 4 +- plutus-executables/executables/pir/Main.hs | 4 +- plutus-executables/executables/uplc/Main.hs | 8 +- .../plutus/AnyProgram/Compile.hs | 8 +- .../certifier/Test/Certifier/Executable.hs | 6 +- .../src/PlutusCore/Executable/Parsers.hs | 34 +++---- .../src/PlutusCore/Executable/Types.hs | 2 +- plutus-metatheory/src/Certifier.hs | 2 +- plutus-metatheory/src/FFI/OptimizerTrace.hs | 2 +- .../certifier-report/Test/Certifier/Report.hs | 8 +- .../certifier/Test/Certifier/Optimizer.hs | 4 +- plutus-tx-plugin/src/PlutusTx/Options.hs | 8 +- .../src/PlutusTx/Plugin/Common.hs | 18 ++-- plutus-tx/src/PlutusTx/Lift.hs | 8 +- 69 files changed, 614 insertions(+), 614 deletions(-) rename plutus-core/untyped-plutus-core/src/UntypedPlutusCore/{Simplify.hs => Optimize.hs} (69%) create mode 100644 plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize/Opts.hs delete mode 100644 plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify/Opts.hs create mode 100644 plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Optimizer.hs delete mode 100644 plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs diff --git a/plutus-benchmark/certifier/src/Certifier/Common.hs b/plutus-benchmark/certifier/src/Certifier/Common.hs index aea21659b84..8cda043ca84 100644 --- a/plutus-benchmark/certifier/src/Certifier/Common.hs +++ b/plutus-benchmark/certifier/src/Certifier/Common.hs @@ -41,10 +41,10 @@ simplify , OptimizerTrace Name DefaultUni DefaultFun () ) simplify = - runSimplifierT - . termSimplifier - ( defaultSimplifyOpts - & soPreserveLogging .~ False + runOptimizerT + . termOptimizer + ( defaultOptimizeOpts + & ooPreserveLogging .~ False ) DefaultFunSemanticsVariantE diff --git a/plutus-core/plutus-core.cabal b/plutus-core/plutus-core.cabal index 8a9f31b4951..e357ae02027 100644 --- a/plutus-core/plutus-core.cabal +++ b/plutus-core/plutus-core.cabal @@ -235,7 +235,7 @@ library UntypedPlutusCore.Transform.ForceDelay UntypedPlutusCore.Transform.Inline UntypedPlutusCore.Transform.LetFloatOut - UntypedPlutusCore.Transform.Simplifier + UntypedPlutusCore.Transform.Optimizer other-modules: Data.Aeson.Flatten @@ -289,8 +289,8 @@ library UntypedPlutusCore.Evaluation.Machine.Cek.EmitterMode UntypedPlutusCore.Evaluation.Machine.Cek.ExBudgetMode UntypedPlutusCore.Evaluation.Machine.CommonAPI - UntypedPlutusCore.Simplify - UntypedPlutusCore.Simplify.Opts + UntypedPlutusCore.Optimize + UntypedPlutusCore.Optimize.Opts UntypedPlutusCore.Subst reexported-modules: Data.SatInt diff --git a/plutus-core/plutus-core/src/PlutusCore/Compiler.hs b/plutus-core/plutus-core/src/PlutusCore/Compiler.hs index 307225a71ed..cc07a347c7c 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Compiler.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Compiler.hs @@ -12,7 +12,7 @@ import PlutusCore.Core import PlutusCore.Name.Unique import PlutusCore.Rename import UntypedPlutusCore.Core.Type qualified as UPLC -import UntypedPlutusCore.Simplify qualified as UPLC +import UntypedPlutusCore.Optimize qualified as UPLC import Control.Lens (view) import Control.Monad.Reader (MonadReader) @@ -25,11 +25,11 @@ compileTerm => Term tyname name uni fun a -> m (UPLC.Term name uni fun a) compileTerm t = do - simplOpts <- view coSimplifyOpts + optimizeOpts <- view coOptimizeOpts builtinSemanticsVariant <- view coBuiltinSemanticsVariant let erased = eraseTerm t renamed <- rename erased - UPLC.simplifyTerm simplOpts builtinSemanticsVariant renamed + UPLC.optimizeTerm optimizeOpts builtinSemanticsVariant renamed -- | Compile a PLC program to UPLC, and optimize it. compileProgram @@ -49,11 +49,11 @@ compileProgramWithTrace => Program tyname name uni fun a -> m (UPLC.Program name uni fun a, UPLC.OptimizerTrace name uni fun a) compileProgramWithTrace (Program a v t) = do - simplOpts <- view coSimplifyOpts + optimizeOpts <- view coOptimizeOpts builtinSemanticsVariant <- view coBuiltinSemanticsVariant let erased = eraseTerm t renamedProgram <- UPLC.Program a v <$> rename erased - UPLC.simplifyProgramWithTrace - simplOpts + UPLC.optimizeProgramWithTrace + optimizeOpts builtinSemanticsVariant renamedProgram diff --git a/plutus-core/plutus-core/src/PlutusCore/Compiler/Opts.hs b/plutus-core/plutus-core/src/PlutusCore/Compiler/Opts.hs index 79e647a3ba8..99e1dc845bc 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Compiler/Opts.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Compiler/Opts.hs @@ -2,7 +2,7 @@ module PlutusCore.Compiler.Opts ( CompilationOpts (..) - , coSimplifyOpts + , coOptimizeOpts , coBuiltinSemanticsVariant , defaultCompilationOpts ) where @@ -10,10 +10,10 @@ module PlutusCore.Compiler.Opts import Control.Lens (makeLenses) import Data.Default.Class (Default (def)) import PlutusCore.Builtin.Meaning (BuiltinSemanticsVariant) -import UntypedPlutusCore.Simplify.Opts (SimplifyOpts, defaultSimplifyOpts) +import UntypedPlutusCore.Optimize.Opts (OptimizeOpts, defaultOptimizeOpts) data CompilationOpts name fun a = CompilationOpts - { _coSimplifyOpts :: SimplifyOpts name a + { _coOptimizeOpts :: OptimizeOpts name a , _coBuiltinSemanticsVariant :: BuiltinSemanticsVariant fun } @@ -22,6 +22,6 @@ $(makeLenses ''CompilationOpts) defaultCompilationOpts :: Default (BuiltinSemanticsVariant fun) => CompilationOpts name fun a defaultCompilationOpts = CompilationOpts - { _coSimplifyOpts = defaultSimplifyOpts + { _coOptimizeOpts = defaultOptimizeOpts , _coBuiltinSemanticsVariant = def } diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore.hs index cb6c7b785cd..4bfd66cbd72 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore.hs @@ -13,8 +13,8 @@ import UntypedPlutusCore.AstSize as Export import UntypedPlutusCore.Check.Scope as Export import UntypedPlutusCore.Core as Export import UntypedPlutusCore.DeBruijn as Export +import UntypedPlutusCore.Optimize as Export import UntypedPlutusCore.Parser as Parser (parseScoped) -import UntypedPlutusCore.Simplify as Export import UntypedPlutusCore.Subst as Export import PlutusCore.Default qualified as PLC diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs similarity index 69% rename from plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify.hs rename to plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs index 7d7790801b1..5ce3c3f782e 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs @@ -2,15 +2,15 @@ {-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeApplications #-} -module UntypedPlutusCore.Simplify +module UntypedPlutusCore.Optimize ( module Opts - , simplifyTerm - , simplifyProgram - , simplifyProgramWithTrace + , optimizeTerm + , optimizeProgram + , optimizeProgramWithTrace , InlineHints (..) , CseWhichSubterms (..) - , termSimplifier - , module UntypedPlutusCore.Transform.Simplifier + , termOptimizer + , module UntypedPlutusCore.Transform.Optimizer ) where import PlutusCore.Compiler.Types @@ -18,7 +18,7 @@ import PlutusCore.Default qualified as PLC import PlutusCore.Default.Builtins import PlutusCore.Name.Unique import UntypedPlutusCore.Core.Type -import UntypedPlutusCore.Simplify.Opts as Opts +import UntypedPlutusCore.Optimize.Opts as Opts import UntypedPlutusCore.Transform.ApplyToCase (applyToCase) import UntypedPlutusCore.Transform.CaseOfCase import UntypedPlutusCore.Transform.CaseReduce @@ -28,55 +28,55 @@ import UntypedPlutusCore.Transform.ForceCaseDelay (forceCaseDelay) import UntypedPlutusCore.Transform.ForceDelay (forceDelay) import UntypedPlutusCore.Transform.Inline (InlineHints (..), inline) import UntypedPlutusCore.Transform.LetFloatOut (letFloatOut) -import UntypedPlutusCore.Transform.Simplifier +import UntypedPlutusCore.Transform.Optimizer import Control.Monad import Data.List as List (foldl') import Data.Typeable import Data.Vector.Orphans () -simplifyProgram +optimizeProgram :: forall name uni fun m a . Compiling m uni fun name a - => SimplifyOpts name a + => OptimizeOpts name a -> BuiltinSemanticsVariant fun -> Program name uni fun a -> m (Program name uni fun a) -simplifyProgram opts builtinSemanticsVariant (Program a v t) = - Program a v <$> simplifyTerm opts builtinSemanticsVariant t +optimizeProgram opts builtinSemanticsVariant (Program a v t) = + Program a v <$> optimizeTerm opts builtinSemanticsVariant t -simplifyProgramWithTrace +optimizeProgramWithTrace :: forall name uni fun m a . Compiling m uni fun name a - => SimplifyOpts name a + => OptimizeOpts name a -> BuiltinSemanticsVariant fun -> Program name uni fun a -> m (Program name uni fun a, OptimizerTrace name uni fun a) -simplifyProgramWithTrace opts builtinSemanticsVariant (Program a v t) = do +optimizeProgramWithTrace opts builtinSemanticsVariant (Program a v t) = do (result, trace) <- - runSimplifierT $ - termSimplifier opts builtinSemanticsVariant t + runOptimizerT $ + termOptimizer opts builtinSemanticsVariant t pure (Program a v result, trace) -simplifyTerm +optimizeTerm :: forall name uni fun m a . Compiling m uni fun name a - => SimplifyOpts name a + => OptimizeOpts name a -> BuiltinSemanticsVariant fun -> Term name uni fun a -> m (Term name uni fun a) -simplifyTerm opts builtinSemanticsVariant term = - evalSimplifierT $ termSimplifier opts builtinSemanticsVariant term +optimizeTerm opts builtinSemanticsVariant term = + evalOptimizerT $ termOptimizer opts builtinSemanticsVariant term -termSimplifier +termOptimizer :: forall name uni fun m a . Compiling m uni fun name a - => SimplifyOpts name a + => OptimizeOpts name a -> BuiltinSemanticsVariant fun -> Term name uni fun a - -> SimplifierT name uni fun a m (Term name uni fun a) -termSimplifier opts builtinSemanticsVariant = - simplifyNTimes (_soMaxSimplifierIterations opts) + -> OptimizerT name uni fun a m (Term name uni fun a) +termOptimizer opts builtinSemanticsVariant = + simplifyNTimes (_ooMaxSimplifierIterations opts) >=> runStage CseStage >=> runStage ApplyToCaseStage where @@ -84,7 +84,7 @@ termSimplifier opts builtinSemanticsVariant = simplifyNTimes :: Int -> Term name uni fun a - -> SimplifierT name uni fun a m (Term name uni fun a) + -> OptimizerT name uni fun a m (Term name uni fun a) simplifyNTimes n = List.foldl' (>=>) pure $ map simplifyStep [1 .. n] -- Run CSE @n@ times, interleaved with the simplifier. @@ -92,14 +92,14 @@ termSimplifier opts builtinSemanticsVariant = cseNTimes :: Int -> Term name uni fun a - -> SimplifierT name uni fun a m (Term name uni fun a) + -> OptimizerT name uni fun a m (Term name uni fun a) cseNTimes n = foldl' (>=>) pure $ concatMap (\i -> [cseStep i, simplifyStep i]) [1 .. n] -- generate simplification step simplifyStep :: Int -> Term name uni fun a - -> SimplifierT name uni fun a m (Term name uni fun a) + -> OptimizerT name uni fun a m (Term name uni fun a) simplifyStep _ = runStage FloatDelayStage >=> runStage ForceCaseDelayStage @@ -112,10 +112,10 @@ termSimplifier opts builtinSemanticsVariant = runStage stage' = let isIC = either (const False) (const True) stage' withSafeOpts action - | _soSafeOpts opts + | _ooSafeOpts opts , isIC = action - | _soSafeOpts opts + | _ooSafeOpts opts , not isIC = return | otherwise = action @@ -136,22 +136,22 @@ termSimplifier opts builtinSemanticsVariant = InlineStage -> withSafeOpts $ inline - (_soInlineCallsiteGrowth opts) - (_soInlineConstants opts) - (_soPreserveLogging opts) - (_soInlineHints opts) + (_ooInlineCallsiteGrowth opts) + (_ooInlineConstants opts) + (_ooPreserveLogging opts) + (_ooInlineHints opts) builtinSemanticsVariant CseStage -> withSafeOpts $ cseNTimes cseTimes ApplyToCaseStage -> withSafeOpts $ - if _soApplyToCase opts then applyToCase else pure + if _ooApplyToCase opts then applyToCase else pure LetFloatOutStage -> withSafeOpts letFloatOut caseOfCase' :: Term name uni fun a - -> SimplifierT name uni fun a m (Term name uni fun a) + -> OptimizerT name uni fun a m (Term name uni fun a) caseOfCase' = case eqT @fun @DefaultFun of Just Refl -> caseOfCase Nothing -> pure @@ -159,10 +159,10 @@ termSimplifier opts builtinSemanticsVariant = cseStep :: Int -> Term name uni fun a - -> SimplifierT name uni fun a m (Term name uni fun a) + -> OptimizerT name uni fun a m (Term name uni fun a) cseStep _ = case (eqT @name @Name, eqT @uni @PLC.DefaultUni) of - (Just Refl, Just Refl) -> cse (_soCseWhichSubterms opts) builtinSemanticsVariant + (Just Refl, Just Refl) -> cse (_ooCseWhichSubterms opts) builtinSemanticsVariant _ -> pure - cseTimes = if _soConservativeOpts opts then 0 else _soMaxCseIterations opts + cseTimes = if _ooConservativeOpts opts then 0 else _ooMaxCseIterations opts diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize/Opts.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize/Opts.hs new file mode 100644 index 00000000000..4b8a800e087 --- /dev/null +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize/Opts.hs @@ -0,0 +1,63 @@ +{-# LANGUAGE TemplateHaskell #-} + +module UntypedPlutusCore.Optimize.Opts + ( OptimizeOpts (..) + , ooApplyToCase + , ooMaxSimplifierIterations + , ooMaxCseIterations + , ooCseWhichSubterms + , ooInlineHints + , ooConservativeOpts + , ooInlineConstants + , ooInlineCallsiteGrowth + , ooPreserveLogging + , ooSafeOpts + , defaultOptimizeOpts + , CseWhichSubterms (..) + ) where + +import Control.Lens.TH (makeLenses) +import Data.Default.Class + +import PlutusCore.Annotation (InlineHints (..)) +import PlutusCore.AstSize +import PlutusCore.Pretty +import Prettyprinter (viaShow) + +-- | Which subterms should be considered as candidates for CSE? +data CseWhichSubterms = AllSubterms | ExcludeWorkFree + deriving stock (Show, Read) + +instance Pretty CseWhichSubterms where + pretty = viaShow + +data OptimizeOpts name a = OptimizeOpts + { _ooMaxSimplifierIterations :: Int + , _ooMaxCseIterations :: Int + , _ooCseWhichSubterms :: CseWhichSubterms + , _ooConservativeOpts :: Bool + , _ooInlineHints :: InlineHints name a + , _ooInlineConstants :: Bool + , _ooInlineCallsiteGrowth :: AstSize + , _ooPreserveLogging :: Bool + , _ooApplyToCase :: Bool + , _ooSafeOpts :: Bool + } + deriving stock (Show) + +$(makeLenses ''OptimizeOpts) + +defaultOptimizeOpts :: OptimizeOpts name a +defaultOptimizeOpts = + OptimizeOpts + { _ooMaxSimplifierIterations = 12 + , _ooMaxCseIterations = 4 + , _ooCseWhichSubterms = ExcludeWorkFree + , _ooConservativeOpts = False + , _ooInlineHints = def + , _ooInlineConstants = True + , _ooInlineCallsiteGrowth = 5 + , _ooPreserveLogging = True + , _ooApplyToCase = True + , _ooSafeOpts = False + } diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify/Opts.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify/Opts.hs deleted file mode 100644 index 503016c0002..00000000000 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Simplify/Opts.hs +++ /dev/null @@ -1,63 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} - -module UntypedPlutusCore.Simplify.Opts - ( SimplifyOpts (..) - , soApplyToCase - , soMaxSimplifierIterations - , soMaxCseIterations - , soCseWhichSubterms - , soInlineHints - , soConservativeOpts - , soInlineConstants - , soInlineCallsiteGrowth - , soPreserveLogging - , soSafeOpts - , defaultSimplifyOpts - , CseWhichSubterms (..) - ) where - -import Control.Lens.TH (makeLenses) -import Data.Default.Class - -import PlutusCore.Annotation (InlineHints (..)) -import PlutusCore.AstSize -import PlutusCore.Pretty -import Prettyprinter (viaShow) - --- | Which subterms should be considered as candidates for CSE? -data CseWhichSubterms = AllSubterms | ExcludeWorkFree - deriving stock (Show, Read) - -instance Pretty CseWhichSubterms where - pretty = viaShow - -data SimplifyOpts name a = SimplifyOpts - { _soMaxSimplifierIterations :: Int - , _soMaxCseIterations :: Int - , _soCseWhichSubterms :: CseWhichSubterms - , _soConservativeOpts :: Bool - , _soInlineHints :: InlineHints name a - , _soInlineConstants :: Bool - , _soInlineCallsiteGrowth :: AstSize - , _soPreserveLogging :: Bool - , _soApplyToCase :: Bool - , _soSafeOpts :: Bool - } - deriving stock (Show) - -$(makeLenses ''SimplifyOpts) - -defaultSimplifyOpts :: SimplifyOpts name a -defaultSimplifyOpts = - SimplifyOpts - { _soMaxSimplifierIterations = 12 - , _soMaxCseIterations = 4 - , _soCseWhichSubterms = ExcludeWorkFree - , _soConservativeOpts = False - , _soInlineHints = def - , _soInlineConstants = True - , _soInlineCallsiteGrowth = 5 - , _soPreserveLogging = True - , _soApplyToCase = True - , _soSafeOpts = False - } diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ApplyToCase.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ApplyToCase.hs index 0a91a8ce230..3e6f59a340f 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ApplyToCase.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ApplyToCase.hs @@ -18,9 +18,9 @@ module UntypedPlutusCore.Transform.ApplyToCase (applyToCase) where import Control.Lens (over) import Data.Vector qualified as V import UntypedPlutusCore.Core -import UntypedPlutusCore.Transform.Simplifier - ( SimplifierT - , recordSimplification +import UntypedPlutusCore.Transform.Optimizer + ( OptimizerT + , recordOptimization , pattern ApplyToCaseStage ) @@ -31,10 +31,10 @@ minArgs = 3 applyToCase :: Monad m => Term name uni fun a - -> SimplifierT name uni fun a m (Term name uni fun a) + -> OptimizerT name uni fun a m (Term name uni fun a) applyToCase term = do let result = processTerm term - recordSimplification term ApplyToCaseStage result + recordOptimization term ApplyToCaseStage result pure result processTerm :: Term name uni fun a -> Term name uni fun a diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseOfCase.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseOfCase.hs index 71037818fc6..5e591852d23 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseOfCase.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseOfCase.hs @@ -43,9 +43,9 @@ import PlutusCore.Builtin (CaseBuiltin (..)) import PlutusCore.MkPlc (mkIterApp) import UntypedPlutusCore.Core import UntypedPlutusCore.Transform.CaseReduce qualified as CaseReduce -import UntypedPlutusCore.Transform.Simplifier - ( SimplifierT - , recordSimplification +import UntypedPlutusCore.Transform.Optimizer + ( OptimizerT + , recordOptimization , pattern CaseOfCaseStage ) @@ -61,10 +61,10 @@ caseOfCase , uni `PLC.Everywhere` Eq ) => Term name uni fun a - -> SimplifierT name uni fun a m (Term name uni fun a) + -> OptimizerT name uni fun a m (Term name uni fun a) caseOfCase term = do let result = transformOf termSubterms processTerm term - recordSimplification term CaseOfCaseStage result + recordOptimization term CaseOfCaseStage result return result processTerm diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseReduce.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseReduce.hs index 0d247136b74..9a3a53d75d2 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseReduce.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/CaseReduce.hs @@ -13,19 +13,19 @@ import Data.Vector qualified as V import PlutusCore.Builtin (CaseBuiltin (..)) import PlutusCore.MkPlc import UntypedPlutusCore.Core -import UntypedPlutusCore.Transform.Simplifier - ( SimplifierT - , recordSimplification +import UntypedPlutusCore.Transform.Optimizer + ( OptimizerT + , recordOptimization , pattern CaseReduceStage ) caseReduce :: (Monad m, CaseBuiltin uni) => Term name uni fun a - -> SimplifierT name uni fun a m (Term name uni fun a) + -> OptimizerT name uni fun a m (Term name uni fun a) caseReduce term = do let result = transformOf termSubterms processTerm term - recordSimplification term CaseReduceStage result + recordOptimization term CaseReduceStage result return result processTerm :: CaseBuiltin uni => Term name uni fun a -> Term name uni fun a diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Cse.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Cse.hs index a49ff55320a..f61c4355129 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Cse.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Cse.hs @@ -11,11 +11,11 @@ import PlutusCore (MonadQuote, Name, Rename, freshName, rename) import PlutusCore.Builtin (ToBuiltinMeaning (BuiltinSemanticsVariant)) import UntypedPlutusCore.AstSize (termAstSize) import UntypedPlutusCore.Core +import UntypedPlutusCore.Optimize.Opts (CseWhichSubterms (..)) import UntypedPlutusCore.Purity (isWorkFree) -import UntypedPlutusCore.Simplify.Opts (CseWhichSubterms (..)) -import UntypedPlutusCore.Transform.Simplifier - ( SimplifierT - , recordSimplification +import UntypedPlutusCore.Transform.Optimizer + ( OptimizerT + , recordOptimization , pattern CseStage ) @@ -222,7 +222,7 @@ cse => CseWhichSubterms -> BuiltinSemanticsVariant fun -> Term Name uni fun ann - -> SimplifierT Name uni fun ann m (Term Name uni fun ann) + -> OptimizerT Name uni fun ann m (Term Name uni fun ann) cse whichSubterms builtinSemanticsVariant t0 = do t <- rename t0 let annotated = annotate t @@ -237,7 +237,7 @@ cse whichSubterms builtinSemanticsVariant t0 = do . Map.elems $ countOccs whichSubterms builtinSemanticsVariant annotated result <- mkCseTerm commonSubexprs annotated - recordSimplification t0 CseStage result + recordOptimization t0 CseStage result return result -- | The second pass. See Note [CSE]. diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/FloatDelay.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/FloatDelay.hs index 74e912593d9..f2356586fab 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/FloatDelay.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/FloatDelay.hs @@ -61,9 +61,9 @@ import PlutusCore.Name.UniqueMap qualified as UMap import PlutusCore.Name.UniqueSet qualified as USet import UntypedPlutusCore.Core.Plated (termSubterms) import UntypedPlutusCore.Core.Type (Term (..)) -import UntypedPlutusCore.Transform.Simplifier - ( SimplifierT - , recordSimplification +import UntypedPlutusCore.Transform.Optimizer + ( OptimizerT + , recordOptimization , pattern FloatDelayStage ) @@ -76,12 +76,12 @@ floatDelay , PLC.HasUnique name PLC.TermUnique ) => Term name uni fun a - -> SimplifierT name uni fun a m (Term name uni fun a) + -> OptimizerT name uni fun a m (Term name uni fun a) floatDelay term = do result <- PLC.rename term >>= \t -> pure . uncurry (flip simplifyBodies) $ simplifyArgs (unforcedVars t) t - recordSimplification term FloatDelayStage result + recordOptimization term FloatDelayStage result return result {-| First pass. Returns the names of all variables, at least one occurrence diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceCaseDelay.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceCaseDelay.hs index f3b33ce412e..a9db82bff5e 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceCaseDelay.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceCaseDelay.hs @@ -36,9 +36,9 @@ module UntypedPlutusCore.Transform.ForceCaseDelay where import UntypedPlutusCore.Core -import UntypedPlutusCore.Transform.Simplifier - ( SimplifierT - , recordSimplification +import UntypedPlutusCore.Transform.Optimizer + ( OptimizerT + , recordOptimization , pattern ForceCaseDelayStage ) @@ -47,10 +47,10 @@ import Control.Lens forceCaseDelay :: Monad m => Term name uni fun a - -> SimplifierT name uni fun a m (Term name uni fun a) + -> OptimizerT name uni fun a m (Term name uni fun a) forceCaseDelay term = do let result = transformOf termSubterms processTerm term - recordSimplification term ForceCaseDelayStage result + recordOptimization term ForceCaseDelayStage result return result processTerm :: Term name uni fun a -> Term name uni fun a diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceDelay.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceDelay.hs index 1d52783430f..8a18e700c66 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceDelay.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/ForceDelay.hs @@ -155,9 +155,9 @@ import PlutusCore.Default (DefaultFun (IfThenElse), DefaultUni) import PlutusCore.MkPlc (mkIterApp) import UntypedPlutusCore.Core import UntypedPlutusCore.Purity (isPure, isWorkFree) -import UntypedPlutusCore.Transform.Simplifier - ( SimplifierT - , recordSimplification +import UntypedPlutusCore.Transform.Optimizer + ( OptimizerT + , recordOptimization , pattern ForceDelayStage ) @@ -171,10 +171,10 @@ forceDelay :: (uni ~ DefaultUni, fun ~ DefaultFun, Monad m) => BuiltinSemanticsVariant fun -> Term name uni fun a - -> SimplifierT name uni fun a m (Term name uni fun a) + -> OptimizerT name uni fun a m (Term name uni fun a) forceDelay semVar term = do let result = transformOf termSubterms (processTerm semVar) term - recordSimplification term ForceDelayStage result + recordOptimization term ForceDelayStage result return result {-| Checks whether the term is of the right form, and "pushes" diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Inline.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Inline.hs index 18c09dada44..8bbe1b300a9 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Inline.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Inline.hs @@ -70,9 +70,9 @@ import UntypedPlutusCore.Purity import UntypedPlutusCore.Rename () import UntypedPlutusCore.Subst (termSubstNamesM) import UntypedPlutusCore.Transform.Certify.Hints qualified as CertifierHints -import UntypedPlutusCore.Transform.Simplifier - ( SimplifierT - , recordSimplificationWithHints +import UntypedPlutusCore.Transform.Optimizer + ( OptimizerT + , recordOptimizationWithHints , pattern InlineStage ) @@ -215,7 +215,7 @@ inline -> InlineHints name a -> PLC.BuiltinSemanticsVariant fun -> Term name uni fun a - -> SimplifierT name uni fun a m (Term name uni fun a) + -> OptimizerT name uni fun a m (Term name uni fun a) inline callsiteGrowth inlineConstants @@ -237,7 +237,7 @@ inline , _iiPreserveLogging = preserveLogging } let result = snd <$> decoratedResult - recordSimplificationWithHints + recordOptimizationWithHints (CertifierHints.Inline (mkHints decoratedResult)) t InlineStage diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/LetFloatOut.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/LetFloatOut.hs index d3adc11b595..150343d2a22 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/LetFloatOut.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/LetFloatOut.hs @@ -24,9 +24,9 @@ module UntypedPlutusCore.Transform.LetFloatOut (letFloatOut) where import PlutusCore qualified as PLC import UntypedPlutusCore.Core -import UntypedPlutusCore.Transform.Simplifier - ( SimplifierT - , recordSimplification +import UntypedPlutusCore.Transform.Optimizer + ( OptimizerT + , recordOptimization , pattern LetFloatOutStage ) @@ -37,10 +37,10 @@ letFloatOut , PLC.Rename (Term name uni fun a) ) => Term name uni fun a - -> SimplifierT name uni fun a m (Term name uni fun a) + -> OptimizerT name uni fun a m (Term name uni fun a) letFloatOut term = do result <- PLC.rename term >>= pure . transformOf termSubterms processTerm - recordSimplification term LetFloatOutStage result + recordOptimization term LetFloatOutStage result pure result processTerm :: Term name uni fun a -> Term name uni fun a diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Optimizer.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Optimizer.hs new file mode 100644 index 00000000000..ddd01a503b6 --- /dev/null +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Optimizer.hs @@ -0,0 +1,88 @@ +{-# LANGUAGE PatternSynonyms #-} + +module UntypedPlutusCore.Transform.Optimizer + ( OptimizerT (..) + , Trace.OptStage + , pattern Trace.FloatDelayStage + , pattern Trace.ForceDelayStage + , pattern Trace.ForceCaseDelayStage + , pattern Trace.CaseReduceStage + , pattern Trace.InlineStage + , pattern Trace.CseStage + , pattern Trace.ApplyToCaseStage + , pattern Trace.CaseOfCaseStage + , pattern Trace.LetFloatOutStage + , Trace.OptimizerTrace (..) + , Trace.Optimization (..) + , runOptimizerT + , evalOptimizerT + , execOptimizerT + , Optimizer + , runOptimizer + , evalOptimizer + , execOptimizer + , Trace.initOptimizerTrace + , recordOptimization + , recordOptimizationWithHints + ) where + +import Control.Monad.State (MonadTrans, StateT) +import Control.Monad.State qualified as State + +import Control.Monad.Identity (Identity, runIdentity) +import PlutusCore.Quote (MonadQuote) +import UntypedPlutusCore.Core.Type (Term) +import UntypedPlutusCore.Transform.Certify.Hints qualified as Hints +import UntypedPlutusCore.Transform.Certify.Trace qualified as Trace + +newtype OptimizerT name uni fun ann m a + = OptimizerT + { getOptimizerT :: StateT (Trace.OptimizerTrace name uni fun ann) m a + } + deriving newtype (Functor, Applicative, Monad, MonadTrans) + +instance MonadQuote m => MonadQuote (OptimizerT name uni fun ann m) + +runOptimizerT + :: OptimizerT name uni fun ann m a + -> m (a, Trace.OptimizerTrace name uni fun ann) +runOptimizerT = flip State.runStateT Trace.initOptimizerTrace . getOptimizerT + +evalOptimizerT + :: Monad m => OptimizerT name uni fun ann m a -> m a +evalOptimizerT = flip State.evalStateT Trace.initOptimizerTrace . getOptimizerT + +execOptimizerT + :: Monad m => OptimizerT name uni fun ann m a -> m (Trace.OptimizerTrace name uni fun ann) +execOptimizerT = flip State.execStateT Trace.initOptimizerTrace . getOptimizerT + +type Optimizer name uni fun ann = OptimizerT name uni fun ann Identity + +runOptimizer :: Optimizer name uni fun ann a -> (a, Trace.OptimizerTrace name uni fun ann) +runOptimizer = runIdentity . runOptimizerT + +evalOptimizer :: Optimizer name uni fun ann a -> a +evalOptimizer = runIdentity . evalOptimizerT + +execOptimizer :: Optimizer name uni fun ann a -> Trace.OptimizerTrace name uni fun ann +execOptimizer = runIdentity . execOptimizerT + +recordOptimization + :: Monad m + => Term name uni fun a + -> Trace.OptStage + -> Term name uni fun a + -> OptimizerT name uni fun a m () +recordOptimization = recordOptimizationWithHints Hints.NoHints + +recordOptimizationWithHints + :: Monad m + => Hints.Hints + -> Term name uni fun a + -> Trace.OptStage + -> Term name uni fun a + -> OptimizerT name uni fun a m () +recordOptimizationWithHints hints before stage after = + let optimization = Trace.Optimization before stage hints after + in OptimizerT . State.modify' $ \st -> + st {Trace.optimizerTrace = optimization : Trace.optimizerTrace st} diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs deleted file mode 100644 index 7f41cb6998c..00000000000 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Simplifier.hs +++ /dev/null @@ -1,88 +0,0 @@ -{-# LANGUAGE PatternSynonyms #-} - -module UntypedPlutusCore.Transform.Simplifier - ( SimplifierT (..) - , Trace.OptStage - , pattern Trace.FloatDelayStage - , pattern Trace.ForceDelayStage - , pattern Trace.ForceCaseDelayStage - , pattern Trace.CaseReduceStage - , pattern Trace.InlineStage - , pattern Trace.CseStage - , pattern Trace.ApplyToCaseStage - , pattern Trace.CaseOfCaseStage - , pattern Trace.LetFloatOutStage - , Trace.OptimizerTrace (..) - , Trace.Optimization (..) - , runSimplifierT - , evalSimplifierT - , execSimplifierT - , Simplifier - , runSimplifier - , evalSimplifier - , execSimplifier - , Trace.initOptimizerTrace - , recordOptimization - , recordOptimizationWithHints - ) where - -import Control.Monad.State (MonadTrans, StateT) -import Control.Monad.State qualified as State - -import Control.Monad.Identity (Identity, runIdentity) -import PlutusCore.Quote (MonadQuote) -import UntypedPlutusCore.Core.Type (Term) -import UntypedPlutusCore.Transform.Certify.Hints qualified as Hints -import UntypedPlutusCore.Transform.Certify.Trace qualified as Trace - -newtype SimplifierT name uni fun ann m a - = SimplifierT - { getSimplifierT :: StateT (Trace.OptimizerTrace name uni fun ann) m a - } - deriving newtype (Functor, Applicative, Monad, MonadTrans) - -instance MonadQuote m => MonadQuote (SimplifierT name uni fun ann m) - -runSimplifierT - :: SimplifierT name uni fun ann m a - -> m (a, Trace.OptimizerTrace name uni fun ann) -runSimplifierT = flip State.runStateT Trace.initOptimizerTrace . getSimplifierT - -evalSimplifierT - :: Monad m => SimplifierT name uni fun ann m a -> m a -evalSimplifierT = flip State.evalStateT Trace.initOptimizerTrace . getSimplifierT - -execSimplifierT - :: Monad m => SimplifierT name uni fun ann m a -> m (Trace.OptimizerTrace name uni fun ann) -execSimplifierT = flip State.execStateT Trace.initOptimizerTrace . getSimplifierT - -type Simplifier name uni fun ann = SimplifierT name uni fun ann Identity - -runSimplifier :: Simplifier name uni fun ann a -> (a, Trace.OptimizerTrace name uni fun ann) -runSimplifier = runIdentity . runSimplifierT - -evalSimplifier :: Simplifier name uni fun ann a -> a -evalSimplifier = runIdentity . evalSimplifierT - -execSimplifier :: Simplifier name uni fun ann a -> Trace.OptimizerTrace name uni fun ann -execSimplifier = runIdentity . execSimplifierT - -recordOptimization - :: Monad m - => Term name uni fun a - -> Trace.OptStage - -> Term name uni fun a - -> SimplifierT name uni fun a m () -recordOptimization = recordOptimizationWithHints Hints.NoHints - -recordOptimizationWithHints - :: Monad m - => Hints.Hints - -> Term name uni fun a - -> Trace.OptStage - -> Term name uni fun a - -> SimplifierT name uni fun a m () -recordOptimizationWithHints hints before stage after = - let simplification = Trace.Optimization before stage hints after - in SimplifierT . State.modify' $ \st -> - st {Trace.optimizerTrace = simplification : Trace.optimizerTrace st} diff --git a/plutus-core/untyped-plutus-core/test/Transform/basic.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/basic.golden.certifier-hints index e06a48642b9..937e7d43f0e 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/basic.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/basic.golden.certifier-hints @@ -1,25 +1,25 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/basicInline.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/basicInline.golden.certifier-hints index b90352ca89c..df6566a1a10 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/basicInline.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/basicInline.golden.certifier-hints @@ -1,27 +1,27 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlDrop InlExpand InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/callsiteInline.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/callsiteInline.golden.certifier-hints index af376e1901c..bd63baaba4c 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/callsiteInline.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/callsiteInline.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlLam InlLam InlApply @@ -46,6 +46,6 @@ InlLam InlVar --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/extraDelays.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/extraDelays.golden.certifier-hints index 881e1629410..41a3169d754 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/extraDelays.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/extraDelays.golden.certifier-hints @@ -1,26 +1,26 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlDelay InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/floatDelay1.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/floatDelay1.golden.certifier-hints index 1bd20a131c7..a679a717fb8 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/floatDelay1.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/floatDelay1.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlDrop InlApply InlApply @@ -27,6 +27,6 @@ InlDrop InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/floatDelay2.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/floatDelay2.golden.certifier-hints index eaf79604cbc..24efecbfd6c 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/floatDelay2.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/floatDelay2.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlApply InlLam InlApply @@ -34,6 +34,6 @@ InlApply InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/floatDelay3.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/floatDelay3.golden.certifier-hints index 16ad4f57902..d3e22138e30 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/floatDelay3.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/floatDelay3.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlDrop InlApply InlApply @@ -33,6 +33,6 @@ InlDrop InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps1.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps1.golden.certifier-hints index f2e5a4d6694..5f742946089 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps1.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps1.golden.certifier-hints @@ -1,28 +1,28 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlLam InlCase InlVar InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2.golden.certifier-hints index 35e7b9ec8b9..05806412c0f 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlLam InlCase InlVar @@ -24,6 +24,6 @@ InlLam InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2Fail.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2Fail.golden.certifier-hints index 3c059f65a3f..1c4a282c988 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2Fail.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2Fail.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlLam InlForce InlCase @@ -26,6 +26,6 @@ InlLam InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps1.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps1.golden.certifier-hints index 907204e2581..8b4af947a80 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps1.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps1.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlLam InlCase InlVar @@ -24,6 +24,6 @@ InlLam InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2.golden.certifier-hints index 9b4a32dfd5c..51854554595 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlLam InlCase InlVar @@ -25,6 +25,6 @@ InlLam InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2Fail.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2Fail.golden.certifier-hints index 094edd72621..6305922b6d6 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2Fail.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2Fail.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlLam InlForce InlCase @@ -29,6 +29,6 @@ InlLam InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceDelayComplex.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceDelayComplex.golden.certifier-hints index 90bdebe3625..5a3a35d8ea5 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceDelayComplex.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceDelayComplex.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlLam InlDrop InlDrop @@ -47,6 +47,6 @@ InlLam InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiApply.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiApply.golden.certifier-hints index bf37cd05ea3..c6a5083de48 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiApply.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiApply.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlLam InlDrop InlDrop @@ -35,6 +35,6 @@ InlLam InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiForce.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiForce.golden.certifier-hints index b90352ca89c..df6566a1a10 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiForce.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiForce.golden.certifier-hints @@ -1,27 +1,27 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlDrop InlExpand InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoApps.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoApps.golden.certifier-hints index e06a48642b9..937e7d43f0e 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoApps.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoApps.golden.certifier-hints @@ -1,25 +1,25 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoAppsLayered.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoAppsLayered.golden.certifier-hints index e06a48642b9..937e7d43f0e 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoAppsLayered.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoAppsLayered.golden.certifier-hints @@ -1,25 +1,25 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceDelaySimple.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceDelaySimple.golden.certifier-hints index ceb438d982a..bc7d7212794 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceDelaySimple.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceDelaySimple.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlDrop InlDrop InlDrop @@ -24,6 +24,6 @@ InlDrop InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure1.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure1.golden.certifier-hints index 2f3075a63ef..9a49cfb5ab4 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure1.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure1.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlApply InlLam InlLam @@ -24,6 +24,6 @@ InlApply InlError --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure2.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure2.golden.certifier-hints index 2f3075a63ef..9a49cfb5ab4 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure2.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure2.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlApply InlLam InlLam @@ -24,6 +24,6 @@ InlApply InlError --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure3.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure3.golden.certifier-hints index 2f3075a63ef..9a49cfb5ab4 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure3.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure3.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlApply InlLam InlLam @@ -24,6 +24,6 @@ InlApply InlError --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure4.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure4.golden.certifier-hints index ab1f2cd991c..601867480b6 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure4.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure4.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlLam InlApply InlLam @@ -26,6 +26,6 @@ InlLam InlVar --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlinePure1.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlinePure1.golden.certifier-hints index 68a0a5510c0..11330832f36 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlinePure1.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlinePure1.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlLam InlDrop InlLam @@ -24,6 +24,6 @@ InlLam InlVar --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlinePure2.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlinePure2.golden.certifier-hints index 68a0a5510c0..11330832f36 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlinePure2.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlinePure2.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlLam InlDrop InlLam @@ -24,6 +24,6 @@ InlLam InlVar --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlinePure3.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlinePure3.golden.certifier-hints index 02e859bb342..6f11b126e9c 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlinePure3.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlinePure3.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlDrop InlLam InlExpand @@ -29,6 +29,6 @@ InlDrop InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlinePure4.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlinePure4.golden.certifier-hints index a179e0978d6..d592cc2fa62 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlinePure4.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlinePure4.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlDrop InlLam InlExpand @@ -32,6 +32,6 @@ InlDrop InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/interveningLambda.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/interveningLambda.golden.certifier-hints index cb1cc7836eb..ea33e7407b0 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/interveningLambda.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/interveningLambda.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlDrop InlApply InlExpand @@ -25,6 +25,6 @@ InlDrop InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase1.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase1.golden.certifier-hints index 7a0683f10b3..80536c7bb16 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase1.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase1.golden.certifier-hints @@ -1,26 +1,26 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlDrop InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase2.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase2.golden.certifier-hints index 30a70d2ce89..6fa3cf4b2b9 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase2.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase2.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlLam InlDrop InlApply @@ -28,6 +28,6 @@ InlLam InlVar --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/letFloatOutForce.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/letFloatOutForce.golden.certifier-hints index dfbfc3c4679..75862738baf 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/letFloatOutForce.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/letFloatOutForce.golden.certifier-hints @@ -1,28 +1,28 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlLam InlDrop InlExpand InlVar --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/multiApp.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/multiApp.golden.certifier-hints index fa1ce6ea23f..443b4d8f98d 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/multiApp.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/multiApp.golden.certifier-hints @@ -1,22 +1,22 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlDrop InlDrop InlDrop @@ -30,6 +30,6 @@ InlDrop InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/nested.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/nested.golden.certifier-hints index e06a48642b9..937e7d43f0e 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/nested.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/nested.golden.certifier-hints @@ -1,25 +1,25 @@ --- Certifier hints #1 (FloatDelay) -- +-- Certifier hints #1 (Right FloatDelay) -- NoHints --- Certifier hints #2 (ForceCaseDelay) -- +-- Certifier hints #2 (Right ForceCaseDelay) -- NoHints --- Certifier hints #3 (LetFloatOut) -- +-- Certifier hints #3 (Left LetFloatOut) -- NoHints --- Certifier hints #4 (ForceDelay) -- +-- Certifier hints #4 (Right ForceDelay) -- NoHints --- Certifier hints #5 (CaseOfCase) -- +-- Certifier hints #5 (Left CaseOfCase) -- NoHints --- Certifier hints #6 (CaseReduce) -- +-- Certifier hints #6 (Right CaseReduce) -- NoHints --- Certifier hints #7 (Inline) -- +-- Certifier hints #7 (Right Inline) -- InlCon --- Certifier hints #8 (ApplyToCase) -- +-- Certifier hints #8 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/testlib/Scoping/Spec.hs b/plutus-core/untyped-plutus-core/testlib/Scoping/Spec.hs index 096d1197853..0256f5580c6 100644 --- a/plutus-core/untyped-plutus-core/testlib/Scoping/Spec.hs +++ b/plutus-core/untyped-plutus-core/testlib/Scoping/Spec.hs @@ -86,37 +86,37 @@ test_names = (genTerm @DefaultFun) T.BindingRemovalOk -- COKC removes branches, which may (and likely do) contain bindings. T.PrerenameYes - (evalSimplifierT . caseReduce) + (evalOptimizerT . caseReduce) , -- CSE creates entirely new names, which isn't supported by the scoping check machinery. T.test_scopingBad "cse" (genTerm @DefaultFun) T.BindingRemovalOk T.PrerenameYes - (evalSimplifierT . cse ExcludeWorkFree maxBound) + (evalOptimizerT . cse ExcludeWorkFree maxBound) , T.test_scopingGood "float-delay" (genTerm @DefaultFun) T.BindingRemovalNotOk T.PrerenameNo - (evalSimplifierT . floatDelay) + (evalOptimizerT . floatDelay) , T.test_scopingGood "force-delay" (genTerm @DefaultFun) T.BindingRemovalNotOk T.PrerenameYes - (evalSimplifierT . forceDelay maxBound) + (evalOptimizerT . forceDelay maxBound) , T.test_scopingGood "inline" (genTerm @DefaultFun) T.BindingRemovalOk T.PrerenameYes - ( evalSimplifierT + ( evalOptimizerT . inline 0 True - (_soPreserveLogging defaultSimplifyOpts) - (_soInlineHints defaultSimplifyOpts) + (_ooPreserveLogging defaultOptimizeOpts) + (_ooInlineHints defaultOptimizeOpts) maxBound ) , test_mangle diff --git a/plutus-core/untyped-plutus-core/testlib/Transform/CaseOfCase/Spec.hs b/plutus-core/untyped-plutus-core/testlib/Transform/CaseOfCase/Spec.hs index 9a450eeb7f2..adb79cb57d9 100644 --- a/plutus-core/untyped-plutus-core/testlib/Transform/CaseOfCase/Spec.hs +++ b/plutus-core/untyped-plutus-core/testlib/Transform/CaseOfCase/Spec.hs @@ -36,7 +36,7 @@ import UntypedPlutusCore.Evaluation.Machine.Cek , unsafeSplitStructuralOperational ) import UntypedPlutusCore.Transform.CaseOfCase (caseOfCase) -import UntypedPlutusCore.Transform.Simplifier (evalSimplifier) +import UntypedPlutusCore.Transform.Optimizer (evalOptimizer) test_caseOfCase :: TestTree test_caseOfCase = @@ -128,7 +128,7 @@ testCaseOfCaseWithError = evalCaseOfCase :: Term Name DefaultUni DefaultFun () -> Term Name DefaultUni DefaultFun () -evalCaseOfCase term = evalSimplifier $ caseOfCase term +evalCaseOfCase term = evalOptimizer $ caseOfCase term evaluateUplc :: UPLC.Term Name DefaultUni DefaultFun () diff --git a/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs b/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs index df67664fdcd..30b45b0a2d2 100644 --- a/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs +++ b/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs @@ -20,14 +20,14 @@ import UntypedPlutusCore , Name , OptimizerTrace , Term - , defaultSimplifyOpts - , runSimplifierT - , soCseWhichSubterms - , soInlineCallsiteGrowth - , soMaxCseIterations - , soMaxSimplifierIterations - , soPreserveLogging - , termSimplifier + , defaultOptimizeOpts + , ooCseWhichSubterms + , ooInlineCallsiteGrowth + , ooMaxCseIterations + , ooMaxSimplifierIterations + , ooPreserveLogging + , runOptimizerT + , termOptimizer ) import UntypedPlutusCore.Transform.Certify.Hints qualified as Hints import UntypedPlutusCore.Transform.Certify.Trace qualified as Trace @@ -39,8 +39,8 @@ goldenVsPretty extn name value = pure . BSL.fromStrict . encodeUtf8 . render $ prettyPlcReadableSimple value -goldenVsSimplified :: String -> Term Name PLC.DefaultUni PLC.DefaultFun () -> TestTree -goldenVsSimplified name t = +goldenVsOptimized :: String -> Term Name PLC.DefaultUni PLC.DefaultFun () -> TestTree +goldenVsOptimized name t = testGroup name [ goldenVsPretty ".golden.uplc" name t' @@ -51,7 +51,7 @@ goldenVsSimplified name t = $ renderCertifierHints trace ] where - (t', trace) = PLC.runQuote (testSimplify t) + (t', trace) = PLC.runQuote (testOptimize t) hintsPath = "untyped-plutus-core/test/Transform/" ++ name ++ ".golden.certifier-hints" renderCertifierHints :: Trace.OptimizerTrace Name PLC.DefaultUni PLC.DefaultFun () -> Text @@ -96,21 +96,21 @@ renderCertifierHints (Trace.OptimizerTrace ss) line i payload = T.replicate i " " <> payload <> "\n" -testSimplify +testOptimize :: Term Name PLC.DefaultUni PLC.DefaultFun () -> PLC.Quote ( Term Name PLC.DefaultUni PLC.DefaultFun () , OptimizerTrace Name PLC.DefaultUni PLC.DefaultFun () ) -testSimplify = - runSimplifierT - . termSimplifier - ( defaultSimplifyOpts +testOptimize = + runOptimizerT + . termOptimizer + ( defaultOptimizeOpts -- Just run one iteration, to see what that does - & soMaxSimplifierIterations .~ 1 - & soMaxCseIterations .~ 0 - & soInlineCallsiteGrowth .~ 0 - & soPreserveLogging .~ False + & ooMaxSimplifierIterations .~ 1 + & ooMaxCseIterations .~ 0 + & ooInlineCallsiteGrowth .~ 0 + & ooPreserveLogging .~ False ) (def :: BuiltinSemanticsVariant PLC.DefaultFun) @@ -133,14 +133,14 @@ testCse , OptimizerTrace Name PLC.DefaultUni PLC.DefaultFun () ) testCse whichSubterms = - runSimplifierT - . termSimplifier - ( defaultSimplifyOpts + runOptimizerT + . termOptimizer + ( defaultOptimizeOpts -- Just run one iteration, to see what that does - & soMaxSimplifierIterations .~ 0 - & soMaxCseIterations .~ 1 - & soCseWhichSubterms .~ whichSubterms - & soInlineCallsiteGrowth .~ 0 - & soPreserveLogging .~ False + & ooMaxSimplifierIterations .~ 0 + & ooMaxCseIterations .~ 1 + & ooCseWhichSubterms .~ whichSubterms + & ooInlineCallsiteGrowth .~ 0 + & ooPreserveLogging .~ False ) (def :: BuiltinSemanticsVariant PLC.DefaultFun) diff --git a/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Spec.hs b/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Spec.hs index d8e46e42b79..34001aed43b 100644 --- a/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Spec.hs +++ b/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Spec.hs @@ -9,7 +9,7 @@ import PlutusCore qualified as PLC import PlutusCore.MkPlc (mkConstant, mkIterApp, mkIterAppNoAnn) import PlutusCore.Quote (Quote, freshName, runQuote) import Test.Tasty (TestTree, testGroup) -import Transform.Simplify.Lib (goldenVsCse, goldenVsSimplified) +import Transform.Simplify.Lib (goldenVsCse, goldenVsOptimized) import UntypedPlutusCore ( CseWhichSubterms (..) , DefaultFun @@ -674,6 +674,6 @@ test_simplify :: TestTree test_simplify = testGroup "simplify" - $ fmap (uncurry goldenVsSimplified) testSimplifyInputs + $ fmap (uncurry goldenVsOptimized) testSimplifyInputs <> fmap (uncurry (goldenVsCse ExcludeWorkFree)) testCseInputs <> fmap (uncurry (goldenVsCse AllSubterms)) testCseInputsWorkFree diff --git a/plutus-executables/executables/pir/Main.hs b/plutus-executables/executables/pir/Main.hs index f05033d839e..4ba23be7cb6 100644 --- a/plutus-executables/executables/pir/Main.hs +++ b/plutus-executables/executables/pir/Main.hs @@ -194,8 +194,8 @@ compileToUplc optimise plcProg = then PLC.defaultCompilationOpts else PLC.defaultCompilationOpts - & PLC.coSimplifyOpts - . UPLC.soMaxSimplifierIterations + & PLC.coOptimizeOpts + . UPLC.ooMaxSimplifierIterations .~ 0 in runQuote $ flip runReaderT plcCompilerOpts $ PLC.compileProgram plcProg diff --git a/plutus-executables/executables/uplc/Main.hs b/plutus-executables/executables/uplc/Main.hs index 1a99d7875b2..90b67c43dd6 100644 --- a/plutus-executables/executables/uplc/Main.hs +++ b/plutus-executables/executables/uplc/Main.hs @@ -349,7 +349,7 @@ runOptimiseSingle -> PrintMode -> Certifier -> CertifierOutputMode - -> UPLC.SimplifyOpts UPLC.Name SrcSpan + -> UPLC.OptimizeOpts UPLC.Name SrcSpan -> OptimiseEvalOpts -> IO () runOptimiseSingle inp ifmt outp ofmt mode mcert certifierOutput sopts eopts = do @@ -377,7 +377,7 @@ runOptimiseBlueprint -> Format -> Certifier -> CertifierOutputMode - -> UPLC.SimplifyOpts UPLC.Name SrcSpan + -> UPLC.OptimizeOpts UPLC.Name SrcSpan -> OptimiseEvalOpts -> IO () runOptimiseBlueprint inp outp ofmt mcert certifierOutput sopts eopts @@ -411,7 +411,7 @@ runOptimiseBlueprint inp outp ofmt mcert certifierOutput sopts eopts optimiseProgram :: forall m name a . (UPLC.HasUnique name UPLC.TermUnique, Monad m, Ord name, Typeable name) - => UPLC.SimplifyOpts name a + => UPLC.OptimizeOpts name a -> UPLC.Program name UPLC.DefaultUni UPLC.DefaultFun a -> m ( UPLC.Program name UPLC.DefaultUni UPLC.DefaultFun a @@ -421,7 +421,7 @@ optimiseProgram opts prog = PLC.runQuoteT $ do renamed <- PLC.rename prog let defaultBuiltinSemanticsVariant :: BuiltinSemanticsVariant PLC.DefaultFun defaultBuiltinSemanticsVariant = def - UPLC.simplifyProgramWithTrace opts defaultBuiltinSemanticsVariant renamed + UPLC.optimizeProgramWithTrace opts defaultBuiltinSemanticsVariant renamed execCertifier :: UPLC.OptimizerTrace UPLC.Name UPLC.DefaultUni UPLC.DefaultFun a diff --git a/plutus-executables/plutus/AnyProgram/Compile.hs b/plutus-executables/plutus/AnyProgram/Compile.hs index 839e0acfec4..f6638e39cfd 100644 --- a/plutus-executables/plutus/AnyProgram/Compile.hs +++ b/plutus-executables/plutus/AnyProgram/Compile.hs @@ -253,14 +253,14 @@ uplcOptimise = case _optimiseLvl ?opts of NoOptimise -> const pure -- short-circuit to avoid renaming safeOrUnsafe -> - let sOpts = - UPLC.defaultSimplifyOpts + let oOpts = + UPLC.defaultOptimizeOpts & case safeOrUnsafe of - SafeOptimise -> set UPLC.soConservativeOpts True + SafeOptimise -> set UPLC.ooConservativeOpts True UnsafeOptimise -> id in fmap PLC.runQuoteT . _Wrapped - . uplcViaName (UPLC.simplifyProgram sOpts def) + . uplcViaName (UPLC.optimizeProgram oOpts def) -- | We do not have a typechecker for uplc, but we could pretend that scopecheck is a "typechecker" uplcTypecheck diff --git a/plutus-executables/test/certifier/Test/Certifier/Executable.hs b/plutus-executables/test/certifier/Test/Certifier/Executable.hs index 5694aa51fba..97e1165f1ac 100644 --- a/plutus-executables/test/certifier/Test/Certifier/Executable.hs +++ b/plutus-executables/test/certifier/Test/Certifier/Executable.hs @@ -29,9 +29,9 @@ simplify simplify = runQuote . fmap snd - . runSimplifierT - . termSimplifier - defaultSimplifyOpts + . runOptimizerT + . termOptimizer + defaultOptimizeOpts DefaultFunSemanticsVariantE loadAndMakeCert :: String -> IO FilePath diff --git a/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs b/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs index fc9ab8e37d7..0883de40239 100644 --- a/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs +++ b/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs @@ -197,27 +197,27 @@ certifierOutputMode = ) ] -simplifyOpts :: Parser (UPLC.SimplifyOpts name a) -simplifyOpts = do - _soMaxSimplifierIterations <- +optimizeOpts :: Parser (UPLC.OptimizeOpts name a) +optimizeOpts = do + _ooMaxSimplifierIterations <- option auto ( long "opt-simplifier-iterations" <> metavar "INT" - <> value (UPLC.defaultSimplifyOpts ^. UPLC.soMaxSimplifierIterations) + <> value (UPLC.defaultOptimizeOpts ^. UPLC.ooMaxSimplifierIterations) <> showDefault <> help "Number of simplifier iterations" ) - _soMaxCseIterations <- + _ooMaxCseIterations <- option auto ( long "opt-cse-iterations" <> metavar "INT" - <> value (UPLC.defaultSimplifyOpts ^. UPLC.soMaxCseIterations) + <> value (UPLC.defaultOptimizeOpts ^. UPLC.ooMaxCseIterations) <> showDefault <> help "Number of CSE iterations" ) - _soCseWhichSubterms <- + _ooCseWhichSubterms <- option ( maybeReader ( \case @@ -232,29 +232,29 @@ simplifyOpts = do <> showDefaultWith (\case UPLC.AllSubterms -> "all"; UPLC.ExcludeWorkFree -> "exclude-work-free") <> help "CSE subterm selection: all | exclude-work-free" ) - _soConservativeOpts <- + _ooConservativeOpts <- switch ( long "opt-conservative" <> help "Use conservative optimisation options. May result in less optimized code." ) - let _soInlineHints = UPLC.defaultSimplifyOpts ^. UPLC.soInlineHints - _soInlineConstants <- + let _ooInlineHints = UPLC.defaultOptimizeOpts ^. UPLC.ooInlineHints + _ooInlineConstants <- flag True False ( long "opt-no-inline-constants" <> help "Disable constant inlining" ) - _soInlineCallsiteGrowth <- + _ooInlineCallsiteGrowth <- option (AstSize <$> auto) ( long "opt-inline-callsite-growth" <> metavar "INT" - <> value (UPLC.defaultSimplifyOpts ^. UPLC.soInlineCallsiteGrowth) + <> value (UPLC.defaultOptimizeOpts ^. UPLC.ooInlineCallsiteGrowth) <> showDefault <> help "Maximum allowed AST growth at call sites for inlining" ) - _soPreserveLogging <- + _ooPreserveLogging <- switch ( long "opt-preserve-logging" <> help @@ -262,14 +262,14 @@ simplifyOpts = do <> " May result in less optimized code." ) ) - _soApplyToCase <- + _ooApplyToCase <- flag True False ( long "opt-no-apply-to-case" <> help "Disable apply-to-case optimization" ) - _soSafeOpts <- + _ooSafeOpts <- flag False True @@ -277,7 +277,7 @@ simplifyOpts = do <> help "Run only those optimisation passes which are certified to preserve the functional behavior of the original program." ) - pure UPLC.SimplifyOpts {..} + pure UPLC.OptimizeOpts {..} optimiseEvalOpts :: Parser OptimiseEvalOpts optimiseEvalOpts = @@ -348,7 +348,7 @@ optimiseOpts = <*> printmode <*> certifier <*> certifierOutputMode - <*> simplifyOpts + <*> optimizeOpts <*> optimiseEvalOpts exampleMode :: Parser ExampleMode diff --git a/plutus-ledger-api/executables/src/PlutusCore/Executable/Types.hs b/plutus-ledger-api/executables/src/PlutusCore/Executable/Types.hs index d2f3556d9d8..7239dd533ca 100644 --- a/plutus-ledger-api/executables/src/PlutusCore/Executable/Types.hs +++ b/plutus-ledger-api/executables/src/PlutusCore/Executable/Types.hs @@ -101,7 +101,7 @@ data OptimiseOptions name a PrintMode Certifier CertifierOutputMode - (UPLC.SimplifyOpts name a) + (UPLC.OptimizeOpts name a) OptimiseEvalOpts data PrintOptions = PrintOptions Input Output PrintMode newtype ExampleOptions = ExampleOptions ExampleMode diff --git a/plutus-metatheory/src/Certifier.hs b/plutus-metatheory/src/Certifier.hs index 3d35b93eb6f..d0bfbc5c747 100644 --- a/plutus-metatheory/src/Certifier.hs +++ b/plutus-metatheory/src/Certifier.hs @@ -28,7 +28,7 @@ import MAlonzo.Code.Certifier (runCertifierMain) import PlutusLedgerApi.Common import UntypedPlutusCore qualified as UPLC import UntypedPlutusCore.Evaluation.Machine.Cek -import UntypedPlutusCore.Transform.Simplifier +import UntypedPlutusCore.Transform.Optimizer type CertName = String type CertDir = FilePath diff --git a/plutus-metatheory/src/FFI/OptimizerTrace.hs b/plutus-metatheory/src/FFI/OptimizerTrace.hs index 2ef9172d9e2..1f2fa0bcd1d 100644 --- a/plutus-metatheory/src/FFI/OptimizerTrace.hs +++ b/plutus-metatheory/src/FFI/OptimizerTrace.hs @@ -14,7 +14,7 @@ import PlutusCore.Evaluation.Machine.ExMemory import UntypedPlutusCore qualified as UPLC import UntypedPlutusCore.Evaluation.Machine.Cek import UntypedPlutusCore.Transform.Certify.Hints qualified as Certify -import UntypedPlutusCore.Transform.Simplifier +import UntypedPlutusCore.Transform.Optimizer import Data.Coerce import Data.Functor diff --git a/plutus-metatheory/test/certifier-report/Test/Certifier/Report.hs b/plutus-metatheory/test/certifier-report/Test/Certifier/Report.hs index e0f1ade203e..c048f14fb0a 100644 --- a/plutus-metatheory/test/certifier-report/Test/Certifier/Report.hs +++ b/plutus-metatheory/test/certifier-report/Test/Certifier/Report.hs @@ -58,10 +58,10 @@ simplify , OptimizerTrace Name DefaultUni DefaultFun () ) simplify = - runSimplifierT - . termSimplifier - ( defaultSimplifyOpts - & soPreserveLogging .~ False + runOptimizerT + . termOptimizer + ( defaultOptimizeOpts + & ooPreserveLogging .~ False ) def diff --git a/plutus-metatheory/test/certifier/Test/Certifier/Optimizer.hs b/plutus-metatheory/test/certifier/Test/Certifier/Optimizer.hs index 7de4d60f24f..40dc412724f 100644 --- a/plutus-metatheory/test/certifier/Test/Certifier/Optimizer.hs +++ b/plutus-metatheory/test/certifier/Test/Certifier/Optimizer.hs @@ -5,7 +5,7 @@ import MAlonzo.Code.Certifier (runCertifierMain) import PlutusCore qualified as PLC import Test.Tasty (TestTree, testGroup) import Test.Tasty.HUnit (assertBool, assertFailure, testCase) -import Transform.Simplify.Lib (testCse, testSimplify) +import Transform.Simplify.Lib (testCse, testOptimize) import Transform.Simplify.Spec (testCseInputs, testSimplifyInputs) import UntypedPlutusCore ( CseWhichSubterms (..) @@ -43,7 +43,7 @@ mkUPLCSimplifierTest :: String -> Term Name DefaultUni DefaultFun () -> TestTree -mkUPLCSimplifierTest = mkUPLCTest testSimplify +mkUPLCSimplifierTest = mkUPLCTest testOptimize mkUPLCCseTest :: CseWhichSubterms diff --git a/plutus-tx-plugin/src/PlutusTx/Options.hs b/plutus-tx-plugin/src/PlutusTx/Options.hs index 167e06e1523..b041b628f7b 100644 --- a/plutus-tx-plugin/src/PlutusTx/Options.hs +++ b/plutus-tx-plugin/src/PlutusTx/Options.hs @@ -268,7 +268,7 @@ pluginOptions = desc = "Set the max iterations for the PIR simplifier" in (k, PluginOption typeRep (readOption k) posMaxSimplifierIterationsPir desc []) , let k = "max-simplifier-iterations-uplc" - desc = "Set the max iterations for the UPLC simplifier" + desc = "Set the max iterations for the UPLC optimizer" in (k, PluginOption typeRep (readOption k) posMaxSimplifierIterationsUPlc desc []) , let k = "max-cse-iterations" desc = "Set the max iterations for CSE" @@ -397,9 +397,9 @@ defaultPluginOptions = , _posVerbosity = Quiet , _posDatatypes = PIR.defaultDatatypeCompilationOpts , _posMaxSimplifierIterationsPir = view PIR.coMaxSimplifierIterations PIR.defaultCompilationOpts - , _posMaxSimplifierIterationsUPlc = view UPLC.soMaxSimplifierIterations UPLC.defaultSimplifyOpts - , _posMaxCseIterations = view UPLC.soMaxCseIterations UPLC.defaultSimplifyOpts - , _posCseWhichSubterms = view UPLC.soCseWhichSubterms UPLC.defaultSimplifyOpts + , _posMaxSimplifierIterationsUPlc = view UPLC.ooMaxSimplifierIterations UPLC.defaultOptimizeOpts + , _posMaxCseIterations = view UPLC.ooMaxCseIterations UPLC.defaultOptimizeOpts + , _posCseWhichSubterms = view UPLC.ooCseWhichSubterms UPLC.defaultOptimizeOpts , _posDoSimplifierUnwrapCancel = True , _posDoSimplifierBeta = True , _posDoSimplifierInline = True diff --git a/plutus-tx-plugin/src/PlutusTx/Plugin/Common.hs b/plutus-tx-plugin/src/PlutusTx/Plugin/Common.hs index 1081cd60920..3c727e654ee 100644 --- a/plutus-tx-plugin/src/PlutusTx/Plugin/Common.hs +++ b/plutus-tx-plugin/src/PlutusTx/Plugin/Common.hs @@ -783,29 +783,29 @@ runCompiler moduleName opts expr = do plcOpts = PLC.defaultCompilationOpts & set - (PLC.coSimplifyOpts . UPLC.soMaxSimplifierIterations) + (PLC.coOptimizeOpts . UPLC.ooMaxSimplifierIterations) (opts ^. posMaxSimplifierIterationsUPlc) & set - (PLC.coSimplifyOpts . UPLC.soCseWhichSubterms) + (PLC.coOptimizeOpts . UPLC.ooCseWhichSubterms) (opts ^. posCseWhichSubterms) & set - (PLC.coSimplifyOpts . UPLC.soMaxCseIterations) + (PLC.coOptimizeOpts . UPLC.ooMaxCseIterations) (opts ^. posMaxCseIterations) & set - (PLC.coSimplifyOpts . UPLC.soConservativeOpts) + (PLC.coOptimizeOpts . UPLC.ooConservativeOpts) (opts ^. posConservativeOpts) - & set (PLC.coSimplifyOpts . UPLC.soInlineHints) hints + & set (PLC.coOptimizeOpts . UPLC.ooInlineHints) hints & set - (PLC.coSimplifyOpts . UPLC.soInlineConstants) + (PLC.coOptimizeOpts . UPLC.ooInlineConstants) (opts ^. posInlineConstants) & set - (PLC.coSimplifyOpts . UPLC.soInlineCallsiteGrowth) + (PLC.coOptimizeOpts . UPLC.ooInlineCallsiteGrowth) (opts ^. posInlineCallsiteGrowth . to fromIntegral) & set - (PLC.coSimplifyOpts . UPLC.soPreserveLogging) + (PLC.coOptimizeOpts . UPLC.ooPreserveLogging) (opts ^. posPreserveLogging) & set - (PLC.coSimplifyOpts . UPLC.soApplyToCase) + (PLC.coOptimizeOpts . UPLC.ooApplyToCase) (opts ^. posApplyToCase) -- GHC.Core -> Pir translation. diff --git a/plutus-tx/src/PlutusTx/Lift.hs b/plutus-tx/src/PlutusTx/Lift.hs index 965d276d724..becfe732f87 100644 --- a/plutus-tx/src/PlutusTx/Lift.hs +++ b/plutus-tx/src/PlutusTx/Lift.hs @@ -106,7 +106,7 @@ safeLiftWith f g v x = do ucOpts = ( g . ( if v == PLC.plcVersion100 - then set (PLC.coSimplifyOpts . UPLC.soApplyToCase) False + then set (PLC.coOptimizeOpts . UPLC.ooApplyToCase) False else id ) ) @@ -164,9 +164,9 @@ safeLiftUnopt safeLiftUnopt = safeLiftWith (set coMaxSimplifierIterations 0) - ( set (PLC.coSimplifyOpts . UPLC.soMaxSimplifierIterations) 0 - . set (PLC.coSimplifyOpts . UPLC.soMaxCseIterations) 0 - . set (PLC.coSimplifyOpts . UPLC.soApplyToCase) False + ( set (PLC.coOptimizeOpts . UPLC.ooMaxSimplifierIterations) 0 + . set (PLC.coOptimizeOpts . UPLC.ooMaxCseIterations) 0 + . set (PLC.coOptimizeOpts . UPLC.ooApplyToCase) False ) {-| Get a Plutus Core program corresponding to the given value, applying default PIR/UPLC From 30a82fbab43db755ceaaebf2f67ad3fe3dcb674e Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Thu, 16 Apr 2026 18:50:27 +0300 Subject: [PATCH 13/16] Fixes --- .../delve-deeper/plinth-compiler-options.md | 1 + ...415_215659_ana.pantilie95_safe_opt_mode.md | 2 +- .../src/UntypedPlutusCore/Optimize.hs | 24 +++++++++---------- .../src/UntypedPlutusCore/Optimize/Opts.hs | 6 ++--- .../src/PlutusCore/Executable/Parsers.hs | 2 +- ...415_215659_ana.pantilie95_safe_opt_mode.md | 3 +++ plutus-tx-plugin/src/PlutusTx/Options.hs | 8 +++---- .../src/PlutusTx/Plugin/Common.hs | 3 +++ 8 files changed, 28 insertions(+), 21 deletions(-) create mode 100644 plutus-tx-plugin/changelog.d/20260415_215659_ana.pantilie95_safe_opt_mode.md diff --git a/doc/docusaurus/docs/delve-deeper/plinth-compiler-options.md b/doc/docusaurus/docs/delve-deeper/plinth-compiler-options.md index 9a1218349cb..90beba91602 100644 --- a/doc/docusaurus/docs/delve-deeper/plinth-compiler-options.md +++ b/doc/docusaurus/docs/delve-deeper/plinth-compiler-options.md @@ -22,6 +22,7 @@ For each boolean option, you can add a `no-` prefix to switch it off, such as `n |-|-|-|-| |`apply-to-case`|Bool|True|Run the apply-to-case pass, turning multi-argument applications into case-constr form.| |`certify`|Maybe [Char]||Produce a certificate for the compiled program, with the given name. This certificate provides evidence that the compiler optimizations have preserved the functional behavior of the original program. Currently, this is only supported for the UPLC compilation pipeline.| +|`certified-opts-only`|Bool|False|Run only those optimisation passes which are certified to preserve the functional behavior of the original program.| |`conservative-optimisation`|Bool|False|When conservative optimisation is used, only the optimisations that never make the program worse (in terms of cost or size) are employed. Implies `no-relaxed-float-in`, `no-inline-constants`, `no-inline-fix`, `no-simplifier-evaluate-builtins`, and `preserve-logging`.| |`context-level`|Int|1|Set context level for error messages.| |`coverage-all`|Bool|False|Add all available coverage annotations in the trace output| diff --git a/plutus-core/changelog.d/20260415_215659_ana.pantilie95_safe_opt_mode.md b/plutus-core/changelog.d/20260415_215659_ana.pantilie95_safe_opt_mode.md index d8aa835fe75..a6d43d1b9fa 100644 --- a/plutus-core/changelog.d/20260415_215659_ana.pantilie95_safe_opt_mode.md +++ b/plutus-core/changelog.d/20260415_215659_ana.pantilie95_safe_opt_mode.md @@ -1,3 +1,3 @@ ### Added -- Added a new command line option `--safe-optimization` which disables those optimization passes which are not certified. +- Added a new command line option `--certified-opts-only` which disables those optimization passes which are not certified. diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs index 5ce3c3f782e..b54d8677b86 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs @@ -111,30 +111,30 @@ termOptimizer opts builtinSemanticsVariant = runStage stage' = let isIC = either (const False) (const True) stage' - withSafeOpts action - | _ooSafeOpts opts + withCertifiedOptsOnly action + | _ooCertifiedOptsOnly opts , isIC = action - | _ooSafeOpts opts + | _ooCertifiedOptsOnly opts , not isIC = return | otherwise = action in case stage' of FloatDelayStage -> - withSafeOpts floatDelay + withCertifiedOptsOnly floatDelay ForceCaseDelayStage -> - withSafeOpts forceCaseDelay + withCertifiedOptsOnly forceCaseDelay ForceDelayStage -> - withSafeOpts $ + withCertifiedOptsOnly $ case (eqT @uni @PLC.DefaultUni, eqT @fun @DefaultFun) of (Just Refl, Just Refl) -> forceDelay builtinSemanticsVariant _ -> pure CaseOfCaseStage -> - withSafeOpts caseOfCase' + withCertifiedOptsOnly caseOfCase' CaseReduceStage -> - withSafeOpts caseReduce + withCertifiedOptsOnly caseReduce InlineStage -> - withSafeOpts $ + withCertifiedOptsOnly $ inline (_ooInlineCallsiteGrowth opts) (_ooInlineConstants opts) @@ -142,12 +142,12 @@ termOptimizer opts builtinSemanticsVariant = (_ooInlineHints opts) builtinSemanticsVariant CseStage -> - withSafeOpts $ cseNTimes cseTimes + withCertifiedOptsOnly $ cseNTimes cseTimes ApplyToCaseStage -> - withSafeOpts $ + withCertifiedOptsOnly $ if _ooApplyToCase opts then applyToCase else pure LetFloatOutStage -> - withSafeOpts letFloatOut + withCertifiedOptsOnly letFloatOut caseOfCase' :: Term name uni fun a diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize/Opts.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize/Opts.hs index 4b8a800e087..84789e28984 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize/Opts.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize/Opts.hs @@ -11,7 +11,7 @@ module UntypedPlutusCore.Optimize.Opts , ooInlineConstants , ooInlineCallsiteGrowth , ooPreserveLogging - , ooSafeOpts + , ooCertifiedOptsOnly , defaultOptimizeOpts , CseWhichSubterms (..) ) where @@ -41,7 +41,7 @@ data OptimizeOpts name a = OptimizeOpts , _ooInlineCallsiteGrowth :: AstSize , _ooPreserveLogging :: Bool , _ooApplyToCase :: Bool - , _ooSafeOpts :: Bool + , _ooCertifiedOptsOnly :: Bool } deriving stock (Show) @@ -59,5 +59,5 @@ defaultOptimizeOpts = , _ooInlineCallsiteGrowth = 5 , _ooPreserveLogging = True , _ooApplyToCase = True - , _ooSafeOpts = False + , _ooCertifiedOptsOnly = False } diff --git a/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs b/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs index 0883de40239..9776cb93c17 100644 --- a/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs +++ b/plutus-ledger-api/executables/src/PlutusCore/Executable/Parsers.hs @@ -269,7 +269,7 @@ optimizeOpts = do ( long "opt-no-apply-to-case" <> help "Disable apply-to-case optimization" ) - _ooSafeOpts <- + _ooCertifiedOptsOnly <- flag False True diff --git a/plutus-tx-plugin/changelog.d/20260415_215659_ana.pantilie95_safe_opt_mode.md b/plutus-tx-plugin/changelog.d/20260415_215659_ana.pantilie95_safe_opt_mode.md new file mode 100644 index 00000000000..121e724b00d --- /dev/null +++ b/plutus-tx-plugin/changelog.d/20260415_215659_ana.pantilie95_safe_opt_mode.md @@ -0,0 +1,3 @@ +### Added + +- Added a new plugin option `certified-opts-only` which disables those optimisation passes which are not certified to preserve the functional behavior of the original program. diff --git a/plutus-tx-plugin/src/PlutusTx/Options.hs b/plutus-tx-plugin/src/PlutusTx/Options.hs index b041b628f7b..c6895506115 100644 --- a/plutus-tx-plugin/src/PlutusTx/Options.hs +++ b/plutus-tx-plugin/src/PlutusTx/Options.hs @@ -85,7 +85,7 @@ data PluginOptions = PluginOptions _posRemoveTrace :: Bool , _posDumpCompilationTrace :: Bool , _posCertify :: Maybe String - , _posSafeOpts :: Bool + , _posCertifiedOptsOnly :: Bool } makeLenses ''PluginOptions @@ -340,11 +340,11 @@ pluginOptions = rest <- many (alphaNumChar <|> char '_' <|> char '\\') pure (firstC : rest) in (k, PluginOption typeRep (plcParserOption p k) posCertify desc []) - , let k = "safe-optimisation" + , let k = "certified-opts-only" desc = "Run only those optimisation passes which are certified to preserve the functional " <> "behavior of the original program." - in (k, PluginOption typeRep (setTrue k) posSafeOpts desc []) + in (k, PluginOption typeRep (setTrue k) posCertifiedOptsOnly desc []) ] flag :: (a -> a) -> OptionKey -> Maybe OptionValue -> Validation ParseError (a -> a) @@ -420,7 +420,7 @@ defaultPluginOptions = , _posRemoveTrace = False , _posDumpCompilationTrace = False , _posCertify = Nothing - , _posSafeOpts = False + , _posCertifiedOptsOnly = False } processOne diff --git a/plutus-tx-plugin/src/PlutusTx/Plugin/Common.hs b/plutus-tx-plugin/src/PlutusTx/Plugin/Common.hs index 3c727e654ee..5184c0aee04 100644 --- a/plutus-tx-plugin/src/PlutusTx/Plugin/Common.hs +++ b/plutus-tx-plugin/src/PlutusTx/Plugin/Common.hs @@ -807,6 +807,9 @@ runCompiler moduleName opts expr = do & set (PLC.coOptimizeOpts . UPLC.ooApplyToCase) (opts ^. posApplyToCase) + & set + (PLC.coOptimizeOpts . UPLC.ooCertifiedOptsOnly) + (opts ^. posCertifiedOptsOnly) -- GHC.Core -> Pir translation. pirT <- original <$> (PIR.runDefT annMayInline $ compileExprWithDefs expr) From 5eae7b1d668c4cbb75537d5d60d9e251bca33ea0 Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Thu, 16 Apr 2026 18:58:54 +0300 Subject: [PATCH 14/16] Fix docs --- .../src/UntypedPlutusCore/Transform/Certify/Trace.hs | 4 ++-- plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs index 2f6723a590f..e6acd9f8e08 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs @@ -11,7 +11,7 @@ import Control.DeepSeq import GHC.Generics {-| Datatype which represents optimization passes which are also -certified (__I__mplemented in the __C__ertifier). +certified. This means that these passes are formalized as part of the certifier, and adding a new pass constructor to this type means that it is expected @@ -28,7 +28,7 @@ data CertifiedOptStage deriving anyclass (NFData) {-| Datatype which represents optimization passes which are not yet -certified (__N__ot __I__mplemented in the __C__ertifier). +certified. IMPORTANT: if you add a new pass, or modify an existing pass, without also modifying the certifier in the same PR, you must add/move its diff --git a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md index 04b0c09963d..e197392a40c 100644 --- a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md @@ -20,8 +20,8 @@ open Maybe ``` ## Pass tags We enumerate the known passes and partition them into two categories: -- *N*ot *I*mplemented in the *C*ertifier -- *I*mplemented in the *C*ertifier +- those which are not yet (fully) implemented in the certifier +- those which are implemented in the certifier and we know they are correct. ``` From a97625b6064ef0b00970d693d4857e18cd7eb325 Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Fri, 17 Apr 2026 13:17:15 +0300 Subject: [PATCH 15/16] Address review comments --- .../src/UntypedPlutusCore/Optimize.hs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs index b54d8677b86..b8b30c1c0fe 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs @@ -31,6 +31,7 @@ import UntypedPlutusCore.Transform.LetFloatOut (letFloatOut) import UntypedPlutusCore.Transform.Optimizer import Control.Monad +import Data.Either (isRight) import Data.List as List (foldl') import Data.Typeable import Data.Vector.Orphans () @@ -110,14 +111,9 @@ termOptimizer opts builtinSemanticsVariant = >=> runStage InlineStage runStage stage' = - let isIC = either (const False) (const True) stage' + let certified = isRight stage' withCertifiedOptsOnly action - | _ooCertifiedOptsOnly opts - , isIC = - action - | _ooCertifiedOptsOnly opts - , not isIC = - return + | _ooCertifiedOptsOnly opts && not certified = pure | otherwise = action in case stage' of FloatDelayStage -> From 796f0bd6e4f91907685a1681fa52b2e058a8db19 Mon Sep 17 00:00:00 2001 From: Ana Pantilie Date: Sat, 18 Apr 2026 01:07:46 +0300 Subject: [PATCH 16/16] WIP --- .../certifier/src/Certifier/Common.hs | 2 + plutus-core/plutus-core.cabal | 2 + .../plutus-core/src/PlutusCore/Compiler.hs | 19 +- .../Transform/StrictLetRec/Tests/Lib.hs | 2 +- plutus-core/testlib/PlutusCore/Test.hs | 3 +- .../src/UntypedPlutusCore/Core/Type.hs | 5 + .../src/UntypedPlutusCore/Optimize.hs | 73 +- .../Transform/Certify/Trace.hs | 55 + .../Transform/EvaluateBuiltins.hs | 158 ++ .../UntypedPlutusCore/Transform/Optimizer.hs | 2 + plutus-core/untyped-plutus-core/test/Spec.hs | 2 + .../cfAddInteger.golden.certifier-hints | 35 + .../EvaluateBuiltins/cfAddInteger.golden.uplc | 1 + .../cfAppendByteString.golden.certifier-hints | 35 + .../cfAppendByteString.golden.uplc | 1 + ...StringCertifiedOnly.golden.certifier-hints | 26 + ...fAppendByteStringCertifiedOnly.golden.uplc | 1 + .../cfDivisionByZero.golden.certifier-hints | 35 + .../cfDivisionByZero.golden.uplc | 1 + .../cfEqualsInteger.golden.certifier-hints | 35 + .../cfEqualsInteger.golden.uplc | 1 + .../cfIfThenElse.golden.certifier-hints | 38 + .../EvaluateBuiltins/cfIfThenElse.golden.uplc | 1 + .../cfNested.golden.certifier-hints | 39 + .../EvaluateBuiltins/cfNested.golden.uplc | 1 + .../cfUnderApplied.golden.certifier-hints | 33 + .../cfUnderApplied.golden.uplc | 1 + .../Transform/basic.golden.certifier-hints | 8 +- .../basicInline.golden.certifier-hints | 8 +- .../callsiteInline.golden.certifier-hints | 8 +- .../test/Transform/cse2.golden.uplc | 5 +- .../test/Transform/cseExpensive.golden.uplc | 764 +++------ .../test/Transform/csePlusTree.golden.uplc | 2 +- .../extraDelays.golden.certifier-hints | 8 +- .../floatDelay1.golden.certifier-hints | 8 +- .../test/Transform/floatDelay1.golden.uplc | 2 +- .../floatDelay2.golden.certifier-hints | 8 +- .../test/Transform/floatDelay2.golden.uplc | 2 +- .../floatDelay3.golden.certifier-hints | 8 +- ...rceCaseDelayNoApps1.golden.certifier-hints | 8 +- ...rceCaseDelayNoApps2.golden.certifier-hints | 8 +- ...aseDelayNoApps2Fail.golden.certifier-hints | 8 +- ...eCaseDelayWithApps1.golden.certifier-hints | 8 +- ...eCaseDelayWithApps2.golden.certifier-hints | 8 +- ...eDelayWithApps2Fail.golden.certifier-hints | 8 +- .../forceDelayComplex.golden.certifier-hints | 8 +- ...orceDelayMultiApply.golden.certifier-hints | 8 +- ...orceDelayMultiForce.golden.certifier-hints | 8 +- .../forceDelayNoApps.golden.certifier-hints | 8 +- ...eDelayNoAppsLayered.golden.certifier-hints | 8 +- .../forceDelaySimple.golden.certifier-hints | 8 +- .../inlineImpure1.golden.certifier-hints | 8 +- .../inlineImpure2.golden.certifier-hints | 8 +- .../inlineImpure3.golden.certifier-hints | 8 +- .../inlineImpure4.golden.certifier-hints | 8 +- .../inlinePure1.golden.certifier-hints | 8 +- .../inlinePure2.golden.certifier-hints | 8 +- .../inlinePure3.golden.certifier-hints | 8 +- .../inlinePure4.golden.certifier-hints | 8 +- .../interveningLambda.golden.certifier-hints | 8 +- .../letFloatOutCase1.golden.certifier-hints | 8 +- .../letFloatOutCase2.golden.certifier-hints | 8 +- .../letFloatOutForce.golden.certifier-hints | 8 +- .../Transform/multiApp.golden.certifier-hints | 8 +- .../Transform/nested.golden.certifier-hints | 8 +- .../Transform/EvaluateBuiltins/Spec.hs | 173 +++ .../testlib/Transform/Simplify/Lib.hs | 3 + plutus-executables/executables/pir/Main.hs | 5 +- plutus-executables/executables/uplc/Main.hs | 6 +- .../plutus/AnyProgram/Compile.hs | 5 +- .../certifier/Test/Certifier/Executable.hs | 2 + plutus-metatheory/plutus-metatheory.cabal | 1 + .../src/CertifierReport.lagda.md | 3 + plutus-metatheory/src/FFI/AgdaUnparse.hs | 2 + .../src/MAlonzo/Code/Certifier.hs | 24 +- .../src/MAlonzo/Code/CertifierReport.hs | 144 +- .../src/MAlonzo/Code/VerifiedCompilation.hs | 65 +- .../Code/VerifiedCompilation/Certificate.hs | 20 +- .../MAlonzo/Code/VerifiedCompilation/Trace.hs | 484 ++++-- .../Code/VerifiedCompilation/UApplyToCase.hs | 24 +- .../MAlonzo/Code/VerifiedCompilation/UCSE.hs | 6 +- .../Code/VerifiedCompilation/UCaseOfCase.hs | 18 +- .../Code/VerifiedCompilation/UCaseReduce.hs | 8 +- .../Code/VerifiedCompilation/UConstantFold.hs | 1376 +++++++++++++++++ .../Code/VerifiedCompilation/UFloatDelay.hs | 12 +- .../VerifiedCompilation/UForceCaseDelay.hs | 18 +- .../Code/VerifiedCompilation/UForceDelay.hs | 78 +- .../Code/VerifiedCompilation/UInline.hs | 105 +- .../VerifiedCompilation/UntypedTranslation.hs | 8 +- .../src/VerifiedCompilation.lagda.md | 3 + .../src/VerifiedCompilation/Trace.lagda.md | 22 +- .../UConstantFold.lagda.md | 217 +++ .../certifier-report/Test/Certifier/Report.hs | 2 + .../src/PlutusTx/Plugin/Common.hs | 2 +- .../test/Budget/9.6/applicative.golden.eval | 8 +- .../test/Budget/9.6/applicative.golden.uplc | 2 +- .../test/Budget/9.6/monadicDo.golden.eval | 8 +- .../test/Budget/9.6/monadicDo.golden.uplc | 2 +- .../test/Budget/9.6/toFromData.golden.eval | 8 +- .../test/Budget/9.6/toFromData.golden.uplc | 83 +- plutus-tx/src/PlutusTx/Lift.hs | 4 +- 101 files changed, 3450 insertions(+), 1147 deletions(-) create mode 100644 plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/EvaluateBuiltins.hs create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAddInteger.golden.certifier-hints create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAddInteger.golden.uplc create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteString.golden.certifier-hints create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteString.golden.uplc create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteStringCertifiedOnly.golden.certifier-hints create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteStringCertifiedOnly.golden.uplc create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfDivisionByZero.golden.certifier-hints create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfDivisionByZero.golden.uplc create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfEqualsInteger.golden.certifier-hints create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfEqualsInteger.golden.uplc create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfIfThenElse.golden.certifier-hints create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfIfThenElse.golden.uplc create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfNested.golden.certifier-hints create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfNested.golden.uplc create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfUnderApplied.golden.certifier-hints create mode 100644 plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfUnderApplied.golden.uplc create mode 100644 plutus-core/untyped-plutus-core/testlib/Transform/EvaluateBuiltins/Spec.hs create mode 100644 plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UConstantFold.hs create mode 100644 plutus-metatheory/src/VerifiedCompilation/UConstantFold.lagda.md diff --git a/plutus-benchmark/certifier/src/Certifier/Common.hs b/plutus-benchmark/certifier/src/Certifier/Common.hs index 8cda043ca84..4b3977bf6e7 100644 --- a/plutus-benchmark/certifier/src/Certifier/Common.hs +++ b/plutus-benchmark/certifier/src/Certifier/Common.hs @@ -8,6 +8,7 @@ import FFI.OptimizerTrace import FFI.Untyped (UTerm) import PlutusBenchmark.Common (getDataDir) import PlutusCore.Default.Builtins +import PlutusCore.Evaluation.Machine.ExBudgetingDefaults (defaultBuiltinCostModelForTesting) import PlutusCore.Quote import PlutusLedgerApi.Common import System.FilePath @@ -47,6 +48,7 @@ simplify = & ooPreserveLogging .~ False ) DefaultFunSemanticsVariantE + defaultBuiltinCostModelForTesting testScripts :: [FilePath] testScripts = diff --git a/plutus-core/plutus-core.cabal b/plutus-core/plutus-core.cabal index e357ae02027..3e1311943d1 100644 --- a/plutus-core/plutus-core.cabal +++ b/plutus-core/plutus-core.cabal @@ -230,6 +230,7 @@ library UntypedPlutusCore.Transform.Certify.Hints UntypedPlutusCore.Transform.Certify.Trace UntypedPlutusCore.Transform.Cse + UntypedPlutusCore.Transform.EvaluateBuiltins UntypedPlutusCore.Transform.FloatDelay UntypedPlutusCore.Transform.ForceCaseDelay UntypedPlutusCore.Transform.ForceDelay @@ -479,6 +480,7 @@ library untyped-plutus-core-testlib Generators.Spec Scoping.Spec Transform.CaseOfCase.Spec + Transform.EvaluateBuiltins.Spec Transform.Inline.Spec Transform.Simplify.Lib Transform.Simplify.Spec diff --git a/plutus-core/plutus-core/src/PlutusCore/Compiler.hs b/plutus-core/plutus-core/src/PlutusCore/Compiler.hs index cc07a347c7c..c69cf4d1996 100644 --- a/plutus-core/plutus-core/src/PlutusCore/Compiler.hs +++ b/plutus-core/plutus-core/src/PlutusCore/Compiler.hs @@ -5,6 +5,7 @@ module PlutusCore.Compiler , compileProgramWithTrace ) where +import PlutusCore.Builtin (CostingPart) import PlutusCore.Compiler.Erase import PlutusCore.Compiler.Opts as Opts import PlutusCore.Compiler.Types @@ -22,23 +23,25 @@ compileTerm :: ( Compiling m uni fun name a , MonadReader (CompilationOpts name fun a) m ) - => Term tyname name uni fun a + => CostingPart uni fun + -> Term tyname name uni fun a -> m (UPLC.Term name uni fun a) -compileTerm t = do +compileTerm costingPart t = do optimizeOpts <- view coOptimizeOpts builtinSemanticsVariant <- view coBuiltinSemanticsVariant let erased = eraseTerm t renamed <- rename erased - UPLC.optimizeTerm optimizeOpts builtinSemanticsVariant renamed + UPLC.optimizeTerm optimizeOpts builtinSemanticsVariant costingPart renamed -- | Compile a PLC program to UPLC, and optimize it. compileProgram :: ( Compiling m uni fun name a , MonadReader (CompilationOpts name fun a) m ) - => Program tyname name uni fun a + => CostingPart uni fun + -> Program tyname name uni fun a -> m (UPLC.Program name uni fun a) -compileProgram (Program a v t) = UPLC.Program a v <$> compileTerm t +compileProgram costingPart (Program a v t) = UPLC.Program a v <$> compileTerm costingPart t {-| Compile a PLC program to UPLC, and optimize it. This includes the compilation trace in the result. -} @@ -46,9 +49,10 @@ compileProgramWithTrace :: ( Compiling m uni fun name a , MonadReader (CompilationOpts name fun a) m ) - => Program tyname name uni fun a + => CostingPart uni fun + -> Program tyname name uni fun a -> m (UPLC.Program name uni fun a, UPLC.OptimizerTrace name uni fun a) -compileProgramWithTrace (Program a v t) = do +compileProgramWithTrace costingPart (Program a v t) = do optimizeOpts <- view coOptimizeOpts builtinSemanticsVariant <- view coBuiltinSemanticsVariant let erased = eraseTerm t @@ -56,4 +60,5 @@ compileProgramWithTrace (Program a v t) = do UPLC.optimizeProgramWithTrace optimizeOpts builtinSemanticsVariant + costingPart renamedProgram diff --git a/plutus-core/plutus-ir/test/PlutusIR/Transform/StrictLetRec/Tests/Lib.hs b/plutus-core/plutus-ir/test/PlutusIR/Transform/StrictLetRec/Tests/Lib.hs index 81336af95a5..11f667eca97 100644 --- a/plutus-core/plutus-ir/test/PlutusIR/Transform/StrictLetRec/Tests/Lib.hs +++ b/plutus-core/plutus-ir/test/PlutusIR/Transform/StrictLetRec/Tests/Lib.hs @@ -91,7 +91,7 @@ compileTplcProgramOrFail -> m (UPLC.Program Name DefaultUni DefaultFun ()) compileTplcProgramOrFail plcProgram = handlePirErrorByFailing @SrcSpan =<< do - TPLC.compileProgram plcProgram + TPLC.compileProgram defaultBuiltinCostModelForTesting plcProgram & flip runReaderT TPLC.defaultCompilationOpts & runQuoteT & runExceptT diff --git a/plutus-core/testlib/PlutusCore/Test.hs b/plutus-core/testlib/PlutusCore/Test.hs index be8cdad0c95..9f393cc24c7 100644 --- a/plutus-core/testlib/PlutusCore/Test.hs +++ b/plutus-core/testlib/PlutusCore/Test.hs @@ -194,6 +194,7 @@ instance , TPLC.GEq uni , TPLC.Closed uni , TPLC.Everywhere uni Eq + , Default (CostingPart uni fun) ) => ToUPlc (TPLC.Program TPLC.TyName UPLC.Name uni fun ()) uni fun where @@ -201,7 +202,7 @@ instance pure . TPLC.runQuote . flip runReaderT TPLC.defaultCompilationOpts - . TPLC.compileProgram + . TPLC.compileProgram def instance ToUPlc (UPLC.Program UPLC.NamedDeBruijn uni fun ()) uni fun where toUPlc p = diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Core/Type.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Core/Type.hs index 5bb131cd520..f1890dbaad9 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Core/Type.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Core/Type.hs @@ -34,6 +34,7 @@ import PlutusPrelude import Data.Vector import PlutusCore.Builtin qualified as TPLC import PlutusCore.Core qualified as TPLC +import PlutusCore.Evaluation.Machine.ExMemoryUsage (ExMemoryUsage (..)) import PlutusCore.MkPlc import PlutusCore.Name.Unique qualified as TPLC import Universe @@ -152,6 +153,10 @@ instance TPLC.HasConstant (Term name uni fun ()) where fromConstant = Constant () +-- See Note [ExMemoryUsage instances for non-constants]. +instance ExMemoryUsage (Term name uni fun ann) where + memoryUsage = Prelude.error "Internal error: 'memoryUsage' for UPLC 'Term' is not supposed to be forced" + type instance TPLC.HasUniques (Term name uni fun ann) = TPLC.HasUnique name TPLC.TermUnique type instance TPLC.HasUniques (Program name uni fun ann) = TPLC.HasUniques (Term name uni fun ann) diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs index b8b30c1c0fe..4f1f88a23ed 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Optimize.hs @@ -13,6 +13,7 @@ module UntypedPlutusCore.Optimize , module UntypedPlutusCore.Transform.Optimizer ) where +import PlutusCore.Builtin import PlutusCore.Compiler.Types import PlutusCore.Default qualified as PLC import PlutusCore.Default.Builtins @@ -23,6 +24,7 @@ import UntypedPlutusCore.Transform.ApplyToCase (applyToCase) import UntypedPlutusCore.Transform.CaseOfCase import UntypedPlutusCore.Transform.CaseReduce import UntypedPlutusCore.Transform.Cse +import UntypedPlutusCore.Transform.EvaluateBuiltins (certifiedBuiltinToFun, evaluateBuiltins) import UntypedPlutusCore.Transform.FloatDelay (floatDelay) import UntypedPlutusCore.Transform.ForceCaseDelay (forceCaseDelay) import UntypedPlutusCore.Transform.ForceDelay (forceDelay) @@ -33,30 +35,34 @@ import UntypedPlutusCore.Transform.Optimizer import Control.Monad import Data.Either (isRight) import Data.List as List (foldl') +import Data.Set qualified as Set import Data.Typeable import Data.Vector.Orphans () +import Universe (Some (..), ValueOf (..)) optimizeProgram :: forall name uni fun m a . Compiling m uni fun name a => OptimizeOpts name a -> BuiltinSemanticsVariant fun + -> CostingPart uni fun -> Program name uni fun a -> m (Program name uni fun a) -optimizeProgram opts builtinSemanticsVariant (Program a v t) = - Program a v <$> optimizeTerm opts builtinSemanticsVariant t +optimizeProgram opts builtinSemanticsVariant costingPart (Program a v t) = + Program a v <$> optimizeTerm opts builtinSemanticsVariant costingPart t optimizeProgramWithTrace :: forall name uni fun m a . Compiling m uni fun name a => OptimizeOpts name a -> BuiltinSemanticsVariant fun + -> CostingPart uni fun -> Program name uni fun a -> m (Program name uni fun a, OptimizerTrace name uni fun a) -optimizeProgramWithTrace opts builtinSemanticsVariant (Program a v t) = do +optimizeProgramWithTrace opts builtinSemanticsVariant costingPart (Program a v t) = do (result, trace) <- runOptimizerT $ - termOptimizer opts builtinSemanticsVariant t + termOptimizer opts builtinSemanticsVariant costingPart t pure (Program a v result, trace) optimizeTerm @@ -64,19 +70,21 @@ optimizeTerm . Compiling m uni fun name a => OptimizeOpts name a -> BuiltinSemanticsVariant fun + -> CostingPart uni fun -> Term name uni fun a -> m (Term name uni fun a) -optimizeTerm opts builtinSemanticsVariant term = - evalOptimizerT $ termOptimizer opts builtinSemanticsVariant term +optimizeTerm opts builtinSemanticsVariant costingPart term = + evalOptimizerT $ termOptimizer opts builtinSemanticsVariant costingPart term termOptimizer :: forall name uni fun m a . Compiling m uni fun name a => OptimizeOpts name a -> BuiltinSemanticsVariant fun + -> CostingPart uni fun -> Term name uni fun a -> OptimizerT name uni fun a m (Term name uni fun a) -termOptimizer opts builtinSemanticsVariant = +termOptimizer opts builtinSemanticsVariant costingPart = simplifyNTimes (_ooMaxSimplifierIterations opts) >=> runStage CseStage >=> runStage ApplyToCaseStage @@ -109,6 +117,8 @@ termOptimizer opts builtinSemanticsVariant = >=> runStage CaseOfCaseStage >=> runStage CaseReduceStage >=> runStage InlineStage + >=> runStage ConstantFoldStage + >=> runStage UncertifiedConstantFoldStage runStage stage' = let certified = isRight stage' @@ -144,6 +154,45 @@ termOptimizer opts builtinSemanticsVariant = if _ooApplyToCase opts then applyToCase else pure LetFloatOutStage -> withCertifiedOptsOnly letFloatOut + ConstantFoldStage -> + withCertifiedOptsOnly $ + case eqT @fun @DefaultFun of + Just Refl -> + evaluateBuiltins + (_ooPreserveLogging opts) + builtinSemanticsVariant + costingPart + (`Set.member` certifiedFuns) + (const True) + ConstantFoldStage + Nothing -> pure + UncertifiedConstantFoldStage -> + withCertifiedOptsOnly $ + case (eqT @fun @DefaultFun, eqT @uni @PLC.DefaultUni) of + (Just Refl, Just Refl) -> + evaluateBuiltins + (_ooPreserveLogging opts) + builtinSemanticsVariant + costingPart + (`Set.notMember` certifiedFuns) + defaultUniConstantIsSerializable + UncertifiedConstantFoldStage + (Just Refl, Nothing) -> + evaluateBuiltins + (_ooPreserveLogging opts) + builtinSemanticsVariant + costingPart + (`Set.notMember` certifiedFuns) + (const True) + UncertifiedConstantFoldStage + (Nothing, _) -> + evaluateBuiltins + (_ooPreserveLogging opts) + builtinSemanticsVariant + costingPart + (const True) + (const True) + UncertifiedConstantFoldStage caseOfCase' :: Term name uni fun a @@ -162,3 +211,13 @@ termOptimizer opts builtinSemanticsVariant = _ -> pure cseTimes = if _ooConservativeOpts opts then 0 else _ooMaxCseIterations opts + + certifiedFuns :: Set.Set DefaultFun + certifiedFuns = Set.fromList (map certifiedBuiltinToFun [minBound .. maxBound]) + +defaultUniConstantIsSerializable :: Some (ValueOf PLC.DefaultUni) -> Bool +defaultUniConstantIsSerializable c = case c of + Some (ValueOf PLC.DefaultUniBLS12_381_G1_Element _) -> False + Some (ValueOf PLC.DefaultUniBLS12_381_G2_Element _) -> False + Some (ValueOf PLC.DefaultUniBLS12_381_MlResult _) -> False + _ -> True diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs index e6acd9f8e08..e2be25d6e97 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Certify/Trace.hs @@ -24,6 +24,7 @@ data CertifiedOptStage | Inline | CSE | ApplyToCase + | ConstantFold deriving stock (Show, Generic) deriving anyclass (NFData) @@ -37,6 +38,7 @@ at https://github.com/IntersectMBO/plutus/issues. -} data UncertifiedOptStage = CaseOfCase | LetFloatOut + | UncertifiedConstantFold deriving stock (Show, Generic) deriving anyclass (NFData) @@ -69,6 +71,12 @@ pattern CaseOfCaseStage = Left CaseOfCase pattern LetFloatOutStage :: OptStage pattern LetFloatOutStage = Left LetFloatOut +pattern ConstantFoldStage :: OptStage +pattern ConstantFoldStage = Right ConstantFold + +pattern UncertifiedConstantFoldStage :: OptStage +pattern UncertifiedConstantFoldStage = Left UncertifiedConstantFold + {-# COMPLETE FloatDelayStage , ForceDelayStage @@ -77,10 +85,57 @@ pattern LetFloatOutStage = Left LetFloatOut , InlineStage , CseStage , ApplyToCaseStage + , ConstantFoldStage , CaseOfCaseStage , LetFloatOutStage + , UncertifiedConstantFoldStage #-} +{-| The set of 'DefaultFun' builtins that can be constant-folded in the +certified optimization stage, i.e. those whose Agda implementations use +only native Agda operations (no postulated functions). + +This type is FFI-linked to the Agda certifier via a @COMPILE GHC@ pragma. +Adding a constructor here requires adding the corresponding native Agda +implementation in the certifier; the Agda compiler will reject the build if +the two types diverge in constructor count or order. -} +data CertifiedBuiltin + = CertAddInteger + | CertSubtractInteger + | CertMultiplyInteger + | CertDivideInteger + | CertQuotientInteger + | CertRemainderInteger + | CertModInteger + | CertEqualsInteger + | CertLessThanInteger + | CertLessThanEqualsInteger + | CertIfThenElse + | CertChooseUnit + | CertFstPair + | CertSndPair + | CertChooseList + | CertMkCons + | CertHeadList + | CertTailList + | CertNullList + | CertDropList + | CertChooseData + | CertConstrData + | CertMapData + | CertListData + | CertIData + | CertUnConstrData + | CertUnMapData + | CertUnListData + | CertUnIData + | CertEqualsData + | CertMkPairData + | CertMkNilData + | CertMkNilPairData + deriving stock (Show, Eq, Ord, Enum, Bounded, Generic) + deriving anyclass (NFData) + data Optimization name uni fun a = Optimization { beforeAST :: Term name uni fun a diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/EvaluateBuiltins.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/EvaluateBuiltins.hs new file mode 100644 index 00000000000..ee7d95079b1 --- /dev/null +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/EvaluateBuiltins.hs @@ -0,0 +1,158 @@ +{-# LANGUAGE LambdaCase #-} +{-# LANGUAGE ViewPatterns #-} + +{-| A pass that evaluates fully-applied builtin applications in the program. +This functions as a generic constant-folding pass. -} +module UntypedPlutusCore.Transform.EvaluateBuiltins + ( evaluateBuiltins + , certifiedBuiltinToFun + ) where + +import PlutusCore.Builtin +import PlutusCore.Default.Builtins (DefaultFun (..)) +import UntypedPlutusCore.Core.Plated (termSubterms) +import UntypedPlutusCore.Core.Type +import UntypedPlutusCore.Transform.Certify.Trace qualified as Trace +import UntypedPlutusCore.Transform.Optimizer + +import Control.Lens (transformOf) +import Data.Functor (void) +import Universe (Some (..), ValueOf (..)) + +{-| Application context for UPLC terms. Unlike the PIR @AppContext@, there are +no type applications, so 'Force' takes the place of 'TypeAppContext'. -} +data AppContext name uni fun a + = TermAppContext (Term name uni fun a) a (AppContext name uni fun a) + | ForceContext a (AppContext name uni fun a) + | AppContextEnd + +{-| Split a term into its head and the sequence of 'Apply'/'Force' wrappers +surrounding it. This handles 'Force' in addition to 'Apply', unlike the +exported 'splitApplication'. -} +splitBuiltinApplication + :: Term name uni fun a + -> (Term name uni fun a, AppContext name uni fun a) +splitBuiltinApplication = go AppContextEnd + where + go ctx = \case + Apply ann fun arg -> go (TermAppContext arg ann ctx) fun + Force ann t -> go (ForceContext ann ctx) t + t -> (t, ctx) + +{-| Evaluate fully-applied builtin applications. + +The @shouldFold@ predicate determines which builtins may be folded; use +'certifiedBuiltins' for the certified subset or @const True@ for all builtins. + +The @isSerializableConstant@ predicate guards against introducing constants +that cannot be flat-encoded (e.g. BLS12-381 group elements). +See Note [Unserializable constants] in PlutusIR.Analysis.Builtins. -} +evaluateBuiltins + :: forall name uni fun m a + . ( Monad m + , ToBuiltinMeaning uni fun + , Typeable name + ) + => Bool + -- ^ If 'True', do not fold builtins that emit logs (e.g. @trace@). + -> BuiltinSemanticsVariant fun + -> CostingPart uni fun + -> (fun -> Bool) + -- ^ Which builtins to fold. + -> (Some (ValueOf uni) -> Bool) + {-^ Whether a constant produced by folding is serializable. Return 'False' + to prevent the fold from introducing an unserializable constant into the + program (e.g. BLS12-381 group elements). -} + -> Trace.OptStage + -> Term name uni fun a + -> OptimizerT name uni fun a m (Term name uni fun a) +evaluateBuiltins preserveLogging semVar costModel shouldFold isSerializableConstant optStage term = do + let result = transformOf termSubterms processTerm term + recordOptimization term optStage result + pure result + where + eval + :: BuiltinRuntime (Term name uni fun ()) + -> AppContext name uni fun a + -> Maybe (Term name uni fun ()) + eval (BuiltinCostedResult _ getFXs) AppContextEnd = + case getFXs of + BuiltinSuccess y -> Just y + -- Leave terms that produce logs if we're asked to preserve logging + -- behaviour (e.g. `trace "hello" x` in certified mode). + BuiltinSuccessWithLogs _ y -> if preserveLogging then Nothing else Just y + -- Evaluation failure (e.g. divideInteger 1 0) – leave unchanged. + BuiltinFailure {} -> Nothing + eval (BuiltinExpectArgument toRuntime) (TermAppContext arg _ ctx) = + eval (toRuntime $ void arg) ctx + eval (BuiltinExpectForce runtime) (ForceContext _ ctx) = + eval runtime ctx + -- Argument mismatch (including under-application) – leave unchanged. + eval _ _ = Nothing + + termIsSerializable :: Term name uni fun () -> Bool + termIsSerializable = \case + Constant _ c -> isSerializableConstant c + Var {} -> True + Builtin {} -> True + Error {} -> True + LamAbs _ _ body -> termIsSerializable body + Delay _ body -> termIsSerializable body + Force _ body -> termIsSerializable body + Apply _ f arg -> termIsSerializable f && termIsSerializable arg + Constr _ _ args -> all termIsSerializable args + Case _ scrut alts -> termIsSerializable scrut && all termIsSerializable alts + + processTerm :: Term name uni fun a -> Term name uni fun a + processTerm t = case splitBuiltinApplication t of + (Builtin x bn, argCtx) + | shouldFold bn -> + let runtime = toBuiltinRuntime costModel (toBuiltinMeaning semVar bn) + in case eval runtime argCtx of + -- Replace all annotations in the result with the annotation of + -- the Builtin node (see the analogous note in PIR.EvaluateBuiltins). + -- Guard against introducing unserializable constants (e.g. BLS + -- group elements); see Note [Unserializable constants]. + Just t' | termIsSerializable t' -> x <$ t' + _ -> t + _ -> t + +{-| Map each 'Trace.CertifiedBuiltin' to its corresponding 'DefaultFun'. +This is the single authoritative mapping between the FFI-linked +'Trace.CertifiedBuiltin' type (shared with the Agda certifier) and +the Haskell 'DefaultFun' enum. -} +certifiedBuiltinToFun :: Trace.CertifiedBuiltin -> DefaultFun +certifiedBuiltinToFun = \case + Trace.CertAddInteger -> AddInteger + Trace.CertSubtractInteger -> SubtractInteger + Trace.CertMultiplyInteger -> MultiplyInteger + Trace.CertDivideInteger -> DivideInteger + Trace.CertQuotientInteger -> QuotientInteger + Trace.CertRemainderInteger -> RemainderInteger + Trace.CertModInteger -> ModInteger + Trace.CertEqualsInteger -> EqualsInteger + Trace.CertLessThanInteger -> LessThanInteger + Trace.CertLessThanEqualsInteger -> LessThanEqualsInteger + Trace.CertIfThenElse -> IfThenElse + Trace.CertChooseUnit -> ChooseUnit + Trace.CertFstPair -> FstPair + Trace.CertSndPair -> SndPair + Trace.CertChooseList -> ChooseList + Trace.CertMkCons -> MkCons + Trace.CertHeadList -> HeadList + Trace.CertTailList -> TailList + Trace.CertNullList -> NullList + Trace.CertDropList -> DropList + Trace.CertChooseData -> ChooseData + Trace.CertConstrData -> ConstrData + Trace.CertMapData -> MapData + Trace.CertListData -> ListData + Trace.CertIData -> IData + Trace.CertUnConstrData -> UnConstrData + Trace.CertUnMapData -> UnMapData + Trace.CertUnListData -> UnListData + Trace.CertUnIData -> UnIData + Trace.CertEqualsData -> EqualsData + Trace.CertMkPairData -> MkPairData + Trace.CertMkNilData -> MkNilData + Trace.CertMkNilPairData -> MkNilPairData diff --git a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Optimizer.hs b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Optimizer.hs index ddd01a503b6..a5ba6037419 100644 --- a/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Optimizer.hs +++ b/plutus-core/untyped-plutus-core/src/UntypedPlutusCore/Transform/Optimizer.hs @@ -12,6 +12,8 @@ module UntypedPlutusCore.Transform.Optimizer , pattern Trace.ApplyToCaseStage , pattern Trace.CaseOfCaseStage , pattern Trace.LetFloatOutStage + , pattern Trace.ConstantFoldStage + , pattern Trace.UncertifiedConstantFoldStage , Trace.OptimizerTrace (..) , Trace.Optimization (..) , runOptimizerT diff --git a/plutus-core/untyped-plutus-core/test/Spec.hs b/plutus-core/untyped-plutus-core/test/Spec.hs index 0accb0b0c75..5fb2951d184 100644 --- a/plutus-core/untyped-plutus-core/test/Spec.hs +++ b/plutus-core/untyped-plutus-core/test/Spec.hs @@ -17,6 +17,7 @@ import Flat.Spec (test_flat) import Generators.Spec (test_parsing) import Scoping.Spec (test_names) import Transform.CaseOfCase.Spec (test_caseOfCase) +import Transform.EvaluateBuiltins.Spec (test_evaluateBuiltins) import Transform.Inline.Spec (test_inline) import Transform.Simplify.Spec (test_simplify) @@ -32,6 +33,7 @@ main = do , test_builtins , test_budget , test_caseOfCase + , test_evaluateBuiltins , test_inline , test_golden , test_tallying diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAddInteger.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAddInteger.golden.certifier-hints new file mode 100644 index 00000000000..434bc0a0ebc --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAddInteger.golden.certifier-hints @@ -0,0 +1,35 @@ +-- Certifier hints #1 (Right FloatDelay) -- +NoHints + +-- Certifier hints #2 (Right ForceCaseDelay) -- +NoHints + +-- Certifier hints #3 (Left LetFloatOut) -- +NoHints + +-- Certifier hints #4 (Right ForceDelay) -- +NoHints + +-- Certifier hints #5 (Left CaseOfCase) -- +NoHints + +-- Certifier hints #6 (Right CaseReduce) -- +NoHints + +-- Certifier hints #7 (Right Inline) -- +InlApply + InlApply + InlBuiltin + InlCon + InlCon + + +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- +NoHints + diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAddInteger.golden.uplc b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAddInteger.golden.uplc new file mode 100644 index 00000000000..e440e5c8425 --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAddInteger.golden.uplc @@ -0,0 +1 @@ +3 \ No newline at end of file diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteString.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteString.golden.certifier-hints new file mode 100644 index 00000000000..434bc0a0ebc --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteString.golden.certifier-hints @@ -0,0 +1,35 @@ +-- Certifier hints #1 (Right FloatDelay) -- +NoHints + +-- Certifier hints #2 (Right ForceCaseDelay) -- +NoHints + +-- Certifier hints #3 (Left LetFloatOut) -- +NoHints + +-- Certifier hints #4 (Right ForceDelay) -- +NoHints + +-- Certifier hints #5 (Left CaseOfCase) -- +NoHints + +-- Certifier hints #6 (Right CaseReduce) -- +NoHints + +-- Certifier hints #7 (Right Inline) -- +InlApply + InlApply + InlBuiltin + InlCon + InlCon + + +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- +NoHints + diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteString.golden.uplc b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteString.golden.uplc new file mode 100644 index 00000000000..5939c0d3aa2 --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteString.golden.uplc @@ -0,0 +1 @@ +#61626364 \ No newline at end of file diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteStringCertifiedOnly.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteStringCertifiedOnly.golden.certifier-hints new file mode 100644 index 00000000000..c5b20633dfb --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteStringCertifiedOnly.golden.certifier-hints @@ -0,0 +1,26 @@ +-- Certifier hints #1 (Right FloatDelay) -- +NoHints + +-- Certifier hints #2 (Right ForceCaseDelay) -- +NoHints + +-- Certifier hints #3 (Right ForceDelay) -- +NoHints + +-- Certifier hints #4 (Right CaseReduce) -- +NoHints + +-- Certifier hints #5 (Right Inline) -- +InlApply + InlApply + InlBuiltin + InlCon + InlCon + + +-- Certifier hints #6 (Right ConstantFold) -- +NoHints + +-- Certifier hints #7 (Right ApplyToCase) -- +NoHints + diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteStringCertifiedOnly.golden.uplc b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteStringCertifiedOnly.golden.uplc new file mode 100644 index 00000000000..159638c860a --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfAppendByteStringCertifiedOnly.golden.uplc @@ -0,0 +1 @@ +appendByteString #6162 #6364 \ No newline at end of file diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfDivisionByZero.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfDivisionByZero.golden.certifier-hints new file mode 100644 index 00000000000..434bc0a0ebc --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfDivisionByZero.golden.certifier-hints @@ -0,0 +1,35 @@ +-- Certifier hints #1 (Right FloatDelay) -- +NoHints + +-- Certifier hints #2 (Right ForceCaseDelay) -- +NoHints + +-- Certifier hints #3 (Left LetFloatOut) -- +NoHints + +-- Certifier hints #4 (Right ForceDelay) -- +NoHints + +-- Certifier hints #5 (Left CaseOfCase) -- +NoHints + +-- Certifier hints #6 (Right CaseReduce) -- +NoHints + +-- Certifier hints #7 (Right Inline) -- +InlApply + InlApply + InlBuiltin + InlCon + InlCon + + +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- +NoHints + diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfDivisionByZero.golden.uplc b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfDivisionByZero.golden.uplc new file mode 100644 index 00000000000..1f11dc4236f --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfDivisionByZero.golden.uplc @@ -0,0 +1 @@ +divideInteger 1 0 \ No newline at end of file diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfEqualsInteger.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfEqualsInteger.golden.certifier-hints new file mode 100644 index 00000000000..434bc0a0ebc --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfEqualsInteger.golden.certifier-hints @@ -0,0 +1,35 @@ +-- Certifier hints #1 (Right FloatDelay) -- +NoHints + +-- Certifier hints #2 (Right ForceCaseDelay) -- +NoHints + +-- Certifier hints #3 (Left LetFloatOut) -- +NoHints + +-- Certifier hints #4 (Right ForceDelay) -- +NoHints + +-- Certifier hints #5 (Left CaseOfCase) -- +NoHints + +-- Certifier hints #6 (Right CaseReduce) -- +NoHints + +-- Certifier hints #7 (Right Inline) -- +InlApply + InlApply + InlBuiltin + InlCon + InlCon + + +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- +NoHints + diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfEqualsInteger.golden.uplc b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfEqualsInteger.golden.uplc new file mode 100644 index 00000000000..4791ed5559b --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfEqualsInteger.golden.uplc @@ -0,0 +1 @@ +True \ No newline at end of file diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfIfThenElse.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfIfThenElse.golden.certifier-hints new file mode 100644 index 00000000000..29d9b04fa96 --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfIfThenElse.golden.certifier-hints @@ -0,0 +1,38 @@ +-- Certifier hints #1 (Right FloatDelay) -- +NoHints + +-- Certifier hints #2 (Right ForceCaseDelay) -- +NoHints + +-- Certifier hints #3 (Left LetFloatOut) -- +NoHints + +-- Certifier hints #4 (Right ForceDelay) -- +NoHints + +-- Certifier hints #5 (Left CaseOfCase) -- +NoHints + +-- Certifier hints #6 (Right CaseReduce) -- +NoHints + +-- Certifier hints #7 (Right Inline) -- +InlApply + InlApply + InlApply + InlForce + InlBuiltin + InlCon + InlCon + InlCon + + +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- +NoHints + diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfIfThenElse.golden.uplc b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfIfThenElse.golden.uplc new file mode 100644 index 00000000000..56a6051ca2b --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfIfThenElse.golden.uplc @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfNested.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfNested.golden.certifier-hints new file mode 100644 index 00000000000..4386a00a725 --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfNested.golden.certifier-hints @@ -0,0 +1,39 @@ +-- Certifier hints #1 (Right FloatDelay) -- +NoHints + +-- Certifier hints #2 (Right ForceCaseDelay) -- +NoHints + +-- Certifier hints #3 (Left LetFloatOut) -- +NoHints + +-- Certifier hints #4 (Right ForceDelay) -- +NoHints + +-- Certifier hints #5 (Left CaseOfCase) -- +NoHints + +-- Certifier hints #6 (Right CaseReduce) -- +NoHints + +-- Certifier hints #7 (Right Inline) -- +InlApply + InlApply + InlBuiltin + InlApply + InlApply + InlBuiltin + InlCon + InlCon + InlCon + + +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- +NoHints + diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfNested.golden.uplc b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfNested.golden.uplc new file mode 100644 index 00000000000..9a037142aa3 --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfNested.golden.uplc @@ -0,0 +1 @@ +10 \ No newline at end of file diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfUnderApplied.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfUnderApplied.golden.certifier-hints new file mode 100644 index 00000000000..afb357e8aed --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfUnderApplied.golden.certifier-hints @@ -0,0 +1,33 @@ +-- Certifier hints #1 (Right FloatDelay) -- +NoHints + +-- Certifier hints #2 (Right ForceCaseDelay) -- +NoHints + +-- Certifier hints #3 (Left LetFloatOut) -- +NoHints + +-- Certifier hints #4 (Right ForceDelay) -- +NoHints + +-- Certifier hints #5 (Left CaseOfCase) -- +NoHints + +-- Certifier hints #6 (Right CaseReduce) -- +NoHints + +-- Certifier hints #7 (Right Inline) -- +InlApply + InlBuiltin + InlCon + + +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- +NoHints + diff --git a/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfUnderApplied.golden.uplc b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfUnderApplied.golden.uplc new file mode 100644 index 00000000000..51e72e82dd1 --- /dev/null +++ b/plutus-core/untyped-plutus-core/test/Transform/EvaluateBuiltins/cfUnderApplied.golden.uplc @@ -0,0 +1 @@ +addInteger 1 \ No newline at end of file diff --git a/plutus-core/untyped-plutus-core/test/Transform/basic.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/basic.golden.certifier-hints index 937e7d43f0e..de40334dc3c 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/basic.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/basic.golden.certifier-hints @@ -20,6 +20,12 @@ NoHints InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/basicInline.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/basicInline.golden.certifier-hints index df6566a1a10..1c4498488ad 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/basicInline.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/basicInline.golden.certifier-hints @@ -22,6 +22,12 @@ InlDrop InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/callsiteInline.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/callsiteInline.golden.certifier-hints index bd63baaba4c..1ee9486e8c3 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/callsiteInline.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/callsiteInline.golden.certifier-hints @@ -46,6 +46,12 @@ InlLam InlVar --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/cse2.golden.uplc b/plutus-core/untyped-plutus-core/test/Transform/cse2.golden.uplc index 6922068a035..ac8c8049ae7 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/cse2.golden.uplc +++ b/plutus-core/untyped-plutus-core/test/Transform/cse2.golden.uplc @@ -1,8 +1,5 @@ force (force (case - (constr 0 - [ (lessThanInteger 0 0) - , (delay ((\cse -> addInteger cse cse) (addInteger 1 2))) - , (delay (addInteger 1 2)) ]) + (constr 0 [False, (delay ((\cse -> addInteger cse cse) 3)), (delay 3)]) [ifThenElse])) \ No newline at end of file diff --git a/plutus-core/untyped-plutus-core/test/Transform/cseExpensive.golden.uplc b/plutus-core/untyped-plutus-core/test/Transform/cseExpensive.golden.uplc index 79b6fe2109c..6b25f80cf2c 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/cseExpensive.golden.uplc +++ b/plutus-core/untyped-plutus-core/test/Transform/cseExpensive.golden.uplc @@ -604,566 +604,204 @@ cse) cse) cse)) - (addInteger - 4 - 5)) - (addInteger - 30 - 31)) - (addInteger - 132 - 133)) - (addInteger - 358 - 359)) - (addInteger - 182 - 183)) - (addInteger - 340 - 341)) - (addInteger - 342 - 343)) - (addInteger - 128 - 129)) - (addInteger - 126 - 127)) - (addInteger - 18 - 19)) - (addInteger - 264 - 265)) - (addInteger - 260 - 261)) - (addInteger - 174 - 175)) - (addInteger - 6 - 7)) - (addInteger - 370 - 371)) - (addInteger - 190 - 191)) - (addInteger - 72 - 73)) - (addInteger - 24 - 25)) - (addInteger - 44 - 45)) - (addInteger - 336 - 337)) - (addInteger - 138 - 139)) - (addInteger - 192 - 193)) - (addInteger - 278 - 279)) - (addInteger - 230 - 231)) - (addInteger - 74 - 75)) - (addInteger - 246 - 247)) - (addInteger - 292 - 293)) - (addInteger - 316 - 317)) - (addInteger - 388 - 389)) - (addInteger - 122 - 123)) - (addInteger - 102 - 103)) - (addInteger - 262 - 263)) - (addInteger - 62 - 63)) - (addInteger - 34 - 35)) - (addInteger - 352 - 353)) - (addInteger - 104 - 105)) - (addInteger - 362 - 363)) - (addInteger - 46 - 47)) - (addInteger - 344 - 345)) - (addInteger - 232 - 233)) - (addInteger - 328 - 329)) - (addInteger - 20 - 21)) - (addInteger - 378 - 379)) - (addInteger - 92 - 93)) - (addInteger - 268 - 269)) - (addInteger - 78 - 79)) - (addInteger - 286 - 287)) - (addInteger - 64 - 65)) - (addInteger - 2 - 3)) - (addInteger - 228 - 229)) - (addInteger - 172 - 173)) - (addInteger - 296 - 297)) - (addInteger - 86 - 87)) - (addInteger - 178 - 179)) - (addInteger - 244 - 245)) - (addInteger - 12 - 13)) - (addInteger - 392 - 393)) - (addInteger - 384 - 385)) - (addInteger - 134 - 135)) - (addInteger - 304 - 305)) - (addInteger - 54 - 55)) - (addInteger - 356 - 357)) - (addInteger - 150 - 151)) - (addInteger - 270 - 271)) - (addInteger - 28 - 29)) - (addInteger - 204 - 205)) - (addInteger - 222 - 223)) - (addInteger - 84 - 85)) - (addInteger - 320 - 321)) - (addInteger - 170 - 171)) - (addInteger - 200 - 201)) - (addInteger - 306 - 307)) - (addInteger - 152 - 153)) - (addInteger - 186 - 187)) - (addInteger - 272 - 273)) - (addInteger - 58 - 59)) - (addInteger - 52 - 53)) - (addInteger - 290 - 291)) - (addInteger - 32 - 33)) - (addInteger - 364 - 365)) - (addInteger - 14 - 15)) - (addInteger - 110 - 111)) - (addInteger - 212 - 213)) - (addInteger - 208 - 209)) - (addInteger - 90 - 91)) - (addInteger - 252 - 253)) - (addInteger - 124 - 125)) - (addInteger - 216 - 217)) - (addInteger - 354 - 355)) - (addInteger - 146 - 147)) - (addInteger - 196 - 197)) - (addInteger - 236 - 237)) - (addInteger - 96 - 97)) - (addInteger - 332 - 333)) - (addInteger - 184 - 185)) - (addInteger - 106 - 107)) - (addInteger - 8 - 9)) - (addInteger - 22 - 23)) - (addInteger - 168 - 169)) - (addInteger - 98 - 99)) - (addInteger - 94 - 95)) - (addInteger - 390 - 391)) - (addInteger - 206 - 207)) - (addInteger - 10 - 11)) - (addInteger - 318 - 319)) - (addInteger - 108 - 109)) - (addInteger - 350 - 351)) - (addInteger - 256 - 257)) - (addInteger - 372 - 373)) - (addInteger - 386 - 387)) - (addInteger - 214 - 215)) - (addInteger - 156 - 157)) - (addInteger - 162 - 163)) - (addInteger - 300 - 301)) - (addInteger - 158 - 159)) - (addInteger - 284 - 285)) - (addInteger - 120 - 121)) - (addInteger - 382 - 383)) - (addInteger - 346 - 347)) - (addInteger - 298 - 299)) - (addInteger - 288 - 289)) - (addInteger - 166 - 167)) - (addInteger - 310 - 311)) - (addInteger - 68 - 69)) - (addInteger - 224 - 225)) - (addInteger - 250 - 251)) - (addInteger - 112 - 113)) - (addInteger - 188 - 189)) - (addInteger - 116 - 117)) - (addInteger - 164 - 165)) - (addInteger - 118 - 119)) - (addInteger - 16 - 17)) - (addInteger - 376 - 377)) - (addInteger - 282 - 283)) - (addInteger - 220 - 221)) - (addInteger - 100 - 101)) - (addInteger - 234 - 235)) - (addInteger - 60 - 61)) - (addInteger - 88 - 89)) - (addInteger - 240 - 241)) - (addInteger - 242 - 243)) - (addInteger - 40 - 41)) - (addInteger - 56 - 57)) - (addInteger - 26 - 27)) - (addInteger - 140 - 141)) - (addInteger - 312 - 313)) - (addInteger - 326 - 327)) - (addInteger - 50 - 51)) - (addInteger - 322 - 323)) - (addInteger - 154 - 155)) - (addInteger - 258 - 259)) - (addInteger - 180 - 181)) - (addInteger - 400 - 401)) - (addInteger - 276 - 277)) - (addInteger - 394 - 395)) - (addInteger - 360 - 361)) - (addInteger - 202 - 203)) - (addInteger - 148 - 149)) - (addInteger - 70 - 71)) - (addInteger - 48 - 49)) - (addInteger - 210 - 211)) - (addInteger - 144 - 145)) - (addInteger - 398 - 399)) - (addInteger - 338 - 339)) - (addInteger - 226 - 227)) - (addInteger - 280 - 281)) - (addInteger - 348 - 349)) - (addInteger - 142 - 143)) - (addInteger - 254 - 255)) - (addInteger - 248 - 249)) - (addInteger - 374 - 375)) - (addInteger - 366 - 367)) - (addInteger - 160 - 161)) - (addInteger - 198 - 199)) - (addInteger - 368 - 369)) - (addInteger - 76 - 77)) - (addInteger - 294 - 295)) - (addInteger - 80 - 81)) - (addInteger - 380 - 381)) - (addInteger - 176 - 177)) - (addInteger - 396 - 397)) - (addInteger 194 195)) - (addInteger 42 43)) - (addInteger 66 67)) - (addInteger 0 1)) - (addInteger 324 325)) - (addInteger 308 309)) - (addInteger 114 115)) - (addInteger 238 239)) - (addInteger 218 219)) - (addInteger 36 37)) - (addInteger 136 137)) - (addInteger 274 275)) - (addInteger 302 303)) - (addInteger 82 83)) - (addInteger 314 315)) - (addInteger 266 267)) - (addInteger 130 131)) - (addInteger 334 335)) - (addInteger 330 331)) - (addInteger 38 39) \ No newline at end of file + 9) + 61) + 265) + 717) + 365) + 681) + 685) + 257) + 253) + 37) + 529) + 521) + 349) + 13) + 741) + 381) + 145) + 49) + 89) + 673) + 277) + 385) + 557) + 461) + 149) + 493) + 585) + 633) + 777) + 245) + 205) + 525) + 125) + 69) + 705) + 209) + 725) + 93) + 689) + 465) + 657) + 41) + 757) + 185) + 537) + 157) + 573) + 129) + 5) + 457) + 345) + 593) + 173) + 357) + 489) + 25) + 785) + 769) + 269) + 609) + 109) + 713) + 301) + 541) + 57) + 409) + 445) + 169) + 641) + 341) + 401) + 613) + 305) + 373) + 545) + 117) + 105) + 581) + 65) + 729) + 29) + 221) + 425) + 417) + 181) + 505) + 249) + 433) + 709) + 293) + 393) + 473) + 193) + 665) + 369) + 213) + 17) + 45) + 337) + 197) + 189) + 781) + 413) + 21) + 637) + 217) + 701) + 513) + 745) + 773) + 429) + 313) + 325) + 601) + 317) + 569) + 241) + 765) + 693) + 597) + 577) + 333) + 621) + 137) + 449) + 501) + 225) + 377) + 233) + 329) + 237) + 33) + 753) + 565) + 441) + 201) + 469) + 121) + 177) + 481) + 485) + 81) + 113) + 53) + 281) + 625) + 653) + 101) + 645) + 309) + 517) + 361) + 801) + 553) + 789) + 721) + 405) + 297) + 141) + 97) + 421) + 289) + 797) + 677) + 453) + 561) + 697) + 285) + 509) + 497) + 749) + 733) + 321) + 397) + 737) + 153) + 589) + 161) + 761) + 353) + 793) + 389) + 85) + 133) + 1) + 649) + 617) + 229) + 477) + 437) + 73) + 273) + 549) + 605) + 165) + 629) + 533) + 261) + 669) + 661) + 77 \ No newline at end of file diff --git a/plutus-core/untyped-plutus-core/test/Transform/csePlusTree.golden.uplc b/plutus-core/untyped-plutus-core/test/Transform/csePlusTree.golden.uplc index 11e5be629e8..b1375c680f2 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/csePlusTree.golden.uplc +++ b/plutus-core/untyped-plutus-core/test/Transform/csePlusTree.golden.uplc @@ -3,4 +3,4 @@ (\cse -> (\cse -> addInteger cse cse) (addInteger cse cse)) (addInteger cse cse)) (addInteger cse cse)) - (addInteger 1 1) \ No newline at end of file + 2 \ No newline at end of file diff --git a/plutus-core/untyped-plutus-core/test/Transform/extraDelays.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/extraDelays.golden.certifier-hints index 41a3169d754..d2aaca39e35 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/extraDelays.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/extraDelays.golden.certifier-hints @@ -21,6 +21,12 @@ InlDelay InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/floatDelay1.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/floatDelay1.golden.certifier-hints index a679a717fb8..f29e1245c56 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/floatDelay1.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/floatDelay1.golden.certifier-hints @@ -27,6 +27,12 @@ InlDrop InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/floatDelay1.golden.uplc b/plutus-core/untyped-plutus-core/test/Transform/floatDelay1.golden.uplc index b7b8ae1aa74..d8263ee9860 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/floatDelay1.golden.uplc +++ b/plutus-core/untyped-plutus-core/test/Transform/floatDelay1.golden.uplc @@ -1 +1 @@ -addInteger 1 1 \ No newline at end of file +2 \ No newline at end of file diff --git a/plutus-core/untyped-plutus-core/test/Transform/floatDelay2.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/floatDelay2.golden.certifier-hints index 24efecbfd6c..f62a9235da2 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/floatDelay2.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/floatDelay2.golden.certifier-hints @@ -34,6 +34,12 @@ InlApply InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/floatDelay2.golden.uplc b/plutus-core/untyped-plutus-core/test/Transform/floatDelay2.golden.uplc index 87366c81f72..98b96f2992a 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/floatDelay2.golden.uplc +++ b/plutus-core/untyped-plutus-core/test/Transform/floatDelay2.golden.uplc @@ -1 +1 @@ -(\a -> addInteger (force a) (force a)) (delay (addInteger 1 2)) \ No newline at end of file +(\a -> addInteger (force a) (force a)) (delay 3) \ No newline at end of file diff --git a/plutus-core/untyped-plutus-core/test/Transform/floatDelay3.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/floatDelay3.golden.certifier-hints index d3e22138e30..8c78a0e95ff 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/floatDelay3.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/floatDelay3.golden.certifier-hints @@ -33,6 +33,12 @@ InlDrop InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps1.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps1.golden.certifier-hints index 5f742946089..9bb58bab3ac 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps1.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps1.golden.certifier-hints @@ -23,6 +23,12 @@ InlLam InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2.golden.certifier-hints index 05806412c0f..ca41492366f 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2.golden.certifier-hints @@ -24,6 +24,12 @@ InlLam InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2Fail.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2Fail.golden.certifier-hints index 1c4a282c988..6f43dfae0df 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2Fail.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayNoApps2Fail.golden.certifier-hints @@ -26,6 +26,12 @@ InlLam InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps1.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps1.golden.certifier-hints index 8b4af947a80..ee3356c41a3 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps1.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps1.golden.certifier-hints @@ -24,6 +24,12 @@ InlLam InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2.golden.certifier-hints index 51854554595..41fd4d6b39c 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2.golden.certifier-hints @@ -25,6 +25,12 @@ InlLam InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2Fail.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2Fail.golden.certifier-hints index 6305922b6d6..b509bbe7321 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2Fail.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceCaseDelayWithApps2Fail.golden.certifier-hints @@ -29,6 +29,12 @@ InlLam InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceDelayComplex.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceDelayComplex.golden.certifier-hints index 5a3a35d8ea5..3e667e310ef 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceDelayComplex.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceDelayComplex.golden.certifier-hints @@ -47,6 +47,12 @@ InlLam InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiApply.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiApply.golden.certifier-hints index c6a5083de48..ef0badcd056 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiApply.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiApply.golden.certifier-hints @@ -35,6 +35,12 @@ InlLam InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiForce.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiForce.golden.certifier-hints index df6566a1a10..1c4498488ad 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiForce.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceDelayMultiForce.golden.certifier-hints @@ -22,6 +22,12 @@ InlDrop InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoApps.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoApps.golden.certifier-hints index 937e7d43f0e..de40334dc3c 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoApps.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoApps.golden.certifier-hints @@ -20,6 +20,12 @@ NoHints InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoAppsLayered.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoAppsLayered.golden.certifier-hints index 937e7d43f0e..de40334dc3c 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoAppsLayered.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceDelayNoAppsLayered.golden.certifier-hints @@ -20,6 +20,12 @@ NoHints InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/forceDelaySimple.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/forceDelaySimple.golden.certifier-hints index bc7d7212794..78eba079e6c 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/forceDelaySimple.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/forceDelaySimple.golden.certifier-hints @@ -24,6 +24,12 @@ InlDrop InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure1.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure1.golden.certifier-hints index 9a49cfb5ab4..13419a5817b 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure1.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure1.golden.certifier-hints @@ -24,6 +24,12 @@ InlApply InlError --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure2.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure2.golden.certifier-hints index 9a49cfb5ab4..13419a5817b 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure2.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure2.golden.certifier-hints @@ -24,6 +24,12 @@ InlApply InlError --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure3.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure3.golden.certifier-hints index 9a49cfb5ab4..13419a5817b 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure3.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure3.golden.certifier-hints @@ -24,6 +24,12 @@ InlApply InlError --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure4.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure4.golden.certifier-hints index 601867480b6..2efaa5c56fd 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlineImpure4.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlineImpure4.golden.certifier-hints @@ -26,6 +26,12 @@ InlLam InlVar --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlinePure1.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlinePure1.golden.certifier-hints index 11330832f36..8a815630ca1 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlinePure1.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlinePure1.golden.certifier-hints @@ -24,6 +24,12 @@ InlLam InlVar --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlinePure2.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlinePure2.golden.certifier-hints index 11330832f36..8a815630ca1 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlinePure2.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlinePure2.golden.certifier-hints @@ -24,6 +24,12 @@ InlLam InlVar --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlinePure3.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlinePure3.golden.certifier-hints index 6f11b126e9c..e9fe8322595 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlinePure3.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlinePure3.golden.certifier-hints @@ -29,6 +29,12 @@ InlDrop InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/inlinePure4.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/inlinePure4.golden.certifier-hints index d592cc2fa62..a06bf0024c4 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/inlinePure4.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/inlinePure4.golden.certifier-hints @@ -32,6 +32,12 @@ InlDrop InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/interveningLambda.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/interveningLambda.golden.certifier-hints index ea33e7407b0..50c87e76c2d 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/interveningLambda.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/interveningLambda.golden.certifier-hints @@ -25,6 +25,12 @@ InlDrop InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase1.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase1.golden.certifier-hints index 80536c7bb16..98e30cad70e 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase1.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase1.golden.certifier-hints @@ -21,6 +21,12 @@ InlDrop InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase2.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase2.golden.certifier-hints index 6fa3cf4b2b9..0e4d6b9298b 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase2.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/letFloatOutCase2.golden.certifier-hints @@ -28,6 +28,12 @@ InlLam InlVar --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/letFloatOutForce.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/letFloatOutForce.golden.certifier-hints index 75862738baf..4faae2ef3e9 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/letFloatOutForce.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/letFloatOutForce.golden.certifier-hints @@ -23,6 +23,12 @@ InlLam InlVar --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/multiApp.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/multiApp.golden.certifier-hints index 443b4d8f98d..d1905d96611 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/multiApp.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/multiApp.golden.certifier-hints @@ -30,6 +30,12 @@ InlDrop InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/test/Transform/nested.golden.certifier-hints b/plutus-core/untyped-plutus-core/test/Transform/nested.golden.certifier-hints index 937e7d43f0e..de40334dc3c 100644 --- a/plutus-core/untyped-plutus-core/test/Transform/nested.golden.certifier-hints +++ b/plutus-core/untyped-plutus-core/test/Transform/nested.golden.certifier-hints @@ -20,6 +20,12 @@ NoHints InlCon --- Certifier hints #8 (Right ApplyToCase) -- +-- Certifier hints #8 (Right ConstantFold) -- +NoHints + +-- Certifier hints #9 (Left UncertifiedConstantFold) -- +NoHints + +-- Certifier hints #10 (Right ApplyToCase) -- NoHints diff --git a/plutus-core/untyped-plutus-core/testlib/Transform/EvaluateBuiltins/Spec.hs b/plutus-core/untyped-plutus-core/testlib/Transform/EvaluateBuiltins/Spec.hs new file mode 100644 index 00000000000..76c987d90da --- /dev/null +++ b/plutus-core/untyped-plutus-core/testlib/Transform/EvaluateBuiltins/Spec.hs @@ -0,0 +1,173 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE TypeApplications #-} + +module Transform.EvaluateBuiltins.Spec where + +import Control.Lens ((&), (.~)) +import Data.ByteString qualified as BS +import Data.ByteString.Lazy qualified as BSL +import Data.Text.Encoding (encodeUtf8) +import PlutusCore qualified as PLC +import PlutusCore.Builtin (BuiltinSemanticsVariant) +import PlutusCore.Evaluation.Machine.ExBudgetingDefaults (defaultBuiltinCostModelForTesting) +import PlutusCore.MkPlc (mkConstant, mkIterApp) +import PlutusCore.Pretty (PrettyPlc, Render (render), prettyPlcReadableSimple) +import PlutusPrelude (Default (def)) +import Test.Tasty (TestTree, testGroup) +import Test.Tasty.Golden (goldenVsString) +import Transform.Simplify.Lib (renderCertifierHints, testOptimize) +import UntypedPlutusCore + ( Name + , OptimizerTrace + , Term (..) + , defaultOptimizeOpts + , ooCertifiedOptsOnly + , ooInlineCallsiteGrowth + , ooMaxCseIterations + , ooMaxSimplifierIterations + , ooPreserveLogging + , runOptimizerT + , termOptimizer + ) + +test_evaluateBuiltins :: TestTree +test_evaluateBuiltins = + testGroup + "EvaluateBuiltins" + [ goldenVsOptimized "cfAddInteger" cfAddInteger + , goldenVsOptimized "cfNested" cfNested + , goldenVsOptimized "cfIfThenElse" cfIfThenElse + , goldenVsOptimized "cfEqualsInteger" cfEqualsInteger + , goldenVsOptimized "cfDivisionByZero" cfDivisionByZero + , goldenVsOptimized "cfUnderApplied" cfUnderApplied + , goldenVsOptimized "cfAppendByteString" cfAppendByteString + , goldenVsCertifiedOnly "cfAppendByteStringCertifiedOnly" cfAppendByteString + ] + +-- | @addInteger 1 2@ — folds to @3@. +cfAddInteger :: Term Name PLC.DefaultUni PLC.DefaultFun () +cfAddInteger = + Apply + () + (Apply () (Builtin () PLC.AddInteger) (mkConstant @Integer () 1)) + (mkConstant @Integer () 2) + +-- | @addInteger (multiplyInteger 2 3) 4@ — bottom-up folding produces @10@. +cfNested :: Term Name PLC.DefaultUni PLC.DefaultFun () +cfNested = + Apply + () + ( Apply + () + (Builtin () PLC.AddInteger) + ( Apply + () + (Apply () (Builtin () PLC.MultiplyInteger) (mkConstant @Integer () 2)) + (mkConstant @Integer () 3) + ) + ) + (mkConstant @Integer () 4) + +-- | @(force ifThenElse) True 1 2@ — folds to @1@. +cfIfThenElse :: Term Name PLC.DefaultUni PLC.DefaultFun () +cfIfThenElse = + mkIterApp + (Force () (Builtin () PLC.IfThenElse)) + [ ((), mkConstant @Bool () True) + , ((), mkConstant @Integer () 1) + , ((), mkConstant @Integer () 2) + ] + +-- | @equalsInteger 3 3@ — folds to @True@. +cfEqualsInteger :: Term Name PLC.DefaultUni PLC.DefaultFun () +cfEqualsInteger = + Apply + () + (Apply () (Builtin () PLC.EqualsInteger) (mkConstant @Integer () 3)) + (mkConstant @Integer () 3) + +-- | @divideInteger 1 0@ — not folded because evaluation fails. +cfDivisionByZero :: Term Name PLC.DefaultUni PLC.DefaultFun () +cfDivisionByZero = + Apply + () + (Apply () (Builtin () PLC.DivideInteger) (mkConstant @Integer () 1)) + (mkConstant @Integer () 0) + +-- | @addInteger 1@ — not folded because it is under-applied. +cfUnderApplied :: Term Name PLC.DefaultUni PLC.DefaultFun () +cfUnderApplied = + Apply () (Builtin () PLC.AddInteger) (mkConstant @Integer () 1) + +{-| @appendByteString "ab" "cd"@ — an uncertified builtin. +Folds to @"abcd"@ in normal mode; left unchanged in certified-only mode +(see 'cfAppendByteStringCertifiedOnly'). -} +cfAppendByteString :: Term Name PLC.DefaultUni PLC.DefaultFun () +cfAppendByteString = + Apply + () + ( Apply + () + (Builtin () PLC.AppendByteString) + (mkConstant @BS.ByteString () "ab") + ) + (mkConstant @BS.ByteString () "cd") + +---------------------------------------------------------------------------------------------------- +-- Helpers ----------------------------------------------------------------------------------------- + +goldenDir :: String +goldenDir = "untyped-plutus-core/test/Transform/EvaluateBuiltins/" + +goldenVsOptimized :: String -> Term Name PLC.DefaultUni PLC.DefaultFun () -> TestTree +goldenVsOptimized name t = + testGroup + name + [ goldenVsPretty ".golden.uplc" name t' + , goldenVsString (name ++ ".certifier-hints") (goldenDir ++ name ++ ".golden.certifier-hints") + . pure + . BSL.fromStrict + . encodeUtf8 + $ renderCertifierHints trace + ] + where + (t', trace) = PLC.runQuote (testOptimize t) + +goldenVsCertifiedOnly :: String -> Term Name PLC.DefaultUni PLC.DefaultFun () -> TestTree +goldenVsCertifiedOnly name t = + testGroup + name + [ goldenVsPretty ".golden.uplc" name t' + , goldenVsString (name ++ ".certifier-hints") (goldenDir ++ name ++ ".golden.certifier-hints") + . pure + . BSL.fromStrict + . encodeUtf8 + $ renderCertifierHints trace + ] + where + (t', trace) = PLC.runQuote (testOptimizeCertifiedOnly t) + +goldenVsPretty :: PrettyPlc a => String -> String -> a -> TestTree +goldenVsPretty extn name value = + goldenVsString name (goldenDir ++ name ++ extn) $ + pure . BSL.fromStrict . encodeUtf8 . render $ + prettyPlcReadableSimple value + +testOptimizeCertifiedOnly + :: Term Name PLC.DefaultUni PLC.DefaultFun () + -> PLC.Quote + ( Term Name PLC.DefaultUni PLC.DefaultFun () + , OptimizerTrace Name PLC.DefaultUni PLC.DefaultFun () + ) +testOptimizeCertifiedOnly = + runOptimizerT + . termOptimizer + ( defaultOptimizeOpts + & ooMaxSimplifierIterations .~ 1 + & ooMaxCseIterations .~ 0 + & ooInlineCallsiteGrowth .~ 0 + & ooPreserveLogging .~ False + & ooCertifiedOptsOnly .~ True + ) + (def :: BuiltinSemanticsVariant PLC.DefaultFun) + defaultBuiltinCostModelForTesting diff --git a/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs b/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs index 30b45b0a2d2..467234d5758 100644 --- a/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs +++ b/plutus-core/untyped-plutus-core/testlib/Transform/Simplify/Lib.hs @@ -11,6 +11,7 @@ import Data.Text.Encoding (encodeUtf8) import Data.Tuple.Extra ((&&&)) import PlutusCore qualified as PLC import PlutusCore.Builtin (BuiltinSemanticsVariant) +import PlutusCore.Evaluation.Machine.ExBudgetingDefaults (defaultBuiltinCostModelForTesting) import PlutusCore.Pretty (PrettyPlc, Render (render), prettyPlcReadableSimple) import PlutusPrelude (Default (def)) import Test.Tasty (TestTree, testGroup) @@ -113,6 +114,7 @@ testOptimize = & ooPreserveLogging .~ False ) (def :: BuiltinSemanticsVariant PLC.DefaultFun) + defaultBuiltinCostModelForTesting goldenVsCse :: CseWhichSubterms @@ -144,3 +146,4 @@ testCse whichSubterms = & ooPreserveLogging .~ False ) (def :: BuiltinSemanticsVariant PLC.DefaultFun) + defaultBuiltinCostModelForTesting diff --git a/plutus-executables/executables/pir/Main.hs b/plutus-executables/executables/pir/Main.hs index 4ba23be7cb6..ad37e43b843 100644 --- a/plutus-executables/executables/pir/Main.hs +++ b/plutus-executables/executables/pir/Main.hs @@ -12,6 +12,7 @@ import Paths_plutus_executables qualified as Paths import PlutusCore qualified as PLC import PlutusCore.Compiler qualified as PLC import PlutusCore.Error (ParserErrorBundle (..)) +import PlutusCore.Evaluation.Machine.ExBudgetingDefaults (defaultBuiltinCostModelForTesting) import PlutusCore.Executable.Common hiding (runPrint) import PlutusCore.Executable.Parsers import PlutusCore.Quote (runQuote, runQuoteT) @@ -197,7 +198,9 @@ compileToUplc optimise plcProg = & PLC.coOptimizeOpts . UPLC.ooMaxSimplifierIterations .~ 0 - in runQuote $ flip runReaderT plcCompilerOpts $ PLC.compileProgram plcProg + in runQuote $ + flip runReaderT plcCompilerOpts $ + PLC.compileProgram defaultBuiltinCostModelForTesting plcProg loadPirAndCompile :: CompileOptions -> IO () loadPirAndCompile (CompileOptions language optimise test inp ifmt outp ofmt mode) = do diff --git a/plutus-executables/executables/uplc/Main.hs b/plutus-executables/executables/uplc/Main.hs index 90b67c43dd6..aff34188fff 100644 --- a/plutus-executables/executables/uplc/Main.hs +++ b/plutus-executables/executables/uplc/Main.hs @@ -421,7 +421,11 @@ optimiseProgram opts prog = PLC.runQuoteT $ do renamed <- PLC.rename prog let defaultBuiltinSemanticsVariant :: BuiltinSemanticsVariant PLC.DefaultFun defaultBuiltinSemanticsVariant = def - UPLC.optimizeProgramWithTrace opts defaultBuiltinSemanticsVariant renamed + UPLC.optimizeProgramWithTrace + opts + defaultBuiltinSemanticsVariant + PLC.defaultBuiltinCostModelForTesting + renamed execCertifier :: UPLC.OptimizerTrace UPLC.Name UPLC.DefaultUni UPLC.DefaultFun a diff --git a/plutus-executables/plutus/AnyProgram/Compile.hs b/plutus-executables/plutus/AnyProgram/Compile.hs index f6638e39cfd..fc75ce67ef0 100644 --- a/plutus-executables/plutus/AnyProgram/Compile.hs +++ b/plutus-executables/plutus/AnyProgram/Compile.hs @@ -24,6 +24,7 @@ import PlutusCore.Compiler qualified as PLC import PlutusCore.DeBruijn qualified as PLC import PlutusCore.Default import PlutusCore.Error as PLC +import PlutusCore.Evaluation.Machine.ExBudgetingDefaults (defaultBuiltinCostModelForTesting) import PlutusCore.MkPlc hiding (error) import PlutusIR qualified as PIR import PlutusIR.Compiler qualified as PIR @@ -127,7 +128,7 @@ compileProgram = curry $ \case -- PLC.compileProgram subsumes uplcOptimise >=> ( PLC.runQuoteT . flip runReaderT PLC.defaultCompilationOpts - . plcToUplcViaName n2 PLC.compileProgram + . plcToUplcViaName n2 (PLC.compileProgram defaultBuiltinCostModelForTesting) ) >=> pure . UPLC.UnrestrictedProgram @@ -260,7 +261,7 @@ uplcOptimise = UnsafeOptimise -> id in fmap PLC.runQuoteT . _Wrapped - . uplcViaName (UPLC.optimizeProgram oOpts def) + . uplcViaName (UPLC.optimizeProgram oOpts def defaultBuiltinCostModelForTesting) -- | We do not have a typechecker for uplc, but we could pretend that scopecheck is a "typechecker" uplcTypecheck diff --git a/plutus-executables/test/certifier/Test/Certifier/Executable.hs b/plutus-executables/test/certifier/Test/Certifier/Executable.hs index 97e1165f1ac..84d0460bf95 100644 --- a/plutus-executables/test/certifier/Test/Certifier/Executable.hs +++ b/plutus-executables/test/certifier/Test/Certifier/Executable.hs @@ -2,6 +2,7 @@ module Test.Certifier.Executable where import Certifier import PlutusCore.Default.Builtins +import PlutusCore.Evaluation.Machine.ExBudgetingDefaults (defaultBuiltinCostModelForTesting) import PlutusCore.Executable.Common import PlutusCore.Quote import UntypedPlutusCore as UPLC @@ -33,6 +34,7 @@ simplify = . termOptimizer defaultOptimizeOpts DefaultFunSemanticsVariantE + defaultBuiltinCostModelForTesting loadAndMakeCert :: String -> IO FilePath loadAndMakeCert name = diff --git a/plutus-metatheory/plutus-metatheory.cabal b/plutus-metatheory/plutus-metatheory.cabal index b34fcaf1a82..944abc836b2 100644 --- a/plutus-metatheory/plutus-metatheory.cabal +++ b/plutus-metatheory/plutus-metatheory.cabal @@ -378,6 +378,7 @@ library MAlonzo.Code.VerifiedCompilation.UApplyToCase MAlonzo.Code.VerifiedCompilation.UCaseOfCase MAlonzo.Code.VerifiedCompilation.UCaseReduce + MAlonzo.Code.VerifiedCompilation.UConstantFold MAlonzo.Code.VerifiedCompilation.UCSE MAlonzo.Code.VerifiedCompilation.UFloatDelay MAlonzo.Code.VerifiedCompilation.UForceCaseDelay diff --git a/plutus-metatheory/src/CertifierReport.lagda.md b/plutus-metatheory/src/CertifierReport.lagda.md index c79113c8be0..2448a561498 100644 --- a/plutus-metatheory/src/CertifierReport.lagda.md +++ b/plutus-metatheory/src/CertifierReport.lagda.md @@ -43,10 +43,12 @@ showCertifiedOptTag caseReduceT = "Case-Constr and Case-Constant Cancellation" showCertifiedOptTag inlineT = "Inlining" showCertifiedOptTag cseT = "Common Subexpression Elimination" showCertifiedOptTag applyToCaseT = "Transform multi-argument applications into case-constr form" +showCertifiedOptTag constantFoldT = "Constant Folding" showUncertifiedOptTag : UncertifiedOptTag → String showUncertifiedOptTag caseOfCaseT = "Case-of-Case" showUncertifiedOptTag letFloatOutT = "Float bindings outwards" +showUncertifiedOptTag uncertifiedConstantFoldT = "Constant Folding (uncertified)" showTag : OptTag → String showTag (inj₁ tag) = showUncertifiedOptTag tag ++ " ⚠ (certifier unavailable)" @@ -121,6 +123,7 @@ numSites caseReduceT p = numSites′ p numSites inlineT p = numSitesInline p numSites forceCaseDelayT p = numSites′ p numSites applyToCaseT p = numSites′ p +numSites constantFoldT p = numSites′ p showSites : {M N : 0 ⊢} → (tag : OptTag) → RelationOf tag M N → String showSites (inj₁ _) _ = "" diff --git a/plutus-metatheory/src/FFI/AgdaUnparse.hs b/plutus-metatheory/src/FFI/AgdaUnparse.hs index efa4d270828..bffe54b6802 100644 --- a/plutus-metatheory/src/FFI/AgdaUnparse.hs +++ b/plutus-metatheory/src/FFI/AgdaUnparse.hs @@ -58,10 +58,12 @@ instance AgdaUnparse CertifiedOptStage where agdaUnparse Inline = "inlineT" agdaUnparse CSE = "cseT" agdaUnparse ApplyToCase = "applyToCaseT" + agdaUnparse ConstantFold = "constantFoldT" instance AgdaUnparse UncertifiedOptStage where agdaUnparse CaseOfCase = "caseOfCaseT" agdaUnparse LetFloatOut = "letFloatOutT" + agdaUnparse UncertifiedConstantFold = "uncertifiedConstantFoldT" instance AgdaUnparse Hints.Hints where agdaUnparse = \case diff --git a/plutus-metatheory/src/MAlonzo/Code/Certifier.hs b/plutus-metatheory/src/MAlonzo/Code/Certifier.hs index 0004333ff17..443d4e568f5 100644 --- a/plutus-metatheory/src/MAlonzo/Code/Certifier.hs +++ b/plutus-metatheory/src/MAlonzo/Code/Certifier.hs @@ -33,9 +33,9 @@ d_runCertifier_2 :: [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12) (MAlonzo.Code.Utils.T__'215'__428 - MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_72 + MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_146 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> @@ -47,7 +47,7 @@ d_runCertifier_2 v0 MAlonzo.Code.Utils.du_eitherBind_54 (coe MAlonzo.Code.Utils.du_try_94 - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_toTrace_98 (coe v0)) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_toTrace_172 (coe v0)) (coe MAlonzo.Code.VerifiedCompilation.C_emptyDump_4)) (coe (\ v1 -> @@ -77,14 +77,14 @@ runCertifierMain :: (MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12) (MAlonzo.Code.Utils.T__'215'__428 - MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_72 + MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_146 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))) -> MAlonzo.Code.Agda.Builtin.List.T_List_10 - () MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_134 -> + () MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_208 -> MAlonzo.Code.Agda.Builtin.Maybe.T_Maybe_10 () (MAlonzo.Code.Utils.T__'215'__428 @@ -94,13 +94,13 @@ d_runCertifierMain_12 :: [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12) (MAlonzo.Code.Utils.T__'215'__428 - MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_72 + MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_146 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_134] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_208] -> Maybe (MAlonzo.Code.Utils.T__'215'__428 Bool MAlonzo.Code.Agda.Builtin.String.T_String_6) @@ -121,7 +121,7 @@ d_runCertifierMain_12 v0 v1 MAlonzo.Code.Utils.C__'44'__442 (coe MAlonzo.Code.Agda.Builtin.Bool.C_false_8) (coe - MAlonzo.Code.CertifierReport.d_makeReport_286 (coe v2) (coe v1))) + MAlonzo.Code.CertifierReport.d_makeReport_288 (coe v2) (coe v1))) MAlonzo.Code.VerifiedCompilation.C_abort_10 v4 -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 @@ -129,7 +129,7 @@ d_runCertifierMain_12 v0 v1 MAlonzo.Code.Utils.C__'44'__442 (coe MAlonzo.Code.Agda.Builtin.Bool.C_false_8) (coe - MAlonzo.Code.CertifierReport.d_makeReport_286 (coe v2) (coe v1))) + MAlonzo.Code.CertifierReport.d_makeReport_288 (coe v2) (coe v1))) _ -> MAlonzo.RTE.mazUnreachableError MAlonzo.Code.Utils.C_inj'8322'_14 v3 -> coe @@ -140,5 +140,5 @@ d_runCertifierMain_12 v0 v1 MAlonzo.Code.Utils.C__'44'__442 (coe MAlonzo.Code.Agda.Builtin.Bool.C_true_10) (coe - MAlonzo.Code.CertifierReport.d_makeReport_286 (coe v2) (coe v1)))) + MAlonzo.Code.CertifierReport.d_makeReport_288 (coe v2) (coe v1)))) _ -> MAlonzo.RTE.mazUnreachableError) diff --git a/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs b/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs index 329edb15a1d..f5df543de0e 100644 --- a/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs +++ b/plutus-metatheory/src/MAlonzo/Code/CertifierReport.hs @@ -51,28 +51,30 @@ d_hl_8 Data.Text.Text) -- CertifierReport.showCertifiedOptTag d_showCertifiedOptTag_10 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> MAlonzo.Code.Agda.Builtin.String.T_String_6 d_showCertifiedOptTag_10 v0 = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_12 + MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_14 -> coe ("Float Delay" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_14 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_16 -> coe ("Force-Delay Cancellation" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_16 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_18 -> coe ("Float Force into Case Branches" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_18 + MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_20 -> coe ("Case-Constr and Case-Constant Cancellation" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_20 + MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_22 -> coe ("Inlining" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_22 + MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_24 -> coe ("Common Subexpression Elimination" :: Data.Text.Text) - MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_24 + MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_26 -> coe ("Transform multi-argument applications into case-constr form" :: Data.Text.Text) + MAlonzo.Code.VerifiedCompilation.Trace.C_constantFoldT_28 + -> coe ("Constant Folding" :: Data.Text.Text) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.showUncertifiedOptTag d_showUncertifiedOptTag_12 :: @@ -84,12 +86,14 @@ d_showUncertifiedOptTag_12 v0 -> coe ("Case-of-Case" :: Data.Text.Text) MAlonzo.Code.VerifiedCompilation.Trace.C_letFloatOutT_8 -> coe ("Float bindings outwards" :: Data.Text.Text) + MAlonzo.Code.VerifiedCompilation.Trace.C_uncertifiedConstantFoldT_10 + -> coe ("Constant Folding (uncertified)" :: Data.Text.Text) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.showTag d_showTag_14 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> MAlonzo.Code.Agda.Builtin.String.T_String_6 d_showTag_14 v0 = case coe v0 of @@ -559,39 +563,41 @@ d_numSitesInline_140 v0 v1 v2 v3 v4 v5 v6 v7 d_numSites_178 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> Integer d_numSites_178 v0 v1 v2 v3 = case coe v2 of - MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_12 + MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_14 -> coe du_numSites'8242'_26 v0 v1 v3 - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_14 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_16 -> coe du_numSites'8242'_26 v0 v1 v3 - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_16 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_18 -> coe du_numSites'8242'_26 v0 v1 v3 - MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_18 + MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_20 -> coe du_numSites'8242'_26 v0 v1 v3 - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_20 + MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_22 -> coe d_numSitesInline_140 (coe (0 :: Integer)) erased (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_32) (coe MAlonzo.Code.VerifiedCompilation.UInline.C_'9633'_106) (coe v0) (coe v1) (coe v3) - MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_22 + MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_24 -> coe du_numSites'8242'_26 v0 v1 v3 - MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_24 + MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_26 + -> coe du_numSites'8242'_26 v0 v1 v3 + MAlonzo.Code.VerifiedCompilation.Trace.C_constantFoldT_28 -> coe du_numSites'8242'_26 v0 v1 v3 _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.showSites -d_showSites_200 :: +d_showSites_202 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_showSites_200 v0 v1 v2 v3 +d_showSites_202 v0 v1 v2 v3 = case coe v2 of MAlonzo.Code.Utils.C_inj'8321'_12 v4 -> coe ("" :: Data.Text.Text) MAlonzo.Code.Utils.C_inj'8322'_14 v4 @@ -605,61 +611,61 @@ d_showSites_200 v0 v1 v2 v3 (d_numSites_178 (coe v0) (coe v1) (coe v4) (coe v3)))) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.termSize -d_termSize_208 :: +d_termSize_210 :: Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> Integer -d_termSize_208 v0 v1 +d_termSize_210 v0 v1 = case coe v1 of MAlonzo.Code.Untyped.C_'96'_18 v2 -> coe (1 :: Integer) MAlonzo.Code.Untyped.C_ƛ_20 v2 -> coe addInt (coe (1 :: Integer)) (coe - d_termSize_208 (coe addInt (coe (1 :: Integer)) (coe v0)) (coe v2)) + d_termSize_210 (coe addInt (coe (1 :: Integer)) (coe v0)) (coe v2)) MAlonzo.Code.Untyped.C__'183'__22 v2 v3 -> coe addInt (coe - addInt (coe (1 :: Integer)) (coe d_termSize_208 (coe v0) (coe v2))) - (coe d_termSize_208 (coe v0) (coe v3)) + addInt (coe (1 :: Integer)) (coe d_termSize_210 (coe v0) (coe v2))) + (coe d_termSize_210 (coe v0) (coe v3)) MAlonzo.Code.Untyped.C_force_24 v2 -> coe - addInt (coe (1 :: Integer)) (coe d_termSize_208 (coe v0) (coe v2)) + addInt (coe (1 :: Integer)) (coe d_termSize_210 (coe v0) (coe v2)) MAlonzo.Code.Untyped.C_delay_26 v2 -> coe - addInt (coe (1 :: Integer)) (coe d_termSize_208 (coe v0) (coe v2)) + addInt (coe (1 :: Integer)) (coe d_termSize_210 (coe v0) (coe v2)) MAlonzo.Code.Untyped.C_con_28 v2 -> coe (1 :: Integer) MAlonzo.Code.Untyped.C_constr_34 v2 v3 -> coe addInt (coe (1 :: Integer)) - (coe d_termSize'7510''695'_212 (coe v0) (coe v3)) + (coe d_termSize'7510''695'_214 (coe v0) (coe v3)) MAlonzo.Code.Untyped.C_case_40 v2 v3 -> coe addInt (coe addInt (coe (1 :: Integer)) - (coe d_termSize'7510''695'_212 (coe v0) (coe v3))) - (coe d_termSize_208 (coe v0) (coe v2)) + (coe d_termSize'7510''695'_214 (coe v0) (coe v3))) + (coe d_termSize_210 (coe v0) (coe v2)) MAlonzo.Code.Untyped.C_builtin_44 v2 -> coe (1 :: Integer) MAlonzo.Code.Untyped.C_error_46 -> coe (1 :: Integer) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.termSizeᵖʷ -d_termSize'7510''695'_212 :: +d_termSize'7510''695'_214 :: Integer -> [MAlonzo.Code.Untyped.T__'8866'_14] -> Integer -d_termSize'7510''695'_212 v0 v1 +d_termSize'7510''695'_214 v0 v1 = case coe v1 of [] -> coe (0 :: Integer) (:) v2 v3 -> coe - addInt (coe d_termSize'7510''695'_212 (coe v0) (coe v3)) - (coe d_termSize_208 (coe v0) (coe v2)) + addInt (coe d_termSize'7510''695'_214 (coe v0) (coe v3)) + (coe d_termSize_210 (coe v0) (coe v2)) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.showEvalResult -d_showEvalResult_234 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_134 -> +d_showEvalResult_236 :: + MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_208 -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_showEvalResult_234 v0 +d_showEvalResult_236 v0 = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_success_136 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.C_success_210 v1 v2 -> coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 (d_'8649'__2 (coe ("Execution Cost: CPU = " :: Data.Text.Text))) @@ -670,7 +676,7 @@ d_showEvalResult_234 v0 MAlonzo.Code.Data.String.Base.d__'43''43'__20 (", MEM = " :: Data.Text.Text) (coe MAlonzo.Code.Data.Nat.Show.d_show_56 v2))) - MAlonzo.Code.VerifiedCompilation.Trace.C_failure_138 v1 v2 v3 + MAlonzo.Code.VerifiedCompilation.Trace.C_failure_212 v1 v2 v3 -> coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 (d_'8649'__2 (coe ("Evaluation FAILED: " :: Data.Text.Text))) @@ -690,10 +696,10 @@ d_showEvalResult_234 v0 (coe MAlonzo.Code.Data.Nat.Show.d_show_56 v3)))))) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.showCostPair -d_showCostPair_246 :: - [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_134] -> +d_showCostPair_248 :: + [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_208] -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_showCostPair_246 v0 +d_showCostPair_248 v0 = let v1 = "" :: Data.Text.Text in coe (case coe v0 of @@ -702,7 +708,7 @@ d_showCostPair_246 v0 (:) v4 v5 -> coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_showEvalResult_234 (coe v2)) + (d_showEvalResult_236 (coe v2)) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 (" (before)" :: Data.Text.Text) @@ -710,28 +716,28 @@ d_showCostPair_246 v0 MAlonzo.Code.Data.String.Base.d__'43''43'__20 d_nl_6 (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_showEvalResult_234 (coe v4)) (" (after)" :: Data.Text.Text)))) + (d_showEvalResult_236 (coe v4)) (" (after)" :: Data.Text.Text)))) _ -> coe v1 _ -> coe v1) -- CertifierReport.tail -d_tail_254 :: () -> [AgdaAny] -> [AgdaAny] -d_tail_254 ~v0 v1 = du_tail_254 v1 -du_tail_254 :: [AgdaAny] -> [AgdaAny] -du_tail_254 v0 +d_tail_256 :: () -> [AgdaAny] -> [AgdaAny] +d_tail_256 ~v0 v1 = du_tail_256 v1 +du_tail_256 :: [AgdaAny] -> [AgdaAny] +du_tail_256 v0 = case coe v0 of [] -> coe v0 (:) v1 v2 -> coe v2 _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.reportPasses -d_reportPasses_264 :: +d_reportPasses_266 :: Integer -> - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_80 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_154 -> AgdaAny -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_134] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_208] -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_reportPasses_264 v0 v1 v2 v3 +d_reportPasses_266 v0 v1 v2 v3 = case coe v1 of - MAlonzo.Code.VerifiedCompilation.Trace.C_step_84 v4 v5 v6 v7 + MAlonzo.Code.VerifiedCompilation.Trace.C_step_158 v4 v5 v6 v7 -> case coe v2 of MAlonzo.Code.Utils.C__'44'__442 v8 v9 -> coe @@ -757,7 +763,7 @@ d_reportPasses_264 v0 v1 v2 v3 MAlonzo.Code.Data.String.Base.d__'43''43'__20 (coe MAlonzo.Code.Data.Nat.Show.d_show_56 - (d_termSize_208 (coe (0 :: Integer)) (coe v6))) + (d_termSize_210 (coe (0 :: Integer)) (coe v6))) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 (" (before)" :: Data.Text.Text) @@ -771,10 +777,10 @@ d_reportPasses_264 v0 v1 v2 v3 MAlonzo.Code.Data.String.Base.d__'43''43'__20 (coe MAlonzo.Code.Data.Nat.Show.d_show_56 - (d_termSize_208 + (d_termSize_210 (coe (0 :: Integer)) (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_head_90 + MAlonzo.Code.VerifiedCompilation.Trace.d_head_164 (coe v7)))) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 @@ -784,40 +790,40 @@ d_reportPasses_264 v0 v1 v2 v3 d_nl_6 (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_showCostPair_246 (coe v3)) + (d_showCostPair_248 (coe v3)) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 d_nl_6 (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 - (d_showSites_200 + (d_showSites_202 (coe v6) (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_head_90 + MAlonzo.Code.VerifiedCompilation.Trace.d_head_164 (coe v7)) (coe v4) (coe v8)) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 d_nl_6 - (d_reportPasses_264 + (d_reportPasses_266 (coe addInt (coe (1 :: Integer)) (coe v0)) (coe v7) (coe v9) (coe - du_tail_254 + du_tail_256 (coe v3)))))))))))))))))))) _ -> MAlonzo.RTE.mazUnreachableError - MAlonzo.Code.VerifiedCompilation.Trace.C_done_86 v4 + MAlonzo.Code.VerifiedCompilation.Trace.C_done_160 v4 -> coe ("" :: Data.Text.Text) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.reportFailure -d_reportFailure_280 :: +d_reportFailure_282 :: MAlonzo.Code.VerifiedCompilation.T_Error_2 -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_reportFailure_280 v0 +d_reportFailure_282 v0 = case coe v0 of MAlonzo.Code.VerifiedCompilation.C_emptyDump_4 -> coe @@ -861,24 +867,24 @@ d_reportFailure_280 v0 (" \10060 FAILED" :: Data.Text.Text) d_hl_8))) _ -> MAlonzo.RTE.mazUnreachableError -- CertifierReport.makeReport -d_makeReport_286 :: +d_makeReport_288 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.T_Error_2 MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_134] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_EvalResult_208] -> MAlonzo.Code.Agda.Builtin.String.T_String_6 -d_makeReport_286 v0 v1 +d_makeReport_288 v0 v1 = coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 ("UPLC OPTIMIZATION: CERTIFIER REPORT" :: Data.Text.Text) (coe MAlonzo.Code.Data.String.Base.d__'43''43'__20 d_nl_6 (coe - MAlonzo.Code.Utils.du_either_22 (coe v0) (coe d_reportFailure_280) + MAlonzo.Code.Utils.du_either_22 (coe v0) (coe d_reportFailure_282) (coe (\ v2 -> case coe v2 of MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 v3 v4 -> coe - d_reportPasses_264 (coe (1 :: Integer)) (coe v3) (coe v4) (coe v1) + d_reportPasses_266 (coe (1 :: Integer)) (coe v3) (coe v4) (coe v1) _ -> MAlonzo.RTE.mazUnreachableError)))) diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs index 6114833a616..20d421dfaca 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation.hs @@ -29,6 +29,7 @@ import qualified MAlonzo.Code.VerifiedCompilation.Trace import qualified MAlonzo.Code.VerifiedCompilation.UApplyToCase import qualified MAlonzo.Code.VerifiedCompilation.UCSE import qualified MAlonzo.Code.VerifiedCompilation.UCaseReduce +import qualified MAlonzo.Code.VerifiedCompilation.UConstantFold import qualified MAlonzo.Code.VerifiedCompilation.UFloatDelay import qualified MAlonzo.Code.VerifiedCompilation.UForceCaseDelay import qualified MAlonzo.Code.VerifiedCompilation.UForceDelay @@ -40,13 +41,13 @@ data T_Error_2 = C_emptyDump_4 | C_illScoped_6 | C_counterExample_8 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) | + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12) | C_abort_10 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12) -- VerifiedCompilation.tagToRelation d_tagToRelation_12 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> () d_tagToRelation_12 = erased @@ -54,7 +55,7 @@ d_tagToRelation_12 = erased d_RelationOf_14 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> () d_RelationOf_14 = erased @@ -62,15 +63,15 @@ d_RelationOf_14 = erased d_hasRelation_18 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> Bool d_hasRelation_18 = coe MAlonzo.Code.Utils.du_is'45'inj'8322'_46 -- VerifiedCompilation.certifyPass d_certifyPass_26 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_72 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_Hints_146 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.VerifiedCompilation.Certificate.T_CertResult_12 @@ -83,72 +84,78 @@ d_certifyPass_26 v0 v1 MAlonzo.Code.VerifiedCompilation.NotImplemented.du_certNotImplemented_22) MAlonzo.Code.Utils.C_inj'8322'_14 v2 -> case coe v2 of - MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_12 + MAlonzo.Code.VerifiedCompilation.Trace.C_floatDelayT_14 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 (coe MAlonzo.Code.VerifiedCompilation.UFloatDelay.d_isFloatDelay'63'_488 (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_14 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceDelayT_16 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 (coe MAlonzo.Code.VerifiedCompilation.UForceDelay.d_isForceDelay'63'_178 (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_16 + MAlonzo.Code.VerifiedCompilation.Trace.C_forceCaseDelayT_18 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 (coe MAlonzo.Code.VerifiedCompilation.UForceCaseDelay.d_isForceCaseDelay'63'_94 (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_18 + MAlonzo.Code.VerifiedCompilation.Trace.C_caseReduceT_20 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 (coe MAlonzo.Code.VerifiedCompilation.UCaseReduce.d_isCaseReduce'63'_26 (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_20 + MAlonzo.Code.VerifiedCompilation.Trace.C_inlineT_22 -> case coe v1 of - MAlonzo.Code.VerifiedCompilation.Trace.C_inline_74 v3 + MAlonzo.Code.VerifiedCompilation.Trace.C_inline_148 v3 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du_checker_156 (coe MAlonzo.Code.VerifiedCompilation.UInline.d_top'45'check_718 (coe v3)) - MAlonzo.Code.VerifiedCompilation.Trace.C_none_76 + MAlonzo.Code.VerifiedCompilation.Trace.C_none_150 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_40) _ -> MAlonzo.RTE.mazUnreachableError - MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_22 + MAlonzo.Code.VerifiedCompilation.Trace.C_cseT_24 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 (coe MAlonzo.Code.VerifiedCompilation.UCSE.d_isUntypedCSE'63'_26 (coe (0 :: Integer))) - MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_24 + MAlonzo.Code.VerifiedCompilation.Trace.C_applyToCaseT_26 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 (coe MAlonzo.Code.VerifiedCompilation.UApplyToCase.d_a2c'63''7580''7580'_24 (coe (0 :: Integer))) + MAlonzo.Code.VerifiedCompilation.Trace.C_constantFoldT_28 + -> coe + MAlonzo.Code.VerifiedCompilation.Certificate.du_decider_192 + (coe + MAlonzo.Code.VerifiedCompilation.UConstantFold.d_isUConstantFold'63'_262 + (coe (0 :: Integer))) _ -> MAlonzo.RTE.mazUnreachableError _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.Certificate d_Certificate_34 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_80 -> () + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_154 -> () d_Certificate_34 = erased -- VerifiedCompilation.certify d_certify_46 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_80 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_154 -> MAlonzo.Code.Utils.T_Either_6 T_Error_2 AgdaAny d_certify_46 v0 = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_step_84 v1 v2 v3 v4 + MAlonzo.Code.VerifiedCompilation.Trace.C_step_158 v1 v2 v3 v4 -> let v5 = coe d_certifyPass_26 v1 v2 v3 - (MAlonzo.Code.VerifiedCompilation.Trace.d_head_90 (coe v4)) in + (MAlonzo.Code.VerifiedCompilation.Trace.d_head_164 (coe v4)) in coe (case coe v5 of MAlonzo.Code.VerifiedCompilation.Certificate.C_proof_18 v6 @@ -165,14 +172,14 @@ d_certify_46 v0 MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_32 v8 v9 v10 -> coe MAlonzo.Code.Utils.C_inj'8321'_12 (coe C_abort_10 (coe v8)) _ -> MAlonzo.RTE.mazUnreachableError) - MAlonzo.Code.VerifiedCompilation.Trace.C_done_86 v1 + MAlonzo.Code.VerifiedCompilation.Trace.C_done_160 v1 -> coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe MAlonzo.Code.Agda.Builtin.Unit.C_tt_8) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.cert d_cert_96 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_80 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_154 -> MAlonzo.Code.Utils.T_Either_6 T_Error_2 AgdaAny -> AgdaAny -> AgdaAny d_cert_96 ~v0 v1 v2 = du_cert_96 v1 v2 @@ -193,11 +200,11 @@ d_checkScope_100 v0 (coe MAlonzo.Code.Untyped.d_scopeCheckU0_276 (coe v0)) -- VerifiedCompilation.checkScopeᵗ d_checkScope'7511'_102 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_80 -> - Maybe MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_80 + MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_154 -> + Maybe MAlonzo.Code.VerifiedCompilation.Trace.T_Trace_154 d_checkScope'7511'_102 v0 = case coe v0 of - MAlonzo.Code.VerifiedCompilation.Trace.C_step_84 v1 v2 v3 v4 + MAlonzo.Code.VerifiedCompilation.Trace.C_step_158 v1 v2 v3 v4 -> coe MAlonzo.Code.Data.Maybe.Base.du__'62''62''61'__72 (coe d_checkScope_100 (coe v3)) @@ -211,9 +218,9 @@ d_checkScope'7511'_102 v0 coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_step_84 (coe v1) (coe v2) + MAlonzo.Code.VerifiedCompilation.Trace.C_step_158 (coe v1) (coe v2) (coe v5) (coe v6)))))) - MAlonzo.Code.VerifiedCompilation.Trace.C_done_86 v1 + MAlonzo.Code.VerifiedCompilation.Trace.C_done_160 v1 -> coe MAlonzo.Code.Data.Maybe.Base.du__'62''62''61'__72 (coe d_checkScope_100 (coe v1)) @@ -221,5 +228,5 @@ d_checkScope'7511'_102 v0 (\ v2 -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_done_86 (coe v2)))) + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_done_160 (coe v2)))) _ -> MAlonzo.RTE.mazUnreachableError diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs index 74b444bfe0f..75f7bdc10c4 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Certificate.hs @@ -33,11 +33,11 @@ data T_CertResult_12 = C_proof_18 AgdaAny | C_ce_26 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12) AgdaAny AgdaAny | C_abort_32 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12) AgdaAny AgdaAny -- VerifiedCompilation.Certificate.ProofOrCE d_ProofOrCE_38 a0 a1 = () @@ -45,7 +45,7 @@ data T_ProofOrCE_38 = C_proof_44 AgdaAny | C_ce_52 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12) AgdaAny AgdaAny -- VerifiedCompilation.Certificate.isProof? d_isProof'63'_56 :: @@ -74,7 +74,7 @@ data T_Proof'63'_66 = C_proof_72 AgdaAny | C_abort_78 (MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10) + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12) AgdaAny AgdaAny -- VerifiedCompilation.Certificate._>>=_ d__'62''62''61'__88 :: @@ -145,14 +145,14 @@ d_decToPCE_234 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20 -> AgdaAny -> AgdaAny -> T_ProofOrCE_38 d_decToPCE_234 ~v0 ~v1 v2 v3 v4 v5 = du_decToPCE_234 v2 v3 v4 v5 du_decToPCE_234 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20 -> AgdaAny -> AgdaAny -> T_ProofOrCE_38 du_decToPCE_234 v0 v1 v2 v3 @@ -195,7 +195,7 @@ d_matchOrCE_262 :: (AgdaAny -> AgdaAny -> ()) -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> (AgdaAny -> AgdaAny -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20) -> @@ -205,7 +205,7 @@ d_matchOrCE_262 ~v0 ~v1 ~v2 ~v3 v4 v5 v6 v7 du_matchOrCE_262 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> (AgdaAny -> AgdaAny -> MAlonzo.Code.Relation.Nullary.Decidable.Core.T_Dec_20) -> @@ -230,7 +230,7 @@ d_pcePointwise_304 :: (AgdaAny -> AgdaAny -> ()) -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> (AgdaAny -> AgdaAny -> T_ProofOrCE_38) -> [AgdaAny] -> [AgdaAny] -> T_ProofOrCE_38 d_pcePointwise_304 ~v0 ~v1 ~v2 ~v3 v4 v5 v6 v7 @@ -238,7 +238,7 @@ d_pcePointwise_304 ~v0 ~v1 ~v2 ~v3 v4 v5 v6 v7 du_pcePointwise_304 :: MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> (AgdaAny -> AgdaAny -> T_ProofOrCE_38) -> [AgdaAny] -> [AgdaAny] -> T_ProofOrCE_38 du_pcePointwise_304 v0 v1 v2 v3 diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs index 93f9b1b72ab..419317d7079 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/Trace.hs @@ -31,41 +31,48 @@ d_UncertifiedOptTag_4 = () type T_UncertifiedOptTag_4 = UncertifiedOptStage pattern C_caseOfCaseT_6 = CaseOfCase pattern C_letFloatOutT_8 = LetFloatOut +pattern C_uncertifiedConstantFoldT_10 = UncertifiedConstantFold check_caseOfCaseT_6 :: T_UncertifiedOptTag_4 check_caseOfCaseT_6 = CaseOfCase check_letFloatOutT_8 :: T_UncertifiedOptTag_4 check_letFloatOutT_8 = LetFloatOut +check_uncertifiedConstantFoldT_10 :: T_UncertifiedOptTag_4 +check_uncertifiedConstantFoldT_10 = UncertifiedConstantFold cover_UncertifiedOptTag_4 :: UncertifiedOptStage -> () cover_UncertifiedOptTag_4 x = case x of CaseOfCase -> () LetFloatOut -> () + UncertifiedConstantFold -> () -- VerifiedCompilation.Trace.CertifiedOptTag -d_CertifiedOptTag_10 = () -type T_CertifiedOptTag_10 = CertifiedOptStage -pattern C_floatDelayT_12 = FloatDelay -pattern C_forceDelayT_14 = ForceDelay -pattern C_forceCaseDelayT_16 = ForceCaseDelay -pattern C_caseReduceT_18 = CaseReduce -pattern C_inlineT_20 = Inline -pattern C_cseT_22 = CSE -pattern C_applyToCaseT_24 = ApplyToCase -check_floatDelayT_12 :: T_CertifiedOptTag_10 -check_floatDelayT_12 = FloatDelay -check_forceDelayT_14 :: T_CertifiedOptTag_10 -check_forceDelayT_14 = ForceDelay -check_forceCaseDelayT_16 :: T_CertifiedOptTag_10 -check_forceCaseDelayT_16 = ForceCaseDelay -check_caseReduceT_18 :: T_CertifiedOptTag_10 -check_caseReduceT_18 = CaseReduce -check_inlineT_20 :: T_CertifiedOptTag_10 -check_inlineT_20 = Inline -check_cseT_22 :: T_CertifiedOptTag_10 -check_cseT_22 = CSE -check_applyToCaseT_24 :: T_CertifiedOptTag_10 -check_applyToCaseT_24 = ApplyToCase -cover_CertifiedOptTag_10 :: CertifiedOptStage -> () -cover_CertifiedOptTag_10 x +d_CertifiedOptTag_12 = () +type T_CertifiedOptTag_12 = CertifiedOptStage +pattern C_floatDelayT_14 = FloatDelay +pattern C_forceDelayT_16 = ForceDelay +pattern C_forceCaseDelayT_18 = ForceCaseDelay +pattern C_caseReduceT_20 = CaseReduce +pattern C_inlineT_22 = Inline +pattern C_cseT_24 = CSE +pattern C_applyToCaseT_26 = ApplyToCase +pattern C_constantFoldT_28 = ConstantFold +check_floatDelayT_14 :: T_CertifiedOptTag_12 +check_floatDelayT_14 = FloatDelay +check_forceDelayT_16 :: T_CertifiedOptTag_12 +check_forceDelayT_16 = ForceDelay +check_forceCaseDelayT_18 :: T_CertifiedOptTag_12 +check_forceCaseDelayT_18 = ForceCaseDelay +check_caseReduceT_20 :: T_CertifiedOptTag_12 +check_caseReduceT_20 = CaseReduce +check_inlineT_22 :: T_CertifiedOptTag_12 +check_inlineT_22 = Inline +check_cseT_24 :: T_CertifiedOptTag_12 +check_cseT_24 = CSE +check_applyToCaseT_26 :: T_CertifiedOptTag_12 +check_applyToCaseT_26 = ApplyToCase +check_constantFoldT_28 :: T_CertifiedOptTag_12 +check_constantFoldT_28 = ConstantFold +cover_CertifiedOptTag_12 :: CertifiedOptStage -> () +cover_CertifiedOptTag_12 x = case x of FloatDelay -> () ForceDelay -> () @@ -74,109 +81,254 @@ cover_CertifiedOptTag_10 x Inline -> () CSE -> () ApplyToCase -> () + ConstantFold -> () -- VerifiedCompilation.Trace.OptTag -d_OptTag_26 :: () -d_OptTag_26 = erased +d_OptTag_30 :: () +d_OptTag_30 = erased -- VerifiedCompilation.Trace.FloatDelayT -d_FloatDelayT_28 :: +d_FloatDelayT_32 :: MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10 -d_FloatDelayT_28 - = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_floatDelayT_12) + T_UncertifiedOptTag_4 T_CertifiedOptTag_12 +d_FloatDelayT_32 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_floatDelayT_14) -- VerifiedCompilation.Trace.ForceDelayT -d_ForceDelayT_30 :: +d_ForceDelayT_34 :: MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10 -d_ForceDelayT_30 - = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_forceDelayT_14) + T_UncertifiedOptTag_4 T_CertifiedOptTag_12 +d_ForceDelayT_34 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_forceDelayT_16) -- VerifiedCompilation.Trace.ForceCaseDelayT -d_ForceCaseDelayT_32 :: +d_ForceCaseDelayT_36 :: MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10 -d_ForceCaseDelayT_32 - = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_forceCaseDelayT_16) + T_UncertifiedOptTag_4 T_CertifiedOptTag_12 +d_ForceCaseDelayT_36 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_forceCaseDelayT_18) -- VerifiedCompilation.Trace.CaseReduceT -d_CaseReduceT_34 :: +d_CaseReduceT_38 :: MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10 -d_CaseReduceT_34 - = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_caseReduceT_18) + T_UncertifiedOptTag_4 T_CertifiedOptTag_12 +d_CaseReduceT_38 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_caseReduceT_20) -- VerifiedCompilation.Trace.InlineT -d_InlineT_36 :: +d_InlineT_40 :: MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10 -d_InlineT_36 - = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_inlineT_20) + T_UncertifiedOptTag_4 T_CertifiedOptTag_12 +d_InlineT_40 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_inlineT_22) -- VerifiedCompilation.Trace.CseT -d_CseT_38 :: +d_CseT_42 :: MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10 -d_CseT_38 = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_cseT_22) + T_UncertifiedOptTag_4 T_CertifiedOptTag_12 +d_CseT_42 = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_cseT_24) -- VerifiedCompilation.Trace.ApplyToCaseT -d_ApplyToCaseT_40 :: +d_ApplyToCaseT_44 :: MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10 -d_ApplyToCaseT_40 - = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_applyToCaseT_24) + T_UncertifiedOptTag_4 T_CertifiedOptTag_12 +d_ApplyToCaseT_44 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_applyToCaseT_26) +-- VerifiedCompilation.Trace.ConstantFoldT +d_ConstantFoldT_46 :: + MAlonzo.Code.Utils.T_Either_6 + T_UncertifiedOptTag_4 T_CertifiedOptTag_12 +d_ConstantFoldT_46 + = coe MAlonzo.Code.Utils.C_inj'8322'_14 (coe C_constantFoldT_28) -- VerifiedCompilation.Trace.CaseOfCaseT -d_CaseOfCaseT_42 :: +d_CaseOfCaseT_48 :: MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10 -d_CaseOfCaseT_42 + T_UncertifiedOptTag_4 T_CertifiedOptTag_12 +d_CaseOfCaseT_48 = coe MAlonzo.Code.Utils.C_inj'8321'_12 (coe C_caseOfCaseT_6) -- VerifiedCompilation.Trace.LetFloatOutT -d_LetFloatOutT_44 :: +d_LetFloatOutT_50 :: MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10 -d_LetFloatOutT_44 + T_UncertifiedOptTag_4 T_CertifiedOptTag_12 +d_LetFloatOutT_50 = coe MAlonzo.Code.Utils.C_inj'8321'_12 (coe C_letFloatOutT_8) +-- VerifiedCompilation.Trace.CertifiedBuiltin +d_CertifiedBuiltin_52 = () +type T_CertifiedBuiltin_52 = CertifiedBuiltin +pattern C_certAddInteger_54 = CertAddInteger +pattern C_certSubtractInteger_56 = CertSubtractInteger +pattern C_certMultiplyInteger_58 = CertMultiplyInteger +pattern C_certDivideInteger_60 = CertDivideInteger +pattern C_certQuotientInteger_62 = CertQuotientInteger +pattern C_certRemainderInteger_64 = CertRemainderInteger +pattern C_certModInteger_66 = CertModInteger +pattern C_certEqualsInteger_68 = CertEqualsInteger +pattern C_certLessThanInteger_70 = CertLessThanInteger +pattern C_certLessThanEqualsInteger_72 = CertLessThanEqualsInteger +pattern C_certIfThenElse_74 = CertIfThenElse +pattern C_certChooseUnit_76 = CertChooseUnit +pattern C_certFstPair_78 = CertFstPair +pattern C_certSndPair_80 = CertSndPair +pattern C_certChooseList_82 = CertChooseList +pattern C_certMkCons_84 = CertMkCons +pattern C_certHeadList_86 = CertHeadList +pattern C_certTailList_88 = CertTailList +pattern C_certNullList_90 = CertNullList +pattern C_certDropList_92 = CertDropList +pattern C_certChooseData_94 = CertChooseData +pattern C_certConstrData_96 = CertConstrData +pattern C_certMapData_98 = CertMapData +pattern C_certListData_100 = CertListData +pattern C_certIData_102 = CertIData +pattern C_certUnConstrData_104 = CertUnConstrData +pattern C_certUnMapData_106 = CertUnMapData +pattern C_certUnListData_108 = CertUnListData +pattern C_certUnIData_110 = CertUnIData +pattern C_certEqualsData_112 = CertEqualsData +pattern C_certMkPairData_114 = CertMkPairData +pattern C_certMkNilData_116 = CertMkNilData +pattern C_certMkNilPairData_118 = CertMkNilPairData +check_certAddInteger_54 :: T_CertifiedBuiltin_52 +check_certAddInteger_54 = CertAddInteger +check_certSubtractInteger_56 :: T_CertifiedBuiltin_52 +check_certSubtractInteger_56 = CertSubtractInteger +check_certMultiplyInteger_58 :: T_CertifiedBuiltin_52 +check_certMultiplyInteger_58 = CertMultiplyInteger +check_certDivideInteger_60 :: T_CertifiedBuiltin_52 +check_certDivideInteger_60 = CertDivideInteger +check_certQuotientInteger_62 :: T_CertifiedBuiltin_52 +check_certQuotientInteger_62 = CertQuotientInteger +check_certRemainderInteger_64 :: T_CertifiedBuiltin_52 +check_certRemainderInteger_64 = CertRemainderInteger +check_certModInteger_66 :: T_CertifiedBuiltin_52 +check_certModInteger_66 = CertModInteger +check_certEqualsInteger_68 :: T_CertifiedBuiltin_52 +check_certEqualsInteger_68 = CertEqualsInteger +check_certLessThanInteger_70 :: T_CertifiedBuiltin_52 +check_certLessThanInteger_70 = CertLessThanInteger +check_certLessThanEqualsInteger_72 :: T_CertifiedBuiltin_52 +check_certLessThanEqualsInteger_72 = CertLessThanEqualsInteger +check_certIfThenElse_74 :: T_CertifiedBuiltin_52 +check_certIfThenElse_74 = CertIfThenElse +check_certChooseUnit_76 :: T_CertifiedBuiltin_52 +check_certChooseUnit_76 = CertChooseUnit +check_certFstPair_78 :: T_CertifiedBuiltin_52 +check_certFstPair_78 = CertFstPair +check_certSndPair_80 :: T_CertifiedBuiltin_52 +check_certSndPair_80 = CertSndPair +check_certChooseList_82 :: T_CertifiedBuiltin_52 +check_certChooseList_82 = CertChooseList +check_certMkCons_84 :: T_CertifiedBuiltin_52 +check_certMkCons_84 = CertMkCons +check_certHeadList_86 :: T_CertifiedBuiltin_52 +check_certHeadList_86 = CertHeadList +check_certTailList_88 :: T_CertifiedBuiltin_52 +check_certTailList_88 = CertTailList +check_certNullList_90 :: T_CertifiedBuiltin_52 +check_certNullList_90 = CertNullList +check_certDropList_92 :: T_CertifiedBuiltin_52 +check_certDropList_92 = CertDropList +check_certChooseData_94 :: T_CertifiedBuiltin_52 +check_certChooseData_94 = CertChooseData +check_certConstrData_96 :: T_CertifiedBuiltin_52 +check_certConstrData_96 = CertConstrData +check_certMapData_98 :: T_CertifiedBuiltin_52 +check_certMapData_98 = CertMapData +check_certListData_100 :: T_CertifiedBuiltin_52 +check_certListData_100 = CertListData +check_certIData_102 :: T_CertifiedBuiltin_52 +check_certIData_102 = CertIData +check_certUnConstrData_104 :: T_CertifiedBuiltin_52 +check_certUnConstrData_104 = CertUnConstrData +check_certUnMapData_106 :: T_CertifiedBuiltin_52 +check_certUnMapData_106 = CertUnMapData +check_certUnListData_108 :: T_CertifiedBuiltin_52 +check_certUnListData_108 = CertUnListData +check_certUnIData_110 :: T_CertifiedBuiltin_52 +check_certUnIData_110 = CertUnIData +check_certEqualsData_112 :: T_CertifiedBuiltin_52 +check_certEqualsData_112 = CertEqualsData +check_certMkPairData_114 :: T_CertifiedBuiltin_52 +check_certMkPairData_114 = CertMkPairData +check_certMkNilData_116 :: T_CertifiedBuiltin_52 +check_certMkNilData_116 = CertMkNilData +check_certMkNilPairData_118 :: T_CertifiedBuiltin_52 +check_certMkNilPairData_118 = CertMkNilPairData +cover_CertifiedBuiltin_52 :: CertifiedBuiltin -> () +cover_CertifiedBuiltin_52 x + = case x of + CertAddInteger -> () + CertSubtractInteger -> () + CertMultiplyInteger -> () + CertDivideInteger -> () + CertQuotientInteger -> () + CertRemainderInteger -> () + CertModInteger -> () + CertEqualsInteger -> () + CertLessThanInteger -> () + CertLessThanEqualsInteger -> () + CertIfThenElse -> () + CertChooseUnit -> () + CertFstPair -> () + CertSndPair -> () + CertChooseList -> () + CertMkCons -> () + CertHeadList -> () + CertTailList -> () + CertNullList -> () + CertDropList -> () + CertChooseData -> () + CertConstrData -> () + CertMapData -> () + CertListData -> () + CertIData -> () + CertUnConstrData -> () + CertUnMapData -> () + CertUnListData -> () + CertUnIData -> () + CertEqualsData -> () + CertMkPairData -> () + CertMkNilData -> () + CertMkNilPairData -> () -- VerifiedCompilation.Trace.InlineHints -d_InlineHints_46 = () -type T_InlineHints_46 = Hints.Inline -pattern C_var_48 = Hints.InlVar -pattern C_expand_50 a0 = Hints.InlExpand a0 -pattern C_ƛ_52 a0 = Hints.InlLam a0 -pattern C__'183'__54 a0 a1 = Hints.InlApply a0 a1 -pattern C__'183''8595'_56 a0 = Hints.InlDrop a0 -pattern C_force_58 a0 = Hints.InlForce a0 -pattern C_delay_60 a0 = Hints.InlDelay a0 -pattern C_con_62 = Hints.InlCon -pattern C_builtin_64 = Hints.InlBuiltin -pattern C_error_66 = Hints.InlError -pattern C_constr_68 a0 = Hints.InlConstr a0 -pattern C_case_70 a0 a1 = Hints.InlCase a0 a1 -check_var_48 :: T_InlineHints_46 -check_var_48 = Hints.InlVar -check_expand_50 :: T_InlineHints_46 -> T_InlineHints_46 -check_expand_50 = Hints.InlExpand -check_ƛ_52 :: T_InlineHints_46 -> T_InlineHints_46 -check_ƛ_52 = Hints.InlLam -check__'183'__54 :: - T_InlineHints_46 -> T_InlineHints_46 -> T_InlineHints_46 -check__'183'__54 = Hints.InlApply -check__'183''8595'_56 :: T_InlineHints_46 -> T_InlineHints_46 -check__'183''8595'_56 = Hints.InlDrop -check_force_58 :: T_InlineHints_46 -> T_InlineHints_46 -check_force_58 = Hints.InlForce -check_delay_60 :: T_InlineHints_46 -> T_InlineHints_46 -check_delay_60 = Hints.InlDelay -check_con_62 :: T_InlineHints_46 -check_con_62 = Hints.InlCon -check_builtin_64 :: T_InlineHints_46 -check_builtin_64 = Hints.InlBuiltin -check_error_66 :: T_InlineHints_46 -check_error_66 = Hints.InlError -check_constr_68 :: - MAlonzo.Code.Agda.Builtin.List.T_List_10 () T_InlineHints_46 -> - T_InlineHints_46 -check_constr_68 = Hints.InlConstr -check_case_70 :: - T_InlineHints_46 -> - MAlonzo.Code.Agda.Builtin.List.T_List_10 () T_InlineHints_46 -> - T_InlineHints_46 -check_case_70 = Hints.InlCase -cover_InlineHints_46 :: Hints.Inline -> () -cover_InlineHints_46 x +d_InlineHints_120 = () +type T_InlineHints_120 = Hints.Inline +pattern C_var_122 = Hints.InlVar +pattern C_expand_124 a0 = Hints.InlExpand a0 +pattern C_ƛ_126 a0 = Hints.InlLam a0 +pattern C__'183'__128 a0 a1 = Hints.InlApply a0 a1 +pattern C__'183''8595'_130 a0 = Hints.InlDrop a0 +pattern C_force_132 a0 = Hints.InlForce a0 +pattern C_delay_134 a0 = Hints.InlDelay a0 +pattern C_con_136 = Hints.InlCon +pattern C_builtin_138 = Hints.InlBuiltin +pattern C_error_140 = Hints.InlError +pattern C_constr_142 a0 = Hints.InlConstr a0 +pattern C_case_144 a0 a1 = Hints.InlCase a0 a1 +check_var_122 :: T_InlineHints_120 +check_var_122 = Hints.InlVar +check_expand_124 :: T_InlineHints_120 -> T_InlineHints_120 +check_expand_124 = Hints.InlExpand +check_ƛ_126 :: T_InlineHints_120 -> T_InlineHints_120 +check_ƛ_126 = Hints.InlLam +check__'183'__128 :: + T_InlineHints_120 -> T_InlineHints_120 -> T_InlineHints_120 +check__'183'__128 = Hints.InlApply +check__'183''8595'_130 :: T_InlineHints_120 -> T_InlineHints_120 +check__'183''8595'_130 = Hints.InlDrop +check_force_132 :: T_InlineHints_120 -> T_InlineHints_120 +check_force_132 = Hints.InlForce +check_delay_134 :: T_InlineHints_120 -> T_InlineHints_120 +check_delay_134 = Hints.InlDelay +check_con_136 :: T_InlineHints_120 +check_con_136 = Hints.InlCon +check_builtin_138 :: T_InlineHints_120 +check_builtin_138 = Hints.InlBuiltin +check_error_140 :: T_InlineHints_120 +check_error_140 = Hints.InlError +check_constr_142 :: + MAlonzo.Code.Agda.Builtin.List.T_List_10 () T_InlineHints_120 -> + T_InlineHints_120 +check_constr_142 = Hints.InlConstr +check_case_144 :: + T_InlineHints_120 -> + MAlonzo.Code.Agda.Builtin.List.T_List_10 () T_InlineHints_120 -> + T_InlineHints_120 +check_case_144 = Hints.InlCase +cover_InlineHints_120 :: Hints.Inline -> () +cover_InlineHints_120 x = case x of Hints.InlVar -> () Hints.InlExpand _ -> () @@ -191,110 +343,110 @@ cover_InlineHints_46 x Hints.InlConstr _ -> () Hints.InlCase _ _ -> () -- VerifiedCompilation.Trace.Hints -d_Hints_72 = () -type T_Hints_72 = Hints.Hints -pattern C_inline_74 a0 = Hints.Inline a0 -pattern C_none_76 = Hints.NoHints -check_inline_74 :: T_InlineHints_46 -> T_Hints_72 -check_inline_74 = Hints.Inline -check_none_76 :: T_Hints_72 -check_none_76 = Hints.NoHints -cover_Hints_72 :: Hints.Hints -> () -cover_Hints_72 x +d_Hints_146 = () +type T_Hints_146 = Hints.Hints +pattern C_inline_148 a0 = Hints.Inline a0 +pattern C_none_150 = Hints.NoHints +check_inline_148 :: T_InlineHints_120 -> T_Hints_146 +check_inline_148 = Hints.Inline +check_none_150 :: T_Hints_146 +check_none_150 = Hints.NoHints +cover_Hints_146 :: Hints.Hints -> () +cover_Hints_146 x = case x of Hints.Inline _ -> () Hints.NoHints -> () -- VerifiedCompilation.Trace.Trace -d_Trace_80 a0 = () -data T_Trace_80 - = C_step_84 (MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10) - T_Hints_72 AgdaAny T_Trace_80 | - C_done_86 AgdaAny +d_Trace_154 a0 = () +data T_Trace_154 + = C_step_158 (MAlonzo.Code.Utils.T_Either_6 + T_UncertifiedOptTag_4 T_CertifiedOptTag_12) + T_Hints_146 AgdaAny T_Trace_154 | + C_done_160 AgdaAny -- VerifiedCompilation.Trace.head -d_head_90 :: T_Trace_80 -> AgdaAny -d_head_90 v0 +d_head_164 :: T_Trace_154 -> AgdaAny +d_head_164 v0 = case coe v0 of - C_step_84 v1 v2 v3 v4 -> coe v3 - C_done_86 v1 -> coe v1 + C_step_158 v1 v2 v3 v4 -> coe v3 + C_done_160 v1 -> coe v1 _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.Trace.Dump -d_Dump_96 :: () -d_Dump_96 = erased +d_Dump_170 :: () +d_Dump_170 = erased -- VerifiedCompilation.Trace.toTrace -d_toTrace_98 :: +d_toTrace_172 :: [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_12) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_72 + T_Hints_146 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> - Maybe T_Trace_80 -d_toTrace_98 v0 + Maybe T_Trace_154 +d_toTrace_172 v0 = case coe v0 of [] -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 (:) v1 v2 -> coe MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 - (coe du_go_108 (coe v1) (coe v2)) + (coe du_go_182 (coe v1) (coe v2)) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.Trace._.go -d_go_108 :: +d_go_182 :: MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_12) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_72 + T_Hints_146 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208)) -> [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_12) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_72 + T_Hints_146 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_12) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_72 + T_Hints_146 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208)) -> [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_12) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_72 + T_Hints_146 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> - T_Trace_80 -d_go_108 ~v0 ~v1 v2 v3 = du_go_108 v2 v3 -du_go_108 :: + T_Trace_154 +d_go_182 ~v0 ~v1 v2 v3 = du_go_182 v2 v3 +du_go_182 :: MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_12) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_72 + T_Hints_146 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208)) -> [MAlonzo.Code.Utils.T__'215'__428 (MAlonzo.Code.Utils.T_Either_6 - T_UncertifiedOptTag_4 T_CertifiedOptTag_10) + T_UncertifiedOptTag_4 T_CertifiedOptTag_12) (MAlonzo.Code.Utils.T__'215'__428 - T_Hints_72 + T_Hints_146 (MAlonzo.Code.Utils.T__'215'__428 MAlonzo.Code.RawU.T_Untyped_208 MAlonzo.Code.RawU.T_Untyped_208))] -> - T_Trace_80 -du_go_108 v0 v1 + T_Trace_154 +du_go_182 v0 v1 = case coe v0 of MAlonzo.Code.Utils.C__'44'__442 v2 v3 -> case coe v3 of @@ -304,7 +456,7 @@ du_go_108 v0 v1 -> case coe v1 of [] -> coe - C_step_84 (coe v2) (coe v4) (coe v6) (coe C_done_86 (coe v7)) + C_step_158 (coe v2) (coe v4) (coe v6) (coe C_done_160 (coe v7)) (:) v8 v9 -> case coe v8 of MAlonzo.Code.Utils.C__'44'__442 v10 v11 @@ -313,9 +465,9 @@ du_go_108 v0 v1 -> case coe v13 of MAlonzo.Code.Utils.C__'44'__442 v14 v15 -> coe - C_step_84 (coe v2) (coe v4) (coe v6) + C_step_158 (coe v2) (coe v4) (coe v6) (coe - du_go_108 + du_go_182 (coe MAlonzo.Code.Utils.C__'44'__442 (coe v10) @@ -334,18 +486,18 @@ du_go_108 v0 v1 _ -> MAlonzo.RTE.mazUnreachableError _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.Trace.EvalResult -d_EvalResult_134 = () -type T_EvalResult_134 = EvalResult -pattern C_success_136 a0 a1 = EvalSuccess a0 a1 -pattern C_failure_138 a0 a1 a2 = EvalFailure a0 a1 a2 -check_success_136 :: Integer -> Integer -> T_EvalResult_134 -check_success_136 = EvalSuccess -check_failure_138 :: +d_EvalResult_208 = () +type T_EvalResult_208 = EvalResult +pattern C_success_210 a0 a1 = EvalSuccess a0 a1 +pattern C_failure_212 a0 a1 a2 = EvalFailure a0 a1 a2 +check_success_210 :: Integer -> Integer -> T_EvalResult_208 +check_success_210 = EvalSuccess +check_failure_212 :: MAlonzo.Code.Agda.Builtin.String.T_String_6 -> - Integer -> Integer -> T_EvalResult_134 -check_failure_138 = EvalFailure -cover_EvalResult_134 :: EvalResult -> () -cover_EvalResult_134 x + Integer -> Integer -> T_EvalResult_208 +check_failure_212 = EvalFailure +cover_EvalResult_208 :: EvalResult -> () +cover_EvalResult_208 x = case x of EvalSuccess _ _ -> () EvalFailure _ _ _ -> () diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs index 5f9b7fb0e6e..438bc1e9acd 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UApplyToCase.hs @@ -44,7 +44,7 @@ d_a2c'63''7580''7580'_24 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_44) (coe d_a2c'63'_32) -- VerifiedCompilation.UApplyToCase.a2c? d_a2c'63'_32 :: @@ -75,31 +75,31 @@ d_a2c'63'_32 v0 v1 v2 MAlonzo.Code.Untyped.C_'96'_18 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_44 v1 v2 MAlonzo.Code.Untyped.C_ƛ_20 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_44 v1 v2 MAlonzo.Code.Untyped.C__'183'__22 v5 v6 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_44 v1 v2 MAlonzo.Code.Untyped.C_force_24 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_44 v1 v2 MAlonzo.Code.Untyped.C_delay_26 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_44 v1 v2 MAlonzo.Code.Untyped.C_con_28 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_44 v1 v2 MAlonzo.Code.Untyped.C_constr_34 v5 v6 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_44 v1 v2 MAlonzo.Code.Untyped.C_case_40 v5 v6 -> let v7 = coe @@ -241,18 +241,18 @@ d_a2c'63'_32 v0 v1 v2 seq (coe v12) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_44 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError) MAlonzo.Code.Untyped.C_builtin_44 v5 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_44 v1 v2 MAlonzo.Code.Untyped.C_error_46 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_40 v1 v2 + MAlonzo.Code.VerifiedCompilation.Trace.d_ApplyToCaseT_44 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError)) -- VerifiedCompilation.UApplyToCase..extendedlambda0 d_'46'extendedlambda0_48 :: @@ -276,7 +276,7 @@ d_'46'extendedlambda1_94 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> T_ApplyToCase_4 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs index 34d8e9b0985..54b40b35e7a 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCSE.hs @@ -47,7 +47,7 @@ d_isUntypedCSE'63'_26 :: d_isUntypedCSE'63'_26 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 - (coe v0) (coe MAlonzo.Code.VerifiedCompilation.Trace.d_CseT_38) + (coe v0) (coe MAlonzo.Code.VerifiedCompilation.Trace.d_CseT_42) (coe d_isUCSE'63'_30) -- VerifiedCompilation.UCSE.isUCSE? d_isUCSE'63'_30 :: @@ -116,7 +116,7 @@ d_isUCSE'63'_30 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_CseT_38 v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_CseT_42 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UCSE..extendedlambda0 d_'46'extendedlambda0_46 :: @@ -139,7 +139,7 @@ d_'46'extendedlambda1_78 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> T_UCSE_4 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda1_78 = erased diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs index b4bef7b61b0..17269c21022 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseOfCase.hs @@ -560,7 +560,7 @@ d_isCaseOfCase'63'_256 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_42) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_48) (coe d_isCoC'63'_264) -- VerifiedCompilation.UCaseOfCase.isCoC? d_isCoC'63'_264 :: @@ -671,7 +671,7 @@ d_isCoC'63'_264 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_42) + MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_48) (coe d_isCaseOfCase'63'_256 (coe @@ -688,7 +688,7 @@ d_isCoC'63'_264 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_42) + MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_48) (coe d_isCaseOfCase'63'_256 (coe @@ -705,7 +705,7 @@ d_isCoC'63'_264 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_42) + MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_48) (coe d_isCaseOfCase'63'_256 (coe @@ -754,7 +754,7 @@ d_isCoC'63'_264 v0 v1 v2 v40) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_42 + MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_48 (coe MAlonzo.Code.Untyped.C_case_40 (coe @@ -826,7 +826,7 @@ d_isCoC'63'_264 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_42 v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_CaseOfCaseT_48 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UCaseOfCase..extendedlambda4 d_'46'extendedlambda4_280 :: @@ -867,7 +867,7 @@ d_'46'extendedlambda6_444 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -890,7 +890,7 @@ d_'46'extendedlambda7_524 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> @@ -914,7 +914,7 @@ d_'46'extendedlambda8_608 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs index cc4301735d6..eb6735813db 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UCaseReduce.hs @@ -50,7 +50,7 @@ d_isCaseReduce'63'_26 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_CaseReduceT_34) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_CaseReduceT_38) (coe d_isCR'63'_42) -- VerifiedCompilation.UCaseReduce.justEq d_justEq_34 :: @@ -133,7 +133,7 @@ d_isCR'63'_42 v0 v1 v2 MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_CaseReduceT_34 + MAlonzo.Code.VerifiedCompilation.Trace.d_CaseReduceT_38 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError))) _ -> MAlonzo.RTE.mazUnreachableError @@ -145,7 +145,7 @@ d_isCR'63'_42 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_CaseReduceT_34 v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_CaseReduceT_38 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UCaseReduce..extendedlambda0 d_'46'extendedlambda0_58 :: @@ -192,7 +192,7 @@ d_'46'extendedlambda3_142 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UConstantFold.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UConstantFold.hs new file mode 100644 index 00000000000..60af93e4ccd --- /dev/null +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UConstantFold.hs @@ -0,0 +1,1376 @@ +{-# LANGUAGE BangPatterns #-} +{-# LANGUAGE EmptyCase #-} +{-# LANGUAGE EmptyDataDecls #-} +{-# LANGUAGE ExistentialQuantification #-} +{-# LANGUAGE NoMonomorphismRestriction #-} +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE PatternSynonyms #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} + +{-# OPTIONS_GHC -Wno-overlapping-patterns #-} + +module MAlonzo.Code.VerifiedCompilation.UConstantFold where + +import MAlonzo.RTE (coe, erased, AgdaAny, addInt, subInt, mulInt, + quotInt, remInt, geqInt, ltInt, eqInt, add64, sub64, mul64, quot64, + rem64, lt64, eq64, word64FromNat, word64ToNat) +import qualified MAlonzo.RTE +import qualified Data.Text +import qualified MAlonzo.Code.Agda.Builtin.Bool +import qualified MAlonzo.Code.Agda.Builtin.Equality +import qualified MAlonzo.Code.Agda.Builtin.Maybe +import qualified MAlonzo.Code.Builtin +import qualified MAlonzo.Code.Builtin.Constant.AtomicType +import qualified MAlonzo.Code.Builtin.Signature +import qualified MAlonzo.Code.Data.Bool.Base +import qualified MAlonzo.Code.Data.Integer.Base +import qualified MAlonzo.Code.Data.Integer.Properties +import qualified MAlonzo.Code.RawU +import qualified MAlonzo.Code.Relation.Nullary.Decidable.Core +import qualified MAlonzo.Code.Untyped +import qualified MAlonzo.Code.Untyped.Equality +import qualified MAlonzo.Code.Utils +import qualified MAlonzo.Code.VerifiedCompilation.Certificate +import qualified MAlonzo.Code.VerifiedCompilation.Trace +import qualified MAlonzo.Code.VerifiedCompilation.UntypedTranslation + +-- VerifiedCompilation.UConstantFold.evalCF +d_evalCF_6 :: + Integer -> + MAlonzo.Code.Untyped.T__'8866'_14 -> + Maybe MAlonzo.Code.Untyped.T__'8866'_14 +d_evalCF_6 ~v0 v1 = du_evalCF_6 v1 +du_evalCF_6 :: + MAlonzo.Code.Untyped.T__'8866'_14 -> + Maybe MAlonzo.Code.Untyped.T__'8866'_14 +du_evalCF_6 v0 + = let v1 = coe MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 in + coe + (case coe v0 of + MAlonzo.Code.Untyped.C__'183'__22 v2 v3 + -> case coe v2 of + MAlonzo.Code.Untyped.C__'183'__22 v4 v5 + -> case coe v4 of + MAlonzo.Code.Untyped.C__'183'__22 v6 v7 + -> case coe v6 of + MAlonzo.Code.Untyped.C__'183'__22 v8 v9 + -> case coe v8 of + MAlonzo.Code.Untyped.C__'183'__22 v10 v11 + -> case coe v10 of + MAlonzo.Code.Untyped.C__'183'__22 v12 v13 + -> case coe v12 of + MAlonzo.Code.Untyped.C_force_24 v14 + -> case coe v14 of + MAlonzo.Code.Untyped.C_builtin_44 v15 + -> case coe v15 of + MAlonzo.Code.Builtin.C_chooseData_86 + -> case coe v13 of + MAlonzo.Code.Untyped.C_con_28 v16 + -> case coe v16 of + MAlonzo.Code.RawU.C_tmCon_206 v17 v18 + -> case coe v17 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v20 + -> case coe + v20 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18 + -> case coe + v18 of + MAlonzo.Code.Utils.C_ConstrDATA_612 v21 v22 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + v11) + MAlonzo.Code.Utils.C_MapDATA_614 v21 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + v9) + MAlonzo.Code.Utils.C_ListDATA_616 v21 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + v7) + MAlonzo.Code.Utils.C_iDATA_618 v21 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + v5) + MAlonzo.Code.Utils.C_bDATA_620 v21 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + v3) + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe + v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + MAlonzo.Code.Untyped.C_force_24 v8 + -> case coe v8 of + MAlonzo.Code.Untyped.C_force_24 v9 + -> case coe v9 of + MAlonzo.Code.Untyped.C_builtin_44 v10 + -> case coe v10 of + MAlonzo.Code.Builtin.C_chooseList_70 + -> case coe v7 of + MAlonzo.Code.Untyped.C_con_28 v11 + -> case coe v11 of + MAlonzo.Code.RawU.C_tmCon_206 v12 v13 + -> case coe v12 of + MAlonzo.Code.Builtin.Signature.C_list_16 v15 + -> case coe v13 of + MAlonzo.Code.Utils.C_'91''93'_450 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe v5) + MAlonzo.Code.Utils.C__'8759'__452 v16 v17 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe v3) + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + MAlonzo.Code.Untyped.C_builtin_44 v9 + -> case coe v9 of + MAlonzo.Code.Builtin.C_ifThenElse_60 + -> case coe v7 of + MAlonzo.Code.Untyped.C_con_28 v10 + -> case coe v10 of + MAlonzo.Code.RawU.C_tmCon_206 v11 v12 + -> case coe v11 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v14 + -> case coe v14 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aBool_16 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Data.Bool.Base.du_if_then_else__44 + (coe v12) (coe v5) + (coe v3)) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + MAlonzo.Code.Untyped.C_force_24 v6 + -> case coe v6 of + MAlonzo.Code.Untyped.C_builtin_44 v7 + -> case coe v7 of + MAlonzo.Code.Builtin.C_chooseUnit_62 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v8 + -> case coe v8 of + MAlonzo.Code.RawU.C_tmCon_206 v9 v10 + -> case coe v9 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v12 + -> case coe v12 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aUnit_14 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe v3) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_mkCons_72 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v8 + -> case coe v8 of + MAlonzo.Code.RawU.C_tmCon_206 v9 v10 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v11 + -> case coe v11 of + MAlonzo.Code.RawU.C_tmCon_206 v12 v13 + -> case coe v12 of + MAlonzo.Code.Builtin.Signature.C_list_16 v15 + -> let v16 + = MAlonzo.Code.RawU.d_decTyTag_68 + (coe v9) + (coe v15) in + coe + (case coe v16 of + MAlonzo.Code.Relation.Nullary.Decidable.Core.C__because__32 v17 v18 + -> if coe v17 + then coe + seq + (coe + v18) + (coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_list_16 + v9) + (coe + MAlonzo.Code.Utils.C__'8759'__452 + (coe + v10) + (coe + v13))))) + else coe + seq + (coe + v18) + (coe + MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18) + _ -> MAlonzo.RTE.mazUnreachableError) + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_dropList_186 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v8 + -> case coe v8 of + MAlonzo.Code.RawU.C_tmCon_206 v9 v10 + -> case coe v9 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v12 + -> case coe v12 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v13 + -> case coe v13 of + MAlonzo.Code.RawU.C_tmCon_206 v14 v15 + -> case coe v14 of + MAlonzo.Code.Builtin.Signature.C_list_16 v17 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_list_16 + v17) + (coe + MAlonzo.Code.Utils.du_dropLIST_520 + (coe + v10) + (coe + v15)))) + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + MAlonzo.Code.Untyped.C_builtin_44 v6 + -> case coe v6 of + MAlonzo.Code.Builtin.C_addInteger_4 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v11 + -> case coe v11 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v12 + -> case coe v12 of + MAlonzo.Code.RawU.C_tmCon_206 v13 v14 + -> case coe v13 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v16 + -> case coe v16 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v16) + (coe + MAlonzo.Code.Data.Integer.Base.d__'43'__284 + (coe + v9) + (coe + v14)))) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_subtractInteger_6 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v11 + -> case coe v11 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v12 + -> case coe v12 of + MAlonzo.Code.RawU.C_tmCon_206 v13 v14 + -> case coe v13 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v16 + -> case coe v16 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v16) + (coe + MAlonzo.Code.Data.Integer.Base.d__'45'__302 + (coe + v9) + (coe + v14)))) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_multiplyInteger_8 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v11 + -> case coe v11 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v12 + -> case coe v12 of + MAlonzo.Code.RawU.C_tmCon_206 v13 v14 + -> case coe v13 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v16 + -> case coe v16 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v16) + (coe + MAlonzo.Code.Data.Integer.Base.d__'42'__316 + (coe + v9) + (coe + v14)))) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_divideInteger_10 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v11 + -> case coe v11 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v12 + -> case coe v12 of + MAlonzo.Code.RawU.C_tmCon_206 v13 v14 + -> case coe v13 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v16 + -> case coe v16 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> let v17 + = MAlonzo.Code.Data.Integer.Properties.d__'8799'__2800 + (coe + v14) + (coe + (0 :: + Integer)) in + coe + (case coe + v17 of + MAlonzo.Code.Relation.Nullary.Decidable.Core.C__because__32 v18 v19 + -> if coe + v18 + then coe + seq + (coe + v19) + (coe + MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18) + else coe + seq + (coe + v19) + (coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v16) + (coe + MAlonzo.Code.Builtin.d_div_312 + v9 + v14)))) + _ -> MAlonzo.RTE.mazUnreachableError) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_quotientInteger_12 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v11 + -> case coe v11 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v12 + -> case coe v12 of + MAlonzo.Code.RawU.C_tmCon_206 v13 v14 + -> case coe v13 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v16 + -> case coe v16 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> let v17 + = MAlonzo.Code.Data.Integer.Properties.d__'8799'__2800 + (coe + v14) + (coe + (0 :: + Integer)) in + coe + (case coe + v17 of + MAlonzo.Code.Relation.Nullary.Decidable.Core.C__because__32 v18 v19 + -> if coe + v18 + then coe + seq + (coe + v19) + (coe + MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18) + else coe + seq + (coe + v19) + (coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v16) + (coe + MAlonzo.Code.Builtin.d_quot_314 + v9 + v14)))) + _ -> MAlonzo.RTE.mazUnreachableError) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_remainderInteger_14 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v11 + -> case coe v11 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v12 + -> case coe v12 of + MAlonzo.Code.RawU.C_tmCon_206 v13 v14 + -> case coe v13 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v16 + -> case coe v16 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> let v17 + = MAlonzo.Code.Data.Integer.Properties.d__'8799'__2800 + (coe + v14) + (coe + (0 :: + Integer)) in + coe + (case coe + v17 of + MAlonzo.Code.Relation.Nullary.Decidable.Core.C__because__32 v18 v19 + -> if coe + v18 + then coe + seq + (coe + v19) + (coe + MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18) + else coe + seq + (coe + v19) + (coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v16) + (coe + MAlonzo.Code.Builtin.d_rem_316 + v9 + v14)))) + _ -> MAlonzo.RTE.mazUnreachableError) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_modInteger_16 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v11 + -> case coe v11 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v12 + -> case coe v12 of + MAlonzo.Code.RawU.C_tmCon_206 v13 v14 + -> case coe v13 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v16 + -> case coe v16 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> let v17 + = MAlonzo.Code.Data.Integer.Properties.d__'8799'__2800 + (coe + v14) + (coe + (0 :: + Integer)) in + coe + (case coe + v17 of + MAlonzo.Code.Relation.Nullary.Decidable.Core.C__because__32 v18 v19 + -> if coe + v18 + then coe + seq + (coe + v19) + (coe + MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18) + else coe + seq + (coe + v19) + (coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v16) + (coe + MAlonzo.Code.Builtin.d_mod_318 + v9 + v14)))) + _ -> MAlonzo.RTE.mazUnreachableError) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_equalsInteger_18 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v11 + -> case coe v11 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v12 + -> case coe v12 of + MAlonzo.Code.RawU.C_tmCon_206 v13 v14 + -> case coe v13 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v16 + -> case coe v16 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + (coe + MAlonzo.Code.Builtin.Constant.AtomicType.C_aBool_16)) + (coe + MAlonzo.Code.Relation.Nullary.Decidable.Core.d_does_28 + (coe + MAlonzo.Code.Data.Integer.Properties.d__'8799'__2800 + (coe + v9) + (coe + v14))))) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_lessThanInteger_20 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v11 + -> case coe v11 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v12 + -> case coe v12 of + MAlonzo.Code.RawU.C_tmCon_206 v13 v14 + -> case coe v13 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v16 + -> case coe v16 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + (coe + MAlonzo.Code.Builtin.Constant.AtomicType.C_aBool_16)) + (coe + MAlonzo.Code.Relation.Nullary.Decidable.Core.d_does_28 + (coe + MAlonzo.Code.Data.Integer.Properties.d__'60''63'__3190 + (coe + v9) + (coe + v14))))) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_lessThanEqualsInteger_22 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v11 + -> case coe v11 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v12 + -> case coe v12 of + MAlonzo.Code.RawU.C_tmCon_206 v13 v14 + -> case coe v13 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v16 + -> case coe v16 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + (coe + MAlonzo.Code.Builtin.Constant.AtomicType.C_aBool_16)) + (coe + MAlonzo.Code.Relation.Nullary.Decidable.Core.d_does_28 + (coe + MAlonzo.Code.Data.Integer.Properties.d__'8804''63'__2880 + (coe + v9) + (coe + v14))))) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_constrData_88 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v11 + -> case coe v11 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v12 + -> case coe v12 of + MAlonzo.Code.RawU.C_tmCon_206 v13 v14 + -> case coe v13 of + MAlonzo.Code.Builtin.Signature.C_list_16 v16 + -> case coe v16 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v18 + -> case coe + v18 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v18) + (coe + MAlonzo.Code.Utils.C_ConstrDATA_612 + (coe + v9) + (coe + v14)))) + _ -> coe + v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_equalsData_108 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v11 + -> case coe v11 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v12 + -> case coe v12 of + MAlonzo.Code.RawU.C_tmCon_206 v13 v14 + -> case coe v13 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v16 + -> case coe v16 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + (coe + MAlonzo.Code.Builtin.Constant.AtomicType.C_aBool_16)) + (coe + MAlonzo.Code.Utils.d_eqDATA_622 + (coe + v9) + (coe + v14)))) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_mkPairData_112 + -> case coe v5 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v11 + -> case coe v11 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v12 + -> case coe v12 of + MAlonzo.Code.RawU.C_tmCon_206 v13 v14 + -> case coe v13 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v16 + -> case coe v16 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_pair_24 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v16) + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v16)) + (coe + MAlonzo.Code.Utils.C__'44'__442 + (coe + v9) + (coe + v14)))) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + MAlonzo.Code.Untyped.C_force_24 v4 + -> case coe v4 of + MAlonzo.Code.Untyped.C_force_24 v5 + -> case coe v5 of + MAlonzo.Code.Untyped.C_builtin_44 v6 + -> case coe v6 of + MAlonzo.Code.Builtin.C_fstPair_66 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_pair_24 v11 v12 + -> case coe v9 of + MAlonzo.Code.Utils.C__'44'__442 v13 v14 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe v11) (coe v13))) + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_sndPair_68 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v7 + -> case coe v7 of + MAlonzo.Code.RawU.C_tmCon_206 v8 v9 + -> case coe v8 of + MAlonzo.Code.Builtin.Signature.C_pair_24 v11 v12 + -> case coe v9 of + MAlonzo.Code.Utils.C__'44'__442 v13 v14 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe v12) (coe v14))) + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + MAlonzo.Code.Untyped.C_builtin_44 v5 + -> case coe v5 of + MAlonzo.Code.Builtin.C_headList_74 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v6 + -> case coe v6 of + MAlonzo.Code.RawU.C_tmCon_206 v7 v8 + -> case coe v7 of + MAlonzo.Code.Builtin.Signature.C_list_16 v10 + -> case coe v8 of + MAlonzo.Code.Utils.C__'8759'__452 v11 v12 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe v10) (coe v11))) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_tailList_76 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v6 + -> case coe v6 of + MAlonzo.Code.RawU.C_tmCon_206 v7 v8 + -> case coe v7 of + MAlonzo.Code.Builtin.Signature.C_list_16 v10 + -> case coe v8 of + MAlonzo.Code.Utils.C__'8759'__452 v11 v12 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_list_16 + v10) + (coe v12))) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_nullList_78 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v6 + -> case coe v6 of + MAlonzo.Code.RawU.C_tmCon_206 v7 v8 + -> case coe v7 of + MAlonzo.Code.Builtin.Signature.C_list_16 v10 + -> case coe v8 of + MAlonzo.Code.Utils.C_'91''93'_450 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + (coe + MAlonzo.Code.Builtin.Constant.AtomicType.C_aBool_16)) + (coe + MAlonzo.Code.Agda.Builtin.Bool.C_true_10))) + MAlonzo.Code.Utils.C__'8759'__452 v11 v12 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + (coe + MAlonzo.Code.Builtin.Constant.AtomicType.C_aBool_16)) + (coe + MAlonzo.Code.Agda.Builtin.Bool.C_false_8))) + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + MAlonzo.Code.Untyped.C_builtin_44 v4 + -> case coe v4 of + MAlonzo.Code.Builtin.C_mapData_90 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v5 + -> case coe v5 of + MAlonzo.Code.RawU.C_tmCon_206 v6 v7 + -> case coe v6 of + MAlonzo.Code.Builtin.Signature.C_list_16 v9 + -> case coe v9 of + MAlonzo.Code.Builtin.Signature.C_pair_24 v11 v12 + -> case coe v11 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v14 + -> case coe v14 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18 + -> case coe v12 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v16 + -> case coe v16 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v16) + (coe + MAlonzo.Code.Utils.C_MapDATA_614 + (coe + v7)))) + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_listData_92 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v5 + -> case coe v5 of + MAlonzo.Code.RawU.C_tmCon_206 v6 v7 + -> case coe v6 of + MAlonzo.Code.Builtin.Signature.C_list_16 v9 + -> case coe v9 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v11 + -> case coe v11 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v11) + (coe + MAlonzo.Code.Utils.C_ListDATA_616 + (coe v7)))) + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_iData_94 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v5 + -> case coe v5 of + MAlonzo.Code.RawU.C_tmCon_206 v6 v7 + -> case coe v6 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v9 + -> case coe v9 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + (coe + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18)) + (coe + MAlonzo.Code.Utils.C_iDATA_618 + (coe v7)))) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_unConstrData_98 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v5 + -> case coe v5 of + MAlonzo.Code.RawU.C_tmCon_206 v6 v7 + -> case coe v6 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v9 + -> case coe v9 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18 + -> case coe v7 of + MAlonzo.Code.Utils.C_ConstrDATA_612 v10 v11 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_pair_24 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + (coe + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8)) + (coe + MAlonzo.Code.Builtin.Signature.C_list_16 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v9))) + (coe + MAlonzo.Code.Utils.C__'44'__442 + (coe v10) (coe v11)))) + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_unMapData_100 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v5 + -> case coe v5 of + MAlonzo.Code.RawU.C_tmCon_206 v6 v7 + -> case coe v6 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v9 + -> case coe v9 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18 + -> case coe v7 of + MAlonzo.Code.Utils.C_MapDATA_614 v10 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_list_16 + (coe + MAlonzo.Code.Builtin.Signature.C_pair_24 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v9) + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v9))) + (coe v10))) + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_unListData_102 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v5 + -> case coe v5 of + MAlonzo.Code.RawU.C_tmCon_206 v6 v7 + -> case coe v6 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v9 + -> case coe v9 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18 + -> case coe v7 of + MAlonzo.Code.Utils.C_ListDATA_616 v10 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_list_16 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + v9)) + (coe v10))) + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_unIData_104 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v5 + -> case coe v5 of + MAlonzo.Code.RawU.C_tmCon_206 v6 v7 + -> case coe v6 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v9 + -> case coe v9 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18 + -> case coe v7 of + MAlonzo.Code.Utils.C_iDATA_618 v10 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + (coe + MAlonzo.Code.Builtin.Constant.AtomicType.C_aInteger_8)) + (coe v10))) + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_mkNilData_114 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v5 + -> case coe v5 of + MAlonzo.Code.RawU.C_tmCon_206 v6 v7 + -> case coe v6 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v9 + -> case coe v9 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aUnit_14 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_list_16 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + (coe + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18))) + (coe + MAlonzo.Code.Utils.C_'91''93'_450))) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + MAlonzo.Code.Builtin.C_mkNilPairData_116 + -> case coe v3 of + MAlonzo.Code.Untyped.C_con_28 v5 + -> case coe v5 of + MAlonzo.Code.RawU.C_tmCon_206 v6 v7 + -> case coe v6 of + MAlonzo.Code.Builtin.Signature.C_atomic_12 v9 + -> case coe v9 of + MAlonzo.Code.Builtin.Constant.AtomicType.C_aUnit_14 + -> coe + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 + (coe + MAlonzo.Code.Untyped.C_con_28 + (coe + MAlonzo.Code.RawU.C_tmCon_206 + (coe + MAlonzo.Code.Builtin.Signature.C_list_16 + (coe + MAlonzo.Code.Builtin.Signature.C_pair_24 + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + (coe + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18)) + (coe + MAlonzo.Code.Builtin.Signature.C_atomic_12 + (coe + MAlonzo.Code.Builtin.Constant.AtomicType.C_aData_18)))) + (coe + MAlonzo.Code.Utils.C_'91''93'_450))) + _ -> coe v1 + _ -> coe v1 + _ -> MAlonzo.RTE.mazUnreachableError + _ -> coe v1 + _ -> coe v1 + _ -> coe v1 + _ -> coe v1) +-- VerifiedCompilation.UConstantFold.ConstantFold +d_ConstantFold_196 a0 a1 a2 = () +data T_ConstantFold_196 = C_constantFold_204 +-- VerifiedCompilation.UConstantFold.isConstantFold? +d_isConstantFold'63'_208 :: + Integer -> + MAlonzo.Code.Untyped.T__'8866'_14 -> + MAlonzo.Code.Untyped.T__'8866'_14 -> + MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 +d_isConstantFold'63'_208 v0 v1 v2 + = let v3 = coe du_evalCF_6 (coe v1) in + coe + (case coe v3 of + MAlonzo.Code.Agda.Builtin.Maybe.C_just_16 v4 + -> let v5 + = MAlonzo.Code.Untyped.Equality.d_decEq'45''8866'_56 + (coe v0) (coe v4) (coe v2) in + coe + (case coe v5 of + MAlonzo.Code.Relation.Nullary.Decidable.Core.C__because__32 v6 v7 + -> if coe v6 + then coe + seq (coe v7) + (coe + MAlonzo.Code.VerifiedCompilation.Certificate.C_proof_44 + (coe C_constantFold_204)) + else coe + seq (coe v7) + (coe + MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 + MAlonzo.Code.VerifiedCompilation.Trace.d_ConstantFoldT_46 v1 v2) + _ -> MAlonzo.RTE.mazUnreachableError) + MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 + -> coe + MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 + MAlonzo.Code.VerifiedCompilation.Trace.d_ConstantFoldT_46 v1 v2 + _ -> MAlonzo.RTE.mazUnreachableError) +-- VerifiedCompilation.UConstantFold.UConstantFold +d_UConstantFold_258 :: + Integer -> + MAlonzo.Code.Untyped.T__'8866'_14 -> + MAlonzo.Code.Untyped.T__'8866'_14 -> () +d_UConstantFold_258 = erased +-- VerifiedCompilation.UConstantFold.isUConstantFold? +d_isUConstantFold'63'_262 :: + Integer -> + MAlonzo.Code.Untyped.T__'8866'_14 -> + MAlonzo.Code.Untyped.T__'8866'_14 -> + MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 +d_isUConstantFold'63'_262 v0 + = coe + MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 + (coe v0) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_ConstantFoldT_46) + (coe d_isConstantFold'63'_208) diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs index e1319321942..b8e1f5857ce 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UFloatDelay.hs @@ -541,7 +541,7 @@ d_isFloatDelay'63'_488 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_FloatDelayT_28) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_FloatDelayT_32) (coe d_isFlD'63'_492) -- VerifiedCompilation.UFloatDelay.isFlD? d_isFlD'63'_492 :: @@ -697,7 +697,7 @@ d_isFlD'63'_492 v0 v1 v2 v38) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_FloatDelayT_28 + MAlonzo.Code.VerifiedCompilation.Trace.d_FloatDelayT_32 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) @@ -726,7 +726,7 @@ d_isFlD'63'_492 v0 v1 v2 v21) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_FloatDelayT_28 + MAlonzo.Code.VerifiedCompilation.Trace.d_FloatDelayT_32 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -741,7 +741,7 @@ d_isFlD'63'_492 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_FloatDelayT_28 v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_FloatDelayT_32 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UFloatDelay..extendedlambda8 d_'46'extendedlambda8_508 :: @@ -773,7 +773,7 @@ d_'46'extendedlambda10_582 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -791,7 +791,7 @@ d_'46'extendedlambda11_630 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs index ec4ae3b602d..79084aae7dc 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceCaseDelay.hs @@ -167,7 +167,7 @@ d_isForceCaseDelay'63'_94 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_32) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_36) (coe d_isFCD'63'_96) -- VerifiedCompilation.UForceCaseDelay.isFCD? d_isFCD'63'_96 :: @@ -271,7 +271,7 @@ d_isFCD'63'_96 v0 v1 v2 = coe MAlonzo.Code.VerifiedCompilation.Certificate.du_pcePointwise_304 (coe - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_32) + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_36) (coe d_isForceCaseDelay'63'_94 (coe @@ -298,14 +298,14 @@ d_isFCD'63'_96 v0 v1 v2 MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 v36 v37 v38 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_32 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_36 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError) MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 v34 v35 v36 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_32 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_36 v1 v2 _ -> MAlonzo.RTE.mazUnreachableError) @@ -316,7 +316,7 @@ d_isFCD'63'_96 v0 v1 v2 v28) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_32 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_36 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError))) @@ -327,7 +327,7 @@ d_isFCD'63'_96 v0 v1 v2 seq (coe v18) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_32 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_36 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError))) _ -> MAlonzo.RTE.mazUnreachableError @@ -339,7 +339,7 @@ d_isFCD'63'_96 v0 v1 v2 seq (coe v5) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_32 v1 v2) + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceCaseDelayT_36 v1 v2) _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UForceCaseDelay..extendedlambda1 d_'46'extendedlambda1_112 :: @@ -382,7 +382,7 @@ d_'46'extendedlambda4_228 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> [MAlonzo.Code.Untyped.T__'8866'_14] -> @@ -401,7 +401,7 @@ d_'46'extendedlambda5_280 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs index b1d468a8d54..fc824c53dab 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UForceDelay.hs @@ -583,7 +583,7 @@ d_isForceDelay'63'_178 v0 = coe MAlonzo.Code.VerifiedCompilation.UntypedTranslation.du_translation'63'_164 (coe v0) - (coe MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30) + (coe MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_34) (coe (\ v1 -> d_isFD'63'_184 (coe v1) (coe C_'9633'_82))) -- VerifiedCompilation.UForceDelay.isFD? d_isFD'63'_184 :: @@ -745,7 +745,7 @@ d_isFD'63'_184 v0 v1 v2 v3 seq (coe v9) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_34 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError) @@ -1114,7 +1114,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v87) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_34 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError) @@ -1146,7 +1146,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v80) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_34 v16 v22) _ -> MAlonzo.RTE.mazUnreachableError @@ -1157,7 +1157,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v77) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_34 v43 v59) _ -> MAlonzo.RTE.mazUnreachableError))))) @@ -1329,7 +1329,7 @@ d_isFD'63'_184 v0 v1 v2 v3 seq (coe v13) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_34 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -1851,7 +1851,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v98) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_34 v15 v3) _ -> MAlonzo.RTE.mazUnreachableError) @@ -1883,7 +1883,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v91) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_34 v27 v33) _ -> MAlonzo.RTE.mazUnreachableError @@ -1894,7 +1894,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v88) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_34 v54 v70) _ -> MAlonzo.RTE.mazUnreachableError))))) @@ -2085,7 +2085,7 @@ d_isFD'63'_184 v0 v1 v2 v3 v24) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_34 v15 v3) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -2228,7 +2228,7 @@ d_isFD'63'_184 v0 v1 v2 v3 seq (coe v14) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_ce_52 - MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_30 + MAlonzo.Code.VerifiedCompilation.Trace.d_ForceDelayT_34 v2 v3) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError)) @@ -2255,7 +2255,7 @@ d_'46'extendedlambda2_246 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda2_246 = erased @@ -2273,7 +2273,7 @@ d_'46'extendedlambda3_320 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.VerifiedCompilation.UntypedViews.T_isForce_270 -> @@ -2292,7 +2292,7 @@ d_'46'extendedlambda4_348 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2322,7 +2322,7 @@ d_'46'extendedlambda6_476 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2334,7 +2334,7 @@ d_'46'extendedlambda6_476 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda6_476 = erased @@ -2354,7 +2354,7 @@ d_'46'extendedlambda7_518 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20 d_'46'extendedlambda7_518 = erased @@ -2381,7 +2381,7 @@ d_'46'extendedlambda8_634 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2410,7 +2410,7 @@ d_'46'extendedlambda9_688 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2434,7 +2434,7 @@ d_'46'extendedlambda10_750 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2446,7 +2446,7 @@ d_'46'extendedlambda10_750 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2470,7 +2470,7 @@ d_'46'extendedlambda11_814 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2481,7 +2481,7 @@ d_'46'extendedlambda11_814 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2506,7 +2506,7 @@ d_'46'extendedlambda12_880 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Builtin.T_Builtin_2 -> @@ -2516,7 +2516,7 @@ d_'46'extendedlambda12_880 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2546,7 +2546,7 @@ d_'46'extendedlambda13_1034 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2567,7 +2567,7 @@ d_'46'extendedlambda14_1074 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> @@ -2584,7 +2584,7 @@ d_'46'extendedlambda15_1190 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> @@ -2592,7 +2592,7 @@ d_'46'extendedlambda15_1190 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2610,7 +2610,7 @@ d_'46'extendedlambda16_1214 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2629,7 +2629,7 @@ d_'46'extendedlambda17_1238 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2661,7 +2661,7 @@ d_'46'extendedlambda19_1340 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.VerifiedCompilation.UntypedViews.T_isDelay_356 -> @@ -2681,7 +2681,7 @@ d_'46'extendedlambda20_1454 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> (T_FD_112 -> MAlonzo.Code.Data.Irrelevant.T_Irrelevant_20) -> @@ -2689,7 +2689,7 @@ d_'46'extendedlambda20_1454 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2706,7 +2706,7 @@ d_'46'extendedlambda21_1480 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2724,7 +2724,7 @@ d_'46'extendedlambda22_1506 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2742,7 +2742,7 @@ d_'46'extendedlambda23_1574 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.Agda.Builtin.Sigma.T_Σ_14 -> @@ -2780,7 +2780,7 @@ d_'46'extendedlambda25_1698 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> (MAlonzo.Code.VerifiedCompilation.UntypedViews.T_isForce_270 -> @@ -2803,7 +2803,7 @@ d_'46'extendedlambda26_1732 :: () -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> AgdaAny -> AgdaAny -> MAlonzo.Code.VerifiedCompilation.Certificate.T_ProofOrCE_38 -> diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs index 3517ee796da..6a42a46b935 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UInline.hs @@ -297,7 +297,7 @@ d_checkPointwise_304 :: Integer -> T__'8605'_28 -> T__'8605'_28 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120] -> (MAlonzo.Code.Data.Fin.Base.T_Fin_10 -> MAlonzo.Code.Untyped.T__'8866'_14) -> T__'8829'__102 -> @@ -308,7 +308,7 @@ d_checkPointwise_304 v0 v1 v2 v3 v4 v5 v6 v7 = let v8 = coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 v6 v7 in + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_40 v6 v7 in coe (case coe v3 of [] @@ -358,19 +358,19 @@ d_check_316 :: MAlonzo.Code.Untyped.T__'8866'_14) -> MAlonzo.Code.Untyped.T__'8866'_14 -> T__'8829'__102 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.VerifiedCompilation.Certificate.T_Proof'63'_66 d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 = let v8 = coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 v4 v7 in + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_40 v4 v7 in coe (case coe v4 of MAlonzo.Code.Untyped.C_'96'_18 v9 -> case coe v6 of - MAlonzo.Code.VerifiedCompilation.Trace.C_var_48 + MAlonzo.Code.VerifiedCompilation.Trace.C_var_122 -> case coe v7 of MAlonzo.Code.Untyped.C_'96'_18 v10 -> let v11 @@ -385,7 +385,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 -> let v15 = coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_40 v4 v7 in coe (case coe v13 of @@ -418,7 +418,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 MAlonzo.Code.Agda.Builtin.Maybe.C_nothing_18 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_40 v4 v4 _ -> MAlonzo.RTE.mazUnreachableError) _ -> coe v15 @@ -428,7 +428,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> coe v15) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C_expand_50 v10 + MAlonzo.Code.VerifiedCompilation.Trace.C_expand_124 v10 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du__'62''62''61'__88 (coe @@ -444,7 +444,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 -> case coe v5 of C_'9633'_106 -> case coe v6 of - MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_52 v10 + MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_126 v10 -> case coe v7 of MAlonzo.Code.Untyped.C_ƛ_20 v11 -> coe @@ -469,7 +469,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 -> case coe v2 of C__'183'__34 v16 v17 -> case coe v6 of - MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_52 v18 + MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_126 v18 -> case coe v7 of MAlonzo.Code.Untyped.C_ƛ_20 v19 -> coe @@ -537,7 +537,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> MAlonzo.RTE.mazUnreachableError MAlonzo.Code.Untyped.C__'183'__22 v9 v10 -> case coe v6 of - MAlonzo.Code.VerifiedCompilation.Trace.C__'183'__54 v11 v12 + MAlonzo.Code.VerifiedCompilation.Trace.C__'183'__128 v11 v12 -> case coe v7 of MAlonzo.Code.Untyped.C__'183'__22 v13 v14 -> coe @@ -559,7 +559,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 MAlonzo.Code.VerifiedCompilation.Certificate.C_proof_72 (coe C__'183'__250 v15 v16))))) _ -> coe v8 - MAlonzo.Code.VerifiedCompilation.Trace.C__'183''8595'_56 v11 + MAlonzo.Code.VerifiedCompilation.Trace.C__'183''8595'_130 v11 -> coe MAlonzo.Code.VerifiedCompilation.Certificate.du__'62''62''61'__88 (coe @@ -574,7 +574,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> coe v8 MAlonzo.Code.Untyped.C_force_24 v9 -> case coe v6 of - MAlonzo.Code.VerifiedCompilation.Trace.C_force_58 v10 + MAlonzo.Code.VerifiedCompilation.Trace.C_force_132 v10 -> case coe v7 of MAlonzo.Code.Untyped.C_force_24 v11 -> coe @@ -591,7 +591,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> coe v8 MAlonzo.Code.Untyped.C_delay_26 v9 -> case coe v6 of - MAlonzo.Code.VerifiedCompilation.Trace.C_delay_60 v10 + MAlonzo.Code.VerifiedCompilation.Trace.C_delay_134 v10 -> case coe v7 of MAlonzo.Code.Untyped.C_delay_26 v11 -> coe @@ -608,7 +608,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> coe v8 MAlonzo.Code.Untyped.C_con_28 v9 -> case coe v6 of - MAlonzo.Code.VerifiedCompilation.Trace.C_con_62 + MAlonzo.Code.VerifiedCompilation.Trace.C_con_136 -> case coe v7 of MAlonzo.Code.Untyped.C_con_28 v10 -> let v11 @@ -627,14 +627,14 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v13) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_40 v4 v7) _ -> MAlonzo.RTE.mazUnreachableError) _ -> coe v8 _ -> coe v8 MAlonzo.Code.Untyped.C_constr_34 v9 v10 -> case coe v6 of - MAlonzo.Code.VerifiedCompilation.Trace.C_constr_68 v11 + MAlonzo.Code.VerifiedCompilation.Trace.C_constr_142 v11 -> case coe v7 of MAlonzo.Code.Untyped.C_constr_34 v12 v13 -> let v14 @@ -669,14 +669,14 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v16) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_40 v4 v7) _ -> MAlonzo.RTE.mazUnreachableError) _ -> coe v8 _ -> coe v8 MAlonzo.Code.Untyped.C_case_40 v9 v10 -> case coe v6 of - MAlonzo.Code.VerifiedCompilation.Trace.C_case_70 v11 v12 + MAlonzo.Code.VerifiedCompilation.Trace.C_case_144 v11 v12 -> case coe v7 of MAlonzo.Code.Untyped.C_case_40 v13 v14 -> coe @@ -701,7 +701,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> coe v8 MAlonzo.Code.Untyped.C_builtin_44 v9 -> case coe v6 of - MAlonzo.Code.VerifiedCompilation.Trace.C_builtin_64 + MAlonzo.Code.VerifiedCompilation.Trace.C_builtin_138 -> case coe v7 of MAlonzo.Code.Untyped.C_builtin_44 v10 -> let v11 @@ -752,7 +752,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v16) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_40 v4 v7) _ -> MAlonzo.RTE.mazUnreachableError) else (let v14 @@ -776,7 +776,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v16) (coe MAlonzo.Code.VerifiedCompilation.Certificate.C_abort_78 - MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_36 + MAlonzo.Code.VerifiedCompilation.Trace.d_InlineT_40 v4 v7) _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError) @@ -784,7 +784,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> coe v8 MAlonzo.Code.Untyped.C_error_46 -> case coe v6 of - MAlonzo.Code.VerifiedCompilation.Trace.C_error_66 + MAlonzo.Code.VerifiedCompilation.Trace.C_error_140 -> case coe v7 of MAlonzo.Code.Untyped.C_error_46 -> coe @@ -795,7 +795,7 @@ d_check_316 v0 v1 v2 v3 v4 v5 v6 v7 _ -> MAlonzo.RTE.mazUnreachableError) -- VerifiedCompilation.UInline.top-check d_top'45'check_718 :: - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.VerifiedCompilation.Certificate.T_Proof'63'_66 @@ -885,7 +885,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 C_'96'_230 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_var_48) erased + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_var_122) erased C_'96''8595'_234 v14 -> case coe v5 of MAlonzo.Code.Untyped.C_'96'_18 v15 @@ -898,7 +898,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 v17 v18 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_expand_50 (coe v17)) + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_expand_124 (coe v17)) erased _ -> MAlonzo.RTE.mazUnreachableError) _ -> MAlonzo.RTE.mazUnreachableError @@ -923,7 +923,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_52 (coe v15)) + MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_126 (coe v15)) erased _ -> MAlonzo.RTE.mazUnreachableError)) _ -> MAlonzo.RTE.mazUnreachableError @@ -962,7 +962,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_52 + MAlonzo.Code.VerifiedCompilation.Trace.C_ƛ_126 (coe v27)) erased _ -> MAlonzo.RTE.mazUnreachableError) @@ -1027,7 +1027,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C__'183'__54 + MAlonzo.Code.VerifiedCompilation.Trace.C__'183'__128 (coe v24) (coe v26)) erased _ -> MAlonzo.RTE.mazUnreachableError @@ -1048,7 +1048,8 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C__'183''8595'_56 (coe v19)) + MAlonzo.Code.VerifiedCompilation.Trace.C__'183''8595'_130 + (coe v19)) erased _ -> MAlonzo.RTE.mazUnreachableError) _ -> MAlonzo.RTE.mazUnreachableError @@ -1067,7 +1068,8 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_force_58 (coe v18)) + MAlonzo.Code.VerifiedCompilation.Trace.C_force_132 + (coe v18)) erased _ -> MAlonzo.RTE.mazUnreachableError) _ -> MAlonzo.RTE.mazUnreachableError @@ -1087,7 +1089,8 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_delay_60 (coe v18)) + MAlonzo.Code.VerifiedCompilation.Trace.C_delay_134 + (coe v18)) erased _ -> MAlonzo.RTE.mazUnreachableError) _ -> MAlonzo.RTE.mazUnreachableError @@ -1095,11 +1098,11 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 C_con_266 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_con_62) erased + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_con_136) erased C_builtin_270 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_builtin_64) erased + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_builtin_138) erased C_constr_280 v15 -> case coe v5 of MAlonzo.Code.Untyped.C_constr_34 v16 v17 @@ -1115,7 +1118,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_constr_68 + MAlonzo.Code.VerifiedCompilation.Trace.C_constr_142 (coe v21)) erased _ -> MAlonzo.RTE.mazUnreachableError) @@ -1143,7 +1146,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 -> coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 (coe - MAlonzo.Code.VerifiedCompilation.Trace.C_case_70 + MAlonzo.Code.VerifiedCompilation.Trace.C_case_144 (coe v24) (coe v26)) erased _ -> MAlonzo.RTE.mazUnreachableError @@ -1157,7 +1160,7 @@ d_complete_806 v0 v1 v2 v3 v4 v5 v6 v7 seq (coe v6) (coe MAlonzo.Code.Agda.Builtin.Sigma.C__'44'__32 - (coe MAlonzo.Code.VerifiedCompilation.Trace.C_error_66) erased)) + (coe MAlonzo.Code.VerifiedCompilation.Trace.C_error_140) erased)) _ -> MAlonzo.RTE.mazUnreachableError -- VerifiedCompilation.UInline._.e′ d_e'8242'_818 :: @@ -1179,7 +1182,7 @@ d_e'8242'_864 :: MAlonzo.Code.Data.Fin.Base.T_Fin_10 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_864 = erased @@ -1191,7 +1194,7 @@ d_e'8242'_898 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_898 = erased @@ -1207,7 +1210,7 @@ d_e'8242'_940 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_940 = erased @@ -1223,7 +1226,7 @@ d_e'8242'_982 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_982 = erased @@ -1241,9 +1244,9 @@ d_e'8243'_1036 :: MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8243'_1036 = erased @@ -1259,7 +1262,7 @@ d_e'8242'_1082 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8242'_1082 = erased @@ -1271,7 +1274,7 @@ d_e'8242'_1120 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> T__'8605'_28 -> T__'8605'_28 -> @@ -1285,7 +1288,7 @@ d_e'8242'_1158 :: MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> T_Inline_224 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> T__'8605'_28 -> T__'8605'_28 -> @@ -1321,7 +1324,7 @@ d_e'8242'_1232 :: [MAlonzo.Code.Untyped.T__'8866'_14] -> [MAlonzo.Code.Untyped.T__'8866'_14] -> MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base.T_Pointwise_48 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120] -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> T__'8605'_28 -> T__'8605'_28 -> @@ -1339,9 +1342,9 @@ d_e'8243'_1290 :: [MAlonzo.Code.Untyped.T__'8866'_14] -> T_Inline_224 -> MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base.T_Pointwise_48 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120] -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> T__'8605'_28 -> T__'8605'_28 -> @@ -1361,9 +1364,9 @@ d_e'8243'_1356 :: [MAlonzo.Code.Untyped.T__'8866'_14] -> T_Inline_224 -> MAlonzo.Code.Data.List.Relation.Binary.Pointwise.Base.T_Pointwise_48 -> - MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> - [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_46] -> + [MAlonzo.Code.VerifiedCompilation.Trace.T_InlineHints_120] -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 -> MAlonzo.Code.Agda.Builtin.Equality.T__'8801'__12 d_e'8243'_1356 = erased diff --git a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs index 88993ed2554..95286113883 100644 --- a/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs +++ b/plutus-metatheory/src/MAlonzo/Code/VerifiedCompilation/UntypedTranslation.hs @@ -87,7 +87,7 @@ d_translation'63'_164 :: MAlonzo.Code.Untyped.T__'8866'_14 -> ()) -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -101,7 +101,7 @@ du_translation'63'_164 :: Integer -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2927,7 +2927,7 @@ d_decPointwiseTranslation'63'_176 :: MAlonzo.Code.Untyped.T__'8866'_14 -> ()) -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> @@ -2941,7 +2941,7 @@ du_decPointwiseTranslation'63'_176 :: Integer -> MAlonzo.Code.Utils.T_Either_6 MAlonzo.Code.VerifiedCompilation.Trace.T_UncertifiedOptTag_4 - MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_10 -> + MAlonzo.Code.VerifiedCompilation.Trace.T_CertifiedOptTag_12 -> (Integer -> MAlonzo.Code.Untyped.T__'8866'_14 -> MAlonzo.Code.Untyped.T__'8866'_14 -> diff --git a/plutus-metatheory/src/VerifiedCompilation.lagda.md b/plutus-metatheory/src/VerifiedCompilation.lagda.md index 2f66ec4d1e7..2caaf355ef7 100644 --- a/plutus-metatheory/src/VerifiedCompilation.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation.lagda.md @@ -50,6 +50,7 @@ import VerifiedCompilation.UForceCaseDelay as UFCD import VerifiedCompilation.UCSE as UCSE import VerifiedCompilation.UInline as UInline import VerifiedCompilation.UCaseReduce as UCR +import VerifiedCompilation.UConstantFold as UCF open import VerifiedCompilation.NotImplemented open import VerifiedCompilation.Trace open import VerifiedCompilation.Certificate hiding (_>>=_) @@ -79,6 +80,7 @@ tagToRelation caseReduceT = UCR.UCaseReduce tagToRelation inlineT = UInline.Inline (λ()) UInline.□ tagToRelation cseT = UCSE.UntypedCSE tagToRelation applyToCaseT = UA2C.UApplyToCase +tagToRelation constantFoldT = UCF.UConstantFold ``` We default to the `NotImplemented` relation to give each `OptTag` a relation: @@ -105,6 +107,7 @@ certifyPass (inj₂ inlineT) (inline hs) = checker (UInline.top-check hs) certifyPass (inj₂ inlineT) none = λ M M' → abort InlineT M M' certifyPass (inj₂ cseT) _ = decider UCSE.isUntypedCSE? certifyPass (inj₂ applyToCaseT) _ = decider UA2C.a2c?ᶜᶜ +certifyPass (inj₂ constantFoldT) _ = decider UCF.isUConstantFold? ``` A `Certificate t` states the main theorem of a trace `t`: a sequence (product) diff --git a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md index e197392a40c..5d5335f8cdb 100644 --- a/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md +++ b/plutus-metatheory/src/VerifiedCompilation/Trace.lagda.md @@ -28,6 +28,7 @@ We enumerate the known passes and partition them into two categories: data UncertifiedOptTag : Set where caseOfCaseT : UncertifiedOptTag letFloatOutT : UncertifiedOptTag + uncertifiedConstantFoldT : UncertifiedOptTag data CertifiedOptTag : Set where floatDelayT : CertifiedOptTag @@ -37,6 +38,7 @@ data CertifiedOptTag : Set where inlineT : CertifiedOptTag cseT : CertifiedOptTag applyToCaseT : CertifiedOptTag + constantFoldT : CertifiedOptTag OptTag = Utils.Either UncertifiedOptTag CertifiedOptTag @@ -55,13 +57,29 @@ CseT = Utils.inj₂ cseT ApplyToCaseT : OptTag ApplyToCaseT = Utils.inj₂ applyToCaseT +ConstantFoldT : OptTag +ConstantFoldT = Utils.inj₂ constantFoldT + CaseOfCaseT : OptTag CaseOfCaseT = Utils.inj₁ caseOfCaseT LetFloatOutT : OptTag LetFloatOutT = Utils.inj₁ letFloatOutT -{-# COMPILE GHC CertifiedOptTag = data CertifiedOptStage (FloatDelay | ForceDelay | ForceCaseDelay | CaseReduce | Inline | CSE | ApplyToCase) #-} -{-# COMPILE GHC UncertifiedOptTag = data UncertifiedOptStage (CaseOfCase | LetFloatOut) #-} +{-# COMPILE GHC CertifiedOptTag = data CertifiedOptStage (FloatDelay | ForceDelay | ForceCaseDelay | CaseReduce | Inline | CSE | ApplyToCase | ConstantFold) #-} +{-# COMPILE GHC UncertifiedOptTag = data UncertifiedOptStage (CaseOfCase | LetFloatOut | UncertifiedConstantFold) #-} + +data CertifiedBuiltin : Set where + certAddInteger certSubtractInteger certMultiplyInteger + certDivideInteger certQuotientInteger certRemainderInteger certModInteger + certEqualsInteger certLessThanInteger certLessThanEqualsInteger + certIfThenElse certChooseUnit + certFstPair certSndPair + certChooseList certMkCons certHeadList certTailList certNullList certDropList + certChooseData certConstrData certMapData certListData certIData + certUnConstrData certUnMapData certUnListData certUnIData + certEqualsData certMkPairData certMkNilData certMkNilPairData : CertifiedBuiltin + +{-# COMPILE GHC CertifiedBuiltin = data CertifiedBuiltin (CertAddInteger | CertSubtractInteger | CertMultiplyInteger | CertDivideInteger | CertQuotientInteger | CertRemainderInteger | CertModInteger | CertEqualsInteger | CertLessThanInteger | CertLessThanEqualsInteger | CertIfThenElse | CertChooseUnit | CertFstPair | CertSndPair | CertChooseList | CertMkCons | CertHeadList | CertTailList | CertNullList | CertDropList | CertChooseData | CertConstrData | CertMapData | CertListData | CertIData | CertUnConstrData | CertUnMapData | CertUnListData | CertUnIData | CertEqualsData | CertMkPairData | CertMkNilData | CertMkNilPairData) #-} ``` ## Hints diff --git a/plutus-metatheory/src/VerifiedCompilation/UConstantFold.lagda.md b/plutus-metatheory/src/VerifiedCompilation/UConstantFold.lagda.md new file mode 100644 index 00000000000..900b789a79d --- /dev/null +++ b/plutus-metatheory/src/VerifiedCompilation/UConstantFold.lagda.md @@ -0,0 +1,217 @@ +--- +title: VerifiedCompilation.UConstantFold +layout: page +--- + +# Constant Fold Translation Phase + +``` +{-# OPTIONS --type-in-type #-} + +module VerifiedCompilation.UConstantFold where + +``` + +## Imports + +``` +open import Data.Nat using (ℕ) +open import Data.Integer using (ℤ; _+_; _-_; _ annMayInline) let optCertify = opts ^. posCertify - (uplcP, simplTrace) <- flip runReaderT plcOpts $ PLC.compileProgramWithTrace plcP + (uplcP, simplTrace) <- flip runReaderT plcOpts $ PLC.compileProgramWithTrace def plcP liftIO $ case optCertify of Just certName -> do -- FIXME: add a plugin option to choose from BasicOutput vs. other options diff --git a/plutus-tx-plugin/test/Budget/9.6/applicative.golden.eval b/plutus-tx-plugin/test/Budget/9.6/applicative.golden.eval index 09f9aa88b5d..0cb4877735b 100644 --- a/plutus-tx-plugin/test/Budget/9.6/applicative.golden.eval +++ b/plutus-tx-plugin/test/Budget/9.6/applicative.golden.eval @@ -1,6 +1,6 @@ -CPU: 197_308 -Memory: 702 -AST Size: 6 -Flat Size: 13 +CPU: 32_100 +Memory: 300 +AST Size: 2 +Flat Size: 9 (constr 0 (con integer 3)) \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/applicative.golden.uplc b/plutus-tx-plugin/test/Budget/9.6/applicative.golden.uplc index 1efbfc301cc..2636cbd763d 100644 --- a/plutus-tx-plugin/test/Budget/9.6/applicative.golden.uplc +++ b/plutus-tx-plugin/test/Budget/9.6/applicative.golden.uplc @@ -1 +1 @@ -(program 1.1.0 (constr 0 [(addInteger 1 2)])) \ No newline at end of file +(program 1.1.0 (constr 0 [3])) \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/monadicDo.golden.eval b/plutus-tx-plugin/test/Budget/9.6/monadicDo.golden.eval index 09f9aa88b5d..0cb4877735b 100644 --- a/plutus-tx-plugin/test/Budget/9.6/monadicDo.golden.eval +++ b/plutus-tx-plugin/test/Budget/9.6/monadicDo.golden.eval @@ -1,6 +1,6 @@ -CPU: 197_308 -Memory: 702 -AST Size: 6 -Flat Size: 13 +CPU: 32_100 +Memory: 300 +AST Size: 2 +Flat Size: 9 (constr 0 (con integer 3)) \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/monadicDo.golden.uplc b/plutus-tx-plugin/test/Budget/9.6/monadicDo.golden.uplc index 1efbfc301cc..2636cbd763d 100644 --- a/plutus-tx-plugin/test/Budget/9.6/monadicDo.golden.uplc +++ b/plutus-tx-plugin/test/Budget/9.6/monadicDo.golden.uplc @@ -1 +1 @@ -(program 1.1.0 (constr 0 [(addInteger 1 2)])) \ No newline at end of file +(program 1.1.0 (constr 0 [3])) \ No newline at end of file diff --git a/plutus-tx-plugin/test/Budget/9.6/toFromData.golden.eval b/plutus-tx-plugin/test/Budget/9.6/toFromData.golden.eval index 7a5f806f08e..5ae2964777a 100644 --- a/plutus-tx-plugin/test/Budget/9.6/toFromData.golden.eval +++ b/plutus-tx-plugin/test/Budget/9.6/toFromData.golden.eval @@ -1,7 +1,7 @@ -CPU: 3_182_422 -Memory: 13_404 -AST Size: 140 -Flat Size: 153 +CPU: 96_100 +Memory: 700 +AST Size: 6 +Flat Size: 15 (constr 1 (constr 0 (constr 0 (con bool True) (con integer 1) (con bool False))) diff --git a/plutus-tx-plugin/test/Budget/9.6/toFromData.golden.uplc b/plutus-tx-plugin/test/Budget/9.6/toFromData.golden.uplc index 6365cded13b..908c3374348 100644 --- a/plutus-tx-plugin/test/Budget/9.6/toFromData.golden.uplc +++ b/plutus-tx-plugin/test/Budget/9.6/toFromData.golden.uplc @@ -1,82 +1 @@ -(program - 1.1.0 - (case - (unConstrData - (constrData - 1 - (force mkCons - (constrData - 0 - (force mkCons - (constrData - 0 - (force mkCons - (Constr 1 []) - (force mkCons - (iData 1) - (force mkCons (Constr 0 []) [])))) - [])) - []))) - [ (\index - args -> - case - index - [ (\ds -> constr 0 [(unIData (force headList ds))]) - , (\ds -> - constr 1 - [ (case - (unConstrData (force headList ds)) - [ (\index - args -> - case - index - [ (\ds -> - constr 0 - [ (case - (unConstrData (force headList ds)) - [ (\index - args -> - case - index - [ (\ds -> - (\l -> - constr 0 - [ (case - (unConstrData - (force - headList - ds)) - [ (\index - args -> - case - index - [ (\ds -> - False) - , (\ds -> - True) ] - args) ]) - , (unIData - (force - headList - l)) - , (case - (unConstrData - (force - headList - (force - tailList - l))) - [ (\index - args -> - case - index - [ (\ds -> - False) - , (\ds -> - True) ] - args) ]) ]) - (force tailList ds)) ] - args) ]) ]) - , (\ds -> constr 1 []) ] - args) ]) ]) ] - args) ])) \ No newline at end of file +(program 1.1.0 (constr 1 [(constr 0 [(constr 0 [True, 1, False])])])) \ No newline at end of file diff --git a/plutus-tx/src/PlutusTx/Lift.hs b/plutus-tx/src/PlutusTx/Lift.hs index becfe732f87..c09cb70a6a7 100644 --- a/plutus-tx/src/PlutusTx/Lift.hs +++ b/plutus-tx/src/PlutusTx/Lift.hs @@ -112,7 +112,7 @@ safeLiftWith f g v x = do ) PLC.defaultCompilationOpts plc <- flip runReaderT ccConfig $ compileProgram (Program () v pir) - uplc <- flip runReaderT ucOpts $ PLC.compileProgram plc + uplc <- flip runReaderT ucOpts $ PLC.compileProgram def plc UPLC.Program _ _ db <- modifyError (PLCError . PLC.FreeVariableErrorE) $ traverseOf UPLC.progTerm UPLC.deBruijnTerm uplc pure (void pir, void db) @@ -507,7 +507,7 @@ typeCode p prog = do _ <- typeCheckAgainst p prog compiled <- flip runReaderT PLC.defaultCompilationOpts $ - PLC.compileProgram prog + PLC.compileProgram def prog db <- modifyError (PLCError . PLC.FreeVariableErrorE) $ traverseOf UPLC.progTerm UPLC.deBruijnTerm compiled