Ejemplo n.º 1
0
def mk_symb(s):
    """
    Parameters
        s : string
    """
    t = ErlangTerm()
    t.type = ErlangTerm.SYMBOLIC_VARIABLE
    t.value = s
    return t
Ejemplo n.º 2
0
def mk_float(f):
    """
    Parameters
        f : float
    """
    t = ErlangTerm()
    t.type = ErlangTerm.FLOAT
    t.value = str(f)
    return t
Ejemplo n.º 3
0
def mk_alias(s):
    """
    Parameters
        s : string
    """
    t = ErlangTerm()
    t.type = ErlangTerm.SUBTERM
    t.value = s
    return t
Ejemplo n.º 4
0
def mk_int(i):
    """
    Parameters
        i : int
    """
    t = ErlangTerm()
    t.type = ErlangTerm.INTEGER
    t.value = str(i)
    return t
Ejemplo n.º 5
0
def mk_int(i):
    """
    Parameters
        i : int
    """
    t = ErlangTerm()
    t.type = ErlangTerm.INTEGER
    t.value = str(i)
    return t
Ejemplo n.º 6
0
def mk_symb(s):
    """
    Parameters
        s : string
    """
    t = ErlangTerm()
    t.type = ErlangTerm.SYMBOLIC_VARIABLE
    t.value = s
    return t
Ejemplo n.º 7
0
def mk_alias(s):
    """
    Parameters
        s : string
    """
    t = ErlangTerm()
    t.type = ErlangTerm.SUBTERM
    t.value = s
    return t
Ejemplo n.º 8
0
def mk_float(f):
    """
    Parameters
        f : float
    """
    t = ErlangTerm()
    t.type = ErlangTerm.FLOAT
    t.value = str(f)
    return t
Ejemplo n.º 9
0
 def toFloat(self, term):
     s = simplify(term)
     t = ErlangTerm()
     t.type = ErlangTerm.FLOAT
     t.value = str(float(s.numerator_as_long()) / float(s.denominator_as_long()))
     return t
Ejemplo n.º 10
0
 def toInt(self, term):
     t = ErlangTerm()
     t.type = ErlangTerm.INTEGER
     t.value = str(simplify(term).as_long())
     return t
Ejemplo n.º 11
0
 def toSymbolic(self, s):
     t = ErlangTerm()
     t.type = ErlangTerm.SYMBOLIC_VARIABLE
     t.value = s
     return t
Ejemplo n.º 12
0
 def toFloat(self, term):
     s = simplify(term)
     t = ErlangTerm()
     t.type = ErlangTerm.FLOAT
     t.value = str(float(s.numerator_as_long()) / float(s.denominator_as_long()))
     return t
Ejemplo n.º 13
0
 def toInt(self, term):
     t = ErlangTerm()
     t.type = ErlangTerm.INTEGER
     t.value = str(simplify(term).as_long())
     return t
Ejemplo n.º 14
0
 def toSymbolic(self, s):
     t = ErlangTerm()
     t.type = ErlangTerm.SYMBOLIC_VARIABLE
     t.value = s
     return t