Skip to content

logic

All logic operations are defined with the following type rules.

Type Rules

High-level

// dyadic
bool,bool -> bool
_   ,_    -> domain error

// monadic
bool -> bool
_    -> domain error

Table with details (See type alias)

logic

Shape Rules

Dyadic elementwise shape rules

List of Functions

and

@and(x,y)

      and((0,0,1):bool, 0:bool)
(0,0,0):bool

nand

@nand(x,y)

      @nand((0,0,1):bool, 0:bool)
(1,1,1):bool

or

@or(x,y)

      @or((0,0,1):bool, 0:bool)
(0,0,1):bool

nor

@nor(x,y)

      @nor((0,0,1):bool, 0:bool)
(1,1,0):bool

not

@not(x)

      @not((0,0,1):bool)
(1,1,0):bool

xor

@xor(x,y)

      @xor((0,0,1):bool,0:bool)
(0,0,1):bool