zuai-logo

Glossary

A

Associative Law

Criticality: 2

A boolean property stating that the grouping of operands in a series of AND or OR operations does not affect the result.

Example:

When checking conditions for a quest, (hasKey && hasMap) && foundTreasure is the same as hasKey && (hasMap && foundTreasure) due to the Associative Law.

B

Boolean Expression Equivalence

Criticality: 3

The state where two boolean expressions produce the same output for all possible input combinations.

Example:

To prove that !(A && B) is equivalent to !A || !B, you would show they always yield the same result.

C

Commutative Law

Criticality: 2

A boolean property stating that the order of operands in an AND or OR operation does not affect the result.

Example:

Checking if isRaining && isCold or isCold && isRaining yields the same result for deciding to wear a jacket, illustrating the Commutative Law.

Consensus Theorems

Criticality: 1

A set of boolean theorems that help simplify expressions with specific patterns, often involving a variable, its negation, and another variable.

Example:

If a system checks (sensorA || (!sensorA && sensorB)), it can be simplified to just sensorA || sensorB using a Consensus Theorem.

D

DeMorgan's Theorems

Criticality: 3

A set of two crucial boolean theorems that describe how to negate complex expressions involving AND and OR operations.

Example:

To check if a user is not both an admin and active, you can use !(isAdmin && isActive), which by DeMorgan's Theorems is !isAdmin || !isActive.

Distributive Law

Criticality: 3

A boolean property that allows an AND operation to be distributed over an OR operation, or vice-versa, similar to multiplication over addition in algebra.

Example:

If a character needs to be (strong && agile) || (strong && intelligent), this can be simplified to strong && (agile || intelligent) using the Distributive Law.

Double Negation

Criticality: 2

A boolean property stating that negating a boolean variable twice returns the original variable.

Example:

If a door is !(!locked), it means the door is locked because of Double Negation.

I

Idempotent Law

Criticality: 2

A boolean property stating that applying an operation (AND or OR) to a variable with itself yields the variable itself.

Example:

If a game character has isFlying || isFlying, their state is simply isFlying due to the Idempotent Law.

O

Order of Operations (Boolean)

Criticality: 3

The established hierarchy for evaluating boolean expressions, where NOT (`!`) is evaluated first, followed by AND (`&&`), and then OR (`||`).

Example:

In !A && B || C, !A is evaluated first, then the result is ANDed with B, and finally that result is ORed with C, following the Order of Operations.

P

Proof by Simplification

Criticality: 3

A method to demonstrate boolean expression equivalence by transforming one expression into another using boolean properties and identities.

Example:

Simplifying A && (A || B) to just A is an example of Proof by Simplification using boolean algebra.

Proof by Testing All Cases

Criticality: 3

A method to demonstrate boolean expression equivalence by constructing a truth table and verifying that both expressions yield identical outputs for every possible input combination.

Example:

Using a truth table to confirm that A || !A always evaluates to true is an instance of Proof by Testing All Cases.

T

Truth Table

Criticality: 3

A tabular representation that lists all possible input combinations for a boolean expression and the corresponding output for each combination.

Example:

A Truth Table for A && B would show that the output is only true when both A and B are true.