Boolean: Difference between revisions
Jump to navigation
Jump to search
→Boolean functions
Miraheze>Marshall (Created page with "In array languages, '''Boolean''' data consists only of the numbers 0 and 1 (outside of APL, Boolean data may use any two values). Boolean...") |
Miraheze>Marshall |
||
Line 30: | Line 30: | ||
Every Boolean function which depends on all of its arguments and is not the monadic [[identity function]] is represented by a [[scalar function]] in APL. | Every Boolean function which depends on all of its arguments and is not the monadic [[identity function]] is represented by a [[scalar function]] in APL. | ||
{|class=wikitable | |||
! <source lang=apl inline>f 0</source> !! <source lang=apl inline>f 1</source> !! Function | |||
|- | |||
| 0 || 0 || Constant 0 | |||
|- | |||
| 0 || 1 || Identity | |||
|- | |||
| 1 || 0 || <source lang=apl inline>~</source> [[Not]] | |||
|- | |||
| 1 || 1 || Constant 1 | |||
|} | |||
{|class=wikitable | |||
! <source lang=apl inline>0 f 0</source> !! <source lang=apl inline>0 f 1</source> !! <source lang=apl inline>1 f 0</source> !! <source lang=apl inline>1 f 1</source> !! Function | |||
|- | |||
| 0 || 0 || 0 || 0 || Constant 0 | |||
|- | |||
| 0 || 0 || 0 || 1 || <source lang=apl inline>∧</source> [[And]], <source lang=apl inline>⌊</source> [[Minimum]] , <source lang=apl inline>×</source> [[Times]] | |||
|- | |||
| 0 || 0 || 1 || 0 || <source lang=apl inline>></source> [[Greater Than]] | |||
|- | |||
| 0 || 0 || 1 || 1 || Left argument | |||
|- | |||
| 0 || 1 || 0 || 0 || <source lang=apl inline><</source> [[Less Than]], <source lang=apl inline>|</source> [[Residue]] | |||
|- | |||
| 0 || 1 || 0 || 1 || Right argument | |||
|- | |||
| 0 || 1 || 1 || 0 || <source lang=apl inline>≠</source> [[Not Equal]] | |||
|- | |||
| 0 || 1 || 1 || 1 || <source lang=apl inline>∨</source> [[Or]], <source lang=apl inline>⌈</source> [[Maximum]] | |||
|- | |||
| 1 || 0 || 0 || 0 || <source lang=apl inline>⍱</source> [[Nor]] | |||
|- | |||
| 1 || 0 || 0 || 1 || <source lang=apl inline>=</source> [[Equal]] | |||
|- | |||
| 1 || 0 || 1 || 0 || Right argument negation | |||
|- | |||
| 1 || 0 || 1 || 1 || <source lang=apl inline>≥</source> [[Greater Than or Equal]], <source lang=apl inline>*</source> [[Power]] | |||
|- | |||
| 1 || 1 || 0 || 0 || Left argument negation | |||
|- | |||
| 1 || 1 || 0 || 1 || <source lang=apl inline>≤</source> [[Less Than or Equal]], <source lang=apl inline>!</source> [[Binomial]] | |||
|- | |||
| 1 || 1 || 1 || 0 || <source lang=apl inline>⍲</source> [[Nand]] | |||
|- | |||
| 1 || 1 || 1 || 1 || Constant 1 | |||
|} | |||
== Boolean optimization == | == Boolean optimization == |