# 1 Funciones aritméticas

## 1.1 Funciones sobre números

abs(x) abs x
signum(x) signum x
max(x,y) max x y
min(x,y) min x y
ceiling(x) ceiling x
floor(x) floor x
round(x) round x
lmax(xs) maximum xs
lmin(xs) minimum xs

## 1.2 Funciones sobre enteros

quotient(a,b) quot a b
remainder(a,b) rem a b
divide(a,b) quotRem a b
mod(a,b) mod a b
evenp(a) even a
oddp(a) oddp a
gcd(a,b) gcd a b
lcm(a,b) lcm a b
primep(a) isPrime a

%pi pi
%e exp 1
exp(x) exp x
log(x) log x
sqrt(x) sqrt x
x^y x ** y
sin(x) sin x
cos(x) cos x
tan(x) tan x
asin(x) asin x
acos(x) acos x
atan(x) atan x
sinh(x) sinh x
cosh(x) cosh x
tanh(x) tanh x
asin(x) asinh x
acos(x) acosh x
atan(x) atanh x

true True
false False
p and q p && q
p or q p ,, q
not(p) not p

# 3 Funciones sobre listas

## 3.1 Funciones elementales

cons(x,xs) x:xs
rest(xs) tail(xs)
length(xs) length xs
last(xs) last xs
emptyp(xs) null xs
member(x,ys) elem x ys
append(xs,ys) xs ++ ys
reverse(xs) reverse xs
sort(xs) sort xs
unique(xs) nub xs
second(xs) xs!!1
delete(x,ys) ys \ [x]
rest(xs,k) drop k xs

## 3.2 Listas de comprensión

create_list(f(x),x,xs) [f(x) : x <- xs]
create_list(f(x,y),x,xs,y,ys) [f(x,y) : x <- xs, y <- ys]
makelist(f(k),k,a,b) [f(k): k <- [a..b]]
makelist(k,k,a,b) [a..b]