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): ty_left = type(self.left) if ty_left == Atom or ty_left == Variable or ty_left == Monad: return self.left.to_html() & html.raw_html( ' ⊗ ') & self.right.to_html() else: return html.text('(') & self.left.to_html() & html.text( ')') & html.raw_html(' ⊗ ') & self.right.to_html()
def to_html(self): ty_ant = type(self.antecedent) if ty_ant == Atom or ty_ant == Variable or ty_ant == Monad: return self.antecedent.to_html() & html.raw_html( ' → ') & self.consequence.to_html() else: return html.text('(') & self.antecedent.to_html() & html.text( ')') & html.raw_html(' → ') & self.consequence.to_html()
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 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')