cu/bool.h: Boolean Functions
[Data Types]

Enumerations

enum  cu_bool1f_t { CU_BOOL1F_FALSE = 0x0, CU_BOOL1F_TRUE = 0x3, CU_BOOL1F_IDENT = 0x2, CU_BOOL1F_NOT = 0x1 }
enum  cu_bool2f_t {
  CU_BOOL2F_FALSE = 0x0, CU_BOOL2F_TRUE = 0xf, CU_BOOL2F_LEFT = 0xa, CU_BOOL2F_RIGHT = 0xc,
  CU_BOOL2F_NOT_LEFT = 0x5, CU_BOOL2F_NOT_RIGHT = 0x3, CU_BOOL2F_NOR = 0x1, CU_BOOL2F_XOR = 0x6,
  CU_BOOL2F_NAND = 0x7, CU_BOOL2F_AND = 0x8, CU_BOOL2F_IFF = 0x9, CU_BOOL2F_OR = 0xe,
  CU_BOOL2F_AND_NOT = 0x2, CU_BOOL2F_NOT_AND = 0x4, CU_BOOL2F_OR_NOT = 0xb, CU_BOOL2F_NOT_OR = 0xd
}

Functions

int cu_bool_cmp (cu_bool_t x, cu_bool_t y)
cu_bool1f_t cu_bool1f_from_func (cu_bool_t(*f)(cu_bool_t))
cu_bool_t cu_bool1f_apply (cu_bool1f_t f, cu_bool_t x)
cu_bool1f_t cu_bool1f_konst (cu_bool_t x)
cu_bool1f_t cu_bool1f_not (cu_bool1f_t f)
cu_bool1f_t cu_bool1f_compose (cu_bool1f_t f, cu_bool1f_t g)
cu_bool2f_t cu_bool2f_from_func (cu_bool_t(*f)(cu_bool_t, cu_bool_t))
cu_bool_t cu_bool2f_apply (cu_bool2f_t f, cu_bool_t x, cu_bool_t y)
cu_bool1f_t cu_bool2f_apply_left (cu_bool2f_t f, cu_bool_t x)
cu_bool1f_t cu_bool2f_apply_right (cu_bool2f_t f, cu_bool_t y)
cu_bool2f_t cu_bool2f_konst (cu_bool_t v)
cu_bool2f_t cu_bool2f_not (cu_bool2f_t f)
cu_bool2f_t cu_bool2f_not_left (cu_bool2f_t f)
cu_bool2f_t cu_bool2f_not_right (cu_bool2f_t f)
cu_bool2f_t cu_bool2f_swap (cu_bool2f_t f)
cu_bool2f_t cu_bool2f_compose (cu_bool1f_t f, cu_bool2f_t g)
cu_bool2f_t cu_bool2f_compose_left (cu_bool2f_t f, cu_bool1f_t g)
cu_bool2f_t cu_bool2f_compose_right (cu_bool2f_t f, cu_bool1f_t g)

Variables

cu_bool_t(*)(cu_bool_tcu_bool1f_to_func (cu_bool1f_t f)
cu_bool_t(*)(cu_bool_t, cu_bool_tcu_bool2f_to_func (cu_bool2f_t f)

Enumeration Type Documentation

An enumeration of unary boolean functions.

Enumerator:
CU_BOOL1F_FALSE 

λx. false

CU_BOOL1F_TRUE 

λx. true

CU_BOOL1F_IDENT 

λx. x

CU_BOOL1F_NOT 

λx. ¬x

An enumeration of binary boolean functions.

Enumerator:
CU_BOOL2F_FALSE 

λ(x, y). false

CU_BOOL2F_TRUE 

λ(x, y). true

CU_BOOL2F_LEFT 

λ(x, y). x

CU_BOOL2F_RIGHT 

λ(x, y). y

CU_BOOL2F_NOT_LEFT 

λ(x, y). ¬x

CU_BOOL2F_NOT_RIGHT 

λ(x, y). ¬y

CU_BOOL2F_NOR 

λ(x, y). ¬(xy)

CU_BOOL2F_XOR 

λ(x, y). xy

CU_BOOL2F_NAND 

λ(x, y). ¬(xy)

CU_BOOL2F_AND 

λ(x, y). xy

CU_BOOL2F_IFF 

λ(x, y). xy

CU_BOOL2F_OR 

λ(x, y). xy

CU_BOOL2F_AND_NOT 

λ(x, y). x ∧ ¬y

CU_BOOL2F_NOT_AND 

λ(x, y). ¬xy

CU_BOOL2F_OR_NOT 

λ(x, y). x ∨ ¬y

CU_BOOL2F_NOT_OR 

λ(x, y). ¬xy


Function Documentation

cu_bool_t cu_bool1f_apply ( cu_bool1f_t  f,
cu_bool_t  x 
)

Evaluate f(x).

cu_bool1f_t cu_bool1f_compose ( cu_bool1f_t  f,
cu_bool1f_t  g 
)

Return the composition fg.

cu_bool1f_t cu_bool1f_from_func ( cu_bool_t(*)(cu_bool_t f  ) 

Return the enumerated boolean function corresponding to f. f will be called twice upon construction.

cu_bool1f_t cu_bool1f_konst ( cu_bool_t  x  ) 

Return the constant function, λy. x.

cu_bool1f_t cu_bool1f_not ( cu_bool1f_t  f  ) 

Return the function λx. ¬f(x).

cu_bool_t cu_bool2f_apply ( cu_bool2f_t  f,
cu_bool_t  x,
cu_bool_t  y 
)

Evaluate f(x, y).

cu_bool1f_t cu_bool2f_apply_left ( cu_bool2f_t  f,
cu_bool_t  x 
)

Return the partial evaluation λy. f(x, y).

cu_bool1f_t cu_bool2f_apply_right ( cu_bool2f_t  f,
cu_bool_t  y 
)

Return the partial evaluation λx. f(x, y).

cu_bool2f_t cu_bool2f_compose ( cu_bool1f_t  f,
cu_bool2f_t  g 
)

Return the composition fg, i.e. the function λ(x, y). f (g (x, y)).

cu_bool2f_t cu_bool2f_compose_left ( cu_bool2f_t  f,
cu_bool1f_t  g 
)

Return the composition of f on the left operand with g, λ(x, y). f (g(x), y).

cu_bool2f_t cu_bool2f_compose_right ( cu_bool2f_t  f,
cu_bool1f_t  g 
)

Return the composition of f on the right operand with g, λ(x, y). f (x, g(y)).

cu_bool2f_t cu_bool2f_from_func ( cu_bool_t(*)(cu_bool_t, cu_bool_t f  ) 

Return the enumerated boolean function which agrees with f on its domain. This samples f 4 times.

cu_bool2f_t cu_bool2f_konst ( cu_bool_t  v  ) 

The constant function λ(x, y). v.

cu_bool2f_t cu_bool2f_not ( cu_bool2f_t  f  ) 

Return the function λ(x, y). ¬f(x, y).

cu_bool2f_t cu_bool2f_swap ( cu_bool2f_t  f  ) 

Swap the arguments, i.e. λ(x, y). f(y, x).

int cu_bool_cmp ( cu_bool_t  x,
cu_bool_t  y 
)

Returns -1 if ¬xy, 0 if xy, and 1 if x ∧ ¬y.


Variable Documentation

Return the C function which at x returns cu_bool1f_apply(f, x).

The C function which agrees with f on its domain.

Generated 2009-11-23 for culibs-0.25 using Doxygen. Maintained by Petter Urkedal.