packages feed

phino-0.0.167 / compiled / generated / Compiled.hs

-- The built-in rules of phino, and the rules of '--rule' it was given, as-- Haskell: this module is written by 'phino compile' and a build with the-- flag 'compiled' links it in (#1617). The next 'phino compile' writes it-- anew, so a change belongs to the rules of YAML and not to it.module Compiled (compiled) whereimport ASTimport qualified Builder as Bimport qualified Contextualize as Cimport qualified Deps as Dimport qualified Control.Exception as Eimport qualified Engine as Enimport qualified Inference as Inimport qualified Matcher as Mimport qualified Data.Map.Strict as Mapimport qualified Rewriter as Rimport qualified Rule as Ruimport qualified Data.Set as Setcompiled :: Maybe En.Enginecompiled =  Just    En.Engine      { En._normalization = normalization      , En._matching = \universe -> Set.fromList . matching universe      , En._rules = steps      , En._normal = nf      , En._contextualize = \term context -> either E.throwIO pure (contextualize term context)      , En._morphing = morphings      , En._dataization = dataizations      , En._sources = sources      }-- The steps of the built-in rules of normalization, in the order of the rules.normalization :: [Ru.Step]normalization = [stepAlpha, stepAmiss, stepCopy, stepDc, stepDca, stepDd, stepDl, stepDot, stepMiss, stepNorho, stepNull, stepOver, stepOvera, stepSkip, stepStay, stepStop]-- The steps of every rule compiled, by the text of the rule.steps :: Map.Map String Ru.Stepsteps =  Map.fromList [("Rule {name = \"alpha\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\",BiVoid !t1,BiMeta \"B2\"]) (ArAlpha \945!i1 (ExMeta \"e1\")), result = ExApplication (ExFormation [BiMeta \"B1\",BiVoid !t1,BiMeta \"B2\"]) (ArTau !t1 (ExMeta \"e1\")), when = Just (And [Eq (CmpNum (MetaIndex \"i1\")) (CmpNum (Domain (BiMeta \"B1\"))),Not (Eq (CmpAttr !t1) (CmpAttr \961))]), where_ = Nothing, having = Nothing}", stepAlpha), ("Rule {name = \"amiss\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\"]) (ArAlpha \945!i1 (ExAny (Slot \"e\" 11))), result = ExTermination, when = Just (Not (Gt (CmpNum (Domain (BiMeta \"B1\"))) (CmpNum (MetaIndex \"i1\")))), where_ = Nothing, having = Nothing}", stepAmiss), ("Rule {name = \"copy\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\",BiVoid !t1,BiMeta \"B2\"]) (ArTau !t1 (ExMeta \"k1\")), result = ExFormation [BiMeta \"B1\",BiTau !t1 (ExMeta \"k1\"),BiMeta \"B2\"], when = Nothing, where_ = Nothing, having = Nothing}", stepCopy), ("Rule {name = \"dc\", label = Nothing, description = Nothing, pattern = ExApplication ExTermination (ArTau !t (ExAny (Slot \"e\" 6))), result = ExTermination, when = Nothing, where_ = Nothing, having = Nothing}", stepDc), ("Rule {name = \"dca\", label = Nothing, description = Nothing, pattern = ExApplication ExTermination (ArAlpha \945!i (ExAny (Slot \"e\" 7))), result = ExTermination, when = Nothing, where_ = Nothing, having = Nothing}", stepDca), ("Rule {name = \"dd\", label = Nothing, description = Nothing, pattern = ExDispatch ExTermination !t, result = ExTermination, when = Nothing, where_ = Nothing, having = Nothing}", stepDd), ("Rule {name = \"dl\", label = Nothing, description = Nothing, pattern = ExFormation [BiMeta \"B1\",BiLambda (FnAny (Slot \"F\" 9)),BiMeta \"B2\"], result = ExTermination, when = Just (In [\916] [BiMeta \"B1\",BiMeta \"B2\"]), where_ = Nothing, having = Nothing}", stepDl), ("Rule {name = \"dot\", label = Nothing, description = Nothing, pattern = ExDispatch (ExFormation [BiMeta \"B1\",BiTau !t1 (ExMeta \"n1\"),BiMeta \"B2\"]) !t1, result = ExApplication (ExMeta \"e1\") (ArTau \961 (ExMeta \"e2\")), when = Just (Not (In [\916,\955] [BiMeta \"B1\",BiMeta \"B2\"])), where_ = Just [Extra {meta = ArgExpression (ExMeta \"e1\"), function = \"contextualize\", args = [ArgExpression (ExMeta \"n1\"),ArgExpression (ExFormation [BiMeta \"B1\",BiMeta \"B2\"])]},Extra {meta = ArgExpression (ExMeta \"e2\"), function = \"named\", args = [ArgExpression (ExFormation [BiMeta \"B1\",BiTau !t1 (ExMeta \"n1\"),BiMeta \"B2\"])]}], having = Nothing}", stepDot), ("Rule {name = \"miss\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\"]) (ArTau !t1 (ExAny (Slot \"e\" 10))), result = ExTermination, when = Just (And [Not (In [!t1] [BiMeta \"B1\"]),Not (Eq (CmpAttr !t1) (CmpAttr \961))]), where_ = Nothing, having = Nothing}", stepMiss), ("Rule {name = \"norho\", label = Nothing, description = Nothing, pattern = ExDispatch (ExFormation [BiMeta \"B1\"]) \961, result = ExTermination, when = Just (Not (In [\961] [BiMeta \"B1\"])), where_ = Nothing, having = Nothing}", stepNorho), ("Rule {name = \"null\", label = Nothing, description = Nothing, pattern = ExDispatch (ExFormation [BiMeta \"B1\",BiVoid !t1,BiMeta \"B2\"]) !t1, result = ExTermination, when = Nothing, where_ = Nothing, having = Nothing}", stepNull), ("Rule {name = \"over\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\",BiTau !t1 (ExMeta \"e1\"),BiMeta \"B2\"]) (ArTau !t1 (ExMeta \"e2\")), result = ExTermination, when = Just (Not (Eq (CmpAttr !t1) (CmpAttr \961))), where_ = Nothing, having = Nothing}", stepOver), ("Rule {name = \"overa\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\",BiTau !t1 (ExMeta \"e1\"),BiMeta \"B2\"]) (ArAlpha \945!i1 (ExMeta \"e2\")), result = ExTermination, when = Just (And [Eq (CmpNum (MetaIndex \"i1\")) (CmpNum (Domain (BiMeta \"B1\"))),Not (Eq (CmpAttr !t1) (CmpAttr \961))]), where_ = Nothing, having = Nothing}", stepOvera), ("Rule {name = \"skip\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\"]) (ArTau \961 (ExMeta \"e1\")), result = ExFormation [BiMeta \"B1\"], when = Just (Not (In [\961] [BiMeta \"B1\"])), where_ = Nothing, having = Nothing}", stepSkip), ("Rule {name = \"stay\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\",BiTau \961 (ExMeta \"e1\"),BiMeta \"B2\"]) (ArTau \961 (ExMeta \"e2\")), result = ExFormation [BiMeta \"B1\",BiTau \961 (ExMeta \"e1\"),BiMeta \"B2\"], when = Nothing, where_ = Nothing, having = Nothing}", stepStay), ("Rule {name = \"stop\", label = Nothing, description = Nothing, pattern = ExDispatch (ExFormation [BiMeta \"B1\"]) !t1, result = ExTermination, when = Just (Disjoint [!t1,\966,\955] [BiMeta \"B1\"]), where_ = Nothing, having = Nothing}", stepStop)]-- The rules of 𝕄, in the order of their files.morphings :: [In.Inference Expression]morphings = [In.direct morphingDead, In.direct morphingMa, In.direct morphingMaa, In.direct morphingMaad, In.direct morphingMad, In.direct morphingMd, In.direct morphingMf, In.direct morphingMg, In.direct morphingMl, In.direct morphingMphi, In.direct morphingUniverse, In.direct morphingXi]-- The rules of 𝔻, in the order of their files.dataizations :: [In.Inference Bytes]dataizations = [In.direct dataizationBox, In.direct dataizationDelta, In.direct dataizationFire, In.direct dataizationNone, In.direct dataizationNorm]-- The texts of the built-in rules of all four judgments this module is made of.sources :: [String]sources = ["Rule {name = \"alpha\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\",BiVoid !t1,BiMeta \"B2\"]) (ArAlpha \945!i1 (ExMeta \"e1\")), result = ExApplication (ExFormation [BiMeta \"B1\",BiVoid !t1,BiMeta \"B2\"]) (ArTau !t1 (ExMeta \"e1\")), when = Just (And [Eq (CmpNum (MetaIndex \"i1\")) (CmpNum (Domain (BiMeta \"B1\"))),Not (Eq (CmpAttr !t1) (CmpAttr \961))]), where_ = Nothing, having = Nothing}", "Rule {name = \"amiss\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\"]) (ArAlpha \945!i1 (ExAny (Slot \"e\" 11))), result = ExTermination, when = Just (Not (Gt (CmpNum (Domain (BiMeta \"B1\"))) (CmpNum (MetaIndex \"i1\")))), where_ = Nothing, having = Nothing}", "Rule {name = \"copy\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\",BiVoid !t1,BiMeta \"B2\"]) (ArTau !t1 (ExMeta \"k1\")), result = ExFormation [BiMeta \"B1\",BiTau !t1 (ExMeta \"k1\"),BiMeta \"B2\"], when = Nothing, where_ = Nothing, having = Nothing}", "Rule {name = \"dc\", label = Nothing, description = Nothing, pattern = ExApplication ExTermination (ArTau !t (ExAny (Slot \"e\" 6))), result = ExTermination, when = Nothing, where_ = Nothing, having = Nothing}", "Rule {name = \"dca\", label = Nothing, description = Nothing, pattern = ExApplication ExTermination (ArAlpha \945!i (ExAny (Slot \"e\" 7))), result = ExTermination, when = Nothing, where_ = Nothing, having = Nothing}", "Rule {name = \"dd\", label = Nothing, description = Nothing, pattern = ExDispatch ExTermination !t, result = ExTermination, when = Nothing, where_ = Nothing, having = Nothing}", "Rule {name = \"dl\", label = Nothing, description = Nothing, pattern = ExFormation [BiMeta \"B1\",BiLambda (FnAny (Slot \"F\" 9)),BiMeta \"B2\"], result = ExTermination, when = Just (In [\916] [BiMeta \"B1\",BiMeta \"B2\"]), where_ = Nothing, having = Nothing}", "Rule {name = \"dot\", label = Nothing, description = Nothing, pattern = ExDispatch (ExFormation [BiMeta \"B1\",BiTau !t1 (ExMeta \"n1\"),BiMeta \"B2\"]) !t1, result = ExApplication (ExMeta \"e1\") (ArTau \961 (ExMeta \"e2\")), when = Just (Not (In [\916,\955] [BiMeta \"B1\",BiMeta \"B2\"])), where_ = Just [Extra {meta = ArgExpression (ExMeta \"e1\"), function = \"contextualize\", args = [ArgExpression (ExMeta \"n1\"),ArgExpression (ExFormation [BiMeta \"B1\",BiMeta \"B2\"])]},Extra {meta = ArgExpression (ExMeta \"e2\"), function = \"named\", args = [ArgExpression (ExFormation [BiMeta \"B1\",BiTau !t1 (ExMeta \"n1\"),BiMeta \"B2\"])]}], having = Nothing}", "Rule {name = \"miss\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\"]) (ArTau !t1 (ExAny (Slot \"e\" 10))), result = ExTermination, when = Just (And [Not (In [!t1] [BiMeta \"B1\"]),Not (Eq (CmpAttr !t1) (CmpAttr \961))]), where_ = Nothing, having = Nothing}", "Rule {name = \"norho\", label = Nothing, description = Nothing, pattern = ExDispatch (ExFormation [BiMeta \"B1\"]) \961, result = ExTermination, when = Just (Not (In [\961] [BiMeta \"B1\"])), where_ = Nothing, having = Nothing}", "Rule {name = \"null\", label = Nothing, description = Nothing, pattern = ExDispatch (ExFormation [BiMeta \"B1\",BiVoid !t1,BiMeta \"B2\"]) !t1, result = ExTermination, when = Nothing, where_ = Nothing, having = Nothing}", "Rule {name = \"over\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\",BiTau !t1 (ExMeta \"e1\"),BiMeta \"B2\"]) (ArTau !t1 (ExMeta \"e2\")), result = ExTermination, when = Just (Not (Eq (CmpAttr !t1) (CmpAttr \961))), where_ = Nothing, having = Nothing}", "Rule {name = \"overa\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\",BiTau !t1 (ExMeta \"e1\"),BiMeta \"B2\"]) (ArAlpha \945!i1 (ExMeta \"e2\")), result = ExTermination, when = Just (And [Eq (CmpNum (MetaIndex \"i1\")) (CmpNum (Domain (BiMeta \"B1\"))),Not (Eq (CmpAttr !t1) (CmpAttr \961))]), where_ = Nothing, having = Nothing}", "Rule {name = \"skip\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\"]) (ArTau \961 (ExMeta \"e1\")), result = ExFormation [BiMeta \"B1\"], when = Just (Not (In [\961] [BiMeta \"B1\"])), where_ = Nothing, having = Nothing}", "Rule {name = \"stay\", label = Nothing, description = Nothing, pattern = ExApplication (ExFormation [BiMeta \"B1\",BiTau \961 (ExMeta \"e1\"),BiMeta \"B2\"]) (ArTau \961 (ExMeta \"e2\")), result = ExFormation [BiMeta \"B1\",BiTau \961 (ExMeta \"e1\"),BiMeta \"B2\"], when = Nothing, where_ = Nothing, having = Nothing}", "Rule {name = \"stop\", label = Nothing, description = Nothing, pattern = ExDispatch (ExFormation [BiMeta \"B1\"]) !t1, result = ExTermination, when = Just (Disjoint [!t1,\966,\955] [BiMeta \"B1\"]), where_ = Nothing, having = Nothing}", "ContextualizeRule {name = \"ca\", label = Nothing, match = ExApplication (ExMeta \"n1\") (ArTau !t1 (ExMeta \"e1\")), cmatch = ExMeta \"k1\", cresult = ExApplication (ExMeta \"n2\") (ArTau !t1 (ExMeta \"n3\")), premises = [Premise {result = \"n2\", operation = OpContextualize (ExMeta \"n1\") (ExMeta \"k1\")},Premise {result = \"n3\", operation = OpContextualize (ExMeta \"e1\") (ExMeta \"k1\")}]}", "ContextualizeRule {name = \"caa\", label = Nothing, match = ExApplication (ExMeta \"n1\") (ArAlpha \945!i1 (ExMeta \"e1\")), cmatch = ExMeta \"k1\", cresult = ExApplication (ExMeta \"n2\") (ArAlpha \945!i1 (ExMeta \"n3\")), premises = [Premise {result = \"n2\", operation = OpContextualize (ExMeta \"n1\") (ExMeta \"k1\")},Premise {result = \"n3\", operation = OpContextualize (ExMeta \"e1\") (ExMeta \"k1\")}]}", "ContextualizeRule {name = \"cd\", label = Nothing, match = ExDispatch (ExMeta \"n1\") !t1, cmatch = ExMeta \"k1\", cresult = ExDispatch (ExMeta \"n2\") !t1, premises = [Premise {result = \"n2\", operation = OpContextualize (ExMeta \"n1\") (ExMeta \"k1\")}]}", "ContextualizeRule {name = \"cf\", label = Nothing, match = ExFormation [BiMeta \"B1\"], cmatch = ExMeta \"k1\", cresult = ExFormation [BiMeta \"B1\"], premises = []}", "ContextualizeRule {name = \"cg\", label = Nothing, match = ExRoot, cmatch = ExMeta \"k1\", cresult = ExRoot, premises = []}", "ContextualizeRule {name = \"ct\", label = Nothing, match = ExTermination, cmatch = ExMeta \"k1\", cresult = ExTermination, premises = []}", "ContextualizeRule {name = \"cxi\", label = Nothing, match = ExXi, cmatch = ExMeta \"k1\", cresult = ExMeta \"k1\", premises = []}", "MorphRule {name = \"dead\", label = Nothing, match = ExTermination, ematch = ExMeta \"e1\", nresult = ExTermination, when = Nothing, premises = []}", "MorphRule {name = \"ma\", label = Nothing, match = ExApplication (ExMeta \"n1\") (ArTau !t1 (ExMeta \"k1\")), ematch = ExMeta \"e1\", nresult = ExMeta \"n4\", when = Nothing, premises = [Premise {result = \"n2\", operation = OpMorph (ExMeta \"n1\") (ExMeta \"e1\")},Premise {result = \"n3\", operation = OpNormalize (ExApplication (ExMeta \"n2\") (ArTau !t1 (ExMeta \"k1\")))},Premise {result = \"n4\", operation = OpMorph (ExMeta \"n3\") (ExMeta \"e1\")}]}", "MorphRule {name = \"maa\", label = Nothing, match = ExApplication (ExMeta \"n1\") (ArAlpha \945!i1 (ExMeta \"k1\")), ematch = ExMeta \"e1\", nresult = ExMeta \"n4\", when = Nothing, premises = [Premise {result = \"n2\", operation = OpMorph (ExMeta \"n1\") (ExMeta \"e1\")},Premise {result = \"n3\", operation = OpNormalize (ExApplication (ExMeta \"n2\") (ArAlpha \945!i1 (ExMeta \"k1\")))},Premise {result = \"n4\", operation = OpMorph (ExMeta \"n3\") (ExMeta \"e1\")}]}", "MorphRule {name = \"maad\", label = Nothing, match = ExApplication (ExAny (Slot \"n\" 0)) (ArAlpha \945!i (ExMeta \"n1\")), ematch = ExMeta \"e1\", nresult = ExMeta \"n2\", when = Just (Not (Absolute (ExMeta \"n1\"))), premises = [Premise {result = \"n2\", operation = OpMorph ExTermination (ExMeta \"e1\")}]}", "MorphRule {name = \"mad\", label = Nothing, match = ExApplication (ExAny (Slot \"n\" 0)) (ArTau !t (ExMeta \"n1\")), ematch = ExMeta \"e1\", nresult = ExMeta \"n2\", when = Just (Not (Absolute (ExMeta \"n1\"))), premises = [Premise {result = \"n2\", operation = OpMorph ExTermination (ExMeta \"e1\")}]}", "MorphRule {name = \"md\", label = Nothing, match = ExDispatch (ExMeta \"n1\") !t1, ematch = ExMeta \"e1\", nresult = ExMeta \"n4\", when = Just (Not (IsFormation (ExMeta \"n1\"))), premises = [Premise {result = \"n2\", operation = OpMorph (ExMeta \"n1\") (ExMeta \"e1\")},Premise {result = \"n3\", operation = OpNormalize (ExDispatch (ExMeta \"n2\") !t1)},Premise {result = \"n4\", operation = OpMorph (ExMeta \"n3\") (ExMeta \"e1\")}]}", "MorphRule {name = \"mf\", label = Nothing, match = ExFormation [BiMeta \"B1\"], ematch = ExMeta \"e1\", nresult = ExFormation [BiMeta \"B1\"], when = Nothing, premises = []}", "MorphRule {name = \"mg\", label = Nothing, match = ExRoot, ematch = ExRoot, nresult = ExMeta \"n1\", when = Nothing, premises = [Premise {result = \"n1\", operation = OpMorph ExTermination ExRoot}]}", "MorphRule {name = \"ml\", label = Just \"\\\\uplambda\", match = ExDispatch (ExFormation [BiMeta \"B1\"]) !t1, ematch = ExMeta \"e1\", nresult = ExMeta \"n3\", when = Just (In [\955] [BiMeta \"B1\"]), premises = [Premise {result = \"n1\", operation = OpEvaluate (ExFormation [BiMeta \"B1\"]) (ExMeta \"e1\")},Premise {result = \"n2\", operation = OpNormalize (ExDispatch (ExMeta \"n1\") !t1)},Premise {result = \"n3\", operation = OpMorph (ExMeta \"n2\") (ExMeta \"e1\")}]}", "MorphRule {name = \"mphi\", label = Just \"\\\\upvarphi\", match = ExDispatch (ExFormation [BiMeta \"B1\"]) !t1, ematch = ExMeta \"e1\", nresult = ExMeta \"n2\", when = Just (And [In [\966] [BiMeta \"B1\"],Disjoint [!t1,\955] [BiMeta \"B1\"]]), premises = [Premise {result = \"n1\", operation = OpNormalize (ExDispatch (ExDispatch (ExFormation [BiMeta \"B1\"]) \966) !t1)},Premise {result = \"n2\", operation = OpMorph (ExMeta \"n1\") (ExMeta \"e1\")}]}", "MorphRule {name = \"universe\", label = Just \"\\\\Phi\", match = ExRoot, ematch = ExMeta \"e1\", nresult = ExMeta \"n2\", when = Just (Not (Eq (CmpExpr (ExMeta \"e1\")) (CmpExpr ExRoot))), premises = [Premise {result = \"n1\", operation = OpNormalize (ExMeta \"e1\")},Premise {result = \"n2\", operation = OpMorph (ExMeta \"n1\") (ExMeta \"e1\")}]}", "MorphRule {name = \"xi\", label = Just \"\\\\upxi\", match = ExXi, ematch = ExMeta \"e1\", nresult = ExMeta \"n1\", when = Nothing, premises = [Premise {result = \"n1\", operation = OpMorph ExTermination (ExMeta \"e1\")}]}", "DataizeRule {name = \"box\", label = Nothing, match = ExFormation [BiMeta \"B1\"], ematch = ExMeta \"e1\", dresult = BtMeta \"d1\", when = Just (And [In [\966] [BiMeta \"B1\"],Disjoint [\916,\955] [BiMeta \"B1\"]]), premises = [Premise {result = \"n1\", operation = OpNormalize (ExDispatch (ExFormation [BiMeta \"B1\"]) \966)},Premise {result = \"d1\", operation = OpDataize (ExMeta \"n1\") (ExMeta \"e1\")}]}", "DataizeRule {name = \"delta\", label = Just \"\\\\Delta\", match = ExFormation [BiMeta \"B1\",BiDelta (BtMeta \"d1\"),BiMeta \"B2\"], ematch = ExMeta \"e1\", dresult = BtMeta \"d1\", when = Just (Disjoint [\955] [BiMeta \"B1\",BiMeta \"B2\"]), premises = []}", "DataizeRule {name = \"fire\", label = Nothing, match = ExFormation [BiMeta \"B1\"], ematch = ExMeta \"e1\", dresult = BtMeta \"d1\", when = Just (And [In [\955] [BiMeta \"B1\"],Disjoint [\916] [BiMeta \"B1\"]]), premises = [Premise {result = \"n1\", operation = OpEvaluate (ExFormation [BiMeta \"B1\"]) (ExMeta \"e1\")},Premise {result = \"d1\", operation = OpDataize (ExMeta \"n1\") (ExMeta \"e1\")}]}", "DataizeRule {name = \"none\", label = Nothing, match = ExFormation [BiMeta \"B1\"], ematch = ExMeta \"e1\", dresult = BtMeta \"d1\", when = Just (Disjoint [\916,\955,\966] [BiMeta \"B1\"]), premises = [Premise {result = \"d1\", operation = OpDataize ExTermination (ExMeta \"e1\")}]}", "DataizeRule {name = \"norm\", label = Nothing, match = ExMeta \"n1\", ematch = ExMeta \"e1\", dresult = BtMeta \"d1\", when = Just (And [Not (IsFormation (ExMeta \"n1\")),Not (Eq (CmpExpr (ExMeta \"n1\")) (CmpExpr ExTermination))]), premises = [Premise {result = \"n2\", operation = OpMorph (ExMeta \"n1\") (ExMeta \"e1\")},Premise {result = \"d1\", operation = OpDataize (ExMeta \"n2\") (ExMeta \"e1\")}]}"]-- Whether the term is a normal form: no built-in rule of normalization-- matches anywhere inside it.-- A rule asking a meta for a normal form asks it of a part of the term,-- and a part that is no normal form holds a match the walk meets anyway,-- so the walk takes every such part for a normal form (#2409).nf :: Expression -> Boolnf = Ru.normalWith (not . null . matchingBy (const True) Nothing)-- The numbers of the built-in rules of normalization matching somewhere in-- the term, in the order one walk over it meets them, told the world the-- term stands in.matching :: Maybe Expression -> Expression -> [Int]matching = matchingBy nf-- The numbers of the built-in rules of normalization matching somewhere in-- the term, a rule asking a meta for a normal form told it by the test.matchingBy :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Int]matchingBy normal =  M.hits    [ (0, True, rewriteAlpha normal)    , (1, True, rewriteAmiss normal)    , (2, True, rewriteCopy normal)    , (3, True, rewriteDc normal)    , (4, True, rewriteDca normal)    , (5, True, rewriteDd normal)    , (6, True, rewriteDl normal)    , (7, True, rewriteDot normal)    , (8, True, rewriteMiss normal)    , (9, True, rewriteNorho normal)    , (10, True, rewriteNull normal)    , (11, True, rewriteOver normal)    , (12, True, rewriteOvera normal)    , (13, True, rewriteSkip normal)    , (14, True, rewriteStay normal)    , (15, True, rewriteStop normal)    ]-- The Contextualization function 𝒞, the conclusion of the one rule matching-- the term and the context.contextualize :: Expression -> Expression -> Either C.ContextualizeException Expressioncontextualize term context =  C.concluded    term    ( concat        [ contextualizeCa term context        , contextualizeCaa term context        , contextualizeCd term context        , contextualizeCf term context        , contextualizeCg term context        , contextualizeCt term context        , contextualizeCxi term context        ]    )-- The rule 'alpha'.stepAlpha :: Ru.StepstepAlpha = R.direct "alpha" True (rewriteAlpha nf)rewriteAlpha :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteAlpha _ _ term =  [ ExApplication (B.formed (concat [x5, [BiVoid x9], x8])) (ArTau x9 x3)  | ExApplication x1 (ArAlpha x2 x3) <- [term]  , ExFormation x4 <- [x1]  , (x5, x6) <- M.splits x4  , (x7 : x8) <- [x6]  , BiVoid x9 <- [x7]  , Alpha x10 <- [x2]  , (x10 == (Ru.domainOf x5) && not (x9 == AtRho))  ]-- The rule 'amiss'.stepAmiss :: Ru.StepstepAmiss = R.direct "amiss" True (rewriteAmiss nf)rewriteAmiss :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteAmiss _ _ term =  [ ExTermination  | ExApplication x1 (ArAlpha x2 _) <- [term]  , ExFormation x4 <- [x1]  , Alpha x5 <- [x2]  , not ((Ru.domainOf x4) > x5)  ]-- The rule 'copy'.stepCopy :: Ru.StepstepCopy = R.direct "copy" True (rewriteCopy nf)rewriteCopy :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteCopy normal _ term =  [ B.formed (concat [x5, [BiTau x2 x3], x8])  | ExApplication x1 (ArTau x2 x3) <- [term]  , ExFormation x4 <- [x1]  , (x5, x6) <- M.splits x4  , (x7 : x8) <- [x6]  , BiVoid x9 <- [x7]  , x2 == x9  , Ru.xiFree x3  , Ru.normalHeld normal x3  ]-- The rule 'dc'.stepDc :: Ru.StepstepDc = R.direct "dc" True (rewriteDc nf)rewriteDc :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteDc _ _ term =  [ ExTermination  | ExApplication x1 (ArTau _ _) <- [term]  , ExTermination <- [x1]  ]-- The rule 'dca'.stepDca :: Ru.StepstepDca = R.direct "dca" True (rewriteDca nf)rewriteDca :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteDca _ _ term =  [ ExTermination  | ExApplication x1 (ArAlpha x2 _) <- [term]  , ExTermination <- [x1]  , Alpha _ <- [x2]  ]-- The rule 'dd'.stepDd :: Ru.StepstepDd = R.direct "dd" True (rewriteDd nf)rewriteDd :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteDd _ _ term =  [ ExTermination  | ExDispatch x1 _ <- [term]  , ExTermination <- [x1]  ]-- The rule 'dl'.stepDl :: Ru.StepstepDl = R.direct "dl" True (rewriteDl nf)rewriteDl :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteDl _ _ term =  [ ExTermination  | ExFormation x1 <- [term]  , (x2, x3) <- M.splits x1  , (x4 : x5) <- [x3]  , BiLambda x6 <- [x4]  , M.named x6  , all (`Ru.presentIn` concat [x2, x5]) [AtDelta]  ]-- The rule 'dot'.stepDot :: Ru.StepstepDot = R.direct "dot" True (rewriteDot nf)rewriteDot :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteDot normal universe term =  [ ExApplication e1 (ArTau AtRho e2)  | ExDispatch x1 x2 <- [term]  , ExFormation x3 <- [x1]  , (x4, x5) <- M.splits x3  , (x6 : x7) <- [x5]  , BiTau x8 x9 <- [x6]  , x2 == x8  , not (all (`Ru.presentIn` concat [x4, x7]) [AtDelta, AtLambda])  , Ru.normalHeld normal x9  , let e1 = either E.throw id (contextualize x9 (B.formed (concat [x4, x7])))  , let e2 = B.nameIn universe (B.formed (concat [x4, [BiTau x2 x9], x7]))  ]-- The rule 'miss'.stepMiss :: Ru.StepstepMiss = R.direct "miss" True (rewriteMiss nf)rewriteMiss :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteMiss _ _ term =  [ ExTermination  | ExApplication x1 (ArTau x2 _) <- [term]  , ExFormation x4 <- [x1]  , (not (all (`Ru.presentIn` concat [x4]) [x2]) && not (x2 == AtRho))  ]-- The rule 'norho'.stepNorho :: Ru.StepstepNorho = R.direct "norho" True (rewriteNorho nf)rewriteNorho :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteNorho _ _ term =  [ ExTermination  | ExDispatch x1 x2 <- [term]  , x2 == AtRho  , ExFormation x3 <- [x1]  , not (all (`Ru.presentIn` concat [x3]) [AtRho])  ]-- The rule 'null'.stepNull :: Ru.StepstepNull = R.direct "null" True (rewriteNull nf)rewriteNull :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteNull _ _ term =  [ ExTermination  | ExDispatch x1 x2 <- [term]  , ExFormation x3 <- [x1]  , (_, x5) <- M.splits x3  , (x6 : _) <- [x5]  , BiVoid x8 <- [x6]  , x2 == x8  ]-- The rule 'over'.stepOver :: Ru.StepstepOver = R.direct "over" True (rewriteOver nf)rewriteOver :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteOver _ _ term =  [ ExTermination  | ExApplication x1 (ArTau x2 _) <- [term]  , ExFormation x4 <- [x1]  , (_, x6) <- M.splits x4  , (x7 : _) <- [x6]  , BiTau x9 _ <- [x7]  , x2 == x9  , not (x2 == AtRho)  ]-- The rule 'overa'.stepOvera :: Ru.StepstepOvera = R.direct "overa" True (rewriteOvera nf)rewriteOvera :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteOvera _ _ term =  [ ExTermination  | ExApplication x1 (ArAlpha x2 _) <- [term]  , ExFormation x4 <- [x1]  , (x5, x6) <- M.splits x4  , (x7 : _) <- [x6]  , BiTau x9 _ <- [x7]  , Alpha x11 <- [x2]  , (x11 == (Ru.domainOf x5) && not (x9 == AtRho))  ]-- The rule 'skip'.stepSkip :: Ru.StepstepSkip = R.direct "skip" True (rewriteSkip nf)rewriteSkip :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteSkip _ _ term =  [ B.formed x4  | ExApplication x1 (ArTau x2 _) <- [term]  , x2 == AtRho  , ExFormation x4 <- [x1]  , not (all (`Ru.presentIn` concat [x4]) [AtRho])  ]-- The rule 'stay'.stepStay :: Ru.StepstepStay = R.direct "stay" True (rewriteStay nf)rewriteStay :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteStay _ _ term =  [ B.formed (concat [x5, [BiTau AtRho x10], x8])  | ExApplication x1 (ArTau x2 _) <- [term]  , x2 == AtRho  , ExFormation x4 <- [x1]  , (x5, x6) <- M.splits x4  , (x7 : x8) <- [x6]  , BiTau x9 x10 <- [x7]  , x9 == AtRho  ]-- The rule 'stop'.stepStop :: Ru.StepstepStop = R.direct "stop" True (rewriteStop nf)rewriteStop :: (Expression -> Bool) -> Maybe Expression -> Expression -> [Expression]rewriteStop _ _ term =  [ ExTermination  | ExDispatch x1 x2 <- [term]  , ExFormation x3 <- [x1]  , not (any (`Ru.presentIn` concat [x3]) [x2, AtPhi, AtLambda])  ]-- The contextualization rule 'ca'.contextualizeCa :: Expression -> Expression -> [(String, Either C.ContextualizeException Expression)]contextualizeCa term context =  [ ("ca", do { n2 <- contextualize x1 context; n3 <- contextualize x3 context; pure (ExApplication n2 (ArTau x2 n3)) })  | ExApplication x1 (ArTau x2 x3) <- [term]  ]-- The contextualization rule 'caa'.contextualizeCaa :: Expression -> Expression -> [(String, Either C.ContextualizeException Expression)]contextualizeCaa term context =  [ ("caa", do { n2 <- contextualize x1 context; n3 <- contextualize x3 context; pure (ExApplication n2 (ArAlpha (Alpha x4) n3)) })  | ExApplication x1 (ArAlpha x2 x3) <- [term]  , Alpha x4 <- [x2]  ]-- The contextualization rule 'cd'.contextualizeCd :: Expression -> Expression -> [(String, Either C.ContextualizeException Expression)]contextualizeCd term context =  [ ("cd", do { n2 <- contextualize x1 context; pure (ExDispatch n2 x2) })  | ExDispatch x1 x2 <- [term]  ]-- The contextualization rule 'cf'.contextualizeCf :: Expression -> Expression -> [(String, Either C.ContextualizeException Expression)]contextualizeCf term _ =  [ ("cf", Right (B.formed x1))  | ExFormation x1 <- [term]  ]-- The contextualization rule 'cg'.contextualizeCg :: Expression -> Expression -> [(String, Either C.ContextualizeException Expression)]contextualizeCg term _ =  [ ("cg", Right ExRoot)  | ExRoot <- [term]  ]-- The contextualization rule 'ct'.contextualizeCt :: Expression -> Expression -> [(String, Either C.ContextualizeException Expression)]contextualizeCt term _ =  [ ("ct", Right ExTermination)  | ExTermination <- [term]  ]-- The contextualization rule 'cxi'.contextualizeCxi :: Expression -> Expression -> [(String, Either C.ContextualizeException Expression)]contextualizeCxi term context =  [ ("cxi", Right context)  | ExXi <- [term]  ]-- The morphing rule 'dead'.morphingDead :: Expression -> Expression -> [In.Premises Expression]morphingDead term _ =  [ In.Concludes (In.Answered (D.Morphing, "dead") ExTermination)  | ExTermination <- [term]  ]-- The morphing rule 'ma'.morphingMa :: Expression -> Expression -> [In.Premises Expression]morphingMa term universe =  [ In.Morphs x1 universe (\n2 -> pure (In.Concludes (In.Onward (In.Normalized (D.Morphing, "ma")) (ExApplication n2 (ArTau x2 x3)) universe)))  | ExApplication x1 (ArTau x2 x3) <- [term]  , Ru.xiFree x3  , Ru.normalHeld nf x1  , Ru.normalHeld nf x3  ]-- The morphing rule 'maa'.morphingMaa :: Expression -> Expression -> [In.Premises Expression]morphingMaa term universe =  [ In.Morphs x1 universe (\n2 -> pure (In.Concludes (In.Onward (In.Normalized (D.Morphing, "maa")) (ExApplication n2 (ArAlpha (Alpha x4) x3)) universe)))  | ExApplication x1 (ArAlpha x2 x3) <- [term]  , Alpha x4 <- [x2]  , Ru.xiFree x3  , Ru.normalHeld nf x1  , Ru.normalHeld nf x3  ]-- The morphing rule 'maad'.morphingMaad :: Expression -> Expression -> [In.Premises Expression]morphingMaad term universe =  [ In.Concludes (In.Onward (In.Taken (D.Morphing, "maad")) ExTermination universe)  | ExApplication x1 (ArAlpha x2 x3) <- [term]  , Alpha _ <- [x2]  , not (Ru.xiFree x3)  , Ru.normalHeld nf x1  , Ru.normalHeld nf x3  ]-- The morphing rule 'mad'.morphingMad :: Expression -> Expression -> [In.Premises Expression]morphingMad term universe =  [ In.Concludes (In.Onward (In.Taken (D.Morphing, "mad")) ExTermination universe)  | ExApplication x1 (ArTau _ x3) <- [term]  , not (Ru.xiFree x3)  , Ru.normalHeld nf x1  , Ru.normalHeld nf x3  ]-- The morphing rule 'md'.morphingMd :: Expression -> Expression -> [In.Premises Expression]morphingMd term universe =  [ In.Morphs x1 universe (\n2 -> pure (In.Concludes (In.Onward (In.Normalized (D.Morphing, "md")) (ExDispatch n2 x2) universe)))  | ExDispatch x1 x2 <- [term]  , not (Ru.isFormation x1)  , Ru.normalHeld nf x1  ]-- The morphing rule 'mf'.morphingMf :: Expression -> Expression -> [In.Premises Expression]morphingMf term _ =  [ In.Concludes (In.Answered (D.Morphing, "mf") (B.formed x1))  | ExFormation x1 <- [term]  ]-- The morphing rule 'mg'.morphingMg :: Expression -> Expression -> [In.Premises Expression]morphingMg term universe =  [ In.Concludes (In.Onward (In.Taken (D.Morphing, "mg")) ExTermination ExRoot)  | ExRoot <- [universe]  , ExRoot <- [term]  ]-- The morphing rule 'ml'.morphingMl :: Expression -> Expression -> [In.Premises Expression]morphingMl term universe =  [ In.Evaluates (B.formed x3) universe (\n1 -> pure (In.Concludes (In.Onward (In.Normalized (D.Morphing, "ml")) (ExDispatch n1 x2) universe)))  | ExDispatch x1 x2 <- [term]  , ExFormation x3 <- [x1]  , all (`Ru.presentIn` concat [x3]) [AtLambda]  ]-- The morphing rule 'mphi'.morphingMphi :: Expression -> Expression -> [In.Premises Expression]morphingMphi term universe =  [ In.Concludes (In.Onward (In.Normalized (D.Morphing, "mphi")) (ExDispatch (ExDispatch (B.formed x3) AtPhi) x2) universe)  | ExDispatch x1 x2 <- [term]  , ExFormation x3 <- [x1]  , (all (`Ru.presentIn` concat [x3]) [AtPhi] && not (any (`Ru.presentIn` concat [x3]) [x2, AtLambda]))  ]-- The morphing rule 'universe'.morphingUniverse :: Expression -> Expression -> [In.Premises Expression]morphingUniverse term universe =  [ In.Concludes (In.Onward (In.Named (D.Morphing, "universe")) universe universe)  | ExRoot <- [term]  , not (universe == ExRoot)  ]-- The morphing rule 'xi'.morphingXi :: Expression -> Expression -> [In.Premises Expression]morphingXi term universe =  [ In.Concludes (In.Onward (In.Taken (D.Morphing, "xi")) ExTermination universe)  | ExXi <- [term]  ]-- The dataization rule 'box'.dataizationBox :: Expression -> Expression -> [In.Premises Bytes]dataizationBox term universe =  [ In.Concludes (In.Onward (In.Normalized (D.Dataization, "box")) (ExDispatch (B.formed x1) AtPhi) universe)  | ExFormation x1 <- [term]  , (all (`Ru.presentIn` concat [x1]) [AtPhi] && not (any (`Ru.presentIn` concat [x1]) [AtDelta, AtLambda]))  ]-- The dataization rule 'delta'.dataizationDelta :: Expression -> Expression -> [In.Premises Bytes]dataizationDelta term _ =  [ In.Concludes (In.Answered (D.Dataization, "delta") x6)  | ExFormation x1 <- [term]  , (x2, x3) <- M.splits x1  , (x4 : x5) <- [x3]  , BiDelta x6 <- [x4]  , not (any (`Ru.presentIn` concat [x2, x5]) [AtLambda])  ]-- The dataization rule 'fire'.dataizationFire :: Expression -> Expression -> [In.Premises Bytes]dataizationFire term universe =  [ In.Evaluates (B.formed x1) universe (\n1 -> pure (In.Concludes (In.Onward (In.Taken (D.Evaluation, "evaluate")) n1 universe)))  | ExFormation x1 <- [term]  , (all (`Ru.presentIn` concat [x1]) [AtLambda] && not (any (`Ru.presentIn` concat [x1]) [AtDelta]))  ]-- The dataization rule 'none'.dataizationNone :: Expression -> Expression -> [In.Premises Bytes]dataizationNone term universe =  [ In.Concludes (In.Onward (In.Taken (D.Dataization, "dataize")) ExTermination universe)  | ExFormation x1 <- [term]  , not (any (`Ru.presentIn` concat [x1]) [AtDelta, AtLambda, AtPhi])  ]-- The dataization rule 'norm'.dataizationNorm :: Expression -> Expression -> [In.Premises Bytes]dataizationNorm term universe =  [ In.Concludes (In.Onward (In.Staged universe) term universe)  | (not (Ru.isFormation term) && not (term == ExTermination))  , Ru.normalHeld nf term  ]