phino-0.0.152: test-resources/evaluate-packs/joins-a-fork-whose-branches-a-rewrite-brought-to-one-shape.yaml
# SPDX-FileCopyrightText: Copyright (c) 2025 Objectionary.com
# SPDX-License-Identifier: MIT
---
# yamllint disable rule:line-length
# The very fork that does not join, with a 'rewrite' block in front of the
# join: the second branch carries an 'x' the first does not, and a rule of the
# entry drops it, so the two have one shape once they are compared and the
# fork answers their join. Each 'rewrite' line binds a meta of its own, which
# the protocol writes like a 'symbolize' one, commented with the meta it was
# rewritten from; a branch no rule matches is bound as it was (#1409).
symbolic: |
- Ξ»: L_fork
morph:
π1: $.a
π2: $.b
rewrite:
π3:
of: π1
rules: &shape
- name: no-x
pattern: β¦ !B1, x β¦ β¦β§, !B2 β§
result: β¦ !B1, !B2 β§
π4:
of: π2
rules: *shape
join:
π5: [π3, π4]
π: π5
location: 'Q.y'
input: 'β¦ y β¦ β¦ a β¦ β¦ Ο β¦ β¦ Ξ» β€ π1 β§ β§, b β¦ β¦ Ο β¦ β¦ Ξ» β€ π2 β§, x β¦ β¦β§ β§, Ξ» β€ L_fork β§.Ο β§'
result: 'π3:Ξ»'
protocol: |
π(Ξ¦.y):
πΌ(L_fork):
π1Β·1 := π1:Ξ»:Ο # π(ΞΎ.a)
π2Β·1 := β¦ Ο β¦ π2:Ξ», x β¦ β¦β§ β§ # π(ΞΎ.b)
π3Β·1 := π1Β·1 # π1
π4Β·1 := π2:Ξ»:Ο # π2
π»(π3:Ξ») β { π»(π1:Ξ»), π»(π2:Ξ») }
π5Β·1 := π3:Ξ»:Ο # [π3, π4]
πΒ·1Β·1 := π5Β·1 # π
πΒ·1Β·2 := π5Β·1 # π(πΒ·1Β·1)