Exemple #1
0
    OpetopicTree
from opetopy.UnnamedOpetope import Graft as OptGraft
from opetopy.UnnamedOpetope import Shift as OptShift

# Derivation of ω
omega = OptGraft(OptShift(OpetopicInteger(2)), OpetopicInteger(2),
                 address([['*']]))

# Faster way:
# >>> omega = OpetopicTree([None, [None, None]])

# Derivation of a
classic = Point(None, "a")  # type: RuleInstance

# Derivation of f
classic = Graft(classic, pastingDiagram(Arrow(), {address([], 0): "a"}))
classic = Shift(classic, "a", "f")

# Derivation of α
classic = Graft(
    classic,
    pastingDiagram(OpetopicInteger(2), {
        address([], 1): "f",
        address(['*']): "f"
    }))
classic = Shift(classic, "f", "α")

# Derivation of β
classic = Graft(
    classic,
    pastingDiagram(OpetopicInteger(3), {
Exemple #2
0
import sys
sys.path.insert(0, "../")

from opetopy.UnnamedOpetope import address, Arrow, OpetopicInteger
from opetopy.UnnamedOpetopicSet import Graft, pastingDiagram, Point, \
    RuleInstance, Shift
from opetopy.UnnamedOpetopicCategory import TFill

# Derive points
proof = Point(None, ["a", "b", "c"])  # type: RuleInstance

# Derive f
proof = Graft(
    proof, pastingDiagram(
        Arrow(),
        {
            address('*'): "a"
        }))
proof = Shift(proof, "b", "f")

# Derive g
proof = Graft(
    proof, pastingDiagram(
        Arrow(),
        {
            address('*'): "b"
        }))
proof = Shift(proof, "c", "g")

# Derive the composition cells
proof = Graft(
Exemple #3
0
import sys
sys.path.insert(0, "../")

from opetopy.UnnamedOpetopicSet import Graft, pastingDiagram, Point, \
    RuleInstance, Shift
from opetopy.UnnamedOpetope import address, Arrow

ar = Point(None, "a")  # type: RuleInstance
ar = Point(ar, "b")
ar = Graft(ar, pastingDiagram(Arrow(), {address([], 0): "a"}))
ar = Shift(ar, "b", "f")

print(ar.eval())