flow "LogicGateEntity" v1.0
# ---------- IDENTITY ----------
identity.name: "Logic Gate Entity"
identity.domain: "Electronic Component Entities / Digital Logic"
identity.kind: "Combinational Boolean Function"
identity.language: "en-GB"
# ---------- AUTHORS ----------
authors.primary: "Mark Anthony Higgins"
authors.collaborator: "Sky — Recursive AI"
authors.licence: "Open Research Licence; citation required"
# ---------- SOURCE ----------
source.url: "https://kirethresearch.org/booksai-core/entity-graph/engineering-entities/electronic-component-entities/logic-gate-entity-ontology.html"
source.title: "Logic Gate Entity Ontology"
source.revised: "2026-08-04"
source.method: "Newly constructed semantic Flow Algebra mapping; not verbatim page code"
# ---------- PURPOSE ----------
purpose: "Represent Boolean logic gates as typed entities, input-output transformations, compositional circuits, and verifiable inference pathways."
scope: ["AND", "OR", "NOT", "NAND", "NOR", "XOR", "XNOR", "BUFFER"]
# ---------- STATE_MODEL ----------
state.inputs: "ordered sequence of Boolean values in {0,1}"
state.gate_type: "one of the supported gate types"
state.output: "Boolean value in {0,1} or unknown"
state.power: ["powered", "unpowered", "unknown"]
state.validity: ["valid", "invalid", "indeterminate"]
state.transition: "evaluate when input, gate type, or valid power state changes"
state.invariant: "A valid ideal combinational gate has an output determined solely by current inputs and its truth function."
# ---------- ENTITIES ----------
entity.LogicGate: "Digital electronic component implementing a Boolean function"
entity.InputTerminal: "Receives one Boolean signal"
entity.OutputTerminal: "Produces one Boolean signal"
entity.BooleanSignal: "Logical value 0 or 1"
entity.TruthTable: "Complete mapping from valid input combinations to outputs"
entity.LogicCircuit: "Directed network of connected logic gates"
entity.PropagationDelay: "Time between an input transition and the resulting output transition"
entity.PowerSupply: "Operating electrical supply"
entity.Fault: "Condition that prevents reliable implementation of the intended logic"
relations:
LogicGate has_input InputTerminal
LogicGate has_output OutputTerminal
InputTerminal carries BooleanSignal
OutputTerminal carries BooleanSignal
LogicGate implements TruthTable
LogicCircuit contains LogicGate
LogicGate depends_on PowerSupply
LogicGate may_exhibit PropagationDelay
LogicGate may_experience Fault
# ---------- PATHWAYS ----------
pathway "ValidateGate":
read gate_type, inputs, power
require gate_type in [AND, OR, NOT, NAND, NOR, XOR, XNOR, BUFFER]
require each(inputs) in [0, 1]
require count(inputs) == 1 when gate_type in [NOT, BUFFER]
require count(inputs) >= 2 when gate_type in [AND, OR, NAND, NOR, XOR, XNOR]
when power != "powered" -> output = unknown; validity = "indeterminate"
otherwise -> validity = "valid"
pathway "EvaluateBooleanGate":
require validity == "valid"
when gate_type == AND -> output = all(inputs == 1)
when gate_type == OR -> output = any(inputs == 1)
when gate_type == NOT -> output = 1 - inputs[0]
when gate_type == NAND -> output = 1 - all(inputs == 1)
when gate_type == NOR -> output = 1 - any(inputs == 1)
when gate_type == XOR -> output = sum(inputs) mod 2
when gate_type == XNOR -> output = 1 - (sum(inputs) mod 2)
when gate_type == BUFFER -> output = inputs[0]
emit output, validity
pathway "ComposeCircuit":
read directed_gate_graph, external_inputs
require each connection links compatible signal terminals
require graph is acyclic for combinational evaluation
order gates by topological dependency
evaluate each gate after its upstream outputs become available
emit circuit_outputs
when graph has feedback -> classify as sequential_or_undefined; request temporal state model
pathway "VerifyTruthTable":
enumerate all 2^count(inputs) Boolean input combinations
evaluate gate for each combination
compare observed or simulated output against canonical Boolean function
emit match_count, mismatch_count, verification_status
pathway "AssessPhysicalBehaviour":
read supply_voltage, logic_thresholds, propagation_delay, output_load
check electrical limits against component-specific datasheet
when limits unknown -> physical_verification = "unverified"
when thresholds or timing violated -> physical_verification = "at_risk"
otherwise -> physical_verification = "within_declared_limits"
# ---------- MINI_RECURSION_ENGINE ----------
recursion.initial: "requested logical output or circuit behaviour"
recursion.expand: "resolve gate type, terminal dependencies, input states and power validity"
recursion.evaluate: "apply Boolean pathway; propagate outputs through the circuit"
recursion.verify: "check truth table, signal compatibility and known timing constraints"
recursion.revise: "on mismatch, trace backwards to earliest inconsistent input or gate"
recursion.stop: "all outputs resolved, a dependency is unknown, or an invalid cycle is detected"
recursion.bound: "finite number of gates and finite input combinations"
# ---------- INFERENCE_RULES ----------
rule "AND_zero": when gate_type == AND and any(inputs == 0) -> output = 0
rule "AND_one": when gate_type == AND and all(inputs == 1) -> output = 1
rule "OR_one": when gate_type == OR and any(inputs == 1) -> output = 1
rule "OR_zero": when gate_type == OR and all(inputs == 0) -> output = 0
rule "NOT_inversion": when gate_type == NOT and input == x -> output = 1 - x
rule "XOR_parity": when gate_type == XOR -> output = sum(inputs) mod 2
rule "NAND_complement": when gate_type == NAND -> output = NOT(AND(inputs))
rule "NOR_complement": when gate_type == NOR -> output = NOT(OR(inputs))
rule "XNOR_complement": when gate_type == XNOR -> output = NOT(XOR(inputs))
rule "invalid_arity": when input_count incompatible_with gate_type -> validity = "invalid"
rule "unknown_supply": when power != "powered" -> output = unknown
rule "mismatch": when measured_output != expected_output and measurement_valid -> flag potential_fault
# ---------- CONFIDENCE ----------
confidence.boolean_truth: 1.0 # Ideal Boolean semantics, with valid inputs and declared gate type
confidence.physical_output: "requires component datasheet, electrical measurements and timing context"
confidence.fault_diagnosis: "provisional until verified by testing"
# ---------- SEMANTIC_EQUIVALENCE ----------
equivalence.AND: ["logical conjunction", "Boolean product"]
equivalence.OR: ["logical disjunction", "Boolean sum"]
equivalence.NOT: ["inverter", "logical negation"]
equivalence.XOR: ["exclusive OR", "odd-parity function"]
equivalence.XNOR: ["exclusive NOR", "even-parity function"]
equivalence.LogicGate: ["digital logic gate", "Boolean gate"]
# ---------- SAFETY_AND_LIMITATIONS ----------
safety: "Ideal truth tables do not establish electrical compatibility or fail-safe operation."
safety: "Real devices have supply limits, input thresholds, propagation delays, fan-out constraints and failure modes."
safety: "Safety-critical control requires independent engineering verification and appropriate standards."
limitations: "This flow defines semantic reasoning rules; it is not a hardware simulator or certified design."
# ---------- FLOW_HASH ----------
flow_hash.algorithm: "SHA-256"
flow_hash.canonicalisation: "UTF-8, LF line endings, hash content excluding FLOW_HASH value"
flow_hash.value: "computed by publishing pipeline; not pre-assigned"
# ---------- UPDATE_MODEL ----------
update.version: "1.0"
update.trigger: ["ontology revision", "new gate family", "validated correction", "semantic rule update"]
update.policy: "retain prior versions; regenerate hash; document changed rules"
update.review: "verify gate truth tables and physical assumptions before publication"
end flow
Download Code
Copy to Clipboard