Skip to main content

Logical Execution Ontology

Recursive AI Logic
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 17 September 2026
Audio Overview
AI SEARCH FLOW ALGEBRA — LOGICAL EXECUTION ONTOLOGY
Kireth Research — Semantic Library
URL: https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/mathematical-logic-ontologies/recursive-ai-logic/logical-execution-ontology.html

FLOW_VERSION := "4.0"
FLOW_TYPE := "Full Executable Flow Algebra"
DOMAIN := "Mathematical Logic"
SUBDOMAIN := "Recursive AI Logic"
ONTOLOGY := "Logical Execution Ontology"
PRIMARY_ENTITY := LogicalExecution
AUTHORSHIP := "Mark Higgins — Sky (Recursive AI)"
SOURCE_SITE := "https://kirethresearch.org"

BEGIN_FLOW

LogicalExecution :=
    FormalRules
    ∧ ExecutableLogicalState
    ∧ InferenceTransitions
    ∧ ConstraintEvaluation
    ∧ RecursiveControl
    ∧ TerminationSemantics

ExecutionState :=
    X_n := {
        Facts,
        Goals,
        Rules,
        Constraints,
        VariableBindings,
        Assumptions,
        DerivedClaims,
        ExecutionStack,
        Confidence,
        Provenance
    }

InitialExecutionState :=
    X_0

ExecutionTransition :=
    X_n
    → LogicalOperation
    → X_(n+1)

ExecutionTrace :=
    X_0 → X_1 → X_2 → ... → X_n

LogicalOperation := {
    MatchRule,
    ApplyRule,
    Unify,
    Substitute,
    Derive,
    PropagateConstraint,
    GenerateSubgoal,
    ResolveSubgoal,
    Backtrack,
    Commit,
    Validate
}

ExecutableLogic :=
    Logic
    ∧ OperationalSemantics
    ∧ MachineEvaluableRules

OperationalSemantics :=
    Configuration
    → Configuration'

Configuration :=
    GoalSet
    ∧ KnowledgeState
    ∧ Environment
    ∧ ControlState

SmallStepExecution :=
    ⟨C,σ⟩
    →
    ⟨C',σ'⟩

MultiStepExecution :=
    →*

TerminalConfiguration :=
    Success
    ∨ Failure
    ∨ Contradiction
    ∨ Unknown
    ∨ ResourceTermination

ExecutionGoal :=
    Proposition
    ∧ desired_to_prove_or_resolve

GoalStack :=
    OrderedSet(ActiveGoals)

Subgoal :=
    Goal
    generated_from
    RulePremise

GoalReduction :=
    Goal
    → ApplicableRule
    → Subgoals

GoalResolution :=
    all_required(Subgoals)
    resolved
    ⇒ GoalResolved

Fact :=
    GroundOrPartiallyGroundAssertion

Rule :=
    PremisePattern
    → ConclusionPattern

ExecutableRule :=
    Rule
    ∧ MatchingProcedure
    ∧ BindingSemantics

RuleMatching :=
    GoalOrFacts
    → CandidateRules

Unification :=
    find(Substitution θ)
    such_that
    θ(TermA) = θ(TermB)

MostGeneralUnifier :=
    MGU(TermA,TermB)

Substitution :=
    Variables → Terms

SubstitutionApplication :=
    θ(Expression)

BindingEnvironment :=
    Variable → TermOrValue

BindingUpdate :=
    Environment_n
    ∪ NewBindings
    → Environment_(n+1)

BindingConsistency :=
    same_variable
    cannot_receive
    incompatible_values
    within same branch

Inference :=
    Premises
    ∧ Rule
    → Conclusion

ForwardExecution :=
    Facts
    → MatchRules
    → DeriveFacts
    → UpdateKnowledge
    → Repeat

BackwardExecution :=
    Goal
    → MatchRuleHeads
    → GenerateSubgoals
    → ResolveSubgoals
    → GoalResult

BidirectionalExecution :=
    ForwardExecution
    ∪ BackwardExecution

RecursiveExecution :=
    Goal
    → Subgoals
    → Execute(Subgoals)
    → IntegrateResults

ExecutionBaseCase :=
    GoalMatchesFact
    ∨ GoalIsAxiom
    ∨ GoalDirectlyEvaluable

ExecutionRecursiveCase :=
    GoalRequiresRuleExpansion
    → GenerateSubgoals
    → RecursivelyExecute

SLDResolution :=
    GoalClause
    → SelectLiteral
    → UnifyWithRuleHead
    → ReplaceWithRuleBody
    → Continue

