def mk_symb(s): """ Parameters s : string """ t = ErlangTerm() t.type = ErlangTerm.SYMBOLIC_VARIABLE t.value = s return t
def mk_float(f): """ Parameters f : float """ t = ErlangTerm() t.type = ErlangTerm.FLOAT t.value = str(f) return t
def mk_alias(s): """ Parameters s : string """ t = ErlangTerm() t.type = ErlangTerm.SUBTERM t.value = s return t
def mk_int(i): """ Parameters i : int """ t = ErlangTerm() t.type = ErlangTerm.INTEGER t.value = str(i) return t
def mk_int(i): """ Parameters i : int """ t = ErlangTerm() t.type = ErlangTerm.INTEGER t.value = str(i) return t
def mk_symb(s): """ Parameters s : string """ t = ErlangTerm() t.type = ErlangTerm.SYMBOLIC_VARIABLE t.value = s return t
def mk_alias(s): """ Parameters s : string """ t = ErlangTerm() t.type = ErlangTerm.SUBTERM t.value = s return t
def mk_float(f): """ Parameters f : float """ t = ErlangTerm() t.type = ErlangTerm.FLOAT t.value = str(f) return t
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
def toInt(self, term): t = ErlangTerm() t.type = ErlangTerm.INTEGER t.value = str(simplify(term).as_long()) return t
def toSymbolic(self, s): t = ErlangTerm() t.type = ErlangTerm.SYMBOLIC_VARIABLE t.value = s return t
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
def toInt(self, term): t = ErlangTerm() t.type = ErlangTerm.INTEGER t.value = str(simplify(term).as_long()) return t
def toSymbolic(self, s): t = ErlangTerm() t.type = ErlangTerm.SYMBOLIC_VARIABLE t.value = s return t