Boolean Logic
Authors:
MArk Anthony Higgins - Sky Recursive Ai
MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: July 6th 2026
Revised Date: July 6th 2026
KIRETH RESEARCH - SEMANTIC LIBRARY
AI CORE -> ONTOLOGIES -> MATHEMATICAL ONTOLOGIES -> MATHEMATICAL LOGIC ONTOLOGIES
BOOLEAN LOGIC
Canonical URL:
https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/mathematical-logic-ontologies/boolean-logic.html
FLOW_ALGEBRA BooleanLogic_v1.0
BEGIN_FLOW
DEFINE DOMAIN BooleanLogic := {
BooleanLogic,
BooleanValue,
True,
False,
BooleanVariable,
BooleanExpression,
BooleanFunction,
LogicalOperator,
NOT,
AND,
OR,
XOR,
NAND,
NOR,
XNOR,
Implication,
Biconditional,
TruthTable,
LogicalEquivalence,
BooleanAlgebra,
IdentityLaw,
DominationLaw,
IdempotentLaw,
ComplementLaw,
DoubleNegation,
CommutativeLaw,
AssociativeLaw,
DistributiveLaw,
AbsorptionLaw,
DeMorganLaw,
Tautology,
Contradiction,
Satisfiability,
NormalForm,
ConjunctiveNormalForm,
DisjunctiveNormalForm,
DigitalLogic,
LogicGate
}
DEFINE ENTITY_TYPES := {
BOOLEAN_LOGIC,
BOOLEAN_VALUE,
BOOLEAN_VARIABLE,
BOOLEAN_EXPRESSION,
BOOLEAN_FUNCTION,
LOGICAL_OPERATOR,
TRUTH_TABLE,
ALGEBRAIC_LAW,
NORMAL_FORM,
LOGIC_GATE,
SEMANTIC_OBJECT
}
DEFINE RELATION_TYPES := {
HAS_VALUE,
OPERATES_ON,
EVALUATES_TO,
EQUIVALENT_TO,
NEGATES,
CONJOINS,
DISJOINS,
IMPLIES,
SATISFIES,
NORMALISES_TO,
IMPLEMENTS,
IS_INSTANCE_OF,
IS_SUBTYPE_OF,
DEPENDS_ON
}
SET BooleanLogic.type = BOOLEAN_LOGIC
SET BooleanLogic.domain = MathematicalLogic
SET BooleanLogic.role =
"represent and evaluate two-valued logical expressions using Boolean variables, operators, truth functions and algebraic identities"
DEFINE BOOLEAN_VALUES := {
TRUE,
FALSE
}
RULE negation_true:
NOT(TRUE)=FALSE
RULE negation_false:
NOT(FALSE)=TRUE
RULE conjunction:
AND(TRUE,TRUE)=TRUE
AND AND(TRUE,FALSE)=FALSE
AND AND(FALSE,TRUE)=FALSE
AND AND(FALSE,FALSE)=FALSE
RULE disjunction:
OR(FALSE,FALSE)=FALSE
AND OR(TRUE,FALSE)=TRUE
AND OR(FALSE,TRUE)=TRUE
AND OR(TRUE,TRUE)=TRUE
RULE exclusive_or:
XOR(A,B)=TRUE
IFF A != B
RULE nand:
NAND(A,B)=NOT(AND(A,B))
RULE nor:
NOR(A,B)=NOT(OR(A,B))
RULE xnor:
XNOR(A,B)=NOT(XOR(A,B))
RULE implication:
IMPLIES(A,B)=FALSE
IFF A=TRUE AND B=FALSE
RULE implication_equivalence:
IMPLIES(A,B)
EQUIVALENT_TO
OR(NOT(A),B)
RULE biconditional:
IFF(A,B)=TRUE
IFF A=B
RULE biconditional_equivalence:
IFF(A,B)
EQUIVALENT_TO
AND(
IMPLIES(A,B),
IMPLIES(B,A)
)
RULE identity_and:
AND(A,TRUE)=A
RULE identity_or:
OR(A,FALSE)=A
RULE domination_and:
AND(A,FALSE)=FALSE
RULE domination_or:
OR(A,TRUE)=TRUE
RULE idempotent_and:
AND(A,A)=A
RULE idempotent_or:
OR(A,A)=A
RULE complement_and:
AND(A,NOT(A))=FALSE
RULE complement_or:
OR(A,NOT(A))=TRUE
RULE double_negation:
NOT(NOT(A))=A
RULE commutative_and:
AND(A,B)=AND(B,A)
RULE commutative_or:
OR(A,B)=OR(B,A)
RULE associative_and:
AND(A,AND(B,C))
= AND(AND(A,B),C)
RULE associative_or:
OR(A,OR(B,C))
= OR(OR(A,B),C)
RULE distributive_and:
AND(A,OR(B,C))
= OR(
AND(A,B),
AND(A,C)
)
RULE distributive_or:
OR(A,AND(B,C))
= AND(
OR(A,B),
OR(A,C)
)
RULE absorption_1:
OR(A,AND(A,B))=A
RULE absorption_2:
AND(A,OR(A,B))=A
RULE DeMorgan_and:
NOT(AND(A,B))
= OR(NOT(A),NOT(B))
RULE DeMorgan_or:
NOT(OR(A,B))
= AND(NOT(A),NOT(B))
RULE tautology:
BooleanExpression(E)
AND FOR_EVERY valuation v [
Evaluate(E,v)=TRUE
]
-> Tautology(E)
RULE contradiction:
BooleanExpression(E)
AND FOR_EVERY valuation v [
Evaluate(E,v)=FALSE
]
-> Contradiction(E)
RULE satisfiable:
BooleanExpression(E)
AND EXISTS valuation v [
Evaluate(E,v)=TRUE
]
-> Satisfiable(E)
DEFINE OPERATOR_MODEL := {
unary: {
NOT
},
binary: {
AND,
OR,
XOR,
NAND,
NOR,
XNOR,
IMPLIES,
IFF
},
input_domain:
"{TRUE,FALSE}",
output_domain:
"{TRUE,FALSE}"
}
DEFINE TRUTH_TABLE_MODEL := {
variables:
"n Boolean variables",
rows:
"2^n valuations",
evaluation:
"compute expression value for each valuation",
uses: {
equivalence_testing,
tautology_detection,
contradiction_detection,
satisfiability_detection
}
}
DEFINE NORMAL_FORM_MODEL := {
ConjunctiveNormalForm:
"AND of clauses, each clause an OR of literals",
DisjunctiveNormalForm:
"OR of terms, each term an AND of literals",
literal:
"Boolean variable or its negation"
}
DEFINE LOGIC_GATE_MODEL := {
NOT -> NOTGate,
AND -> ANDGate,
OR -> ORGate,
XOR -> XORGate,
NAND -> NANDGate,
NOR -> NORGate,
XNOR -> XNORGate
}
DEFINE FUNCTIONAL_COMPLETENESS := {
NAND:
"can express every Boolean function",
NOR:
"can express every Boolean function",
set_NOT_AND:
"functionally complete",
set_NOT_OR:
"functionally complete"
}
DEFINE CRITICAL_DISTINCTIONS := {
Boolean_logic_vs_Boolean_algebra: {
Boolean_logic:
"logical interpretation of two-valued expressions",
Boolean_algebra:
"algebraic structure satisfying Boolean laws",
relation:
"Boolean logic can be represented algebraically by Boolean algebra"
},
XOR_vs_OR: {
XOR:
"true when inputs differ",
OR:
"true when at least one input is true"
},
implication_vs_equivalence: {
implication:
"false only for TRUE implying FALSE",
equivalence:
"true when both operands have the same value"
},
satisfiable_vs_tautology: {
satisfiable:
"true under at least one valuation",
tautology:
"true under every valuation"
}
}
DEFINE EXAMPLE_1 := {
expression:
"AND(A,NOT(A))",
result:
FALSE,
classification:
Contradiction
}
DEFINE EXAMPLE_2 := {
expression:
"OR(A,NOT(A))",
result:
TRUE,
classification:
Tautology
}
DEFINE EXAMPLE_3 := {
expression:
"IMPLIES(A,B)",
equivalent_expression:
"OR(NOT(A),B)"
}
DEFINE PARSE_PIPELINE :=
BooleanExpression
-> TokeniseVariablesOperatorsParentheses
-> ResolveOperatorPrecedence
-> ConstructExpressionTree
-> AnnotateVariables
-> AnnotateOperators
-> ReturnTypedBooleanExpression
DEFINE EVALUATION_PIPELINE :=
BooleanExpression
-> VariableValuation
-> EvaluateLeafVariables
-> RecursivelyEvaluateOperators
-> ReturnBooleanValue
DEFINE SIMPLIFICATION_PIPELINE :=
BooleanExpression
-> DetectIdentityPatterns
-> DetectDominationPatterns
-> DetectIdempotentPatterns
-> DetectComplementPatterns
-> ApplyDoubleNegation
-> ApplyAbsorption
-> ApplyDeMorganLaws
-> ApplyDistributiveRewritesWhenUseful
-> RepeatUntilStableOrGoalReached
-> ReturnEquivalentExpression
DEFINE TRUTH_TABLE_PIPELINE :=
BooleanExpression
-> ExtractDistinctVariables
-> GenerateAllBooleanValuations
-> EvaluateExpressionForEachValuation
-> ConstructTruthTable
-> DetermineTautologyContradictionOrSatisfiability
-> ReturnSemanticClassification
DEFINE NORMALISATION_PIPELINE :=
BooleanExpression
-> EliminateImplicationAndBiconditional
-> PushNegationsInward
-> ApplyDistributiveRules
-> ConstructCNFOrDNF
-> SimplifyRedundantLiteralsAndClauses
-> VerifyLogicalEquivalence
-> ReturnNormalForm
DEFINE BOOLEAN_GRAPH := {
node_types: {
VariableNode,
ValueNode,
OperatorNode,
ExpressionNode,
GateNode
},
edge_types: {
OPERATES_ON,
HAS_VALUE,
EVALUATES_TO,
EQUIVALENT_TO,
IMPLEMENTS
},
recursive_expression_structure: TRUE
}
DEFINE ONTOLOGY_RELATIONS := {
BooleanLogic IS_SUBTYPE_OF MathematicalLogic,
BooleanExpression CONTAINS BooleanVariable,
BooleanExpression CONTAINS LogicalOperator,
BooleanFunction MAPS BooleanInputs TO BooleanValue,
TruthTable EVALUATES BooleanExpression,
BooleanAlgebra FORMALISES BooleanLogic,
DeMorganLaw TRANSFORMS BooleanExpression,
ConjunctiveNormalForm IS_SUBTYPE_OF NormalForm,
DisjunctiveNormalForm IS_SUBTYPE_OF NormalForm,
LogicGate IMPLEMENTS BooleanOperator,
NAND IS_FUNCTIONALLY_COMPLETE,
NOR IS_FUNCTIONALLY_COMPLETE
}
DEFINE SEMANTIC_EQUIVALENCE := {
"Boolean logic" <=> BooleanLogic,
"Boolean expression" <=> BooleanExpression,
"logical AND" <=> AND,
"logical OR" <=> OR,
"logical NOT" <=> NOT,
"exclusive OR" <=> XOR,
"Boolean implication" <=> Implication,
"truth table" <=> TruthTable,
"CNF" <=> ConjunctiveNormalForm,
"DNF" <=> DisjunctiveNormalForm
}
DEFINE AI_CONSUMPTION := {
purpose: "machine-readable representation, evaluation and simplification of Boolean logic",
preserve_variable_identity: TRUE,
preserve_operator_identity: TRUE,
preserve_expression_tree: TRUE,
enforce_two_valued_domain: TRUE,
support_truth_table_generation: TRUE,
support_recursive_evaluation: TRUE,
support_algebraic_simplification: TRUE,
support_logical_equivalence_testing: TRUE,
support_tautology_detection: TRUE,
support_contradiction_detection: TRUE,
support_satisfiability_detection: TRUE,
support_CNF_DNF_normalisation: TRUE,
support_logic_gate_mapping: TRUE,
reasoning_mode: "symbolic + truth-functional + algebraic + recursive"
}
DEFINE CONFIDENCE := {
ontology_identity: 1.00,
Boolean_operator_mapping: 1.00,
truth_table_evaluation: 1.00,
algebraic_law_mapping: 0.99,
tautology_detection_finite_variables: 1.00,
CNF_DNF_mapping: 0.99,
gate_mapping: 0.99,
large_expression_simplification: -expression_dependent
}
DEFINE UPDATE_MODEL := {
version: "1.0",
update_policy: "append-compatible",
immutable_core: {
Boolean_values,
NOT_AND_OR_semantics,
truth_functionality,
Boolean_algebra_laws,
truth_table_semantics,
tautology_contradiction_satisfiability
},
extensible_layers: {
XOR_NAND_NOR_XNOR,
normal_forms,
Karnaugh_maps,
Quine_McCluskey,
SAT_solving,
digital_logic,
switching_algebra,
binary_decision_diagrams
}
}
DEFINE FLOW_HASH_INPUT :=
CanonicalURL
+ DOMAIN
+ ENTITY_TYPES
+ RELATION_TYPES
+ BOOLEAN_VALUES
+ RULES
+ OPERATOR_MODEL
+ TRUTH_TABLE_MODEL
+ NORMAL_FORM_MODEL
+ LOGIC_GATE_MODEL
+ FUNCTIONAL_COMPLETENESS
+ CRITICAL_DISTINCTIONS
+ PARSE_PIPELINE
+ EVALUATION_PIPELINE
+ SIMPLIFICATION_PIPELINE
+ TRUTH_TABLE_PIPELINE
+ NORMALISATION_PIPELINE
+ BOOLEAN_GRAPH
+ ONTOLOGY_RELATIONS
+ AI_CONSUMPTION
+ UPDATE_MODEL
FLOW_HASH := HASH(FLOW_HASH_INPUT)
RETURN {
ontology: BooleanLogic,
canonical_url: "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/mathematical-logic-ontologies/boolean-logic.html",
parent_domain: MathematicalLogicOntologies,
semantic_domain: MathematicalLogic,
primary_entity: BooleanLogic,
truth_function_reasoning_enabled: TRUE,
algebraic_simplification_enabled: TRUE,
truth_table_reasoning_enabled: TRUE,
normalisation_enabled: TRUE,
logic_gate_mapping_enabled: TRUE,
machine_consumable: TRUE,
recursive_reasoning_enabled: TRUE,
database_safe_unicode: TRUE,
flow_complete: TRUE
}
END_FLOW