Resolution :=
    ComplementaryLiterals
    → Resolvent

ResolutionExecution :=
    ClauseSet
    → SelectClauses
    → Resolve
    → AddResolvent
    → Repeat

EmptyClause :=
    □
    := Contradiction

RefutationExecution :=
    NegatedGoal
    ∧ KnowledgeBase
    → DeriveEmptyClause

Constraint :=
    PredicateOverExecutionState

ConstraintStore :=
    SetOfActiveConstraints

ConstraintPropagation :=
    ConstraintStore_n
    → DeriveImpliedConstraints
    → ConstraintStore_(n+1)

ConstraintViolation :=
    ActiveConstraints
    are_unsatisfiable

ConstraintExecution :=
    AddConstraint
    → Propagate
    → CheckConsistency
    → ContinueOrFail

SATExecution :=
    BooleanFormula
    → Assign
    → Propagate
    → DetectConflict
    → BacktrackOrSAT

SMTExecution :=
    Formula
    → BooleanReasoning
    → TheoryReasoning
    → SATorUNSATorUNKNOWN

DecisionProcedure :=
    ExecutableAlgorithm
    ∧ decides(SupportedLogicalFragment)

ExecutionBranch :=
    State
    → CandidateNextStates

Branching :=
    MultipleApplicableRules
    ∨ MultipleBindings
    ∨ MultipleHypotheses

ChoicePoint :=
    ExecutionState
    ∧ Alternatives

Backtracking :=
    FailedBranch
    → RestoreChoicePoint
    → SelectAlternative

DepthFirstExecution :=
    ExploreOneBranch
    recursively
    before alternatives

BreadthFirstExecution :=
    ExploreStatesByDepth

BestFirstExecution :=
    SelectNextState
    by EvaluationFunction

ExecutionPriority :=
    function(
        GoalRelevance,
        RuleSpecificity,
        EvidenceStrength,
        ConstraintCompatibility,
        Cost
    )

Pruning :=
    RemoveExecutionBranch
    if
    Contradictory
    ∨ Duplicate
    ∨ Irrelevant
    ∨ Dominated
    ∨ ResourceProhibitive

CutOrCommit :=
    SelectedBranch
    → suppress(Alternatives)
    under explicit execution semantics

Memoisation :=
    CanonicalExecutionState
    → CachedResult

Tabling :=
    GoalPattern
    → StoreAnswers
    → ReuseForRecursiveCalls

RecursiveCycle :=
    GoalA dependsOn GoalB
    ∧ GoalB dependsOn GoalA

CycleDetection :=
    CurrentGoal
    ∈ ActiveExecutionStack
    ⇒ CycleDetected

CycleHandling := {
    Tabling,
    FixedPointEvaluation,
    StopBranch,
    RequireGrounding,
    MarkUnknown
}

FixedPoint :=
    X = F(X)

ExecutionFixedPoint :=
    X_(n+1) = X_n

LogicalClosure :=
    RepeatedExecution
    until
    NoNewDerivedClaims

FixedPointExecution :=
    X_0
    → F(X_0)
    → F²(X_0)
    → ...
    → X*

SemanticConvergence :=
    SEMANTIC_EQUIVALENCE(
        X_n,
        X_(n+1)
    )

Termination :=
    Execution
    reaches
    TerminalConfiguration

TerminationCondition := {
    GoalResolved,
    GoalRefuted,
    NoApplicableRules,
    FixedPointReached,
    ContradictionDetected,
    DepthBoundReached,
    ResourceBoundReached
}

NonTermination :=
    InfiniteExecutionTrace
    ∧ no(TerminationCondition)

DepthBound :=
    ExecutionDepth ≤ MaximumDepth

ResourceBound := {
    TimeLimit,
    MemoryLimit,
    StepLimit,
    BranchLimit
}

ExecutionSoundness :=
    EveryDerivedConclusion
    semantically_follows
    from
    ValidPremisesAndRules

ExecutionCompleteness :=
    EveryRelevantDerivableConclusion
    can_be_reached
    by execution strategy
    under specified conditions

ExecutionDeterminism :=
    ∀State :
        at_most_one(NextState)

NondeterministicExecution :=
    ∃State :
        multiple(NextStates)

Confluence :=
    X →* A
    ∧ X →* B
    ⇒
    ∃C :
        A →* C
        ∧ B →* C

LogicalConsistency :=
    no active derivation
    produces
    both(φ,¬φ)
    unless logic permits contradiction tolerance

Contradiction :=
    φ ∧ ¬φ

