Named Opetopic Sets, mixed approach¶
Example¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | from opetopy.NamedOpetopicSetM import Glue, Pd, Point, RuleInstance, Shift, Sum
p1 = Shift(Pd(Point("a"), "a"), "f")
p1 = Shift(Pd(p1, "a"), "g")
p2 = Shift(Pd(Point("b"), "b"), "h")
example = Sum(p1, p2) # type: RuleInstance
example = Glue(example, "b", "tf")
example = Glue(example, "b", "tg")
example = Shift(Pd(example, "f"), "ɑ")
example = Glue(example, "b", "ttɑ")
example = Glue(example, "g", "tɑ")
example = Glue(example, "a", "th")
print(example.eval())
print()
print(example.toTex())
|
Documentation¶
Module author: Cédric HT
-
class
opetopy.NamedOpetopicSetM.Degen(p: opetopy.NamedOpetopicSetM.RuleInstance, name: str)[source]¶ A class representing an instance of the
degenrule in a proof tree.-
__init__(p: opetopy.NamedOpetopicSetM.RuleInstance, name: str) → None[source]¶ Creates an instance of the
degenrule and plugs proof treepon the unique premise.
-
-
class
opetopy.NamedOpetopicSetM.DegenShift(p: opetopy.NamedOpetopicSetM.RuleInstance, dname: str, fname: str)[source]¶ A convenient class chaining an instance of the
degenrule with an instance of theshiftrule.-
__init__(p: opetopy.NamedOpetopicSetM.RuleInstance, dname: str, fname: str) → None[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
opetopy.NamedOpetopicSetM.Glue(p: opetopy.NamedOpetopicSetM.RuleInstance, a: str, b: str)[source]¶ A class representing an instance of the
gluerule in a proof tree.-
__init__(p: opetopy.NamedOpetopicSetM.RuleInstance, a: str, b: str) → None[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
opetopy.NamedOpetopicSetM.Graft(p1: opetopy.NamedOpetopicSetM.RuleInstance, p2: opetopy.NamedOpetopicSetM.RuleInstance, a: str)[source]¶ A class representing an instance of the
graftrule in a proof tree.-
__init__(p1: opetopy.NamedOpetopicSetM.RuleInstance, p2: opetopy.NamedOpetopicSetM.RuleInstance, a: str) → None[source]¶ Creates an instance of the
graftrule at variablea, and plugs proof treep1on the first premise, andp2on the second.See: NamedOpetopicSetM.graft().
-
-
class
opetopy.NamedOpetopicSetM.Pd(p: opetopy.NamedOpetopicSetM.RuleInstance, name: str)[source]¶ A class representing an instance of the
pdrule in a proof tree.-
__init__(p: opetopy.NamedOpetopicSetM.RuleInstance, name: str) → None[source]¶ Creates an instance of the
pdrule and plugs proof treepon the unique premise.
-
-
class
opetopy.NamedOpetopicSetM.Point(name: str)[source]¶ A class representing an instance of the
pointrule in a proof tree.
-
class
opetopy.NamedOpetopicSetM.RuleInstance[source]¶ A rule instance of system \(\textbf{OptSet${}^!_m$}\).
-
class
opetopy.NamedOpetopicSetM.Shift(p: opetopy.NamedOpetopicSetM.RuleInstance, name: str)[source]¶ A class representing an instance of the
shiftrule in a proof tree.-
__init__(p: opetopy.NamedOpetopicSetM.RuleInstance, name: str) → None[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
-
class
opetopy.NamedOpetopicSetM.Sum(p1: opetopy.NamedOpetopicSetM.RuleInstance, p2: opetopy.NamedOpetopicSetM.RuleInstance)[source]¶ A class representing an instance of the
sumrule in a proof tree.-
__init__(p1: opetopy.NamedOpetopicSetM.RuleInstance, p2: opetopy.NamedOpetopicSetM.RuleInstance) → None[source]¶ Creates an instance of the
graftrule at variablea, and plugs proof treep1on the first premise, andp2on the second.See: NamedOpetope.graft().
-
-
class
opetopy.NamedOpetopicSetM.Zero[source]¶ A class representing an instance of the
zerorule in a proof tree.
-
opetopy.NamedOpetopicSetM.degen(ocmt: opetopy.NamedOpetope.OCMT, name: str) → opetopy.NamedOpetope.Sequent[source]¶ The \(\textbf{OptSet${}^!_m$}\) \(\texttt{degen}\) rule. Introduces the degenerate pasting diagram on a given variable.
-
opetopy.NamedOpetopicSetM.glue(ocmt: opetopy.NamedOpetope.OCMT, aName: str, bName: str) → opetopy.NamedOpetope.OCMT[source]¶ The \(\textbf{OptSet${}^!_m$}\) \(\texttt{glue}\) rule, which is the same as system \(\textbf{OptSet${}^!$}\)’s \(\texttt{glue}\) rule.
-
opetopy.NamedOpetopicSetM.graft(seqt: opetopy.NamedOpetope.Sequent, seqx: opetopy.NamedOpetope.Sequent, name: str) → opetopy.NamedOpetope.Sequent[source]¶ The \(\textbf{OptSet${}^!_m$}\) \(\texttt{graft}\) rule, which is the same as system \(\textbf{Opt${}^!$}\)’s \(\texttt{graft}\) rule.
-
opetopy.NamedOpetopicSetM.pd(ocmt: opetopy.NamedOpetope.OCMT, name: str) → opetopy.NamedOpetope.Sequent[source]¶ The \(\textbf{OptSet${}^!_m$}\) \(\texttt{pd}\) rule. Introduces the trivial non degenerate pasting diagram on a given variable.
-
opetopy.NamedOpetopicSetM.point(name: str) → opetopy.NamedOpetope.OCMT[source]¶ The \(\textbf{OptSet${}^!_m$}\) \(\texttt{point}\) rule. Introduces a \(0\)-variable with name
x.
-
opetopy.NamedOpetopicSetM.shift(seq: opetopy.NamedOpetope.Sequent, name: str) → opetopy.NamedOpetope.OCMT[source]¶ The \(\textbf{OptSet${}^!_m$}\) \(\texttt{shift}\) rule. Takes a sequent
seqtyping a termtand introduces a new variablexhavingtas \(1\)-source.