def to_html(self): hyps = [h.to_html() for h in self.hypotheses] if self.left_focus >= 0 and self.left_focus < len(self.hypotheses): hyps[self.left_focus] = (html.span() % {'style': 'color: red'}) << hyps[self.left_focus] t = self.theorem.to_html() else: t = (html.span() % {'style': 'color: red'}) << self.theorem.to_html() left = html.text(', ').intersperse(hyps) return left & html.raw_html(' ⊢ ') & t
def to_html(self): ty_ant = type(self.antecedent) ty_cons = type(self.consequence) if ty_ant == Atom or ty_ant == Variable or ty_ant == Monad: ant_wrapper = lambda x: x else: ant_wrapper = lambda x: html.text('(') & x & html.text(')') if ty_cons == Atom or ty_cons == Variable or ty_cons == Monad: cons_wrapper = lambda x: x else: cons_wrapper = lambda x: html.text('(') & x & html.text(')') return cons_wrapper(self.consequence.to_html()) & html.raw_html( ' / ') & ant_wrapper(self.antecedent.to_html())
def label_to_html(label): if label == axiomLabel: return html.raw_html('Id') elif label == tensorLeftLabel: return html.raw_html('⊗ L') elif label == leftImplicationLeftLabel: return html.raw_html('\ L') elif label == rightImplicationLeftLabel: return html.raw_html('/ L') elif label == monadLeftLabel: return html.raw_html('◊ L') elif label == tensorRightLabel: return html.raw_html('⊗ R') elif label == leftImplicationRightLabel: return html.raw_html('\ R') elif label == rightImplicationRightLabel: return html.raw_html('/ R') elif label == monadRightLabel: return html.raw_html('◊ R')
def label_to_html(label): if label == axiomLabel: return html.raw_html('Id') elif label == tensorLeftLabel: return html.raw_html('⊗ L') elif label == implicationLeftLabel: return html.raw_html('→ L') elif label == monadLeftLabel: return html.raw_html('◊ L') elif label == tensorRightLabel: return html.raw_html('⊗ R') elif label == implicationRightLabel: return html.raw_html('→ R') elif label == monadRightLabel: return html.raw_html('◊ R')
def to_html(self): ty_body = type(self.body) if ty_body == Atom or ty_body == Variable: return html.raw_html('◊') & self.body.to_html() else: return html.raw_html('◊') & html.text('(') & self.body.to_html() & html.text(')')
def to_html(self): return self.monad.to_html() + html.raw_html( ' ★ (') + self.function.to_html() + html.text(')')
def to_html(self): return html.raw_html('η(') + self.body.to_html() + html.text(')')
def to_html(self): return html.raw_html('⟨') + self.left.to_html() + html.text( ', ') + self.right.to_html() + html.raw_html('⟩')
def to_html(self): return html.text('(') + html.raw_html( 'λ ') + self.variable.to_html() + html.text( ' . ') + self.body.to_html() + html.text(')')