示例#1
0
 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(')')
示例#2
0
 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()
示例#3
0
 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()
示例#4
0
 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(' &#8866; ') & t
示例#5
0
def label_to_html(label):
    if label == axiomLabel:
        return html.raw_html('Id')
    elif label == tensorLeftLabel:
        return html.raw_html('&otimes; L')
    elif label == implicationLeftLabel:
        return html.raw_html('&rarr; L')
    elif label == monadLeftLabel:
        return html.raw_html('&loz; L')
    elif label == tensorRightLabel:
        return html.raw_html('&otimes; R')
    elif label == implicationRightLabel:
        return html.raw_html('&rarr; R')
    elif label == monadRightLabel:
        return html.raw_html('&loz; R')