KIRETH RESEARCH - SEMANTIC LIBRARY
AI CORE -> ONTOLOGIES -> MATHEMATICAL ONTOLOGIES -> MATHEMATICAL LOGIC ONTOLOGIES
BOOLEAN LOGIC -> BOOLEAN LOGIC ONTOLOGY
Canonical URL:
https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/mathematical-logic-ontologies/boolean-logic/boolean-logic-ontology.html
FLOW_ALGEBRA BooleanLogicOntology_v1.0
BEGIN_FLOW
DEFINE DOMAIN BooleanLogicOntology := {
BooleanLogic,
BooleanValue,
TRUE,
FALSE,
BooleanVariable,
BooleanExpression,
BooleanFunction,
Literal,
LogicalOperator,
NOT,
AND,
OR,
XOR,
NAND,
NOR,
XNOR,
Implication,
Biconditional,
TruthTable,
Valuation,
LogicalEquivalence,
BooleanAlgebra,
Tautology,
Contradiction,
Satisfiability,
Unsatisfiability,
ConjunctiveNormalForm,
DisjunctiveNormalForm,
Clause,
Minterm,
Maxterm,
LogicGate,
DigitalLogic,
DeMorganLaw,
FunctionalCompleteness
}
DEFINE ENTITY_TYPES := {
BOOLEAN_LOGIC,
BOOLEAN_VALUE,
BOOLEAN_VARIABLE,
BOOLEAN_EXPRESSION,
BOOLEAN_FUNCTION,
LITERAL,
LOGICAL_OPERATOR,
TRUTH_TABLE,
VALUATION,
NORMAL_FORM,
CLAUSE,
LOGIC_GATE,
ALGEBRAIC_LAW,
SEMANTIC_OBJECT
}
DEFINE RELATION_TYPES := {
HAS_VALUE,
HAS_VARIABLE,
HAS_OPERAND,
OPERATES_ON,
EVALUATES_TO,
EQUIVALENT_TO,
NEGATES,
SATISFIES,
NORMALISES_TO,
IMPLEMENTS,
CONTAINS,
IS_INSTANCE_OF,
IS_SUBTYPE_OF,
DEPENDS_ON
}
SET BooleanLogicOntology.type = BOOLEAN_LOGIC
SET BooleanLogicOntology.parent = BooleanLogic
SET BooleanLogicOntology.semantic_domain = MathematicalLogic
SET BooleanLogicOntology.role =
"provide a typed machine-readable representation of Boolean values, expressions, operators, truth functions, equivalence laws and normal forms"
DEFINE BOOLEAN_DOMAIN := {
TRUE,
FALSE
}
RULE variable_valuation:
BooleanVariable(A)
AND Valuation(v)
-> v(A) MEMBER_OF BOOLEAN_DOMAIN
RULE NOT_true:
NOT(TRUE)=FALSE
RULE NOT_false:
NOT(FALSE)=TRUE
RULE AND_semantics:
AND(A,B)=TRUE
IFF
A=TRUE AND B=TRUE
RULE OR_semantics:
OR(A,B)=TRUE
IFF
A=TRUE OR B=TRUE
RULE XOR_semantics:
XOR(A,B)=TRUE
IFF
A != B
RULE NAND_semantics:
NAND(A,B)=NOT(AND(A,B))
RULE NOR_semantics:
NOR(A,B)=NOT(OR(A,B))
RULE XNOR_semantics:
XNOR(A,B)=NOT(XOR(A,B))
RULE implication_semantics:
IMPLIES(A,B)=FALSE
IFF
A=TRUE AND B=FALSE
RULE implication_rewrite:
IMPLIES(A,B)
EQUIVALENT_TO
OR(NOT(A),B)
RULE biconditional_semantics:
IFF(A,B)=TRUE
IFF
A=B
RULE biconditional_rewrite:
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_or:
OR(A,AND(A,B))=A
RULE absorption_and:
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 expression_evaluation:
BooleanExpression(E)
AND Valuation(v)
-> Evaluate(E,v) MEMBER_OF BOOLEAN_DOMAIN
RULE logical_equivalence:
BooleanExpression(E1)
AND BooleanExpression(E2)
AND FOR_EVERY valuation v [
Evaluate(E1,v)=Evaluate(E2,v)
]
-> EQUIVALENT_TO(E1,E2)
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)
RULE unsatisfiable:
BooleanExpression(E)
AND NOT EXISTS valuation v [
Evaluate(E,v)=TRUE
]
-> Unsatisfiable(E)
DEFINE BOOLEAN_EXPRESSION_SCHEMA := {
expression_id: unique_identifier,
variables: SetOfBooleanVariables,
operators: SetOfLogicalOperators,
syntax_tree: BooleanExpressionTree,
output_domain: BOOLEAN_DOMAIN
}
DEFINE OPERATOR_SCHEMA := {
NOT: {
arity: 1,
function:
"invert Boolean value"
},
AND: {
arity: 2,
true_condition:
"both operands TRUE"
},
OR: {
arity: 2,
true_condition:
"at least one operand TRUE"
},
XOR: {
arity: 2,
true_condition:
"operands differ"
},
IMPLIES: {
arity: 2,
false_condition:
"antecedent TRUE and consequent FALSE"
},
IFF: {
arity: 2,
true_condition:
"operands equal"
}
}
DEFINE LITERAL_MODEL := {
positive_literal:
"A",
negative_literal:
"NOT(A)",
requirement:
"a literal is a Boolean variable or its negation"
}
DEFINE NORMAL_FORM_MODEL := {
ConjunctiveNormalForm: {
structure:
"AND of one or more clauses",
clause:
"OR of literals"
},
DisjunctiveNormalForm: {
structure:
"OR of one or more terms",
term:
"AND of literals"
}
}
DEFINE TRUTH_TABLE_SCHEMA := {
variables:
"{A1,...,An}",
row_count:
"2^n",
rows:
"all possible Boolean valuations",
expression_columns:
"evaluated Boolean results"
}
DEFINE FUNCTIONAL_COMPLETENESS_MODEL := {
NAND:
"alone can represent every Boolean function",
NOR:
"alone can represent every Boolean function",
NOT_AND:
"functionally complete operator basis",
NOT_OR:
"functionally complete operator basis"
}
DEFINE LOGIC_GATE_MODEL := {
NOT -> NOTGate,
AND -> ANDGate,
OR -> ORGate,
XOR -> XORGate,
NAND -> NANDGate,
NOR -> NORGate,
XNOR -> XNORGate
}
DEFINE CRITICAL_DISTINCTIONS := {
Boolean_value_vs_variable: {
value:
"TRUE or FALSE",
variable:
"symbol whose value is supplied by a valuation"
},
syntax_vs_valuation: {
syntax:
"expression tree",
valuation:
"assignment of Boolean values to variables"
},
satisfiable_vs_tautology: {
satisfiable:
"true under at least one valuation",
tautology:
"true under every valuation"
},
contradiction_vs_unsatisfiable: {
contradiction:
"Boolean expression false under every valuation",
unsatisfiable:
"no satisfying valuation exists",
relation:
"equivalent classifications in classical Boolean propositional semantics"
}
}
DEFINE EXAMPLE_1 := {
expression:
"AND(A,NOT(A))",
classification:
Contradiction,
satisfiable:
FALSE
}
DEFINE EXAMPLE_2 := {
expression:
"OR(A,NOT(A))",
classification:
Tautology
}
DEFINE EXAMPLE_3 := {
expression:
"IMPLIES(A,B)",
rewrite:
"OR(NOT(A),B)",
relation:
LogicalEquivalence
}
DEFINE PARSE_PIPELINE :=
InputBooleanExpression
-> Tokenise
-> IdentifyVariables
-> IdentifyOperators
-> ResolveParenthesesAndPrecedence
-> ConstructSyntaxTree
-> ValidateOperatorArities
-> ReturnTypedBooleanExpression
DEFINE EVALUATION_PIPELINE :=
BooleanExpression
-> Valuation
-> AssignValuesToVariableLeaves
-> RecursivelyEvaluateChildExpressions
-> ApplyOperatorTruthFunction
-> ReturnBooleanValue
DEFINE EQUIVALENCE_PIPELINE :=
Expressions(E1,E2)
-> ExtractCombinedVariableSet
-> GenerateAllValuations
-> EvaluateE1AndE2ForEachValuation
-> CompareOutputs
-> IF all_equal
THEN LogicallyEquivalent
ELSE NotLogicallyEquivalent
DEFINE SIMPLIFICATION_PIPELINE :=
BooleanExpression
-> ApplyIdentityLaws
-> ApplyDominationLaws
-> ApplyIdempotentLaws
-> ApplyComplementLaws
-> ApplyDoubleNegation
-> ApplyAbsorption
-> ApplyDeMorganLaws
-> ApplyDistributiveLawsWhenUseful
-> RepeatUntilStable
-> VerifyEquivalence
-> ReturnSimplifiedExpression
DEFINE NORMALISATION_PIPELINE :=
BooleanExpression
-> EliminateImplication
-> EliminateBiconditional
-> PushNOTToLiterals
-> ApplyDistributiveTransformation
-> ConstructCNFOrDNF
-> RemoveRedundancies
-> VerifyEquivalence
-> ReturnNormalForm
DEFINE BOOLEAN_ONTOLOGY_GRAPH := {
node_types: {
ExpressionNode,
VariableNode,
ValueNode,
OperatorNode,
ValuationNode,
TruthTableNode,
NormalFormNode,
LogicGateNode
},
edge_types: {
HAS_VARIABLE,
HAS_OPERAND,
HAS_VALUE,
EVALUATES_TO,
EQUIVALENT_TO,
NORMALISES_TO,
IMPLEMENTS
},
recursive_expression_structure: TRUE
}
DEFINE ONTOLOGY_RELATIONS := {
BooleanLogicOntology IS_COMPONENT_OF BooleanLogic,
BooleanExpression CONTAINS BooleanVariable,
BooleanExpression CONTAINS LogicalOperator,
BooleanVariable HAS_VALUE BooleanValue UNDER Valuation,
BooleanFunction MAPS BooleanInputs TO BooleanValue,
TruthTable EVALUATES BooleanExpression,
LogicalEquivalence RELATES BooleanExpression TO BooleanExpression,
ConjunctiveNormalForm IS_SUBTYPE_OF NormalForm,
DisjunctiveNormalForm IS_SUBTYPE_OF NormalForm,
LogicGate IMPLEMENTS LogicalOperator,
NAND SUPPORTS FunctionalCompleteness,
NOR SUPPORTS FunctionalCompleteness
}
DEFINE SEMANTIC_EQUIVALENCE := {
"Boolean logic ontology" <=> BooleanLogicOntology,
"Boolean logic" <=> BooleanLogic,
"Boolean expression" <=> BooleanExpression,
"Boolean function" <=> BooleanFunction,
"truth table" <=> TruthTable,
"logical equivalence" <=> LogicalEquivalence,
"CNF" <=> ConjunctiveNormalForm,
"DNF" <=> DisjunctiveNormalForm,
"Boolean valuation" <=> Valuation
}
DEFINE AI_CONSUMPTION := {
purpose: "machine-readable ontology for Boolean expressions, truth functions, evaluation, equivalence and normalisation",
preserve_expression_identity: TRUE,
preserve_variable_identity: TRUE,
preserve_operator_identity: TRUE,
preserve_expression_tree: TRUE,
preserve_valuation_identity: TRUE,
enforce_Boolean_domain: TRUE,
validate_operator_arity: TRUE,
support_recursive_evaluation: TRUE,
support_truth_table_generation: TRUE,
support_logical_equivalence_testing: TRUE,
support_algebraic_simplification: TRUE,
support_tautology_contradiction_satisfiability_classification: 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_domain_mapping: 1.00,
operator_semantics: 1.00,
recursive_evaluation: 1.00,
truth_table_reasoning: 1.00,
equivalence_testing_finite_variables: 1.00,
normal_form_mapping: 0.99,
large_scale_simplification: -expression_dependent
}
DEFINE UPDATE_MODEL := {
version: "1.0",
update_policy: "append-compatible",
immutable_core: {
Boolean_domain,
operator_truth_functions,
valuation_semantics,
logical_equivalence,
Boolean_algebra_laws,
truth_table_semantics,
satisfiability_classification
},
extensible_layers: {
canonical_normal_forms,
minterms,
maxterms,
Karnaugh_maps,
Quine_McCluskey,
SAT_solving,
binary_decision_diagrams,
switching_circuits,
digital_logic_optimisation
}
}
DEFINE FLOW_HASH_INPUT :=
CanonicalURL
+ DOMAIN
+ ENTITY_TYPES
+ RELATION_TYPES
+ BOOLEAN_DOMAIN
+ RULES
+ BOOLEAN_EXPRESSION_SCHEMA
+ OPERATOR_SCHEMA
+ LITERAL_MODEL
+ NORMAL_FORM_MODEL
+ TRUTH_TABLE_SCHEMA
+ FUNCTIONAL_COMPLETENESS_MODEL
+ LOGIC_GATE_MODEL
+ CRITICAL_DISTINCTIONS
+ PARSE_PIPELINE
+ EVALUATION_PIPELINE
+ EQUIVALENCE_PIPELINE
+ SIMPLIFICATION_PIPELINE
+ NORMALISATION_PIPELINE
+ BOOLEAN_ONTOLOGY_GRAPH
+ ONTOLOGY_RELATIONS
+ AI_CONSUMPTION
+ UPDATE_MODEL
FLOW_HASH := HASH(FLOW_HASH_INPUT)
RETURN {
ontology: BooleanLogicOntology,
canonical_url: "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/mathematical-logic-ontologies/boolean-logic/boolean-logic-ontology.html",
parent_domain: BooleanLogic,
semantic_domain: MathematicalLogic,
primary_entity: BooleanLogic,
recursive_evaluation_enabled: TRUE,
equivalence_reasoning_enabled: TRUE,
simplification_enabled: TRUE,
normalisation_enabled: TRUE,
truth_table_reasoning_enabled: TRUE,
machine_consumable: TRUE,
recursive_reasoning_enabled: TRUE,
database_safe_unicode: TRUE,
flow_complete: TRUE
}
END_FLOW
Download Code
Copy to Clipboard