packages feed

phino 0.0.171 → 0.0.172

raw patch · 19 files changed

+788/−57 lines, 19 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

+ Lambdas: [_located] :: Lambda -> Maybe Attribute
+ Lambdas: sited :: Lambdas -> [Binding] -> Maybe (Text, Binding)
- Forks: forked :: Fabric -> Either Int Bytes -> (Expression, Expression) -> (Expression, Expression) -> Either Refusal Expression
+ Forks: forked :: Fabric -> Maybe Binding -> Either Int Bytes -> (Expression, Expression) -> (Expression, Expression) -> Either Refusal Expression
- Lambdas: Lambda :: Text -> [(Meta, Expression)] -> [(Meta, Expression)] -> [(Meta, Expression)] -> [Line] -> [Text] -> Ending -> Lambda
+ Lambdas: Lambda :: Text -> [(Meta, Expression)] -> [(Meta, Expression)] -> [(Meta, Expression)] -> [Line] -> [Text] -> Maybe Attribute -> Ending -> Lambda
- Lambdas: symbolized :: Expression -> Int -> (Expression, [(Int, Bytes)], Int)
+ Lambdas: symbolized :: Lambdas -> Expression -> Int -> (Expression, [(Int, Bytes)], Int)

Files

README.md view
@@ -34,7 +34,7 @@  ```bash cabal update-cabal install --overwrite-policy=always phino-0.0.170+cabal install --overwrite-policy=always phino-0.0.171 phino --version ``` @@ -59,7 +59,7 @@ for the runner and puts it on the `PATH`:  ```yaml-- uses: objectionary/phino@0.0.170+- uses: objectionary/phino@0.0.171   with:     version-file: phino-version.txt - run: phino --version@@ -181,6 +181,10 @@   A term holding one of them, or an application of one, passes every line   as it is, and `join` takes it for a side that raises, as it takes `⊥`.   No entry of the file may answer such a name.+* `site` is a path of one attribute from `$`, as in `$.site🌵`, naming the+  place of the `if` a fork comes from.+  Under `--acyclic=plausible`, a formation of the entry repeats one above it+  only when both hold the same site, and `symbolize` leaves the site as it is.  An entry holds either `𝑛` or `join`, never both. The lines of all blocks run in the order of the metas they read, not in the
phino.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: phino-version: 0.0.171+version: 0.0.172 license: MIT synopsis: Command-Line Manipulator of 𝜑-Calculus Expressions description: Please see the README on GitHub at <https://github.com/objectionary/phino#readme>
src/CST.hs view
@@ -412,7 +412,11 @@  instance ToCST Binding PAIR where   toCST (BiTau attr exp@(ExFormation bds)) ctx =-    let (head', rest) = span positionless bds+    let (run, after) = span positionless bds+        seen = scanl (\acc bd -> acc || named bd) False run+        left = drop 1 (scanr (\bd acc -> named bd || acc) False run)+        cut = length (takeWhile not (zipWith3 between run seen left))+        (head', rest) = (take cut run, drop cut run ++ after)         voids' = [void | BiVoid void <- head']         others = filter (not . isVoid) head'         attr' = toCST attr ctx@@ -432,6 +436,10 @@       positionless BiLambda{} = True       positionless BiDelta{} = True       positionless _ = False+      between :: Binding -> Bool -> Bool -> Bool+      between bd before later = not (isVoid bd) && before && later+      named :: Binding -> Bool+      named bd = isVoid bd && bd /= BiVoid AtRho       isVoid :: Binding -> Bool       isVoid BiVoid{} = True       isVoid _ = False
src/Evaluate.hs view
@@ -24,7 +24,7 @@ import Deps (Evaluation (..), Judgment (Evaluation, Morphing), State (..), dontSaveEval, dontSaveStep, resited) import Engine (Engine (..)) import Forks (Fabric, Refusal (Unnamed, Unripe), Side (Lefthand, Righthand), bared, forked, joined)-import Lambdas (Ending (..), Lambda (..), Line (..), Meta (..), cast, emptyLambdas, matched, minted, rewritten, stayed, symbolized, thrown)+import Lambdas (Ending (..), Lambda (..), Line (..), Meta (..), cast, emptyLambdas, matched, minted, rewritten, sited, stayed, symbolized, thrown) import Matcher (MetaValue (..), Subst, combine, substEmpty, substSingle, substSlot) import Morph (Answer (..), Budget (..), Firing (..), Kept (..), Kindred, ReduceContext (..), ReduceException (..), Steps (..), adopted, argued, awaited, called, charged, coined, counted, deeper, ended, expired, fired, isLambda, kindle, kindred, lambda, minting, morphing, normalized, noted, opening, placed, recalled, remember, remembered, remembering, repeats, retained, settled, starved, unparked, voided) import Printer (printExpression, printFunction)@@ -291,7 +291,7 @@       _ -> False     masked :: ReduceContext -> Expression -> IO Expression     masked ctx term = do-      (stood, known, spent) <- symbolized term <$> readIORef ctx._minted+      (stood, known, spent) <- symbolized ctx._symbolic term <$> readIORef ctx._minted       writeIORef ctx._minted spent       mapM_ (\(fresh, bytes) -> ctx._saveEval (EvSymbolized ctx._nesting fresh bytes)) known       pure stood@@ -432,7 +432,7 @@         Left path -> do           leftName <- Sides.named ctx._sides one           rightName <- Sides.named ctx._sides two-          case maybe (Left Unnamed) (\names -> forked names condition (leftName, one) (rightName, two)) fallback of+          case maybe (Left Unnamed) (\names -> forked names (sited' form) condition (leftName, one) (rightName, two)) fallback of             Right term -> do               ctx._saveEval (EvFabricated ctx._nesting (left, one) (right, two) [(leftName, one), (rightName, two)] term)               pure (Joined term, state''')@@ -442,6 +442,9 @@             Left refusal -> do               ctx._saveEval (EvDiverged ctx._nesting (left, one) (right, two) path refusal)               throwIO (Diverged func)+    sited' :: Expression -> Maybe Binding+    sited' (ExFormation bds) = snd <$> sited caller._symbolic bds+    sited' _ = Nothing     weighed :: [(T.Text, Either Int Bytes)] -> Either Meta Expression -> IO (Either Int Bytes)     weighed operands (Left meta) =       maybe
src/Forks.hs view
@@ -12,7 +12,7 @@ import Data.List (nub) import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map-import Data.Maybe (fromMaybe, listToMaybe, mapMaybe)+import Data.Maybe (fromMaybe, listToMaybe, mapMaybe, maybeToList) import Data.Set (Set) import qualified Data.Set as Set import qualified Data.Text as T@@ -127,8 +127,8 @@ fabric :: Function -> Fabric fabric func = Fabric func (AtLabel "on🌵") (AtLabel "left🌵") (AtLabel "right🌵") -forked :: Fabric -> Either Int Bytes -> (Expression, Expression) -> (Expression, Expression) -> Either Refusal Expression-forked (Fabric func onward lefty righty) condition (leftName, left) (rightName, right) = do+forked :: Fabric -> Maybe Binding -> Either Int Bytes -> (Expression, Expression) -> (Expression, Expression) -> Either Refusal Expression+forked (Fabric func onward lefty righty) site condition (leftName, left) (rightName, right) = do   one <- inlined <$> formed Lefthand left   two <- inlined <$> formed Righthand right   maybe (Right (fabricated one two)) Left (listToMaybe (unripe Lefthand one two ++ unripe Righthand two one))@@ -148,7 +148,7 @@         heldTwo :: Map Attribute [Attribute]         heldTwo = held two         branch :: Attribute -> Binding-        branch attr = BiTau attr (ExFormation ([BiVoid AtRho, BiLambda func] ++ map BiVoid (inner attr) ++ [weighing, ask lefty leftward heldOne attr, ask righty rightward heldTwo attr]))+        branch attr = BiTau attr (ExFormation ([BiVoid AtRho, BiLambda func] ++ map BiVoid (inner attr) ++ [bd | siting `notElem` map Just (inner attr), bd <- maybeToList site] ++ [weighing, ask lefty leftward heldOne attr, ask righty rightward heldTwo attr]))         weighing :: Binding         weighing = BiTau onward (ExFormation [either (BiLambda . FnSymbol) BiDelta condition])         leftward :: Expression@@ -189,7 +189,9 @@     applied :: Expression -> [Attribute] -> Expression     applied = foldl (\term attr -> ExApplication term (ArTau attr (ExDispatch ExXi attr)))     held :: [Binding] -> Map Attribute [Attribute]-    held bds = firsts [(label, vacant inside) | BiTau label (ExFormation inside) <- bds]+    held bds = firsts [(label, vacant inside ++ [name | Just name <- [siting], BiVoid name `elem` inside]) | BiTau label (ExFormation inside) <- bds]+    siting :: Maybe Attribute+    siting = site >>= attributeFromBinding     firsts :: [(Attribute, value)] -> Map Attribute value     firsts = Map.fromListWith (\_ earlier -> earlier)     distinct :: [Attribute] -> [Attribute]
src/Lambdas.hs view
@@ -18,6 +18,7 @@   , matched   , minted   , readLambdas+  , sited   , rewritten   , sized   , stayed@@ -41,7 +42,7 @@ import Data.List (find, nub, sortOn) import Data.Map.Strict (Map) import qualified Data.Map.Strict as Map-import Data.Maybe (fromMaybe, listToMaybe)+import Data.Maybe (fromMaybe, listToMaybe, mapMaybe) import Data.Text (Text) import qualified Data.Text as T import Data.Text.Encoding (encodeUtf8)@@ -87,6 +88,7 @@   , _undressed :: [(Meta, Expression)]   , _lines :: [Line]   , _terminators :: [Text]+  , _located :: Maybe Attribute   , _ending :: Ending   } @@ -112,6 +114,7 @@       Lambda key dataized morphed undressed         <$> (written (T.unpack key) entry >>= ordered (T.unpack key) (map (_name . fst) (morphed ++ undressed)) . ((weighing ++ reading ++ peeling) ++))         <*> entry .:? "terminators" .!= []+        <*> (entry .:? "site" >>= traverse (located (T.unpack key)))         <*> pure ending     once (T.unpack key) lambda     mapM_ (metaless (T.unpack key) "dataize" "a path from '$' or a meta alone") lambda._dataized@@ -126,7 +129,11 @@         name : _ -> fail (printf "The key '%s' of λ function '%s' is none of the keys an entry reads: %s" (T.unpack name) key (T.unpack (T.intercalate ", " known)))         where           known :: [Text]-          known = ["λ", "dataize", "morph", "undress", "evaluate", "defer", "stay", "rewrite", "symbolize", "cast", "join", "terminators", "𝑛"]+          known = ["λ", "dataize", "morph", "undress", "evaluate", "defer", "stay", "rewrite", "symbolize", "cast", "join", "terminators", "site", "𝑛"]+      located :: String -> Text -> Yaml.Parser Attribute+      located key spelling = case parseExpression (T.unpack spelling) of+        Right (ExDispatch ExXi attr@(AtLabel _)) -> pure attr+        _ -> fail (printf "The 'site' of λ function '%s' is '%s', while it must be a path of one attribute from '$', such as '$.site🌵'" key (T.unpack spelling))       concluded :: String -> [(Meta, Expression)] -> Object -> Yaml.Parser Ending       concluded key dataized entry = do         answer <- entry .:? "𝑛"@@ -437,6 +444,13 @@ matched :: Lambdas -> Text -> Maybe Lambda matched (Lambdas entries) func = snd <$> find (\(key, _) -> matchTest key (encodeUtf8 func)) entries +sited :: Lambdas -> [Binding] -> Maybe (Text, Binding)+sited known bds = case [name | BiLambda (Function name) <- bds] of+  [name] -> do+    attr <- matched known name >>= _located+    listToMaybe [(name, bd) | bd@(BiTau attr' _) <- bds, attr' == attr]+  _ -> Nothing+ minted :: Expression -> Int -> ([(Slot, Function)], Int) minted answer spent = (zip fresh [FnSymbol idx | idx <- [spent + 1 ..]], spent + length fresh)   where@@ -519,20 +533,27 @@  type Minting = (Int, [(Int, Bytes)]) -symbolized :: Expression -> Int -> (Expression, [(Int, Bytes)], Int)-symbolized term spent = case runState (goExpr term) (spent, []) of+symbolized :: Lambdas -> Expression -> Int -> (Expression, [(Int, Bytes)], Int)+symbolized registered term spent = case runState (goExpr term) (spent, []) of   (masked, (spent', known)) -> (masked, reverse known, spent')   where     goExpr :: Expression -> State Minting Expression-    goExpr whole@(ExFormation bds) = intact bds whole ExFormation <$> mapM (goBinding (Just AtLambda `elem` map attributeFromBinding bds)) bds+    goExpr whole@(ExFormation bds) = intact bds whole ExFormation <$> mapM (spared (snd <$> sited registered bds) (goBinding (Just AtLambda `elem` map attributeFromBinding bds))) bds     goExpr whole@(ExApplication expr arg) = intact (expr, arg) whole (uncurry ExApplication) <$> ((,) <$> goExpr expr <*> goArgument arg)     goExpr whole@(ExDispatch expr attr) = intact expr whole (`ExDispatch` attr) <$> goExpr expr     goExpr (ExPhiMeet prefix idx expr) = ExPhiMeet prefix idx <$> goExpr expr     goExpr (ExPhiAgain prefix idx expr) = ExPhiAgain prefix idx <$> goExpr expr     goExpr expr = pure expr+    spared :: Maybe Binding -> (Binding -> State Minting Binding) -> Binding -> State Minting Binding+    spared (Just site) _ bd | bd == site = pure bd+    spared _ walk bd = walk bd     goBinding :: Bool -> Binding -> State Minting Binding     goBinding _ (BiDelta bts) = state (\(count, known) -> (BiLambda (FnSymbol (succ count)), (succ count, (succ count, bts) : known)))     goBinding atom bd@(BiTau attr expr) | atom || attr == AtPhi = intact expr bd (BiTau attr) <$> goExpr expr     goBinding _ bd = pure bd     goArgument :: Argument -> State Minting Argument-    goArgument arg@(ArTau attr expr) = intact expr arg (ArTau attr) <$> goExpr expr+    goArgument arg@(ArTau attr expr)+      | attr `elem` sites = pure arg+      | otherwise = intact expr arg (ArTau attr) <$> goExpr expr+    sites :: [Attribute]+    sites = case registered of Lambdas entries -> mapMaybe (_located . snd) entries
src/Morph.hs view
@@ -34,7 +34,7 @@ import GHC.Clock (getMonotonicTime) import GHC.Stats (GCDetails (..), RTSStats (..), getRTSStats, getRTSStatsEnabled) import qualified Inference as In-import Lambdas (Lambdas, stayed, thrown)+import Lambdas (Lambdas, sited, stayed, thrown) import Locator (locatedExpression, withLocatedExpression) import Matcher (substEmpty) import Must (Must (..))@@ -751,7 +751,7 @@ admitted form ctx = maybe (pure (Right ctx)) remembered ctx._acyclic   where     remembered :: Acyclic -> IO (Either (Acyclic, Expression) ReduceContext)-    remembered mode = maybe (Right ctx{_entered = seenInsert (digest mode form) form ctx._entered}) (\before -> Left (mode, before)) . listToMaybe . drop ctx._maxLoops <$> repeats mode form ctx+    remembered mode = maybe (Right ctx{_entered = seenInsert (digest ctx mode form) form ctx._entered}) (\before -> Left (mode, before)) . listToMaybe . drop ctx._maxLoops <$> repeats mode form ctx  repeats :: Acyclic -> Expression -> ReduceContext -> IO [Expression] repeats mode form ctx = do@@ -759,7 +759,7 @@   depth <- gauge ctx._sides   start <- maybe (pure Map.empty) readIORef (searching ctx._memo)   known <- maybe (pure Map.empty) (\(Facts facts _ _) -> readIORef facts) ctx._facts-  (hits, kept) <- awaited ctx (evaluate (forced (goHits look depth (sibling known (origins known form)) start (succ ctx._maxLoops) (Map.findWithDefault [] (digest mode form) ctx._entered))))+  (hits, kept) <- awaited ctx (evaluate (forced (goHits look depth (sibling known (origins known form)) start (succ ctx._maxLoops) (Map.findWithDefault [] (digest ctx mode form) ctx._entered))))   mapM_ (\ref -> writeIORef ref (bounded kept)) (searching ctx._memo)   pure hits   where@@ -780,6 +780,7 @@     repeated :: (T.Text -> Maybe Expression) -> (T.Text -> Maybe Int) -> (Expression -> Bool) -> Acyclic -> Expression -> Searched -> (Bool, Searched)     repeated look _ _ Proven before kept = (alike' look form before, kept)     repeated look depth kin Plausible before kept+      | Just site <- siting form = (siting before == Just site && not (shrunk look before) && not (descended look before), kept)       | kin before && not (atomic form) = (True, kept)       | kin before && ctx._judgment /= Morphing && not (shrunk look before) = (True, kept)       | atomic form = akin'' look depth kept before form@@ -790,6 +791,22 @@     changed :: [Binding] -> Expression -> [Expression]     changed above (ExFormation bds) = [body | BiTau attr body <- bds, attr /= AtRho, BiTau attr body `notElem` above]     changed _ _ = []+    siting :: Expression -> Maybe (T.Text, Binding)+    siting (ExFormation bds) = sited ctx._symbolic bds+    siting _ = Nothing+    descended :: (T.Text -> Maybe Expression) -> Expression -> Bool+    descended look (ExFormation above)+      | ExFormation own <- form+      , Just inner <- rho own+      , Just outer <- rho above =+          held look (pieces outer) inner+      where+        rho :: [Binding] -> Maybe Expression+        rho bds = listToMaybe [body | BiTau AtRho body <- bds]+        pieces :: Expression -> [Expression]+        pieces (ExMeta name) | Just term <- look name = pieces term+        pieces term = parts look term+    descended _ _ = False     held :: (T.Text -> Maybe Expression) -> [Expression] -> Expression -> Bool     held look roots part = goHeld Set.empty roots       where@@ -803,13 +820,13 @@         goHeld seen (term : rest)           | term `elem` wanted = True           | Set.member (hashExpression term) seen = goHeld seen rest-          | otherwise = goHeld (Set.insert (hashExpression term) seen) (parts term ++ rest)-        parts :: Expression -> [Expression]-        parts (ExMeta name) = maybeToList (look name)-        parts (ExApplication callee (ArTau _ arg)) = [callee, arg]-        parts (ExDispatch inner _) = [inner]-        parts (ExFormation bds) = [body | BiTau attr body <- bds, attr /= AtRho]-        parts _ = []+          | otherwise = goHeld (Set.insert (hashExpression term) seen) (parts look term ++ rest)+    parts :: (T.Text -> Maybe Expression) -> Expression -> [Expression]+    parts look (ExMeta name) = maybeToList (look name)+    parts _ (ExApplication callee (ArTau _ arg)) = [callee, arg]+    parts _ (ExDispatch inner _) = [inner]+    parts _ (ExFormation bds) = [body | BiTau attr body <- bds, attr /= AtRho]+    parts _ _ = []     sibling :: Store Expression -> [Expression] -> Expression -> Bool     sibling _ [] _ = False     sibling known own before = any (`elem` own) (origins known before)@@ -833,9 +850,11 @@     atomic (ExFormation bds) = any isLambda bds     atomic _ = False -digest :: Acyclic -> Expression -> Int-digest Proven = hashShape-digest Plausible = hashSkeleton+digest :: ReduceContext -> Acyclic -> Expression -> Int+digest ctx Plausible (ExFormation bds)+  | Just (name, site) <- sited ctx._symbolic bds = hashExpression (ExFormation [BiLambda (Function name), site])+digest _ Proven term = hashShape term+digest _ Plausible term = hashSkeleton term  entrance :: Judgment -> Expression -> Maybe Expression entrance Dataization term@(ExFormation bds)@@ -1188,7 +1207,7 @@     recurring term state' _ = pure (term, state')  carried :: State -> ReduceContext -> (State, ReduceContext)-carried state ctx = (state{_copies = []}, maybe ctx (\mode -> ctx{_entered = foldr (\form -> seenInsert (digest mode form) form) ctx._entered state._copies}) ctx._acyclic)+carried state ctx = (state{_copies = []}, maybe ctx (\mode -> ctx{_entered = foldr (\form -> seenInsert (digest ctx mode form) form) ctx._entered state._copies}) ctx._acyclic)  execBuildTerm :: Expression -> ReduceContext -> BuildTermFunc execBuildTerm _ ctx "evaluate" = evaluated ctx
src/Parser.hs view
@@ -113,9 +113,10 @@  label' :: Parser T.Text label' = lexeme $ do+  sign <- optional (try (oneOf ['+', '-'] <* lookAhead (oneOf ['a' .. 'z'])))   first <- oneOf ['a' .. 'z']   rest <- many (choice [try (char '-' <* notFollowedBy (char '>')), satisfy (`notElem` " \r\n\t,.|':;!?][}{)(⟧⟦-↦⤍>\"ξΦ⊥")] <?> "allowed character")-  return (T.pack (first : rest))+  return (T.pack (maybe id (:) sign (first : rest)))  function :: Parser String function =@@ -213,7 +214,7 @@  number :: Parser Expression number = do-  sign <- optional (choice [char '-', char '+'])+  sign <- optional (try (choice [char '-', char '+'] <* lookAhead digitChar))   unsigned <- lexeme magnitude   return     ( DataNumber
+ test-resources/evaluate-packs/cuts-a-loop-through-one-site-of-a-fork.yaml view
@@ -0,0 +1,104 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+# yamllint disable rule:line-length+# A loop through one 'if': the left side of the fork 'loop' is 'loop' again,+# so the firing fires the same fork inside itself. The entry names the site+# of a fork, and the fork fired inside holds the site of the one above, takes+# no argument that is a part of the one above, and holds the same 'ρ', so+# under '--acyclic=plausible' it repeats the one above and is cut (#2495).+symbolic: |+  - λ: L_fork+    site: $.site🌵+    dataize:+      𝛿1: $.on🌵+    morph:+      𝑛1: $.left🌵+      𝑛2: $.right🌵+    evaluate:+      𝑛3: 𝑛1+      𝑛4: 𝑛2+    join:+      on: 𝛿1+      left: 𝑛3+      right: 𝑛4+location: 'Q.app'+acyclic: plausible+loops: 0+partial: true+input: >+  ⟦ f ↦ ⟦ site🌵 ↦ ∅, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧,+    loop ↦ Φ.f( site🌵 ↦ ⟦ Δ ⤍ 01- ⟧, on🌵 ↦ ⟦ λ ⤍ 𝜎1 ⟧, left🌵 ↦ Φ.loop, right🌵 ↦ ⟦ λ ⤍ 𝜎2 ⟧ ),+    app ↦ Φ.loop.q ⟧+protocol: |+  𝕄(Φ.app):+    normalized 𝑛·0·1 ≔ Φ.f( site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ Φ.loop, right🌵 ↦ 𝜎2:λ )  # Φ.loop+    remembered 𝑛·0·2 ≡ Φ.f  # ⟦ site🌵 ↦ ∅, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    𝑛·0·3 ≔ Φ.f( site🌵 ↦ 01-:Δ )+    𝑛·0·4 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    remembered 𝑛·0·4 ≡ 𝑛·0·2( site🌵 ↦ 01-:Δ )+    𝑛·0·5 ≔ 𝑛·0·3( on🌵 ↦ 𝜎1:λ )+    𝑛·0·6 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    remembered 𝑛·0·6 ≡ 𝑛·0·4( on🌵 ↦ 𝜎1:λ )+    𝑛·0·7 ≔ 𝑛·0·5( left🌵 ↦ Φ.loop )+    𝑛·0·8 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ Φ.loop, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    remembered 𝑛·0·8 ≡ 𝑛·0·6( left🌵 ↦ Φ.loop )+    𝑛·0·9 ≔ 𝑛·0·7( right🌵 ↦ 𝜎2:λ )+    𝑛·0·10 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ Φ.loop, right🌵 ↦ 𝜎2:λ, λ ⤍ L_fork ⟧+    remembered 𝑛·0·10 ≡ 𝑛·0·8( right🌵 ↦ 𝜎2:λ )+    𝔼(L_fork):+      𝔻(ξ.on🌵):+        𝛿·1·1 ≔ 𝔻(𝜎1:λ)+      𝛿1·1 ≔ 𝛿·1·1  # 𝔻(ξ.on🌵)+      𝕄(ξ.left🌵):+        normalized 𝑛·1·1 ≔ 𝑛·0·9  # Φ.loop+        𝑛·1·2 ≔ Φ.f( site🌵 ↦ 01-:Δ )+        𝑛·1·3 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        𝑛·1·4 ≔ 𝑛·1·2( on🌵 ↦ 𝜎1:λ )+        𝑛·1·5 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        𝑛·1·6 ≔ 𝑛·1·4( left🌵 ↦ Φ.loop )+        𝑛·1·7 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ Φ.loop, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        𝑛·1·8 ≔ 𝑛·1·6( right🌵 ↦ 𝜎2:λ )+        𝑛·1·9 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ Φ.loop, right🌵 ↦ 𝜎2:λ, λ ⤍ L_fork ⟧+        morphed 𝑛·1·10 ≔ 𝑛·1·9+      𝑛1·1 ≔ 𝑛·1·9  # 𝕄(ξ.left🌵)+      𝕄(ξ.right🌵):+        morphed 𝑛·1·11 ≔ 𝜎2:λ+      𝑛2·1 ≔ 𝑛·1·11  # 𝕄(ξ.right🌵)+      recalled 𝑛·0·10 ⇒ 𝑛·0·8( right🌵 ↦ 𝜎2:λ )+      recalled 𝑛·0·8 ⇒ 𝑛·0·6( left🌵 ↦ Φ.loop )+      recalled 𝑛·0·6 ⇒ 𝑛·0·4( on🌵 ↦ 𝜎1:λ )+      recalled 𝑛·0·4 ⇒ 𝑛·0·2( site🌵 ↦ 01-:Δ )+      recalled 𝑛·0·2 ⇒ Φ.f+      recalled 𝑛·0·10 ⇒ 𝑛·0·8( right🌵 ↦ 𝜎2:λ )+      recalled 𝑛·0·8 ⇒ 𝑛·0·6( left🌵 ↦ Φ.loop )+      recalled 𝑛·0·6 ⇒ 𝑛·0·4( on🌵 ↦ 𝜎1:λ )+      recalled 𝑛·0·4 ⇒ 𝑛·0·2( site🌵 ↦ 01-:Δ )+      recalled 𝑛·0·2 ⇒ Φ.f+      𝕄(𝑛·1·9.site🌵):+        morphed 𝑛·1·12 ≔ 01-:Δ+      𝕄(𝑛·1·9.left🌵):+        normalized 𝑛·1·13 ≔ 𝑛·1·8  # Φ.loop+        𝑛·1·14 ≔ Φ.f( site🌵 ↦ 01-:Δ )+        𝑛·1·15 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        𝑛·1·16 ≔ 𝑛·1·14( on🌵 ↦ 𝜎1:λ )+        𝑛·1·17 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        𝑛·1·18 ≔ 𝑛·1·16( left🌵 ↦ Φ.loop )+        𝑛·1·19 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ Φ.loop, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        𝑛·1·20 ≔ 𝑛·1·18( right🌵 ↦ 𝜎2:λ )+        𝑛·1·21 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ Φ.loop, right🌵 ↦ 𝜎2:λ, λ ⤍ L_fork ⟧+        morphed 𝑛·1·22 ≔ 𝑛·1·21+      recalled 𝑛·0·10 ⇒ 𝑛·0·8( right🌵 ↦ 𝜎2:λ )+      recalled 𝑛·0·8 ⇒ 𝑛·0·6( left🌵 ↦ Φ.loop )+      recalled 𝑛·0·6 ⇒ 𝑛·0·4( on🌵 ↦ 𝜎1:λ )+      recalled 𝑛·0·4 ⇒ 𝑛·0·2( site🌵 ↦ 01-:Δ )+      recalled 𝑛·0·2 ⇒ Φ.f+      looped 𝜎3 ≔ 𝑛·1·18( right🌵 ↦ 𝜎2:λ )  # 𝔼(𝑛·1·21.left🌵), plausible, repeats 𝑛·1·21+      looped 𝜎4 ≔ 𝑛·1·16( left🌵 ↦ 𝜎3:λ, right🌵 ↦ 𝜎2:λ )  # 𝔼(𝑛1 of L_fork), plausible, repeats 𝑛·1·21+      𝑛3·1 ≔ 𝜎4:λ  # 𝔼(𝑛1 of L_fork)+      joined 𝜎5 ≔ 𝛿1·1 ? 𝜎4 : 𝜎2+      𝑛·1·23 ≔ 𝜎5:λ+      memoized 𝑛·1·21 ⇛ 𝜎5:λ+      evaluated 𝑛·1·24 ≔ 𝑛·1·23  # 𝑛·1·21+    opaque 𝜎6:λ ≔ 𝜎5:λ.q+    morphed 𝑛·0·11 ≔ 𝜎6:λ
+ test-resources/evaluate-packs/keeps-a-branch-read-down-a-chain-of-fabricated-formations-of-one-site.yaml view
@@ -0,0 +1,180 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+# yamllint disable rule:line-length+# Three copies of the fork 'f' of one 'if', each one the left side of the one+# above, and the two sides of each have different shapes, so every firing+# fabricates a formation, and the one above holds the one below as a side.+# Every branch of them holds the site of the fork it was fabricated from.+# The program reads 'ok' of the outer one, and the branch fired there reads+# 'ok' of the one below, and so on down the chain. A branch fired inside+# another one of the same site, holding no argument that is a part of it,+# still repeats nothing, since the formation in its 'ρ' is held inside the+# formation in the 'ρ' of the one above: the walk goes down a chain that+# already exists, so under '--acyclic=plausible' it is not cut, even with+# '--max-loops=0' and a chain deeper than that (#2495).+symbolic: |+  - λ: L_fork+    site: $.site🌵+    dataize:+      𝛿1: $.on🌵+    morph:+      𝑛1: $.left🌵+      𝑛2: $.right🌵+    evaluate:+      𝑛3: 𝑛1+      𝑛4: 𝑛2+    join:+      on: 𝛿1+      left: 𝑛3+      right: 𝑛4+      otherwise: L_fork+location: 'Q.app'+acyclic: plausible+loops: 0+partial: true+input: >+  ⟦ f ↦ ⟦ site🌵 ↦ ∅, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧,+    app ↦ Φ.f( site🌵 ↦ ⟦ Δ ⤍ 01- ⟧, on🌵 ↦ ⟦ λ ⤍ 𝜎1 ⟧, left🌵 ↦ Φ.f( site🌵 ↦ ⟦ Δ ⤍ 01- ⟧, on🌵 ↦ ⟦ λ ⤍ 𝜎2 ⟧, left🌵 ↦ Φ.f( site🌵 ↦ ⟦ Δ ⤍ 01- ⟧, on🌵 ↦ ⟦ λ ⤍ 𝜎3 ⟧, left🌵 ↦ ⟦ ok ↦ ⟦ λ ⤍ 𝜎4 ⟧, ex ↦ ⟦ λ ⤍ 𝜎5 ⟧ ⟧, right🌵 ↦ ⟦ ok ↦ ⟦ λ ⤍ 𝜎6 ⟧ ⟧ ), right🌵 ↦ ⟦ ok ↦ ⟦ λ ⤍ 𝜎7 ⟧ ⟧ ), right🌵 ↦ ⟦ ok ↦ ⟦ λ ⤍ 𝜎8 ⟧ ⟧ ).ok.q ⟧+protocol: |+  𝕄(Φ.app):+    remembered 𝑛·0·1 ≡ Φ.f  # ⟦ site🌵 ↦ ∅, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    𝑛·0·2 ≔ Φ.f( site🌵 ↦ 01-:Δ )+    𝑛·0·3 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    remembered 𝑛·0·3 ≡ 𝑛·0·1( site🌵 ↦ 01-:Δ )+    𝑛·0·4 ≔ 𝑛·0·2( on🌵 ↦ 𝜎1:λ )+    𝑛·0·5 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    remembered 𝑛·0·5 ≡ 𝑛·0·3( on🌵 ↦ 𝜎1:λ )+    𝑛·0·6 ≔ 𝑛·0·4( left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎3:λ, left🌵 ↦ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧, right🌵 ↦ 𝜎6:λ:ok ), right🌵 ↦ 𝜎7:λ:ok ) )+    𝑛·0·7 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎3:λ, left🌵 ↦ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧, right🌵 ↦ 𝜎6:λ:ok ), right🌵 ↦ 𝜎7:λ:ok ), right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    remembered 𝑛·0·7 ≡ 𝑛·0·5( left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎3:λ, left🌵 ↦ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧, right🌵 ↦ 𝜎6:λ:ok ), right🌵 ↦ 𝜎7:λ:ok ) )+    𝑛·0·8 ≔ 𝑛·0·6( right🌵 ↦ 𝜎8:λ:ok )+    𝑛·0·9 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎3:λ, left🌵 ↦ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧, right🌵 ↦ 𝜎6:λ:ok ), right🌵 ↦ 𝜎7:λ:ok ), right🌵 ↦ 𝜎8:λ:ok, λ ⤍ L_fork ⟧+    remembered 𝑛·0·9 ≡ 𝑛·0·7( right🌵 ↦ 𝜎8:λ:ok )+    𝔼(L_fork):+      𝔻(ξ.on🌵):+        𝛿·1·1 ≔ 𝔻(𝜎1:λ)+      𝛿1·1 ≔ 𝛿·1·1  # 𝔻(ξ.on🌵)+      𝕄(ξ.left🌵):+        𝑛·1·1 ≔ Φ.f( site🌵 ↦ 01-:Δ )+        𝑛·1·2 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        𝑛·1·3 ≔ 𝑛·1·1( on🌵 ↦ 𝜎2:λ )+        𝑛·1·4 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎2:λ, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        remembered 𝑛·1·4 ≡ 𝑛·1·2( on🌵 ↦ 𝜎2:λ )+        𝑛·1·5 ≔ 𝑛·1·3( left🌵 ↦ 𝑛·1·1( on🌵 ↦ 𝜎3:λ, left🌵 ↦ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧, right🌵 ↦ 𝜎6:λ:ok ) )+        𝑛·1·6 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝑛·1·1( on🌵 ↦ 𝜎3:λ, left🌵 ↦ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧, right🌵 ↦ 𝜎6:λ:ok ), right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        remembered 𝑛·1·6 ≡ 𝑛·1·4( left🌵 ↦ 𝑛·1·1( on🌵 ↦ 𝜎3:λ, left🌵 ↦ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧, right🌵 ↦ 𝜎6:λ:ok ) )+        𝑛·1·7 ≔ 𝑛·1·5( right🌵 ↦ 𝜎7:λ:ok )+        𝑛·1·8 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝑛·1·1( on🌵 ↦ 𝜎3:λ, left🌵 ↦ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧, right🌵 ↦ 𝜎6:λ:ok ), right🌵 ↦ 𝜎7:λ:ok, λ ⤍ L_fork ⟧+        remembered 𝑛·1·8 ≡ 𝑛·1·6( right🌵 ↦ 𝜎7:λ:ok )+        morphed 𝑛·1·9 ≔ 𝑛·1·8+      𝑛1·1 ≔ 𝑛·1·8  # 𝕄(ξ.left🌵)+      𝕄(ξ.right🌵):+        morphed 𝑛·1·10 ≔ 𝜎8:λ:ok+      𝑛2·1 ≔ 𝑛·1·10  # 𝕄(ξ.right🌵)+      recalled 𝑛·1·8 ⇒ 𝑛·1·6( right🌵 ↦ 𝜎7:λ:ok )+      recalled 𝑛·1·6 ⇒ 𝑛·1·4( left🌵 ↦ 𝑛·1·1( on🌵 ↦ 𝜎3:λ, left🌵 ↦ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧, right🌵 ↦ 𝜎6:λ:ok ) )+      recalled 𝑛·1·4 ⇒ 𝑛·1·2( on🌵 ↦ 𝜎2:λ )+      recalled 𝑛·0·3 ⇒ 𝑛·0·1( site🌵 ↦ 01-:Δ )+      recalled 𝑛·0·1 ⇒ Φ.f+      𝔼(L_fork):  # 𝔼(𝑛1 of L_fork)+        𝔻(ξ.on🌵):+          𝛿·2·1 ≔ 𝔻(𝜎2:λ)+        𝛿1·2 ≔ 𝛿·2·1  # 𝔻(ξ.on🌵)+        𝕄(ξ.left🌵):+          𝑛·2·1 ≔ Φ.f( site🌵 ↦ 01-:Δ )+          𝑛·2·2 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+          𝑛·2·3 ≔ 𝑛·2·1( on🌵 ↦ 𝜎3:λ )+          𝑛·2·4 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎3:λ, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+          remembered 𝑛·2·4 ≡ 𝑛·2·2( on🌵 ↦ 𝜎3:λ )+          𝑛·2·5 ≔ 𝑛·2·3( left🌵 ↦ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧ )+          𝑛·2·6 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎3:λ, left🌵 ↦ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+          remembered 𝑛·2·6 ≡ 𝑛·2·4( left🌵 ↦ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧ )+          𝑛·2·7 ≔ 𝑛·2·5( right🌵 ↦ 𝜎6:λ:ok )+          𝑛·2·8 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎3:λ, left🌵 ↦ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧, right🌵 ↦ 𝜎6:λ:ok, λ ⤍ L_fork ⟧+          remembered 𝑛·2·8 ≡ 𝑛·2·6( right🌵 ↦ 𝜎6:λ:ok )+          morphed 𝑛·2·9 ≔ 𝑛·2·8+        𝑛1·2 ≔ 𝑛·2·8  # 𝕄(ξ.left🌵)+        𝕄(ξ.right🌵):+          morphed 𝑛·2·10 ≔ 𝜎7:λ:ok+        𝑛2·2 ≔ 𝑛·2·10  # 𝕄(ξ.right🌵)+        recalled 𝑛·2·8 ⇒ 𝑛·2·6( right🌵 ↦ 𝜎6:λ:ok )+        recalled 𝑛·2·6 ⇒ 𝑛·2·4( left🌵 ↦ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧ )+        recalled 𝑛·2·4 ⇒ 𝑛·2·2( on🌵 ↦ 𝜎3:λ )+        recalled 𝑛·0·3 ⇒ 𝑛·0·1( site🌵 ↦ 01-:Δ )+        recalled 𝑛·0·1 ⇒ Φ.f+        𝔼(L_fork):  # 𝔼(𝑛1 of L_fork)+          𝔻(ξ.on🌵):+            𝛿·3·1 ≔ 𝔻(𝜎3:λ)+          𝛿1·3 ≔ 𝛿·3·1  # 𝔻(ξ.on🌵)+          𝕄(ξ.left🌵):+            morphed 𝑛·3·1 ≔ ⟦ ok ↦ 𝜎4:λ, ex ↦ 𝜎5:λ ⟧+          𝑛1·3 ≔ 𝑛·3·1  # 𝕄(ξ.left🌵)+          𝕄(ξ.right🌵):+            morphed 𝑛·3·2 ≔ 𝜎6:λ:ok+          𝑛2·3 ≔ 𝑛·3·2  # 𝕄(ξ.right🌵)+          fabricated 𝑛·3·3 ≔ 𝑛·3·1 and 𝑛·3·2  # ⟦ left🌵 ↦ 𝑛·3·1, right🌵 ↦ 𝑛·3·2, ok ↦ ⟦ λ ⤍ L_fork, site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎3:λ, left🌵 ↦ ρ.left🌵.ok, right🌵 ↦ ρ.right🌵.ok ⟧, ex ↦ ⟦ λ ⤍ L_fork, site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎3:λ, left🌵 ↦ ρ.left🌵.ex, right🌵 ↦ ρ.right🌵.ex ⟧ ⟧+          remembered 𝑛·3·3 ≡ 𝑛·2·8+          memoized 𝑛·2·8 ⇛ 𝑛·3·3+          evaluated 𝑛·3·4 ≔ 𝑛·3·3  # 𝑛·2·8+        𝑛3·2 ≔ 𝑛·3·4  # 𝔼(𝑛1 of L_fork)+        fabricated 𝑛·2·11 ≔ 𝑛3·2 and 𝑛·2·10  # ⟦ left🌵 ↦ 𝑛·3·4, right🌵 ↦ 𝑛·2·10, ok ↦ ⟦ λ ⤍ L_fork, site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎2:λ, left🌵 ↦ ρ.left🌵.ok, right🌵 ↦ ρ.right🌵.ok ⟧, ex ↦ ⟦ λ ⤍ L_fork, site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎2:λ, left🌵 ↦ ρ.left🌵.ex, right🌵 ↦ ρ.right🌵.ex ⟧ ⟧+        remembered 𝑛·2·11 ≡ 𝑛·1·8+        memoized 𝑛·1·8 ⇛ 𝑛·2·11+        evaluated 𝑛·2·12 ≔ 𝑛·2·11  # 𝑛·1·8+      𝑛3·1 ≔ 𝑛·2·12  # 𝔼(𝑛1 of L_fork)+      fabricated 𝑛·1·11 ≔ 𝑛3·1 and 𝑛·1·10  # ⟦ left🌵 ↦ 𝑛·2·12, right🌵 ↦ 𝑛·1·10, ok ↦ ⟦ λ ⤍ L_fork, site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ ρ.left🌵.ok, right🌵 ↦ ρ.right🌵.ok ⟧, ex ↦ ⟦ λ ⤍ L_fork, site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ ρ.left🌵.ex, right🌵 ↦ ρ.right🌵.ex ⟧ ⟧+      remembered 𝑛·1·11 ≡ 𝑛·0·9+      memoized 𝑛·0·9 ⇛ 𝑛·1·11+      evaluated 𝑛·1·12 ≔ 𝑛·1·11  # 𝑛·0·9+    remembered 𝑛·0·10 ≡ 𝑛·1·12.ok  # ⟦ λ ⤍ L_fork, site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ ρ.left🌵.ok, right🌵 ↦ ρ.right🌵.ok ⟧+    𝔼(L_fork):+      𝔻(ξ.on🌵):+        𝛿·4·1 ≔ 𝔻(𝜎1:λ)+      𝛿1·4 ≔ 𝛿·4·1  # 𝔻(ξ.on🌵)+      remembered 𝑛·4·1 ≡ 𝑛·2·12.ok  # ⟦ λ ⤍ L_fork, site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎2:λ, left🌵 ↦ ρ.left🌵.ok, right🌵 ↦ ρ.right🌵.ok ⟧+      𝕄(ξ.left🌵):+        morphed 𝑛·4·2 ≔ 𝑛·4·1+      𝑛1·4 ≔ 𝑛·4·1  # 𝕄(ξ.left🌵)+      𝕄(ξ.right🌵):+        morphed 𝑛·4·3 ≔ 𝜎8:λ+      𝑛2·4 ≔ 𝑛·4·3  # 𝕄(ξ.right🌵)+      recalled 𝑛·4·1 ⇒ 𝑛·2·12.ok+      𝔼(L_fork):  # 𝔼(𝑛1 of L_fork)+        𝔻(ξ.on🌵):+          𝛿·5·1 ≔ 𝔻(𝜎2:λ)+        𝛿1·5 ≔ 𝛿·5·1  # 𝔻(ξ.on🌵)+        remembered 𝑛·5·1 ≡ 𝑛·3·4.ok  # ⟦ λ ⤍ L_fork, site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎3:λ, left🌵 ↦ ρ.left🌵.ok, right🌵 ↦ ρ.right🌵.ok ⟧+        𝕄(ξ.left🌵):+          morphed 𝑛·5·2 ≔ 𝑛·5·1+        𝑛1·5 ≔ 𝑛·5·1  # 𝕄(ξ.left🌵)+        𝕄(ξ.right🌵):+          morphed 𝑛·5·3 ≔ 𝜎7:λ+        𝑛2·5 ≔ 𝑛·5·3  # 𝕄(ξ.right🌵)+        recalled 𝑛·5·1 ⇒ 𝑛·3·4.ok+        𝔼(L_fork):  # 𝔼(𝑛1 of L_fork)+          𝔻(ξ.on🌵):+            𝛿·6·1 ≔ 𝔻(𝜎3:λ)+          𝛿1·6 ≔ 𝛿·6·1  # 𝔻(ξ.on🌵)+          𝕄(ξ.left🌵):+            morphed 𝑛·6·1 ≔ 𝜎4:λ+          𝑛1·6 ≔ 𝑛·6·1  # 𝕄(ξ.left🌵)+          𝕄(ξ.right🌵):+            morphed 𝑛·6·2 ≔ 𝜎6:λ+          𝑛2·6 ≔ 𝑛·6·2  # 𝕄(ξ.right🌵)+          joined 𝜎9 ≔ 𝛿1·6 ? 𝜎4 : 𝜎6+          𝑛·6·3 ≔ 𝜎9:λ+          memoized 𝑛·5·1 ⇛ 𝜎9:λ+          evaluated 𝑛·6·4 ≔ 𝑛·6·3  # 𝑛·5·1+        𝑛3·5 ≔ 𝑛·6·3  # 𝔼(𝑛1 of L_fork)+        joined 𝜎10 ≔ 𝛿1·5 ? 𝜎9 : 𝜎7+        𝑛·5·4 ≔ 𝜎10:λ+        memoized 𝑛·4·1 ⇛ 𝜎10:λ+        evaluated 𝑛·5·5 ≔ 𝑛·5·4  # 𝑛·4·1+      𝑛3·4 ≔ 𝑛·5·4  # 𝔼(𝑛1 of L_fork)+      joined 𝜎11 ≔ 𝛿1·4 ? 𝜎10 : 𝜎8+      𝑛·4·4 ≔ 𝜎11:λ+      memoized 𝑛·0·10 ⇛ 𝜎11:λ+      evaluated 𝑛·4·5 ≔ 𝑛·4·4  # 𝑛·0·10+    opaque 𝜎12:λ ≔ 𝜎11:λ.q+    morphed 𝑛·0·11 ≔ 𝜎12:λ
+ test-resources/evaluate-packs/keeps-a-fork-of-another-site-inside-a-fork.yaml view
@@ -0,0 +1,97 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+# yamllint disable rule:line-length+# Two copies of the fork 'f', each of another 'if', the second one fired+# inside the first, since the left side of the first one is the second one.+# The facts lead both copies back to 'Φ.f', and the arguments of the second+# one are no part of the first one, yet the entry names the site of a fork,+# and the two copies hold different sites, so under '--acyclic=plausible'+# the second one repeats nothing, even with '--max-loops=0' (#2495).+symbolic: |+  - λ: L_fork+    site: $.site🌵+    dataize:+      𝛿1: $.on🌵+    morph:+      𝑛1: $.left🌵+      𝑛2: $.right🌵+    evaluate:+      𝑛3: 𝑛1+      𝑛4: 𝑛2+    join:+      on: 𝛿1+      left: 𝑛3+      right: 𝑛4+location: 'Q.app'+acyclic: plausible+loops: 0+partial: true+input: >+  ⟦ f ↦ ⟦ site🌵 ↦ ∅, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧,+    inner ↦ Φ.f( site🌵 ↦ ⟦ Δ ⤍ 02- ⟧, on🌵 ↦ ⟦ λ ⤍ 𝜎2 ⟧, left🌵 ↦ ⟦ λ ⤍ 𝜎3 ⟧, right🌵 ↦ ⟦ λ ⤍ 𝜎4 ⟧ ),+    app ↦ Φ.f( site🌵 ↦ ⟦ Δ ⤍ 01- ⟧, on🌵 ↦ ⟦ λ ⤍ 𝜎1 ⟧, left🌵 ↦ Φ.inner, right🌵 ↦ ⟦ λ ⤍ 𝜎5 ⟧ ).q ⟧+protocol: |+  𝕄(Φ.app):+    remembered 𝑛·0·1 ≡ Φ.f  # ⟦ site🌵 ↦ ∅, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    𝑛·0·2 ≔ Φ.f( site🌵 ↦ 01-:Δ )+    𝑛·0·3 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    remembered 𝑛·0·3 ≡ 𝑛·0·1( site🌵 ↦ 01-:Δ )+    𝑛·0·4 ≔ 𝑛·0·2( on🌵 ↦ 𝜎1:λ )+    𝑛·0·5 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    remembered 𝑛·0·5 ≡ 𝑛·0·3( on🌵 ↦ 𝜎1:λ )+    𝑛·0·6 ≔ 𝑛·0·4( left🌵 ↦ Φ.inner )+    𝑛·0·7 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ Φ.inner, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    remembered 𝑛·0·7 ≡ 𝑛·0·5( left🌵 ↦ Φ.inner )+    𝑛·0·8 ≔ 𝑛·0·6( right🌵 ↦ 𝜎5:λ )+    𝑛·0·9 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ Φ.inner, right🌵 ↦ 𝜎5:λ, λ ⤍ L_fork ⟧+    remembered 𝑛·0·9 ≡ 𝑛·0·7( right🌵 ↦ 𝜎5:λ )+    𝔼(L_fork):+      𝔻(ξ.on🌵):+        𝛿·1·1 ≔ 𝔻(𝜎1:λ)+      𝛿1·1 ≔ 𝛿·1·1  # 𝔻(ξ.on🌵)+      𝕄(ξ.left🌵):+        normalized 𝑛·1·1 ≔ Φ.f( site🌵 ↦ 02-:Δ, on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝜎3:λ, right🌵 ↦ 𝜎4:λ )  # Φ.inner+        𝑛·1·2 ≔ Φ.f( site🌵 ↦ 02-:Δ )+        𝑛·1·3 ≔ ⟦ site🌵 ↦ 02-:Δ, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        remembered 𝑛·1·3 ≡ 𝑛·0·1( site🌵 ↦ 02-:Δ )+        𝑛·1·4 ≔ 𝑛·1·2( on🌵 ↦ 𝜎2:λ )+        𝑛·1·5 ≔ ⟦ site🌵 ↦ 02-:Δ, on🌵 ↦ 𝜎2:λ, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        remembered 𝑛·1·5 ≡ 𝑛·1·3( on🌵 ↦ 𝜎2:λ )+        𝑛·1·6 ≔ 𝑛·1·4( left🌵 ↦ 𝜎3:λ )+        𝑛·1·7 ≔ ⟦ site🌵 ↦ 02-:Δ, on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝜎3:λ, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        remembered 𝑛·1·7 ≡ 𝑛·1·5( left🌵 ↦ 𝜎3:λ )+        𝑛·1·8 ≔ 𝑛·1·6( right🌵 ↦ 𝜎4:λ )+        𝑛·1·9 ≔ ⟦ site🌵 ↦ 02-:Δ, on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝜎3:λ, right🌵 ↦ 𝜎4:λ, λ ⤍ L_fork ⟧+        remembered 𝑛·1·9 ≡ 𝑛·1·7( right🌵 ↦ 𝜎4:λ )+        morphed 𝑛·1·10 ≔ 𝑛·1·9+      𝑛1·1 ≔ 𝑛·1·9  # 𝕄(ξ.left🌵)+      𝕄(ξ.right🌵):+        morphed 𝑛·1·11 ≔ 𝜎5:λ+      𝑛2·1 ≔ 𝑛·1·11  # 𝕄(ξ.right🌵)+      recalled 𝑛·1·9 ⇒ 𝑛·1·7( right🌵 ↦ 𝜎4:λ )+      recalled 𝑛·1·7 ⇒ 𝑛·1·5( left🌵 ↦ 𝜎3:λ )+      recalled 𝑛·1·5 ⇒ 𝑛·1·3( on🌵 ↦ 𝜎2:λ )+      recalled 𝑛·1·3 ⇒ 𝑛·0·1( site🌵 ↦ 02-:Δ )+      recalled 𝑛·0·1 ⇒ Φ.f+      𝔼(L_fork):  # 𝔼(𝑛1 of L_fork)+        𝔻(ξ.on🌵):+          𝛿·2·1 ≔ 𝔻(𝜎2:λ)+        𝛿1·2 ≔ 𝛿·2·1  # 𝔻(ξ.on🌵)+        𝕄(ξ.left🌵):+          morphed 𝑛·2·1 ≔ 𝜎3:λ+        𝑛1·2 ≔ 𝑛·2·1  # 𝕄(ξ.left🌵)+        𝕄(ξ.right🌵):+          morphed 𝑛·2·2 ≔ 𝜎4:λ+        𝑛2·2 ≔ 𝑛·2·2  # 𝕄(ξ.right🌵)+        joined 𝜎6 ≔ 𝛿1·2 ? 𝜎3 : 𝜎4+        𝑛·2·3 ≔ 𝜎6:λ+        memoized 𝑛·1·9 ⇛ 𝜎6:λ+        evaluated 𝑛·2·4 ≔ 𝑛·2·3  # 𝑛·1·9+      𝑛3·1 ≔ 𝑛·2·3  # 𝔼(𝑛1 of L_fork)+      joined 𝜎7 ≔ 𝛿1·1 ? 𝜎6 : 𝜎5+      𝑛·1·12 ≔ 𝜎7:λ+      memoized 𝑛·0·9 ⇛ 𝜎7:λ+      evaluated 𝑛·1·13 ≔ 𝑛·1·12  # 𝑛·0·9+    opaque 𝜎8:λ ≔ 𝜎7:λ.q+    morphed 𝑛·0·10 ≔ 𝜎8:λ
+ test-resources/evaluate-packs/keeps-nested-forks-of-one-site-whose-arguments-shrink.yaml view
@@ -0,0 +1,125 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+# yamllint disable rule:line-length+# Three copies of the fork 'f' of one 'if', each one the left side of the one+# above, the way nested calls of one 'and' share the 'if' inside 'bool'. The+# entry names the site of a fork, and all three hold the same site, yet the+# arguments of each copy are held inside the copy above it: the calls shrink+# and end, so under '--acyclic=plausible' none of them repeats another, even+# with '--max-loops=0' (#2495).+symbolic: |+  - λ: L_fork+    site: $.site🌵+    dataize:+      𝛿1: $.on🌵+    morph:+      𝑛1: $.left🌵+      𝑛2: $.right🌵+    evaluate:+      𝑛3: 𝑛1+      𝑛4: 𝑛2+    join:+      on: 𝛿1+      left: 𝑛3+      right: 𝑛4+location: 'Q.app'+acyclic: plausible+loops: 0+partial: true+input: >+  ⟦ f ↦ ⟦ site🌵 ↦ ∅, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧,+    app ↦ Φ.f( site🌵 ↦ ⟦ Δ ⤍ 01- ⟧, on🌵 ↦ ⟦ λ ⤍ 𝜎1 ⟧, left🌵 ↦ Φ.f( site🌵 ↦ ⟦ Δ ⤍ 01- ⟧, on🌵 ↦ ⟦ λ ⤍ 𝜎2 ⟧, left🌵 ↦ Φ.f( site🌵 ↦ ⟦ Δ ⤍ 01- ⟧, on🌵 ↦ ⟦ λ ⤍ 𝜎3 ⟧, left🌵 ↦ ⟦ λ ⤍ 𝜎4 ⟧, right🌵 ↦ ⟦ λ ⤍ 𝜎5 ⟧ ), right🌵 ↦ ⟦ λ ⤍ 𝜎6 ⟧ ), right🌵 ↦ ⟦ λ ⤍ 𝜎7 ⟧ ).q ⟧+protocol: |+  𝕄(Φ.app):+    remembered 𝑛·0·1 ≡ Φ.f  # ⟦ site🌵 ↦ ∅, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    𝑛·0·2 ≔ Φ.f( site🌵 ↦ 01-:Δ )+    𝑛·0·3 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    remembered 𝑛·0·3 ≡ 𝑛·0·1( site🌵 ↦ 01-:Δ )+    𝑛·0·4 ≔ 𝑛·0·2( on🌵 ↦ 𝜎1:λ )+    𝑛·0·5 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    remembered 𝑛·0·5 ≡ 𝑛·0·3( on🌵 ↦ 𝜎1:λ )+    𝑛·0·6 ≔ 𝑛·0·4( left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎3:λ, left🌵 ↦ 𝜎4:λ, right🌵 ↦ 𝜎5:λ ), right🌵 ↦ 𝜎6:λ ) )+    𝑛·0·7 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎3:λ, left🌵 ↦ 𝜎4:λ, right🌵 ↦ 𝜎5:λ ), right🌵 ↦ 𝜎6:λ ), right🌵 ↦ ∅, λ ⤍ L_fork ⟧+    remembered 𝑛·0·7 ≡ 𝑛·0·5( left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎3:λ, left🌵 ↦ 𝜎4:λ, right🌵 ↦ 𝜎5:λ ), right🌵 ↦ 𝜎6:λ ) )+    𝑛·0·8 ≔ 𝑛·0·6( right🌵 ↦ 𝜎7:λ )+    𝑛·0·9 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝑛·0·2( on🌵 ↦ 𝜎3:λ, left🌵 ↦ 𝜎4:λ, right🌵 ↦ 𝜎5:λ ), right🌵 ↦ 𝜎6:λ ), right🌵 ↦ 𝜎7:λ, λ ⤍ L_fork ⟧+    remembered 𝑛·0·9 ≡ 𝑛·0·7( right🌵 ↦ 𝜎7:λ )+    𝔼(L_fork):+      𝔻(ξ.on🌵):+        𝛿·1·1 ≔ 𝔻(𝜎1:λ)+      𝛿1·1 ≔ 𝛿·1·1  # 𝔻(ξ.on🌵)+      𝕄(ξ.left🌵):+        𝑛·1·1 ≔ Φ.f( site🌵 ↦ 01-:Δ )+        𝑛·1·2 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        𝑛·1·3 ≔ 𝑛·1·1( on🌵 ↦ 𝜎2:λ )+        𝑛·1·4 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎2:λ, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        remembered 𝑛·1·4 ≡ 𝑛·1·2( on🌵 ↦ 𝜎2:λ )+        𝑛·1·5 ≔ 𝑛·1·3( left🌵 ↦ 𝑛·1·1( on🌵 ↦ 𝜎3:λ, left🌵 ↦ 𝜎4:λ, right🌵 ↦ 𝜎5:λ ) )+        𝑛·1·6 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝑛·1·1( on🌵 ↦ 𝜎3:λ, left🌵 ↦ 𝜎4:λ, right🌵 ↦ 𝜎5:λ ), right🌵 ↦ ∅, λ ⤍ L_fork ⟧+        remembered 𝑛·1·6 ≡ 𝑛·1·4( left🌵 ↦ 𝑛·1·1( on🌵 ↦ 𝜎3:λ, left🌵 ↦ 𝜎4:λ, right🌵 ↦ 𝜎5:λ ) )+        𝑛·1·7 ≔ 𝑛·1·5( right🌵 ↦ 𝜎6:λ )+        𝑛·1·8 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎2:λ, left🌵 ↦ 𝑛·1·1( on🌵 ↦ 𝜎3:λ, left🌵 ↦ 𝜎4:λ, right🌵 ↦ 𝜎5:λ ), right🌵 ↦ 𝜎6:λ, λ ⤍ L_fork ⟧+        remembered 𝑛·1·8 ≡ 𝑛·1·6( right🌵 ↦ 𝜎6:λ )+        morphed 𝑛·1·9 ≔ 𝑛·1·8+      𝑛1·1 ≔ 𝑛·1·8  # 𝕄(ξ.left🌵)+      𝕄(ξ.right🌵):+        morphed 𝑛·1·10 ≔ 𝜎7:λ+      𝑛2·1 ≔ 𝑛·1·10  # 𝕄(ξ.right🌵)+      recalled 𝑛·1·8 ⇒ 𝑛·1·6( right🌵 ↦ 𝜎6:λ )+      recalled 𝑛·1·6 ⇒ 𝑛·1·4( left🌵 ↦ 𝑛·1·1( on🌵 ↦ 𝜎3:λ, left🌵 ↦ 𝜎4:λ, right🌵 ↦ 𝜎5:λ ) )+      recalled 𝑛·1·4 ⇒ 𝑛·1·2( on🌵 ↦ 𝜎2:λ )+      recalled 𝑛·0·3 ⇒ 𝑛·0·1( site🌵 ↦ 01-:Δ )+      recalled 𝑛·0·1 ⇒ Φ.f+      𝔼(L_fork):  # 𝔼(𝑛1 of L_fork)+        𝔻(ξ.on🌵):+          𝛿·2·1 ≔ 𝔻(𝜎2:λ)+        𝛿1·2 ≔ 𝛿·2·1  # 𝔻(ξ.on🌵)+        𝕄(ξ.left🌵):+          𝑛·2·1 ≔ Φ.f( site🌵 ↦ 01-:Δ )+          𝑛·2·2 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ ∅, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+          𝑛·2·3 ≔ 𝑛·2·1( on🌵 ↦ 𝜎3:λ )+          𝑛·2·4 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎3:λ, left🌵 ↦ ∅, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+          remembered 𝑛·2·4 ≡ 𝑛·2·2( on🌵 ↦ 𝜎3:λ )+          𝑛·2·5 ≔ 𝑛·2·3( left🌵 ↦ 𝜎4:λ )+          𝑛·2·6 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎3:λ, left🌵 ↦ 𝜎4:λ, right🌵 ↦ ∅, λ ⤍ L_fork ⟧+          remembered 𝑛·2·6 ≡ 𝑛·2·4( left🌵 ↦ 𝜎4:λ )+          𝑛·2·7 ≔ 𝑛·2·5( right🌵 ↦ 𝜎5:λ )+          𝑛·2·8 ≔ ⟦ site🌵 ↦ 01-:Δ, on🌵 ↦ 𝜎3:λ, left🌵 ↦ 𝜎4:λ, right🌵 ↦ 𝜎5:λ, λ ⤍ L_fork ⟧+          remembered 𝑛·2·8 ≡ 𝑛·2·6( right🌵 ↦ 𝜎5:λ )+          morphed 𝑛·2·9 ≔ 𝑛·2·8+        𝑛1·2 ≔ 𝑛·2·8  # 𝕄(ξ.left🌵)+        𝕄(ξ.right🌵):+          morphed 𝑛·2·10 ≔ 𝜎6:λ+        𝑛2·2 ≔ 𝑛·2·10  # 𝕄(ξ.right🌵)+        recalled 𝑛·2·8 ⇒ 𝑛·2·6( right🌵 ↦ 𝜎5:λ )+        recalled 𝑛·2·6 ⇒ 𝑛·2·4( left🌵 ↦ 𝜎4:λ )+        recalled 𝑛·2·4 ⇒ 𝑛·2·2( on🌵 ↦ 𝜎3:λ )+        recalled 𝑛·0·3 ⇒ 𝑛·0·1( site🌵 ↦ 01-:Δ )+        recalled 𝑛·0·1 ⇒ Φ.f+        𝔼(L_fork):  # 𝔼(𝑛1 of L_fork)+          𝔻(ξ.on🌵):+            𝛿·3·1 ≔ 𝔻(𝜎3:λ)+          𝛿1·3 ≔ 𝛿·3·1  # 𝔻(ξ.on🌵)+          𝕄(ξ.left🌵):+            morphed 𝑛·3·1 ≔ 𝜎4:λ+          𝑛1·3 ≔ 𝑛·3·1  # 𝕄(ξ.left🌵)+          𝕄(ξ.right🌵):+            morphed 𝑛·3·2 ≔ 𝜎5:λ+          𝑛2·3 ≔ 𝑛·3·2  # 𝕄(ξ.right🌵)+          joined 𝜎8 ≔ 𝛿1·3 ? 𝜎4 : 𝜎5+          𝑛·3·3 ≔ 𝜎8:λ+          memoized 𝑛·2·8 ⇛ 𝜎8:λ+          evaluated 𝑛·3·4 ≔ 𝑛·3·3  # 𝑛·2·8+        𝑛3·2 ≔ 𝑛·3·3  # 𝔼(𝑛1 of L_fork)+        joined 𝜎9 ≔ 𝛿1·2 ? 𝜎8 : 𝜎6+        𝑛·2·11 ≔ 𝜎9:λ+        memoized 𝑛·1·8 ⇛ 𝜎9:λ+        evaluated 𝑛·2·12 ≔ 𝑛·2·11  # 𝑛·1·8+      𝑛3·1 ≔ 𝑛·2·11  # 𝔼(𝑛1 of L_fork)+      joined 𝜎10 ≔ 𝛿1·1 ? 𝜎9 : 𝜎7+      𝑛·1·11 ≔ 𝜎10:λ+      memoized 𝑛·0·9 ⇛ 𝜎10:λ+      evaluated 𝑛·1·12 ≔ 𝑛·1·11  # 𝑛·0·9+    opaque 𝜎11:λ ≔ 𝜎10:λ.q+    morphed 𝑛·0·10 ≔ 𝜎11:λ
+ test-resources/evaluate-packs/keeps-the-site-a-side-passes-as-an-argument.yaml view
@@ -0,0 +1,79 @@+# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com+# SPDX-License-Identifier: MIT+---+# yamllint disable rule:line-length+# Both sides of the fork 'top' apply the fork 'g' to its site '0B-' as an+# argument, so 'symbolize' turns every datum of a side into a symbol, but+# leaves that argument alone, as it leaves the site a formation binds, and+# the join keeps '0B-' rather than minting a symbol for it (#2499).+symbolic: |+  - λ: L_fork+    site: $.site🌵+    dataize:+      𝛿1: $.on🌵+    morph:+      𝑛1: $.left🌵+      𝑛2: $.right🌵+    symbolize:+      𝑛3: 𝑛1+      𝑛4: 𝑛2+    join:+      on: 𝛿1+      left: 𝑛3+      right: 𝑛4+      otherwise: L_fork+location: 'Q.app'+acyclic: plausible+partial: true+input: >+  ⟦ g ↦ ⟦ λ ⤍ L_fork, v🌵x ↦ ∅, site🌵 ↦ ∅, on🌵 ↦ ⟦ λ ⤍ 𝜎2 ⟧, left🌵 ↦ ξ.v🌵x, right🌵 ↦ ⟦ Δ ⤍ 01- ⟧ ⟧,+    top ↦ ⟦ λ ⤍ L_fork, site🌵 ↦ ⟦ Δ ⤍ 0A- ⟧, on🌵 ↦ ⟦ λ ⤍ 𝜎1 ⟧, left🌵 ↦ ⟦ φ ↦ Φ.g( v🌵x ↦ ⟦ Δ ⤍ 05- ⟧, site🌵 ↦ ⟦ Δ ⤍ 0B- ⟧ ) ⟧, right🌵 ↦ ⟦ φ ↦ Φ.g( v🌵x ↦ ⟦ Δ ⤍ 06- ⟧, site🌵 ↦ ⟦ Δ ⤍ 0B- ⟧ ) ⟧ ⟧,+    app ↦ Φ.top.q ⟧+protocol: |+  𝕄(Φ.app):+    remembered 𝑛·0·1 ≡ Φ.top  # ⟦ λ ⤍ L_fork, site🌵 ↦ 0A-:Δ, on🌵 ↦ 𝜎1:λ, left🌵 ↦ Φ.g( v🌵x ↦ 05-:Δ, site🌵 ↦ 0B-:Δ ):φ, right🌵 ↦ Φ.g( v🌵x ↦ 06-:Δ, site🌵 ↦ 0B-:Δ ):φ ⟧+    𝔼(L_fork):+      𝔻(ξ.on🌵):+        𝛿·1·1 ≔ 𝔻(𝜎1:λ)+      𝛿1·1 ≔ 𝛿·1·1  # 𝔻(ξ.on🌵)+      𝕄(ξ.left🌵):+        morphed 𝑛·1·1 ≔ Φ.g( v🌵x ↦ 05-:Δ, site🌵 ↦ 0B-:Δ ):φ+      𝑛1·1 ≔ 𝑛·1·1  # 𝕄(ξ.left🌵)+      𝕄(ξ.right🌵):+        morphed 𝑛·1·2 ≔ Φ.g( v🌵x ↦ 06-:Δ, site🌵 ↦ 0B-:Δ ):φ+      𝑛2·1 ≔ 𝑛·1·2  # 𝕄(ξ.right🌵)+      symbolized 𝜎3 ≔ 05-+      𝑛3·1 ≔ Φ.g( v🌵x ↦ 𝜎3:λ, site🌵 ↦ 0B-:Δ ):φ  # symbolize(𝑛1 of L_fork)+      symbolized 𝜎4 ≔ 06-+      𝑛4·1 ≔ Φ.g( v🌵x ↦ 𝜎4:λ, site🌵 ↦ 0B-:Δ ):φ  # symbolize(𝑛2 of L_fork)+      joined 𝜎5 ≔ 𝛿1·1 ? 𝜎3 : 𝜎4+      𝑛·1·3 ≔ Φ.g( v🌵x ↦ 𝜎5:λ, site🌵 ↦ 0B-:Δ ):φ+      remembered 𝑛·1·3 ≡ 𝑛·0·1+      memoized 𝑛·0·1 ⇛ 𝑛·1·3+      evaluated 𝑛·1·4 ≔ 𝑛·1·3  # 𝑛·0·1+    normalized 𝑛·0·2 ≔ Φ.g( v🌵x ↦ 𝜎5:λ, site🌵 ↦ 0B-:Δ ).q  # 𝑛·1·4.φ.q+    remembered 𝑛·0·3 ≡ Φ.g  # ⟦ λ ⤍ L_fork, v🌵x ↦ ∅, site🌵 ↦ ∅, on🌵 ↦ 𝜎2:λ, left🌵 ↦ v🌵x, right🌵 ↦ 01-:Δ ⟧+    𝑛·0·4 ≔ Φ.g( v🌵x ↦ 𝜎5:λ )+    𝑛·0·5 ≔ ⟦ λ ⤍ L_fork, v🌵x ↦ 𝜎5:λ, site🌵 ↦ ∅, on🌵 ↦ 𝜎2:λ, left🌵 ↦ v🌵x, right🌵 ↦ 01-:Δ ⟧+    remembered 𝑛·0·5 ≡ 𝑛·0·3( v🌵x ↦ 𝜎5:λ )+    𝑛·0·6 ≔ 𝑛·0·4( site🌵 ↦ 0B-:Δ )+    𝑛·0·7 ≔ ⟦ λ ⤍ L_fork, v🌵x ↦ 𝜎5:λ, site🌵 ↦ 0B-:Δ, on🌵 ↦ 𝜎2:λ, left🌵 ↦ v🌵x, right🌵 ↦ 01-:Δ ⟧+    remembered 𝑛·0·7 ≡ 𝑛·0·5( site🌵 ↦ 0B-:Δ )+    𝔼(L_fork):+      𝔻(ξ.on🌵):+        𝛿·2·1 ≔ 𝔻(𝜎2:λ)+      𝛿1·2 ≔ 𝛿·2·1  # 𝔻(ξ.on🌵)+      𝕄(ξ.left🌵):+        morphed 𝑛·2·1 ≔ 𝜎5:λ+      𝑛1·2 ≔ 𝑛·2·1  # 𝕄(ξ.left🌵)+      𝕄(ξ.right🌵):+        morphed 𝑛·2·2 ≔ 01-:Δ+      𝑛2·2 ≔ 01-:Δ  # 𝕄(ξ.right🌵)+      symbolized 𝜎6 ≔ 01-+      𝑛4·2 ≔ 𝜎6:λ  # symbolize(𝑛2 of L_fork)+      joined 𝜎7 ≔ 𝛿1·2 ? 𝜎5 : 𝜎6+      𝑛·2·3 ≔ 𝜎7:λ+      memoized 𝑛·0·7 ⇛ 𝜎7:λ+      evaluated 𝑛·2·4 ≔ 𝑛·2·3  # 𝑛·0·7+    opaque 𝜎8:λ ≔ 𝜎7:λ.q+    morphed 𝑛·0·8 ≔ 𝜎8:λ
test/ForksSpec.hs view
@@ -89,7 +89,7 @@    describe "forked" $ do     let fork :: Text -> Either Int Bytes -> String -> String -> IO (Either Refusal Expression)-        fork func condition left right = forked (fabric (Function func)) condition <$> fmap twice (parseExpressionThrows left) <*> fmap twice (parseExpressionThrows right)+        fork func condition left right = forked (fabric (Function func)) Nothing condition <$> fmap twice (parseExpressionThrows left) <*> fmap twice (parseExpressionThrows right)         twice :: Expression -> (Expression, Expression)         twice side = (side, side)     it "asks the copies of both sides for an attribute the λ it is given picks between" $ do@@ -114,7 +114,17 @@       expected <- parseExpressionThrows "⟦ ab🌵 ↦ ⟦ ke ↦ Φ.qo, ty ↦ Φ.wa ⟧, cd🌵 ↦ ⟦ ke ↦ Φ.ri ⟧, ke ↦ ⟦ ρ ↦ ∅, λ ⤍ L_xu, ef🌵 ↦ ⟦ λ ⤍ 𝜎5 ⟧, ab🌵 ↦ ξ.ρ.ab🌵.ke, cd🌵 ↦ ξ.ρ.cd🌵.ke ⟧, ty ↦ ⟦ ρ ↦ ∅, λ ⤍ L_xu, ef🌵 ↦ ⟦ λ ⤍ 𝜎5 ⟧, ab🌵 ↦ ξ.ρ.ab🌵.ty, cd🌵 ↦ ξ.ρ.cd🌵.ty ⟧ ⟧"       left <- parseExpressionThrows "⟦ ke ↦ Φ.qo, ty ↦ Φ.wa ⟧"       right <- parseExpressionThrows "⟦ ke ↦ Φ.ri ⟧"-      forked (Fabric (Function "L_xu") (AtLabel "ef🌵") (AtLabel "ab🌵") (AtLabel "cd🌵")) (Left 5) (left, left) (right, right) `shouldBe` Right expected+      forked (Fabric (Function "L_xu") (AtLabel "ef🌵") (AtLabel "ab🌵") (AtLabel "cd🌵")) Nothing (Left 5) (left, left) (right, right) `shouldBe` Right expected+    it "gives every branch the site of the fork it fabricates from" $ do+      expected <- parseExpressionThrows "⟦ left🌵 ↦ ⟦ ke ↦ Φ.qo, ty ↦ Φ.wa ⟧, right🌵 ↦ ⟦ ke ↦ Φ.ri ⟧, ke ↦ ⟦ ρ ↦ ∅, λ ⤍ L_mo, site🌵 ↦ ⟦ Δ ⤍ 3A-91 ⟧, on🌵 ↦ ⟦ λ ⤍ 𝜎5 ⟧, left🌵 ↦ ξ.ρ.left🌵.ke, right🌵 ↦ ξ.ρ.right🌵.ke ⟧, ty ↦ ⟦ ρ ↦ ∅, λ ⤍ L_mo, site🌵 ↦ ⟦ Δ ⤍ 3A-91 ⟧, on🌵 ↦ ⟦ λ ⤍ 𝜎5 ⟧, left🌵 ↦ ξ.ρ.left🌵.ty, right🌵 ↦ ξ.ρ.right🌵.ty ⟧ ⟧"+      left <- parseExpressionThrows "⟦ ke ↦ Φ.qo, ty ↦ Φ.wa ⟧"+      right <- parseExpressionThrows "⟦ ke ↦ Φ.ri ⟧"+      forked (fabric (Function "L_mo")) (Just (BiTau (AtLabel "site🌵") (ExFormation [BiDelta (BtMany ["3A", "91"])]))) (Left 5) (left, left) (right, right) `shouldBe` Right expected+    it "leaves the site void in a branch whose side waits for a site of its own and hands it on" $ do+      expected <- parseExpressionThrows "⟦ left🌵 ↦ ⟦ ke ↦ ⟦ vo ↦ ∅, site🌵 ↦ ∅, φ ↦ Φ.qo ⟧, ty ↦ Φ.wa ⟧, right🌵 ↦ ⟦ ke ↦ ⟦ vo ↦ ∅, site🌵 ↦ ∅, φ ↦ Φ.ri ⟧ ⟧, ke ↦ ⟦ ρ ↦ ∅, λ ⤍ L_mo, vo ↦ ∅, site🌵 ↦ ∅, on🌵 ↦ ⟦ λ ⤍ 𝜎5 ⟧, left🌵 ↦ ξ.ρ.left🌵.ke( vo ↦ ξ.vo, site🌵 ↦ ξ.site🌵 ), right🌵 ↦ ξ.ρ.right🌵.ke( vo ↦ ξ.vo, site🌵 ↦ ξ.site🌵 ) ⟧, ty ↦ ⟦ ρ ↦ ∅, λ ⤍ L_mo, site🌵 ↦ ⟦ Δ ⤍ 3A-91 ⟧, on🌵 ↦ ⟦ λ ⤍ 𝜎5 ⟧, left🌵 ↦ ξ.ρ.left🌵.ty, right🌵 ↦ ξ.ρ.right🌵.ty ⟧ ⟧"+      left <- parseExpressionThrows "⟦ ke ↦ ⟦ vo ↦ ∅, site🌵 ↦ ∅, φ ↦ Φ.qo ⟧, ty ↦ Φ.wa ⟧"+      right <- parseExpressionThrows "⟦ ke ↦ ⟦ vo ↦ ∅, site🌵 ↦ ∅, φ ↦ Φ.ri ⟧ ⟧"+      forked (fabric (Function "L_mo")) (Just (BiTau (AtLabel "site🌵") (ExFormation [BiDelta (BtMany ["3A", "91"])]))) (Left 5) (left, left) (right, right) `shouldBe` Right expected     it "tells that the left side leaves void an attribute the right side binds" $       fork "L_oh" (Right (BtOne "52")) "⟦ ws ↦ ∅ ⟧" "⟦ ws ↦ Φ.ug ⟧" >>= (`shouldBe` Left (Unripe Lefthand (AtLabel "ws")))     it "tells that the right side leaves void an attribute the left side binds" $
test/LambdasSpec.hs view
@@ -524,6 +524,9 @@       , ("a terminator another entry answers", "- λ: L_fork\n  morph:\n    𝑛1: $.a\n  terminators: [L_throw]\n  𝑛: 𝑛1\n- λ: L_th.*\n  𝑛: ⟦ λ ⤍ 𝜎 ⟧\n", "the terminator 'L_throw' of the key 'L_fork' is answered by the key 'L_th.*'")       , ("a terminator its own entry answers", "- λ: L_.*\n  morph:\n    𝑛1: $.a\n  terminators: [L_throw]\n  𝑛: 𝑛1\n", "the terminator 'L_throw' of the key 'L_.*' is answered by the key 'L_.*'")       , ("a 'terminators' key holding no list", "- λ: L_fork\n  morph:\n    𝑛1: $.a\n  terminators: L_throw\n  𝑛: 𝑛1\n", "terminators")+      , ("a 'site' reading a path of two attributes", "- λ: L_fork\n  site: $.a.b\n  𝑛: ⟦ λ ⤍ 𝜎 ⟧\n", "The 'site' of λ function 'L_fork' is '$.a.b', while it must be a path of one attribute from '$', such as '$.site🌵'")+      , ("a 'site' naming a meta", "- λ: L_fork\n  site: 𝑛1\n  𝑛: ⟦ λ ⤍ 𝜎 ⟧\n", "The 'site' of λ function 'L_fork' is '𝑛1', while it must be a path of one attribute from '$'")+      , ("a 'site' reading the ρ", "- λ: L_fork\n  site: $.ρ\n  𝑛: ⟦ λ ⤍ 𝜎 ⟧\n", "The 'site' of λ function 'L_fork' is '$.ρ', while it must be a path of one attribute from '$'")       , ("a 'lenient' key, which is gone", "- λ: L_fork\n  morph:\n    𝑛1: $.a\n  lenient: []\n  𝑛: 𝑛1\n", "The key 'lenient' of λ function 'L_fork' is none of the keys an entry reads")       , ("a misspelled 'dataize' block", "- λ: L_pair\n  datize:\n    𝛿1: $.ρ\n  𝑛: ⟦ λ ⤍ 𝜎 ⟧\n", "The key 'datize' of λ function 'L_pair' is none of the keys an entry reads")       , ("a 'defer' key saying a flag instead of holding lines", "- λ: L_hold\n  morph:\n    𝑛1: $.a\n  defer: true\n  𝑛: 𝑛1\n", "defer: parsing")@@ -703,89 +706,112 @@     it "turns the datum of a formation into a fresh symbol" $ do       term <- parseExpressionThrows "⟦ Δ ⤍ 4A-2C ⟧"       masked <- parseExpressionThrows "⟦ λ ⤍ 𝜎8 ⟧"-      (\(made, _, _) -> made) (symbolized term 7) `shouldBe` masked+      (\(made, _, _) -> made) (symbolized emptyLambdas term 7) `shouldBe` masked      it "tells the datum every fresh symbol stands for" $ do       term <- parseExpressionThrows "⟦ Δ ⤍ 4A-2C ⟧"-      (\(_, known, _) -> known) (symbolized term 7) `shouldBe` [(8, BtMany ["4A", "2C"])]+      (\(_, known, _) -> known) (symbolized emptyLambdas term 7) `shouldBe` [(8, BtMany ["4A", "2C"])]      it "counts every symbol it minted" $ do       term <- parseExpressionThrows "Φ.number( φ ↦ ⟦ Δ ⤍ 0E- ⟧ )"-      (\(_, _, spent) -> spent) (symbolized term 11) `shouldBe` 12+      (\(_, _, spent) -> spent) (symbolized emptyLambdas term 11) `shouldBe` 12 +    it "leaves alone the site of a formation its entry names" $ do+      registered <- lambdasOf "- λ: L_fork\n  site: $.site🌵\n  𝑛: ⟦ λ ⤍ 𝜎 ⟧\n"+      term <- parseExpressionThrows "⟦ λ ⤍ L_fork, site🌵 ↦ ⟦ Δ ⤍ 3A-91 ⟧, on🌵 ↦ ⟦ Δ ⤍ 01- ⟧ ⟧"+      masked <- parseExpressionThrows "⟦ λ ⤍ L_fork, site🌵 ↦ ⟦ Δ ⤍ 3A-91 ⟧, on🌵 ↦ ⟦ λ ⤍ 𝜎6 ⟧ ⟧"+      (\(made, _, _) -> made) (symbolized registered term 5) `shouldBe` masked++    it "leaves alone a site an application takes as an argument" $ do+      registered <- lambdasOf "- λ: L_fork\n  site: $.site🌵\n  𝑛: ⟦ λ ⤍ 𝜎 ⟧\n"+      term <- parseExpressionThrows "Φ.g( v🌵x ↦ ⟦ Δ ⤍ 05- ⟧, site🌵 ↦ ⟦ Δ ⤍ 0B- ⟧ )"+      masked <- parseExpressionThrows "Φ.g( v🌵x ↦ ⟦ λ ⤍ 𝜎4 ⟧, site🌵 ↦ ⟦ Δ ⤍ 0B- ⟧ )"+      (\(made, _, _) -> made) (symbolized registered term 3) `shouldBe` masked++    it "turns an argument named as a site into a symbol where no entry names a site" $ do+      term <- parseExpressionThrows "Φ.g( site🌵 ↦ ⟦ Δ ⤍ 0B- ⟧ )"+      masked <- parseExpressionThrows "Φ.g( site🌵 ↦ ⟦ λ ⤍ 𝜎4 ⟧ )"+      (\(made, _, _) -> made) (symbolized emptyLambdas term 3) `shouldBe` masked++    it "turns the site into a symbol in a formation whose entry names no site" $ do+      registered <- lambdasOf "- λ: L_fork\n  𝑛: ⟦ λ ⤍ 𝜎 ⟧\n"+      term <- parseExpressionThrows "⟦ λ ⤍ L_fork, site🌵 ↦ ⟦ Δ ⤍ 3A-91 ⟧ ⟧"+      masked <- parseExpressionThrows "⟦ λ ⤍ L_fork, site🌵 ↦ ⟦ λ ⤍ 𝜎6 ⟧ ⟧"+      (\(made, _, _) -> made) (symbolized registered term 5) `shouldBe` masked+     it "leaves a term holding no datum as it is" $ do       term <- parseExpressionThrows "⟦ φ ↦ Φ.wert( φ ↦ ⟦ λ ⤍ 𝜎5 ⟧ ).zahl, λ ⤍ L_kern, tief ↦ ξ.ρ.q( am ↦ ξ.w ) ⟧"-      symbolized term 5 `shouldBe` (term, [], 5)+      symbolized emptyLambdas term 5 `shouldBe` (term, [], 5)      it "keeps the bindings beside the datum it turned into a symbol" $ do       term <- parseExpressionThrows "Φ.paar( φ ↦ ⟦ λ ⤍ L_kern, eins ↦ ξ.w.r, zwei ↦ ⟦ Δ ⤍ 7B- ⟧, drei ↦ Φ.k( z ↦ ξ.w ) ⟧ )"       masked <- parseExpressionThrows "Φ.paar( φ ↦ ⟦ λ ⤍ L_kern, eins ↦ ξ.w.r, zwei ↦ ⟦ λ ⤍ 𝜎4 ⟧, drei ↦ Φ.k( z ↦ ξ.w ) ⟧ )"-      (\(made, _, _) -> made) (symbolized term 3) `shouldBe` masked+      (\(made, _, _) -> made) (symbolized emptyLambdas term 3) `shouldBe` masked      it "walks the φ an application binds down to the datum" $ do       term <- parseExpressionThrows "Φ.number( φ ↦ Φ.bytes( φ ↦ ⟦ Δ ⤍ 3F-F0-00-00-00-00-00-00 ⟧ ) )"       masked <- parseExpressionThrows "Φ.number( φ ↦ Φ.bytes( φ ↦ ⟦ λ ⤍ 𝜎3 ⟧ ) )"-      (\(made, _, _) -> made) (symbolized term 2) `shouldBe` masked+      (\(made, _, _) -> made) (symbolized emptyLambdas term 2) `shouldBe` masked      it "walks the head of an application binding no φ" $ do       term <- parseExpressionThrows "Φ.bytes( φ ↦ ⟦ Δ ⤍ 61- ⟧ )( ρ ↦ ⟦ w ↦ ∅ ⟧ )"       masked <- parseExpressionThrows "Φ.bytes( φ ↦ ⟦ λ ⤍ 𝜎20 ⟧ )( ρ ↦ ⟦ w ↦ ∅ ⟧ )"-      (\(made, _, _) -> made) (symbolized term 19) `shouldBe` masked+      (\(made, _, _) -> made) (symbolized emptyLambdas term 19) `shouldBe` masked      it "walks the φ of a formation down to the datum" $ do       term <- parseExpressionThrows "⟦ φ ↦ ⟦ φ ↦ ⟦ Δ ⤍ 07- ⟧ ⟧ ⟧"       masked <- parseExpressionThrows "⟦ φ ↦ ⟦ φ ↦ ⟦ λ ⤍ 𝜎5 ⟧ ⟧ ⟧"-      (\(made, _, _) -> made) (symbolized term 4) `shouldBe` masked+      (\(made, _, _) -> made) (symbolized emptyLambdas term 4) `shouldBe` masked      it "keeps the datum the ρ of a formation holding no λ binds" $ do       term <- parseExpressionThrows "⟦ ρ ↦ ⟦ Δ ⤍ 02- ⟧, q ↦ ∅ ⟧"-      (\(made, _, _) -> made) (symbolized term 9) `shouldBe` term+      (\(made, _, _) -> made) (symbolized emptyLambdas term 9) `shouldBe` term      it "keeps the datum a method of a formation holding no λ binds" $ do       term <- parseExpressionThrows "⟦ φ ↦ ⟦⟧, neg ↦ ⟦ Δ ⤍ BF-F0-00-00-00-00-00-00 ⟧ ⟧"-      (\(made, _, _) -> made) (symbolized term 9) `shouldBe` term+      (\(made, _, _) -> made) (symbolized emptyLambdas term 9) `shouldBe` term      it "mints no symbol for a constant the method of a number holds" $ do       term <- parseExpressionThrows "⟦ φ ↦ Φ.bytes( φ ↦ ⟦ Δ ⤍ 40-45-00-00-00-00-00-00 ⟧ ), abs ↦ ⟦ φ ↦ ξ.ρ.lt( x ↦ Φ.number( φ ↦ Φ.bytes( φ ↦ ⟦ Δ ⤍ 00-00-00-00-00-00-00-00 ⟧ ) ) ) ⟧ ⟧"-      (\(_, known, _) -> known) (symbolized term 603) `shouldBe` [(604, BtMany ["40", "45", "00", "00", "00", "00", "00", "00"])]+      (\(_, known, _) -> known) (symbolized emptyLambdas term 603) `shouldBe` [(604, BtMany ["40", "45", "00", "00", "00", "00", "00", "00"])]      it "turns the datum the ρ of an atom binds into a fresh symbol" $ do       term <- parseExpressionThrows "⟦ λ ⤍ L_bytes_size, ρ ↦ ⟦ Δ ⤍ 2B-07 ⟧ ⟧"       masked <- parseExpressionThrows "⟦ λ ⤍ L_bytes_size, ρ ↦ ⟦ λ ⤍ 𝜎32 ⟧ ⟧"-      (\(made, _, _) -> made) (symbolized term 31) `shouldBe` masked+      (\(made, _, _) -> made) (symbolized emptyLambdas term 31) `shouldBe` masked      it "turns the datum an attribute of an atom binds into a fresh symbol" $ do       term <- parseExpressionThrows "Φ.bool( if ↦ ⟦ λ ⤍ L_fork, left ↦ ∅, right ↦ ∅, on🌵 ↦ ⟦ Δ ⤍ FF- ⟧ ⟧ )"       masked <- parseExpressionThrows "Φ.bool( if ↦ ⟦ λ ⤍ L_fork, left ↦ ∅, right ↦ ∅, on🌵 ↦ ⟦ λ ⤍ 𝜎58 ⟧ ⟧ )"-      (\(made, _, _) -> made) (symbolized term 57) `shouldBe` masked+      (\(made, _, _) -> made) (symbolized emptyLambdas term 57) `shouldBe` masked      it "turns the datum a named argument other than φ holds into a fresh symbol" $ do       term <- parseExpressionThrows "Φ.f( q ↦ ⟦ Δ ⤍ 1D- ⟧ )"       masked <- parseExpressionThrows "Φ.f( q ↦ ⟦ λ ⤍ 𝜎4 ⟧ )"-      (\(made, _, _) -> made) (symbolized term 3) `shouldBe` masked+      (\(made, _, _) -> made) (symbolized emptyLambdas term 3) `shouldBe` masked      it "turns the datum an argument holds into a fresh symbol" $ do       term <- parseExpressionThrows "Φ.vk( ry ↦ ⟦ Δ ⤍ 5B- ⟧ )"       masked <- parseExpressionThrows "Φ.vk( ry ↦ ⟦ λ ⤍ 𝜎14 ⟧ )"-      (\(made, _, _) -> made) (symbolized term 13) `shouldBe` masked+      (\(made, _, _) -> made) (symbolized emptyLambdas term 13) `shouldBe` masked      it "walks the target of a dispatch down to the datum" $ do       term <- parseExpressionThrows "⟦ Δ ⤍ 6E- ⟧.kx"       masked <- parseExpressionThrows "⟦ λ ⤍ 𝜎8 ⟧.kx"-      (\(made, _, _) -> made) (symbolized term 7) `shouldBe` masked+      (\(made, _, _) -> made) (symbolized emptyLambdas term 7) `shouldBe` masked      it "walks a formation bound to an argument down to the datum it holds in φ" $ do       term <- parseExpressionThrows "Φ.bool( if ↦ ⟦ λ ⤍ L_fork, φ ↦ ⟦ Δ ⤍ FF- ⟧ ⟧ )"       masked <- parseExpressionThrows "Φ.bool( if ↦ ⟦ λ ⤍ L_fork, φ ↦ ⟦ λ ⤍ 𝜎147 ⟧ ⟧ )"-      (\(made, _, _) -> made) (symbolized term 146) `shouldBe` masked+      (\(made, _, _) -> made) (symbolized emptyLambdas term 146) `shouldBe` masked      it "mints the symbols in the order the term spells its data" $ do       term <- parseExpressionThrows "Φ.ws( φ ↦ ⟦ Δ ⤍ 3C- ⟧ )( tz ↦ ⟦ Δ ⤍ 9D- ⟧ )"-      (\(_, known, _) -> known) (symbolized term 5) `shouldBe` [(6, BtOne "3C"), (7, BtOne "9D")]+      (\(_, known, _) -> known) (symbolized emptyLambdas term 5) `shouldBe` [(6, BtOne "3C"), (7, BtOne "9D")]      it "mints nothing for a term holding no datum" $ do       term <- parseExpressionThrows "Φ.number( φ ↦ Φ.bytes( φ ↦ ⟦ λ ⤍ 𝜎2 ⟧ ) )"-      (\(_, _, spent) -> spent) (symbolized term 6) `shouldBe` 6+      (\(_, _, spent) -> spent) (symbolized emptyLambdas term 6) `shouldBe` 6    describe "emptyLambdas" $     it "cannot read a λ function without the file naming one" $
test/MorphSpec.hs view
@@ -24,11 +24,11 @@ import Deps (Acyclic (..), Duration (..), Evaluation (EvLooped, EvMorphed, EvNormalized, EvRecalled, EvWorld), Judgment (..), State, Term (TeExpression)) import Engine (Engine (_normal)) import Files (allPathsIn)-import Fixtures (defaultReduceContext, fixtureLambdas, linked, overdue, primitives)+import Fixtures (defaultReduceContext, fixtureLambdas, linked, overdue, primitives, withLambdasOf) import GHC.Clock (getMonotonicTime) import GHC.Generics (Generic) import Inference (Conclusion (Answered), Premises (Concludes, Morphs), direct)-import Lambdas (Lambdas, emptyLambdas)+import Lambdas (Lambdas, emptyLambdas, readLambdas) import Matcher (substEmpty) import Morph (Answer (..), Deadline (..), Firing (..), ReduceContext (..), adopted, declared, emptyState, ended, enter, execBuildTerm, factual, fired, inferred, insideUniverse, kindle, kindred, memoized, morph, morph', normalized, noted, placed, voided) import Parser (Form (MONOFORM), parseExpressionThrows, parseExpressionThrows')@@ -385,6 +385,31 @@           formation = ExFormation [BiTau (AtLabel "ka") (ExDispatch ExRoot (AtLabel "mi")), BiLambda (Function "L_ru")]       base <- defaultReduceContext ExRoot       (enter formation =<< enter formation base{_acyclic = Just Plausible, _maxLoops = 0})+        `shouldThrow` (\e -> "already inside" `isInfixOf` show (e :: SomeException))++  describe "enters a fork by the site its entry names" $ do+    let fork :: Binding -> Expression+        fork rho = ExFormation [rho, BiLambda (Function "L_fk"), BiTau (AtLabel "site🌵") (ExFormation [BiDelta (BtOne "01")]), BiTau (AtLabel "on🌵") (ExFormation [BiLambda (FnSymbol 3)])]+        inner :: Expression+        inner = ExFormation [BiTau (AtLabel "ok") (ExFormation [BiLambda (FnSymbol 1)])]+        outer :: Expression+        outer = ExFormation [BiTau (AtLabel "left🌵") inner, BiTau (AtLabel "ok") (ExFormation [BiLambda (FnSymbol 2)])]+        sited :: (ReduceContext -> IO a) -> IO a+        sited act = withLambdasOf "- λ: L_fk\n  site: $.site🌵\n  𝑛: ⟦ λ ⤍ 𝜎 ⟧\n" $ \file -> do+          entries <- readLambdas file+          base <- defaultReduceContext ExRoot+          act base{_symbolic = entries, _acyclic = Just Plausible, _maxLoops = 0}+    it "enters a fork whose ρ is a part of the ρ of the fork above it" $ sited $ \base -> do+      ctx <- enter (fork (BiTau AtRho inner)) =<< enter (fork (BiTau AtRho outer)) base+      length (concat ctx._entered) `shouldBe` 2+    it "cuts a fork whose ρ is the ρ of the fork above it" $ sited $ \base ->+      (enter (fork (BiTau AtRho outer)) =<< enter (fork (BiTau AtRho outer)) base)+        `shouldThrow` (\e -> "already inside" `isInfixOf` show (e :: SomeException))+    it "cuts a fork whose ρ holds the ρ of the fork above it" $ sited $ \base ->+      (enter (fork (BiTau AtRho outer)) =<< enter (fork (BiTau AtRho inner)) base)+        `shouldThrow` (\e -> "already inside" `isInfixOf` show (e :: SomeException))+    it "cuts a fork whose ρ is void" $ sited $ \base ->+      (enter (fork (BiVoid AtRho)) =<< enter (fork (BiTau AtRho outer)) base)         `shouldThrow` (\e -> "already inside" `isInfixOf` show (e :: SomeException))    describe "places a formation among the objects of the world" $ do
test/ParserSpec.hs view
@@ -8,6 +8,7 @@ module ParserSpec where  import AST+import Bytes (numToBts) import Control.Exception (SomeException, displayException, try) import Control.Monad (forM_) import Data.Either (fromLeft, isLeft, isRight)@@ -50,6 +51,16 @@  spec :: Spec spec = do+  describe "parse a label with a leading sign, the way EO names a test" $+    test+      parseExpression+      [ ("⟦ +foo ↦ Φ.x ⟧", Just (ExFormation [BiTau (AtLabel "+foo") (ExDispatch ExRoot (AtLabel "x"))]))+      , ("⟦ -bar ↦ ∅ ⟧", Just (ExFormation [BiVoid (AtLabel "-bar")]))+      , ("⟦ x ↦ ξ.+foo ⟧", Just (ExFormation [BiTau (AtLabel "x") (ExDispatch ExXi (AtLabel "+foo"))]))+      , ("⟦ x ↦ -5 ⟧", Just (ExFormation [BiTau (AtLabel "x") (DataNumber (numToBts (-5)))]))+      , ("⟦ +Foo ↦ Φ.x ⟧", Nothing)+      ]+   describe "parse expression" $     test       parseExpression
test/PrinterSpec.hs view
@@ -9,6 +9,7 @@ import Bytes (numToBts) import Control.Monad (forM_) import Data.Map.Strict qualified as Map+import Data.Text qualified as T import Encoding (Encoding (..)) import Grown (Grown (..)) import Lining (LineFormat (..))@@ -62,6 +63,13 @@           it desc (printExpression' expr (SWEET, ASCII, SINGLELINE, defaultMargin) `shouldBe` expected)       ) +  it "prints a formation of many named voids in linear time" $ do+    let voids = [BiVoid (AtLabel (T.pack ("a" ++ show i))) | i <- [1 .. 50000 :: Int]]+    printExpression'+      (ExFormation [BiTau (AtLabel "x") (ExFormation voids)])+      (SWEET, ASCII, SINGLELINE, defaultMargin)+      `shouldContain` "a50000"+   describe "printExpression with ASCII reads a bytes meta back" $     forM_       [("d1", "d1"), ("d_Z-9", "d_Z-9"), ("dbytes", "dbytes")]@@ -463,6 +471,11 @@       , ("Φ.bool(v ↦ ⟦ x ↦ ∅, λ ⤍ L_fork ⟧)", SWEET, UNICODE, "Φ.bool( v ↦ ⟦ x ↦ ∅, λ ⤍ L_fork ⟧ )")       , ("Φ.bool(v ↦ ⟦ x ↦ ∅, y ↦ ξ ⟧)", SWEET, UNICODE, "Φ.bool( v ↦ ⟦ x ↦ ∅, y ↦ ξ ⟧ )")       , ("⟦ x ↦ ξ.a ⟧", SALTY, UNICODE, "⟦ x ↦ ξ.a ⟧")+      , ("⟦ x ↦ ⟦ a ↦ ∅, Δ ⤍ 00-, b ↦ ∅ ⟧ ⟧", SWEET, UNICODE, "⟦ x(a) ↦ ⟦ Δ ⤍ 00-, b ↦ ∅ ⟧ ⟧")+      , ("⟦ x ↦ ⟦ a ↦ ∅, Δ ⤍ 00-, b ↦ ∅ ⟧ ⟧", SALTY, UNICODE, "⟦ x ↦ ⟦ a ↦ ∅, Δ ⤍ 00-, b ↦ ∅ ⟧ ⟧")+      , ("⟦ x ↦ ⟦ a ↦ ∅, λ ⤍ Fn, b ↦ ∅ ⟧ ⟧", SWEET, UNICODE, "⟦ x(a) ↦ ⟦ λ ⤍ Fn, b ↦ ∅ ⟧ ⟧")+      , ("⟦ x ↦ ⟦ a ↦ ∅, ρ ↦ ∅, Δ ⤍ 00-, b ↦ ∅, c ↦ ξ ⟧ ⟧", SWEET, UNICODE, "⟦ x(a, ρ) ↦ ⟦ Δ ⤍ 00-, b ↦ ∅, c ↦ ξ ⟧ ⟧")+      , ("⟦ x ↦ ⟦ a ↦ ∅, b ↦ ∅, Δ ⤍ 00- ⟧ ⟧", SWEET, UNICODE, "⟦ x(a, b) ↦ 00-:Δ ⟧")       , ("⟦ Δ ⤍ FF-AA ⟧", SALTY, ASCII, "[[ D> FF-AA ]]")       ]       ( \(src, sugar, encoding, expected) ->
test/XMIRSpec.hs view
@@ -554,6 +554,9 @@       void (parseXMIRThrows "<object><o name=\"app\"><o name=\"+works\"/></o></object>" >>= xmirToPhi)     it "accepts a formation named with a minus, the way EO names a test that must fail" $       void (parseXMIRThrows "<object><o name=\"app\"><o name=\"-stops\"/></o></object>" >>= xmirToPhi)+    it "prints 𝜑 of a test name that reads back the same" $ do+      expr <- parseXMIRThrows "<object><o name=\"app\"><o name=\"+works\" base=\"Φ.x\"/><o name=\"-stops\"/></o></object>" >>= xmirToPhi+      parseExpressionThrows (printExpression expr) `shouldReturn` expr     it "still refuses the rest of the name when it is not a label" $       (parseXMIRThrows "<object><o name=\"app\"><o name=\"+Works\"/></o></object>" >>= xmirToPhi)         `shouldThrow` anyException