コード例 #1
0
 def _id(self, symbol):
     if not isinstance(symbol, Identifier):
         raise FolSemanticError(symbol)
     try:
         return self.ids[symbol], True
     except KeyError:
         i = "%s%d" % ("".join(
             c for c in str(symbol) if c in string.letters + "_")
                       or "i", len(self.ids))
         self.ids[symbol] = i = FolFormula.Identifier(i, symbol.kind)
         return i, True
コード例 #2
0
 class Signature:
     a = FolFormula.Identifier(u'α', 'predicate')
     v = FolFormula.Identifier('v', 'variable')
     u = FolFormula.Identifier('u', 'variable')