Example #1
0
def mk_symb(s):
    """
    Parameters
        s : string
    """
    t = ErlangTerm()
    t.type = ErlangTerm.SYMBOLIC_VARIABLE
    t.value = s
    return t
Example #2
0
def mk_float(f):
    """
    Parameters
        f : float
    """
    t = ErlangTerm()
    t.type = ErlangTerm.FLOAT
    t.value = str(f)
    return t
Example #3
0
def mk_alias(s):
    """
    Parameters
        s : string
    """
    t = ErlangTerm()
    t.type = ErlangTerm.SUBTERM
    t.value = s
    return t
Example #4
0
def mk_int(i):
    """
    Parameters
        i : int
    """
    t = ErlangTerm()
    t.type = ErlangTerm.INTEGER
    t.value = str(i)
    return t
Example #5
0
def mk_int(i):
    """
    Parameters
        i : int
    """
    t = ErlangTerm()
    t.type = ErlangTerm.INTEGER
    t.value = str(i)
    return t
Example #6
0
def mk_symb(s):
    """
    Parameters
        s : string
    """
    t = ErlangTerm()
    t.type = ErlangTerm.SYMBOLIC_VARIABLE
    t.value = s
    return t
Example #7
0
def mk_alias(s):
    """
    Parameters
        s : string
    """
    t = ErlangTerm()
    t.type = ErlangTerm.SUBTERM
    t.value = s
    return t
Example #8
0
def mk_float(f):
    """
    Parameters
        f : float
    """
    t = ErlangTerm()
    t.type = ErlangTerm.FLOAT
    t.value = str(f)
    return t
Example #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
Example #10
0
 def toInt(self, term):
     t = ErlangTerm()
     t.type = ErlangTerm.INTEGER
     t.value = str(simplify(term).as_long())
     return t
Example #11
0
 def toSymbolic(self, s):
     t = ErlangTerm()
     t.type = ErlangTerm.SYMBOLIC_VARIABLE
     t.value = s
     return t
Example #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
Example #13
0
 def toInt(self, term):
     t = ErlangTerm()
     t.type = ErlangTerm.INTEGER
     t.value = str(simplify(term).as_long())
     return t
Example #14
0
 def toSymbolic(self, s):
     t = ErlangTerm()
     t.type = ErlangTerm.SYMBOLIC_VARIABLE
     t.value = s
     return t