Skip to main content

Boolean Logic Ontology

Logic
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 11 October 2026
Audio Overview
FLOW ALGEBRA
TITLE: Boolean Logic Ontology
DOMAIN: Discrete Mathematics / Logic
SOURCE_URL: https://kirethresearch.org/booksai-core/discrete-mathematics-ontologies/logic/boolean-logic-ontology-2.html
VERSION: 1.0
STATUS: Formal mathematical model; source page not independently verified
AUTHORS: Mark Higgins — Sky (Recursive AI)
SITE: https://kirethresearch.org

1. PURPOSE
Model two-valued Boolean logic through typed expressions, truth assignments, algebraic operations, logical entailment, equivalence, and machine-checkable validation.

2. TYPED ENTITIES
BooleanValue := {FALSE, TRUE}
Variable := identifier with type BooleanValue
Environment := finite mapping Variable -> BooleanValue
Expression := Constant | Variable | NOT(Expression) | AND(Expression,Expression) | OR(Expression,Expression) | XOR(Expression,Expression) | IMPLIES(Expression,Expression) | IFF(Expression,Expression)
Formula := Expression
TruthTable := ordered rows of Environment and evaluated BooleanValue
BooleanAlgebra := (B, AND, OR, NOT, FALSE, TRUE)
InferenceRule := premises -> conclusion
Proof := finite sequence of justified formulae

3. OPERATORS AND EVALUATION
NOT p = TRUE iff p = FALSE
p AND q = TRUE iff both p and q are TRUE
p OR q = TRUE iff at least one of p and q is TRUE
p XOR q = TRUE iff p and q differ
p IMPLIES q = (NOT p) OR q
p IFF q = (p IMPLIES q) AND (q IMPLIES p)
EVAL: -Expression x Environment -> BooleanValue
All operands must be Boolean-valued; EVAL is deterministic for complete environments.

4. TRUTH TABLES
p q | NOT p | p AND q | p OR q | p XOR q | p -> q | p <-> q
F F |   T   |    F    |    F   |    F    |    T   |    T
F T |   T   |    F    |    T   |    T    |    T   |    F
T F |   F   |    F    |    T   |    T    |    F   |    F
T T |   F   |    T    |    T   |    F    |    T   |    T

5. BOOLEAN ALGEBRA LAWS
Identity: p AND TRUE = p; p OR FALSE = p
Domination: p OR TRUE = TRUE; p AND FALSE = FALSE
Idempotence: p OR p = p; p AND p = p
Complement: p OR NOT p = TRUE; p AND NOT p = FALSE
Double negation: NOT(NOT p) = p
Commutativity: p AND q = q AND p; p OR q = q OR p
Associativity: (p AND q) AND r = p AND (q AND r); similarly for OR
Distributivity: p AND (q OR r) = (p AND q) OR (p AND r); dual law also holds
Absorption: p OR (p AND q) = p; p AND (p OR q) = p
De Morgan: NOT(p AND q) = NOT p OR NOT q; NOT(p OR q) = NOT p AND NOT q

6. SEMANTIC RELATIONSHIPS
HAS_OPERAND(Expression, Expression)
EVALUATES_TO(Expression, Environment, BooleanValue)
LOGICALLY_EQUIVALENT(p,q) iff for every environment E, EVAL(p,E) = EVAL(q,E)
ENTAILS(Gamma,p) iff every environment satisfying all Gamma satisfies p
IS_TAUTOLOGY(p) iff every environment satisfies p
IS_CONTRADICTION(p) iff no environment satisfies p
IS_SATISFIABLE(p) iff some environment satisfies p
IS_DUAL_OF(p,q) where duality exchanges AND/OR and TRUE/FALSE in Boolean-algebra identities

7. INFERENCE RULES
MODUS_PONENS: p, (p IMPLIES q) -> q
MODUS_TOLLENS: (p IMPLIES q), NOT q -> NOT p
CONJUNCTION_INTRODUCTION: p, q -> p AND q
CONJUNCTION_ELIMINATION: p AND q -> p; p AND q -> q
DISJUNCTION_INTRODUCTION: p -> p OR q
HYPOTHETICAL_SYLLOGISM: (p IMPLIES q), (q IMPLIES r) -> (p IMPLIES r)
All rules are sound under classical two-valued semantics.

8. EXECUTABLE FLOW
flow BooleanLogicEvaluate(expression:E-xpression, environment:Environment) -> BooleanValue:
  require all free variables of expression are assigned
  require expression is well-typed and acyclic
  return recursively evaluate(expression, environment)

flow BooleanLogicEquivalence(left:E-xpression, right:E-xpression) -> BooleanValue:
  variables := union(free_variables(left), free_variables(right))
  for each Boolean assignment E over variables:
    if EVAL(left,E) != EVAL(right,E): return FALSE
  return TRUE

flow BooleanLogicEntailment(premises:Set[Expression], conclusion:E-xpression) -> BooleanValue:
  variables := free_variables(premises union {conclusion})
  for each Boolean assignment E over variables:
    if all(EVAL(p,E) = TRUE for p in premises) and EVAL(conclusion,E) = FALSE:
      return FALSE
  return TRUE

9. VALIDATION AND TESTS
ASSERT EVAL(NOT(TRUE),{}) = FALSE
ASSERT EVAL(AND(TRUE,FALSE),{}) = FALSE
ASSERT EVAL(IMPLIES(FALSE,FALSE),{}) = TRUE
ASSERT LOGICALLY_EQUIVALENT(NOT(AND(p,q)),OR(NOT(p),NOT(q)))
ASSERT LOGICALLY_EQUIVALENT(IMPLIES(p,q),OR(NOT(p),q))
ASSERT ENTAILS({p,IMPLIES(p,q)},q)
ASSERT NOT ENTAILS({OR(p,q)},p)
Guard against unbound variables, invalid operators, malformed arity, and inconsistent type declarations.

10. SEMANTIC_EQUIVALENCE
Canonicalise expressions using validated rewrite laws and/or truth-table signatures over a shared ordered variable set.
Equivalence means equality of truth values under every assignment, not merely syntactic similarity.

11. CONFIDENCE
Formal theorem or exhaustive truth-table result: 1.00 when proof or full enumeration passes.
Unverified heuristic simplification: label as heuristic; do not assign proof-level confidence.
Separate mathematical certainty from source provenance and implementation reliability.

12. FLOW_HASH
Compute SHA-256 over canonical UTF-8 serialisation of ontology version, operator definitions, typed entities, rules and validation tests. Store computed digest on deployment; do not invent a digest.

13. UPDATE_MODEL
On revision: increment version, retain provenance, rerun all truth-table and inference tests, compare canonical FLOW_HASH, and log changed semantics.

14. AI_CONSUMPTION
Expose machine-readable entities, operators, preconditions, proof obligations, counterexample assignments and version metadata.
Require explicit distinction between classical Boolean logic and multi-valued, fuzzy or probabilistic logics.
Use Boolean logic for formal reasoning, digital circuits, filtering, verification and rule evaluation.

END FLOW ALGEBRA
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