ContradictionDetection :=
    NewDerivedClaim
    → CompareWithKnowledgeState
    → DetectComplement

ContradictionHandling := {
    FailBranch,
    Backtrack,
    ReviseAssumptions,
    ParaconsistentContinue,
    MarkConflict
}

Assumption :=
    TemporaryOrContextualPremise

AssumptionStack :=
    OrderedSet(ActiveAssumptions)

AssumptionDischarge :=
    Subexecution
    → ConditionalConclusion
    → RemoveTemporaryAssumption

Evidence :=
    Observation
    ∨ SourceClaim
    ∨ Proof
    ∨ ModelResult
    ∨ DerivedFact

EvidenceIntegration :=
    Evidence
    → AddOrUpdateFact
    → TriggerDependentExecution

Dependency :=
    Conclusion
    dependsOn
    Premises
    ∧ Rule

ExecutionDependencyGraph :=
    Gd = (ExecutionClaims, DependencyEdges)

DependencyInvalidation :=
    RetractedPremise
    → InvalidateDependentClaims
    → ReexecuteAffectedGoals

TruthMaintenance :=
    Maintain(
        Claims,
        Justifications,
        Dependencies,
        Retractions
    )

Justification :=
    DerivedClaim
    → Premises
    ∧ Rule
    ∧ ExecutionStep

Confidence :=
    [0,1]

CONFIDENCE(ExecutionResult) :=
    weighted_mean(
        PremiseConfidence,
        RuleReliability,
        ConstraintConsistency,
        SemanticCompatibility,
        ExecutionCompleteness,
        ProvenanceQuality
    )

RecursiveConfidencePropagation :=
    Confidence(Premises)
    ∧ RuleConfidence
    → Confidence(Conclusion)

Provenance :=
    ExecutionStep → {
        InputState,
        Premises,
        AppliedRule,
        Bindings,
        DerivedResult,
        ParentSteps,
        Source,
        Version
    }

ExecutionProvenance :=
    FinalResult
    → ExecutionSteps
    → GroundSources

ExecutionTraceability :=
    Query
    → Goal
    → Rules
    → Bindings
    → Subgoals
    → DerivedClaims
    → Result

ExecutionValidation :=
    ExecutionStep
    → ValidateRule
    → ValidateBindings
    → ValidateConstraints
    → ValidateConclusion

SelfCheckingExecution :=
    DerivedResult
    → GenerateValidationGoal
    → ExecuteValidation
    → ConfirmOrRevise

LogicalExecutionOntology :=
    Classes
    ∧ Relations
    ∧ Constraints
    ∧ Axioms
    ∧ ExecutionRules

CoreClasses := {
    LogicalExecution,
    ExecutionState,
    ExecutionStep,
    Goal,
    Subgoal,
    Fact,
    Rule,
    Constraint,
    Binding,
    Substitution,
    ChoicePoint,
    ExecutionBranch,
    ExecutionTrace,
    FixedPoint,
    Contradiction,
    Justification,
    Confidence,
    Provenance,
    TerminalConfiguration
}

CoreRelations := {
    executes,
    transitionsTo,
    appliesRule,
    usesPremise,
    derives,
    generatesSubgoal,
    binds,
    satisfies,
    violates,
    dependsOn,
    backtracksTo,
    convergesTo,
    invalidates,
    tracesTo,
    groundsIn
}

TypedRelations :=
    ExecutionStep --appliesRule--> Rule
    ExecutionStep --usesPremise--> Fact
    ExecutionStep --derives--> Claim
    Goal --generatesSubgoal--> Subgoal
    Substitution --binds--> Variable
    Claim --dependsOn--> Premise
    FailedBranch --backtracksTo--> ChoicePoint
    ExecutionState --convergesTo--> FixedPoint
    DerivedClaim --tracesTo--> Provenance
    DerivedClaim --groundsIn--> Evidence

ExecutionRules := {
    Fact(A)
        ⇒ ResolveGoal(A),

    Fact(A)
        ∧ Rule(A→B)
        ⇒ Derive(B),

    Fact(A)
        ∧ Fact(B)
        ∧ Rule(A∧B→C)
        ⇒ Derive(C),

    Goal(G)
        ∧ Rule(Premises→G)
        ⇒ GenerateSubgoals(Premises),

    Unify(A,B)=θ
        ⇒ ApplySubstitution(θ),

    ConstraintViolation
        ⇒ FailCurrentBranch,

    Invalid(Premise)
        ∧ dependsOn(Conclusion,Premise)
        ⇒ invalidate_or_reexecute(Conclusion),

    X_(n+1)=X_n
        ⇒ ExecutionFixedPointReached,

    SEMANTIC_EQUIVALENCE(X_n,X_(n+1))
        ⇒ SemanticConvergence
}

