def fresh_t
import bend-schema-lib@0.4.1.0/core.bend as Coreimport Base
1822# n names no case of the tagged chain s, whose key is k, and the chain ends
1823# in STagEnd{k}: one key for the whole chain.
1824def fresh_t(+k: String, +n: String, s: Schema) -> Bool:
1825 match s:
1826 case STagged{+k2, +m, cs, rest}:
1827 Bool.and(String.eq(k2, k), Bool.and(Bool.not(String.eq(m, n)), fresh_t(k, n, rest)))
1828 case STagEnd{k2}:
1829 String.eq(k2, k)
1830 case _:
1831 False{}