Пример #1
0
def imply(*args):
    return Node.build(TypeNode.IMP, *args)
Пример #2
0
def iff(*args):
    return Node.build(TypeNode.IFF, *args)
Пример #3
0
def xor(*args):
    return Node.build(TypeNode.XOR, *args) if len(args) > 1 else args[0]
Пример #4
0
def dist(*args):
    return Node.build(TypeNode.DIST, *args)
Пример #5
0
def max(*args):
    return Node.build(TypeNode.MAX, *args) if len(args) > 0 and any(isinstance(a, (Node, Variable)) for a in args) else maxPython(*args)
Пример #6
0
def abs(*args):
    if len(args) == 1 and isinstance(args[0], Node) and args[0].type == TypeNode.SUB:
        return Node.build(TypeNode.DIST, *args[0].sons)
    return Node.build(TypeNode.ABS, *args) if len(args) == 1 and isinstance(args[0], (Node, Variable)) else absPython(*args)