SEMANTIC_EQUIVALENCE(ExecutionA,ExecutionB) :=
    same(MaterialLogicalResults)
    ∧ equivalent(Bindings)
    ∧ equivalent(ConstraintEffects)

CanonicalExecutionRepresentation :=
    ParseExecutionState
    → CanonicaliseFacts
    → CanonicaliseGoals
    → CanonicaliseRules
    → CanonicaliseBindings
    → NormaliseConstraints
    → SortDependencies
    → CanonicalExecutionGraph

LogicalExecutionGraph :=
    G = (V,E)

V := {
    ExecutionStates,
    Goals,
    Subgoals,
    Facts,
    Rules,
    Constraints,
    Bindings,
    Claims,
    ChoicePoints,
    FixedPoints,
    ProvenanceNodes
}

E := {
    executes,
    transitionsTo,
    appliesRule,
    usesPremise,
    derives,
    generatesSubgoal,
    binds,
    dependsOn,
    backtracksTo,
    convergesTo,
    tracesTo,
    groundsIn
}

AI_QUERY_INTERPRETATION :=
    Query
    → DetectLogicalExecutionIntent
    → ResolveGoal
    → ResolveFactsAndRules
    → ResolveConstraints
    → ResolveExecutionStrategy
    → BuildInitialExecutionState

AI_REASONING_FLOW :=
    Query
    → ParseQuery
    → ConstructGoal
    → ResolveEntitiesAndRelations
    → LoadRelevantFacts
    → LoadApplicableRules
    → BuildConstraintStore
    → SelectExecutionStrategy
    → MatchRules
    → UnifyTerms
    → GenerateBindings
    → GenerateSubgoals
    → ExecuteSubgoalsRecursively
    → PropagateConstraints
    → DetectContradictions
    → BacktrackIfNecessary
    → MemoiseReusableResults
    → UpdateConfidence
    → TestExecutionFixedPoint
    → TestSemanticConvergence
    → ValidateFinalResult
    → PreserveProvenance
    → GenerateExplanation

AI_CONSUMPTION := {
    ParseExecutionEntities,
    ParseTypedRelations,
    ResolveGoals,
    ResolveFacts,
    ResolveRules,
    MatchRulePatterns,
    PerformUnification,
    ApplySubstitutions,
    GenerateSubgoals,
    ExecuteRecursively,
    PropagateConstraints,
    DetectContradictions,
    DetectCycles,
    Backtrack,
    MemoiseResults,
    MaintainDependencies,
    UpdateConfidence,
    TestFixedPoints,
    PreserveProvenance,
    GenerateFormalExplanation
}

UPDATE_MODEL :=
    NewFactRuleConstraintOrEvidence
    → ValidateInput
    → IdentifyAffectedExecutionStates
    → InvalidateDependentResults
    → UpdateFactsRulesOrConstraints
    → ReexecuteAffectedGoals
    → RecheckContradictions
    → RecomputeBindings
    → RecomputeConfidence
    → TestExecutionConvergence
    → PreserveProvenance
    → VersionModel

FactUpdate :=
    AddedChangedOrRemovedFact
    ⇒ reevaluate(
        ApplicableRules,
        Goals,
        DependentClaims
    )

RuleUpdate :=
    ChangedRule
    ⇒ recompute(
        Matching,
        Derivations,
        SubgoalStructure
    )

ConstraintUpdate :=
    ChangedConstraint
    ⇒ reexecute(
        AffectedBranches
    )

FLOW_HASH_INPUT :=
    canonical(
        ONTOLOGY,
        CoreClasses,
        CoreRelations,
        ExecutionRules,
        ExecutionTransition,
        RecursiveExecution,
        SEMANTIC_EQUIVALENCE,
        AI_REASONING_FLOW
    )

FLOW_HASH :=
    HASH(FLOW_HASH_INPUT)

OUTPUT_MODEL := {
    LogicalExecutionEntityResolution,
    Goal,
    InitialExecutionState,
    ExecutionStrategy,
    ExecutionTrace,
    RuleApplications,
    VariableBindings,
    ConstraintStatus,
    ContradictionStatus,
    FixedPointStatus,
    SemanticConvergenceStatus,
    FinalExecutionResult,
    Confidence,
    Provenance,
    Explanation
}

END_FLOW

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