예제 #1
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
예제 #2
0
 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(
         ' &sol; ') & ant_wrapper(self.antecedent.to_html())
예제 #3
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 == leftImplicationLeftLabel:
        return html.raw_html('&bsol; L')
    elif label == rightImplicationLeftLabel:
        return html.raw_html('&sol; L')
    elif label == monadLeftLabel:
        return html.raw_html('&loz; L')
    elif label == tensorRightLabel:
        return html.raw_html('&otimes; R')
    elif label == leftImplicationRightLabel:
        return html.raw_html('&bsol; R')
    elif label == rightImplicationRightLabel:
        return html.raw_html('&sol; R')
    elif label == monadRightLabel:
        return html.raw_html('&loz; R')
예제 #4
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')
예제 #5
0
 def to_html(self):
     ty_body = type(self.body)
     if ty_body == Atom or ty_body == Variable:
         return html.raw_html('&loz;') & self.body.to_html()
     else:
         return html.raw_html('&loz;') & html.text('(') & self.body.to_html() & html.text(')')
예제 #6
0
 def to_html(self):
     return self.monad.to_html() + html.raw_html(
         ' &starf; (') + self.function.to_html() + html.text(')')
예제 #7
0
 def to_html(self):
     return html.raw_html('&eta;(') + self.body.to_html() + html.text(')')
예제 #8
0
 def to_html(self):
     return html.raw_html('&lang;') + self.left.to_html() + html.text(
         ', ') + self.right.to_html() + html.raw_html('&rang;')
예제 #9
0
 def to_html(self):
     return html.text('(') + html.raw_html(
         '&lambda; ') + self.variable.to_html() + html.text(
             ' . ') + self.body.to_html() + html.text(')')