![]() |
YAP 7.1.0
|
#include <stdlib.h>
#include "inline-only.h"
Go to the source code of this file.
Macros | |
#define | Int_MAX ((Int)((~((CELL)0)) >> 1)) |
#define | Int_MIN (-Int_MAX - (CELL)1) |
#define | PLMAXTAGGEDINT (MAX_ABS_INT - ((CELL)1)) |
#define | PLMINTAGGEDINT (-MAX_ABS_INT) |
#define | PLMAXINT Int_MAX |
#define | PLMININT Int_MIN |
#define | INFINITY (1.0 / 0.0) |
#define | NAN (0.0 / 0.0) |
#define | FlIsInt(X) (FALSE) |
#define | MkEvalFl(X) (FlIsInt(X) ? MkIntTerm((Int)(X)) : MkFloatTerm(X)) |
#define | REvalInt(I) |
#define | REvalFl(F) |
#define | REvalError() { return (FError); } |
#define | FL(X) ((double)(X)) |
#define | Yap_EvalError(id, t, ...) Yap_EvalError__(__FILE__, __FUNCTION__, __LINE__, id, t, __VA_ARGS__) |
#define | Yap_ArithError(id, t, ...) Yap_ThrowError__(__FILE__, __FUNCTION__, __LINE__, id, t, __VA_ARGS__) |
#define | Yap_BinError(id) Yap_ThrowError__(true,__FILE__, __FUNCTION__, __LINE__, id, 0L, "") |
#define | Yap_AbsmiError(id) Yap_ThrowError__(true,__FILE__, __FUNCTION__, __LINE__, id, 0L, "") |
#define | Yap_MathException() Yap_MathException__(PASS_REGS1) |
#define | Yap_InnerEval(x) Yap_InnerEval__(x PASS_REGS) |
#define | Yap_Eval(x) Yap_Eval__(x PASS_REGS) |
#define | Yap_FoundArithError() Yap_FoundArithError__(PASS_REGS1) |
#define | RINT(v) return (MkIntegerTerm(v)) |
#define | RFLOAT(v) return (MkFloatTerm(v)) |
#define | RBIG(v) return (Yap_MkBigIntTerm(v)) |
#define | RERROR() |
#define | Yap_gmp_cmp_float_big(D, T) (-Yap_gmp_cmp_big_float(T, D)) |
#define | Yap_gmp_tcmp_float_big(D, T) (-Yap_gmp_tcmp_big_float(T, D)) |
#define | Yap_Mk64IntegerTerm(i) __Yap_Mk64IntegerTerm((i)PASS_REGS) |
#define | PI 3.14159265358979323846 |
#define | M_E 2.7182818284590452354 |
#define | DBL_EPSILON 0.00000000000000022204 |
Enumerations | |
enum | arith0_op { op_pi , op_e , op_epsilon , op_inf , op_nan , op_random , op_cputime , op_heapused , op_localsp , op_globalsp , op_b , op_env , op_tr , op_stackfree } |
constant operators More... | |
enum | arith1_op { op_uplus , op_uminus , op_unot , op_exp , op_log , op_log10 , op_sqrt , op_sin , op_cos , op_tan , op_sinh , op_cosh , op_tanh , op_asin , op_acos , op_atan , op_asinh , op_acosh , op_atanh , op_floor , op_ceiling , op_round , op_truncate , op_integer , op_float , op_abs , op_lsb , op_msb , op_popcount , op_ffracp , op_fintp , op_sign , op_lgamma , op_erf , op_erfc , op_rational , op_rationalize , op_random1 } |
unary operators More... | |
enum | arith2_op { op_plus , op_minus , op_times , op_fdiv , op_mod , op_rem , op_div , op_idiv , op_sll , op_slr , op_and , op_or , op_xor , op_atan2 , op_power , op_power2 , op_gcd , op_min , op_max , op_rdiv } |
binary operators More... | |
Functions | |
yap_error_number | Yap_MathException__ (USES_REGS1) |
Functor | EvalArg (Term) |
void | Yap_InitConstExps (void) |
void | Yap_InitUnaryExps (void) |
void | Yap_InitBinaryExps (void) |
int | Yap_ReInitConstExps (void) |
int | Yap_ReInitUnaryExps (void) |
int | Yap_ReInitBinaryExps (void) |
Term | Yap_eval_atom (Int) |
Term | Yap_eval_unary (Int, Term) |
Term | Yap_eval_binary (Int, Term, Term) |
Term | Yap_InnerEval__ (Term USES_REGS) |
void | Yap_EvalError__ (const char *, const char *, int, yap_error_number, Term,...) |
INLINE_ONLY Term | Yap_Eval__ (Term t USES_REGS) |
Atom | Yap_NameOfUnaryOp (int i) |
Atom | Yap_NameOfBinaryOp (int i) |
char * | Yap_mpz_to_string (MP_INT *b, char *s, size_t sz, int base) |
Term | Yap_gmq_rdiv_int_int (Int, Int) |
Term | Yap_gmq_rdiv_int_big (Int, Term) |
Term | Yap_gmq_rdiv_big_int (Term, Int) |
Term | Yap_gmq_rdiv_big_big (Term, Term) |
Term | Yap_gmp_add_ints (Int, Int) |
Term | Yap_gmp_sub_ints (Int, Int) |
Term | Yap_gmp_mul_ints (Int, Int) |
Term | Yap_gmp_sll_ints (Int, Int) |
Term | Yap_gmp_add_int_big (Int, Term) |
Term | Yap_gmp_sub_int_big (Int, Term) |
Term | Yap_gmp_sub_big_int (Term, Int) |
Term | Yap_gmp_mul_int_big (Int, Term) |
Term | Yap_gmp_div_int_big (Int, Term) |
Term | Yap_gmp_div_big_int (Term, Int) |
Term | Yap_gmp_div2_big_int (Term, Int) |
Term | Yap_gmp_fdiv_int_big (Int, Term) |
Term | Yap_gmp_fdiv_big_int (Term, Int) |
Term | Yap_gmp_and_int_big (Int, Term) |
Term | Yap_gmp_ior_int_big (Int, Term) |
Term | Yap_gmp_xor_int_big (Int, Term) |
Term | Yap_gmp_sll_big_int (Term, Int) |
Term | Yap_gmp_add_big_big (Term, Term) |
Term | Yap_gmp_sub_big_big (Term, Term) |
Term | Yap_gmp_mul_big_big (Term, Term) |
Term | Yap_gmp_div_big_big (Term, Term) |
Term | Yap_gmp_div2_big_big (Term, Term) |
Term | Yap_gmp_fdiv_big_big (Term, Term) |
Term | Yap_gmp_and_big_big (Term, Term) |
Term | Yap_gmp_ior_big_big (Term, Term) |
Term | Yap_gmp_xor_big_big (Term, Term) |
Term | Yap_gmp_mod_big_big (Term, Term) |
Term | Yap_gmp_mod_big_int (Term, Int) |
Term | Yap_gmp_mod_int_big (Int, Term) |
Term | Yap_gmp_rem_big_big (Term, Term) |
Term | Yap_gmp_rem_big_int (Term, Int) |
Term | Yap_gmp_rem_int_big (Int, Term) |
Term | Yap_gmp_exp_int_int (Int, Int) |
Term | Yap_gmp_exp_int_big (Int, Term) |
Term | Yap_gmp_exp_big_int (Term, Int) |
Term | Yap_gmp_exp_big_big (Term, Term) |
Term | Yap_gmp_gcd_int_big (Int, Term) |
Term | Yap_gmp_gcd_big_big (Term, Term) |
Term | Yap_gmp_big_from_64bits (YAP_LONG_LONG) |
Term | Yap_gmp_float_to_big (Float) |
Term | Yap_gmp_float_to_rational (Float) |
Term | Yap_gmp_float_rationalize (Float) |
Float | Yap_gmp_to_float (Term) |
Term | Yap_gmp_add_float_big (Float, Term) |
Term | Yap_gmp_sub_float_big (Float, Term) |
Term | Yap_gmp_sub_big_float (Term, Float) |
Term | Yap_gmp_mul_float_big (Float, Term) |
Term | Yap_gmp_fdiv_float_big (Float, Term) |
Term | Yap_gmp_fdiv_big_float (Term, Float) |
int | Yap_gmp_cmp_big_int (Term, Int) |
int | Yap_gmp_cmp_int_big (Int, Term) |
int | Yap_gmp_cmp_big_float (Term, Float) |
int | Yap_gmp_cmp_big_big (Term, Term) |
int | Yap_gmp_tcmp_big_int (Term, Int) |
int | Yap_gmp_tcmp_int_big (Int, Term) |
int | Yap_gmp_tcmp_big_float (Term, Float) |
int | Yap_gmp_tcmp_big_big (Term, Term) |
Term | Yap_gmp_neg_int (Int) |
Term | Yap_gmp_abs_big (Term) |
Term | Yap_gmp_neg_big (Term) |
Term | Yap_gmp_unot_big (Term) |
Term | Yap_gmp_floor (Term) |
Term | Yap_gmp_ceiling (Term) |
Term | Yap_gmp_round (Term) |
Term | Yap_gmp_trunc (Term) |
Term | Yap_gmp_float_fractional_part (Term) |
Term | Yap_gmp_float_integer_part (Term) |
Term | Yap_gmp_sign (Term) |
Term | Yap_gmp_lsb (Term) |
Term | Yap_gmp_msb (Term) |
Term | Yap_gmp_popcount (Term) |
char * | Yap_gmp_to_string (Term, char *, size_t, int) |
size_t | Yap_gmp_to_size (Term, int) |
int | Yap_term_to_existing_big (Term, MP_INT *) |
int | Yap_term_to_existing_rat (Term, MP_RAT *) |
void | Yap_gmp_set_bit (Int i, Term t) |
INLINE_ONLY Term | __Yap_Mk64IntegerTerm (YAP_LONG_LONG USES_REGS) |
INLINE_ONLY Term | __Yap_Mk64IntegerTerm (YAP_LONG_LONG i USES_REGS) |
Int | Yap_msb (Int inp USES_REGS) |
#define MkEvalFl | ( | X | ) | (FlIsInt(X) ? MkIntTerm((Int)(X)) : MkFloatTerm(X)) |
#define REvalFl | ( | F | ) |
#define REvalInt | ( | I | ) |
#define Yap_AbsmiError | ( | id | ) | Yap_ThrowError__(true,__FILE__, __FUNCTION__, __LINE__, id, 0L, "") |
#define Yap_ArithError | ( | id, | |
t, | |||
... | |||
) | Yap_ThrowError__(__FILE__, __FUNCTION__, __LINE__, id, t, __VA_ARGS__) |
#define Yap_BinError | ( | id | ) | Yap_ThrowError__(true,__FILE__, __FUNCTION__, __LINE__, id, 0L, "") |
#define Yap_EvalError | ( | id, | |
t, | |||
... | |||
) | Yap_EvalError__(__FILE__, __FUNCTION__, __LINE__, id, t, __VA_ARGS__) |
#define Yap_FoundArithError | ( | ) | Yap_FoundArithError__(PASS_REGS1) |
#define Yap_MathException | ( | ) | Yap_MathException__(PASS_REGS1) |
#define Yap_Mk64IntegerTerm | ( | i | ) | __Yap_Mk64IntegerTerm((i)PASS_REGS) |
enum arith0_op |
constant operators
specifies the available arithmetic "constants"
enum arith1_op |
unary operators
specifies the available unary arithmetic operators
INLINE_ONLY Term __Yap_Mk64IntegerTerm | ( | YAP_LONG_LONG i | USES_REGS | ) |
Term Yap_gmp_abs_big | ( | Term | t | ) |
Definition at line 1447 of file gmp_support.c.
Term Yap_gmp_add_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 417 of file gmp_support.c.
Term Yap_gmp_add_float_big | ( | Float | d, |
Term | t | ||
) |
Definition at line 866 of file gmp_support.c.
Term Yap_gmp_add_int_big | ( | Int | i, |
Term | t | ||
) |
Definition at line 115 of file gmp_support.c.
Term Yap_gmp_add_ints | ( | Int | i, |
Int | j | ||
) |
Definition at line 52 of file gmp_support.c.
Term Yap_gmp_and_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 614 of file gmp_support.c.
Term Yap_gmp_and_int_big | ( | Int | i, |
Term | t | ||
) |
Definition at line 307 of file gmp_support.c.
Term Yap_gmp_big_from_64bits | ( | YAP_LONG_LONG | i | ) |
Definition at line 1027 of file gmp_support.c.
Term Yap_gmp_ceiling | ( | Term | t | ) |
Definition at line 1499 of file gmp_support.c.
int Yap_gmp_cmp_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 1266 of file gmp_support.c.
int Yap_gmp_cmp_big_float | ( | Term | t, |
Float | d | ||
) |
Definition at line 1248 of file gmp_support.c.
int Yap_gmp_cmp_big_int | ( | Term | t, |
Int | i | ||
) |
Definition at line 1222 of file gmp_support.c.
int Yap_gmp_cmp_int_big | ( | Int | i, |
Term | t | ||
) |
Definition at line 1235 of file gmp_support.c.
Term Yap_gmp_div2_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 577 of file gmp_support.c.
Term Yap_gmp_div2_big_int | ( | Term | t, |
Int | i | ||
) |
Definition at line 276 of file gmp_support.c.
Term Yap_gmp_div_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 535 of file gmp_support.c.
Term Yap_gmp_div_big_int | ( | Term | t, |
Int | i | ||
) |
Definition at line 233 of file gmp_support.c.
Term Yap_gmp_div_int_big | ( | Int | i, |
Term | t | ||
) |
Definition at line 214 of file gmp_support.c.
Term Yap_gmp_exp_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 1001 of file gmp_support.c.
Term Yap_gmp_exp_big_int | ( | Term | t, |
Int | i | ||
) |
Definition at line 960 of file gmp_support.c.
Term Yap_gmp_exp_int_big | ( | Int | i, |
Term | t | ||
) |
Definition at line 987 of file gmp_support.c.
Term Yap_gmp_exp_int_int | ( | Int | i1, |
Int | i2 | ||
) |
Definition at line 950 of file gmp_support.c.
Term Yap_gmp_fdiv_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 1190 of file gmp_support.c.
Term Yap_gmp_fdiv_big_float | ( | Term | t, |
Float | d | ||
) |
Definition at line 936 of file gmp_support.c.
Term Yap_gmp_fdiv_big_int | ( | Term | t2, |
Int | i1 | ||
) |
Definition at line 1163 of file gmp_support.c.
Term Yap_gmp_fdiv_float_big | ( | Float | d, |
Term | t | ||
) |
Definition at line 922 of file gmp_support.c.
Term Yap_gmp_fdiv_int_big | ( | Int | i1, |
Term | t2 | ||
) |
Definition at line 1136 of file gmp_support.c.
Term Yap_gmp_float_fractional_part | ( | Term | t | ) |
Definition at line 1567 of file gmp_support.c.
Term Yap_gmp_float_integer_part | ( | Term | t | ) |
Definition at line 1587 of file gmp_support.c.
Term Yap_gmp_float_rationalize | ( | Float | dbl | ) |
Definition at line 1421 of file gmp_support.c.
Term Yap_gmp_float_to_big | ( | Float | v | ) |
Definition at line 844 of file gmp_support.c.
Term Yap_gmp_float_to_rational | ( | Float | dbl | ) |
Definition at line 1397 of file gmp_support.c.
Term Yap_gmp_floor | ( | Term | t | ) |
Definition at line 1481 of file gmp_support.c.
Term Yap_gmp_gcd_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 804 of file gmp_support.c.
Term Yap_gmp_gcd_int_big | ( | Int | i, |
Term | t | ||
) |
Definition at line 825 of file gmp_support.c.
Term Yap_gmp_ior_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 635 of file gmp_support.c.
Term Yap_gmp_ior_int_big | ( | Int | i, |
Term | t | ||
) |
Definition at line 324 of file gmp_support.c.
Term Yap_gmp_lsb | ( | Term | t | ) |
Definition at line 1617 of file gmp_support.c.
Term Yap_gmp_mod_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 677 of file gmp_support.c.
Term Yap_gmp_mod_big_int | ( | Term | t, |
Int | i2 | ||
) |
Definition at line 698 of file gmp_support.c.
Term Yap_gmp_mod_int_big | ( | Int | i1, |
Term | t | ||
) |
Definition at line 714 of file gmp_support.c.
Term Yap_gmp_msb | ( | Term | t | ) |
Definition at line 1634 of file gmp_support.c.
Term Yap_gmp_mul_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 491 of file gmp_support.c.
Term Yap_gmp_mul_float_big | ( | Float | d, |
Term | t | ||
) |
Definition at line 908 of file gmp_support.c.
Term Yap_gmp_mul_int_big | ( | Int | i, |
Term | t | ||
) |
Definition at line 167 of file gmp_support.c.
Term Yap_gmp_mul_ints | ( | Int | i, |
Int | j | ||
) |
Definition at line 94 of file gmp_support.c.
Term Yap_gmp_neg_big | ( | Term | t | ) |
Definition at line 1378 of file gmp_support.c.
Term Yap_gmp_neg_int | ( | Int | i | ) |
Definition at line 1368 of file gmp_support.c.
Term Yap_gmp_popcount | ( | Term | t | ) |
Definition at line 1651 of file gmp_support.c.
Term Yap_gmp_rem_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 754 of file gmp_support.c.
Term Yap_gmp_rem_big_int | ( | Term | t, |
Int | i2 | ||
) |
Definition at line 775 of file gmp_support.c.
Term Yap_gmp_rem_int_big | ( | Int | i1, |
Term | t | ||
) |
Definition at line 791 of file gmp_support.c.
Term Yap_gmp_round | ( | Term | t | ) |
Definition at line 1517 of file gmp_support.c.
void Yap_gmp_set_bit | ( | Int | i, |
Term | t | ||
) |
Definition at line 136 of file gmp_support.c.
Term Yap_gmp_sign | ( | Term | t | ) |
Definition at line 1605 of file gmp_support.c.
Term Yap_gmp_sll_big_int | ( | Term | t, |
Int | i | ||
) |
Definition at line 378 of file gmp_support.c.
Term Yap_gmp_sll_ints | ( | Int | i, |
Int | j | ||
) |
Definition at line 104 of file gmp_support.c.
Term Yap_gmp_sub_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 454 of file gmp_support.c.
Term Yap_gmp_sub_big_float | ( | Term | t, |
Float | d | ||
) |
Definition at line 894 of file gmp_support.c.
Term Yap_gmp_sub_big_int | ( | Term | t, |
Int | i | ||
) |
Definition at line 190 of file gmp_support.c.
Term Yap_gmp_sub_float_big | ( | Float | d, |
Term | t | ||
) |
Definition at line 880 of file gmp_support.c.
Term Yap_gmp_sub_int_big | ( | Int | i, |
Term | t | ||
) |
Definition at line 144 of file gmp_support.c.
Term Yap_gmp_sub_ints | ( | Int | i, |
Int | j | ||
) |
Definition at line 71 of file gmp_support.c.
int Yap_gmp_tcmp_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 1336 of file gmp_support.c.
int Yap_gmp_tcmp_big_float | ( | Term | t, |
Float | d | ||
) |
Definition at line 1330 of file gmp_support.c.
int Yap_gmp_tcmp_big_int | ( | Term | t, |
Int | i | ||
) |
Definition at line 1306 of file gmp_support.c.
int Yap_gmp_tcmp_int_big | ( | Int | i, |
Term | t | ||
) |
Definition at line 1318 of file gmp_support.c.
Float Yap_gmp_to_float | ( | Term | t | ) |
Definition at line 853 of file gmp_support.c.
size_t Yap_gmp_to_size | ( | Term | t, |
int | base | ||
) |
Definition at line 1721 of file gmp_support.c.
char * Yap_gmp_to_string | ( | Term | t, |
char * | s, | ||
size_t | sz, | ||
int | base | ||
) |
Definition at line 1681 of file gmp_support.c.
Term Yap_gmp_trunc | ( | Term | t | ) |
Definition at line 1544 of file gmp_support.c.
Term Yap_gmp_unot_big | ( | Term | t | ) |
Definition at line 1466 of file gmp_support.c.
Term Yap_gmp_xor_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 656 of file gmp_support.c.
Term Yap_gmp_xor_int_big | ( | Int | i, |
Term | t | ||
) |
Definition at line 361 of file gmp_support.c.
Term Yap_gmq_rdiv_big_big | ( | Term | t1, |
Term | t2 | ||
) |
Definition at line 1105 of file gmp_support.c.
Term Yap_gmq_rdiv_big_int | ( | Term | t1, |
Int | i2 | ||
) |
Definition at line 1081 of file gmp_support.c.
Term Yap_gmq_rdiv_int_big | ( | Int | i1, |
Term | t2 | ||
) |
Definition at line 1059 of file gmp_support.c.
Term Yap_gmq_rdiv_int_int | ( | Int | i1, |
Int | i2 | ||
) |
Definition at line 1044 of file gmp_support.c.
char * Yap_mpz_to_string | ( | MP_INT * | b, |
char * | s, | ||
size_t | sz, | ||
int | base | ||
) |
Definition at line 1668 of file gmp_support.c.
int Yap_term_to_existing_big | ( | Term | t, |
MP_INT * | b | ||
) |
Definition at line 1737 of file gmp_support.c.
int Yap_term_to_existing_rat | ( | Term | t, |
MP_RAT * | b | ||
) |
Definition at line 1755 of file gmp_support.c.