AI SEARCH FLOW ALGEBRA — RECURSIVE KNOWLEDGE GRAPH ONTOLOGY
Kireth Research — Semantic Library
URL: https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/mathematical-logic-ontologies/recursive-ai-logic/recursive-knowledge-graph-ontology.html
FLOW_VERSION := "4.0"
FLOW_TYPE := "Full Executable Flow Algebra"
DOMAIN := "Mathematical Logic"
SUBDOMAIN := "Recursive AI Logic"
ONTOLOGY := "Recursive Knowledge Graph Ontology"
PRIMARY_ENTITY := RecursiveKnowledgeGraph
AUTHORSHIP := "Mark Higgins — Sky (Recursive AI)"
SOURCE_SITE := "https://kirethresearch.org"
BEGIN_FLOW
RecursiveKnowledgeGraph :=
KnowledgeGraph
∧ RecursiveTraversal
∧ RecursiveInference
∧ DependencyExpansion
∧ IterativeGraphUpdate
∧ SemanticConvergence
∧ ProvenancePreservation
KnowledgeGraph :=
G = (V,E)
V :=
SetOfKnowledgeNodes
E :=
SetOfTypedKnowledgeEdges
KnowledgeNode := {
Entity,
Concept,
Class,
Instance,
Claim,
Evidence,
Rule,
Constraint,
Query,
ReasoningState
}
KnowledgeEdge := {
isA,
instanceOf,
partOf,
relatedTo,
dependsOn,
derives,
supports,
contradicts,
refines,
equivalentTo,
causes,
precedes,
tracesTo
}
TypedNode :=
Node ∧ Type
TypedEdge :=
Edge(
SourceNode,
Predicate,
TargetNode
)
GraphTriple :=
(Subject, Predicate, Object)
KnowledgeStatement :=
GraphTriple
∨ LogicalAssertion
∨ Constraint
RecursiveGraphTraversal :=
Node_n
→ AdjacentEdges(Node_n)
→ AdjacentNodes
→ RecursiveGraphTraversal
TraversalState := {
CurrentNode,
VisitedNodes,
ActivePath,
Depth,
Constraints,
AccumulatedEvidence
}
TraversalBaseCase :=
GoalNodeReached
∨ LeafNodeReached
∨ DepthBoundReached
∨ NoRelevantEdges
TraversalRecursiveCase :=
RelevantNeighbourExists
→ VisitNeighbour
→ ContinueTraversal
RecursiveDepth :=
Length(ActivePath)
DepthBound :=
RecursiveDepth ≤ MaximumDepth
BreadthBound :=
NumberOfExpandedNeighbours ≤ MaximumBreadth
VisitedSet :=
SetOfPreviouslyVisitedNodes
CycleDetection :=
CandidateNode ∈ ActivePath
⇒ CycleDetected
GraphCycle :=
Path(v0,...,vn)
∧ v0 = vn
CycleHandling := {
StopBranch,
Memoise,
CollapseStronglyConnectedComponent,
FixedPointEvaluation,
RevisitUnderChangedState
}
StronglyConnectedComponent :=
MaximalNodeSet
∧ mutuallyReachable
RecursiveDependency :=
NodeA
→ dependsOn(NodeB)
→ dependsOn(NodeC)
→ ...
DependencyClosure :=
transitive_closure(dependsOn)
RecursiveEvidenceTrace :=
Claim
→ SupportingEvidence
→ EvidenceDependencies
→ GroundSources
GroundNode :=
Node
supported_by
PrimitiveFact
∨ Axiom
∨ DirectObservation
∨ AuthoritativeSource
UngroundedCycle :=
DependencyCycle
∧ no(GroundNode)
RecursiveInference :=
GraphPattern
∧ InferenceRule
→ NewNodeOrEdge
→ ReevaluateGraph
InferenceClosure :=
repeatedly_apply(GraphInferenceRules)
until(NoNewGraphFacts)
Subsumption :=
ClassA ⊑ ClassB
RecursiveSubsumption :=
A ⊑ B
∧ B ⊑ C
⇒ A ⊑ C
Inheritance :=
Instance(x,A)
∧ A ⊑ B
⇒ Instance(x,B)
TransitiveRelation :=
R(a,b)
∧ R(b,c)
∧ Transitive(R)
⇒ R(a,c)
SymmetricRelation :=
R(a,b)
∧ Symmetric(R)
⇒ R(b,a)
InverseRelation :=
R(a,b)
∧ inverseOf(R,S)
⇒ S(b,a)
EquivalentClassPropagation :=
A ≡ B
∧ Instance(x,A)
⇒ Instance(x,B)
EquivalentPropertyPropagation :=
P ≡ Q
∧ P(a,b)
⇒ Q(a,b)
RecursiveRule :=
PremiseGraphPattern
→ ConclusionGraphPattern
GraphPatternMatching :=
Pattern
→ CandidateSubgraphs
→ VariableBindings
RuleApplication :=
Match(Premises)
→ ValidateConstraints
→ Materialise(Conclusion)
Materialisation :=
DerivedTriple
added_to
KnowledgeGraph
VirtualInference :=
DerivedTriple
computed_on_demand
without_persistent_materialisation
RecursiveMaterialisation :=
NewTriples_n
→ ApplyRules
→ NewTriples_(n+1)
→ repeat_until_closure
GraphState :=
G_n
GraphUpdate :=
G_(n+1)
=
Update(
G_n,
NewNodes,
NewEdges,
RevisedNodes,
RemovedInvalidDerivations
)
MonotonicGraphUpdate :=
G_n ⊆ G_(n+1)
NonMonotonicGraphUpdate :=
NewEvidence
may_remove_or_invalidate
ExistingDerivedKnowledge
FixedPoint :=
G* = F(G*)
GraphFixedPointIteration :=
G_0
→ F(G_0)
→ F²(G_0)
→ ...
→ G*
GraphConvergence :=
G_(n+1) = G_n
SemanticGraphConvergence :=
SEMANTIC_EQUIVALENCE(
G_(n+1),
G_n
)
ConvergenceCriteria := {
NoNewNodes,
NoNewEdges,
NoChangedEntityResolution,
NoChangedConstraints,
NoChangedMaterialConclusions,
ConfidenceDeltaBelowThreshold
}
EntityResolution :=
Mention
→ CandidateEntities
→ Context
→ GraphNeighbourhood
→ SelectedEntity
RecursiveEntityResolution :=
EntityCandidate_n
→ ExpandNeighbourhood
→ CompareRelations
→ ReevaluateIdentity
→ EntityCandidate_(n+1)
EntityIdentity :=
sameAs
∨ differentFrom
SameAsPropagation :=
sameAs(a,b)
→ transfer_compatible_relations(a,b)
EntityMerge :=
sameEntity(a,b)
→ CanonicalEntity
→ MergeCompatibleEdges
EntitySplit :=
AmbiguousEntity
→ DistinctCanonicalEntities
→ ReassignEdges
RelationResolution :=
CandidatePredicate
→ DomainRangeCheck
→ NeighbourhoodCompatibility
→ SelectedPredicate
RecursiveRelationResolution :=
Relation_n
→ ExpandRelatedPredicates
→ ApplyOntologyConstraints
→ Relation_(n+1)
Ontology :=
Classes
∧ Properties
∧ Individuals
∧ Axioms
∧ Constraints
OntologyGraph :=
Ontology
represented_as
TypedKnowledgeGraph
ClassHierarchy :=
Class
→ Superclass
→ HigherSuperclass
PropertyHierarchy :=
Property
→ Superproperty
→ HigherSuperproperty
RecursiveHierarchyExpansion :=
Node
→ Parent
→ ParentOfParent
→ ...
DomainConstraint :=
Property
→ RequiredSourceClass
RangeConstraint :=
Property
→ RequiredTargetClass
CardinalityConstraint :=
Entity
∧ Property
→ AllowedValueCount
DisjointnessConstraint :=
Disjoint(A,B)
TypeConflict :=
Instance(x,A)
∧ Instance(x,B)
∧ Disjoint(A,B)
IdentityConflict :=
sameAs(a,b)
∧ differentFrom(a,b)
GraphContradiction :=
Derived(φ)
∧ Derived(¬φ)
RecursiveConsistencyCheck :=
GraphUpdate
→ DetectDirectConflicts
→ PropagateConstraints
→ DetectDerivedConflicts
→ TraceDependencies
→ ResolveOrAnnotate
ConflictGraph :=
Gc = (ConflictingNodes, ConflictEdges)
ConflictPropagation :=
InvalidatedNode
→ DependentDerivedNodes
→ Reevaluate
DependencyInvalidation :=
RetractedPremise
→ invalidate(
ConclusionsDependingOnPremise
)
TruthMaintenance :=
Maintain(
Beliefs,
Justifications,
Dependencies,
Retractions
)
Justification :=
DerivedClaim
→ SupportingPremises
∧ AppliedRule
AssumptionBasedTruthMaintenance :=
Conclusions
indexed_by
AssumptionSets
RecursiveTruthMaintenance :=
ChangedPremise
→ TraverseDependents
→ RecomputeJustifications
→ UpdateBeliefStatus
Evidence :=
{
SourceClaim,
Observation,
FormalProof,
DatasetRecord,
ModelResult,
DerivedGraphFact
}
EvidenceNode :=
Evidence
∧ Provenance
SupportEdge :=
Evidence --supports--> Claim
ContradictionEdge :=
EvidenceOrClaim --contradicts--> Claim
EvidenceAggregation :=
Claim
→ SupportingEvidenceSet
→ AggregateSupport
CONFIDENCE(NodeOrEdge) :=
weighted_mean(
SourceReliability,
EvidenceStrength,
LogicalSupport,
SemanticCompatibility,
DependencyReliability,
RecursiveStability,
ProvenanceQuality
)
RecursiveConfidencePropagation :=
Confidence(Premises)
∧ RuleConfidence
→ Confidence(Conclusion)
ConfidenceUpdate :=
NewEvidence
→ RecomputeAffectedNodes
→ PropagateConfidenceChanges
Provenance :=
NodeOrEdge → {
Source,
CreationMethod,
ParentNodes,
AppliedRules,
Timestamp,
Version
}
RecursiveProvenance :=
DerivedNode
→ Justifications
→ ParentNodes
→ GroundSources
GraphTraceability :=
Query
→ TraversedNodes
→ Evidence
→ Rules
→ DerivedAnswer
Query :=
GraphInformationNeed
GraphQuery :=
Pattern
∧ Constraints
∧ Projection
RecursiveQuery :=
Query
→ ResolveSeedEntities
→ TraverseGraph
→ GenerateSubqueries
→ ResolveDependencies
→ AggregateResults
SubqueryGraph :=
Gq = (Subqueries, DependencyEdges)
PathQuery :=
FindPath(Source,Target)
RecursivePathSearch :=
CurrentNode
→ Neighbours
→ Search(Target)
Reachability :=
Reachable(a,b)
iff
PathExists(a,b)
RecursiveReachability :=
Edge(a,b)
⇒ Reachable(a,b)
Edge(a,c)
∧ Reachable(c,b)
⇒ Reachable(a,b)
ShortestPath :=
minimum_length(PathSet)
SemanticPath :=
Path
∧ relation_sequence_has
coherent_semantic_meaning
Relevance :=
function(
SemanticSimilarity,
GraphDistance,
RelationImportance,
EvidenceStrength,
QueryContext
)
RecursiveRelevanceExpansion :=
SeedNodes
→ ExpandHighestRelevanceEdges
→ RecomputeRelevance
→ ContinueUntilThreshold
GraphPruning :=
RemoveOrIgnore(
IrrelevantBranches,
InvalidBranches,
RedundantPaths,
LowConfidenceBranches
)
Memoisation :=
CanonicalSubquery
∧ GraphVersion
→ CachedResult
RecursiveGraphMemoisation :=
if Cached(Subquery,GraphVersion)
then Reuse
else ComputeAndCache
KnowledgeGraphComposition :=
GraphA
⊕ GraphB
→ MergedGraph
GraphMerge :=
AlignEntities
→ AlignRelations
→ MergeCompatibleKnowledge
→ DetectConflicts
→ PreserveProvenance
RecursiveGraphIntegration :=
ExternalGraph
→ MapVocabulary
→ ResolveEntities
→ ResolveRelations
→ ImportKnowledge
→ InferNewRelations
→ RecheckConsistency
GraphAlignment :=
NodesAndRelations(GraphA)
↔ NodesAndRelations(GraphB)
SemanticEquivalence :=
EquivalentMeaning
despite
different(GraphRepresentation)
SEMANTIC_EQUIVALENCE(GraphA,GraphB) :=
same(MaterialSemanticClaims)
∧ equivalent(EntityMappings)
∧ equivalent(RelationMappings)
GraphCanonicalisation :=
ResolveCanonicalEntities
→ NormaliseRelationNames
→ NormaliseTypes
→ SortTriples
→ NormaliseConstraints
→ CanonicalGraph
RecursiveKnowledgeGraphOntology :=
Classes
∧ Relations
∧ Constraints
∧ Axioms
∧ RecursiveGraphRules
CoreClasses := {
RecursiveKnowledgeGraph,
KnowledgeGraph,
KnowledgeNode,
KnowledgeEdge,
Entity,
Class,
Instance,
Relation,
Claim,
Evidence,
Rule,
Constraint,
Query,
Subquery,
Dependency,
Justification,
Provenance,
GraphState,
FixedPoint,
Cycle
}
CoreRelations := {
recursesInto,
dependsOn,
derives,
supports,
contradicts,
refines,
equivalentTo,
instanceOf,
subclassOf,
relatedTo,
convergesTo,
tracesTo,
groundsIn,
invalidates
}
TypedRelations :=
Query --recursesInto--> Subquery
Claim --dependsOn--> Claim
Rule --derives--> Claim
Evidence --supports--> Claim
Evidence --contradicts--> Claim
Instance --instanceOf--> Class
Class --subclassOf--> Class
DerivedClaim --groundsIn--> Evidence
GraphState --convergesTo--> FixedPoint
Claim --tracesTo--> Provenance
RecursiveGraphRules := {
instanceOf(x,A)
∧ subclassOf(A,B)
⇒ instanceOf(x,B),
subclassOf(A,B)
∧ subclassOf(B,C)
⇒ subclassOf(A,C),
R(a,b)
∧ R(b,c)
∧ Transitive(R)
⇒ R(a,c),
equivalentTo(A,B)
∧ Relation(A,X)
⇒ candidate(Relation(B,X)),
Evidence(E)
∧ supports(E,C)
⇒ update(CONFIDENCE(C)),
Retracted(P)
∧ dependsOn(C,P)
⇒ invalidate_or_recheck(C),
G_(n+1)=G_n
⇒ GraphFixedPointReached,
SEMANTIC_EQUIVALENCE(G_n,G_(n+1))
⇒ SemanticGraphConvergence
}
AI_QUERY_INTERPRETATION :=
Query
→ DetectKnowledgeGraphIntent
→ ResolveSeedEntities
→ ResolveRequestedRelations
→ ResolveConstraints
→ DetermineRecursiveDependencies
→ BuildInitialQueryGraph
AI_REASONING_FLOW :=
Query
→ ParseQuery
→ ResolveSeedEntities
→ BuildTypedQueryPattern
→ SearchDirectGraphMatches
→ IdentifyKnowledgeGaps
→ ExpandRelevantRelations
→ GenerateSubqueries
→ ResolveSubqueriesRecursively
→ ApplyGraphInferenceRules
→ MaterialiseOrVirtuallyDeriveKnowledge
→ PropagateConstraints
→ DetectCycles
→ CheckGrounding
→ DetectContradictions
→ UpdateConfidence
→ TestGraphConvergence
→ RepeatIfNecessary
→ RankRelevantSupportedResults
→ PreserveProvenance
→ GenerateExplanation
AI_CONSUMPTION := {
ParseGraphEntities,
ParseTypedEdges,
ResolveEntityIdentity,
ResolveRelationSemantics,
TraverseGraphRecursively,
ExpandDependencies,
MatchGraphPatterns,
ApplyInferenceRules,
ComputeTransitiveClosure,
DetectCycles,
CheckGrounding,
MaintainTruthDependencies,
DetectContradictions,
UpdateConfidence,
CompareSemanticEquivalence,
PreserveProvenance,
GenerateFormalExplanation
}
UPDATE_MODEL :=
NewNodeEdgeEvidenceOrRule
→ ValidateInput
→ ResolveEntityIdentity
→ ResolveRelationType
→ IdentifyAffectedSubgraph
→ InvalidateDependentDerivations
→ UpdateGraph
→ ReapplyRecursiveInference
→ RecheckConstraints
→ RecheckContradictions
→ RecomputeConfidence
→ TestConvergence
→ PreserveProvenance
→ VersionModel
NodeUpdate :=
AddedChangedOrRemovedNode
⇒ reevaluate(
AdjacentEdges,
Dependencies,
DerivedClaims
)
EdgeUpdate :=
AddedChangedOrRemovedEdge
⇒ recompute(
RelationClosure,
InferenceResults,
RelevantPaths
)
RuleUpdate :=
ChangedGraphRule
⇒ recompute(
DependentMaterialisations,
Justifications
)
EvidenceUpdate :=
NewOrRetractedEvidence
⇒ update(
SupportedClaims,
Confidence,
TruthMaintenance
)
FLOW_HASH_INPUT :=
canonical(
ONTOLOGY,
CoreClasses,
CoreRelations,
RecursiveGraphRules,
RecursiveGraphTraversal,
GraphFixedPointIteration,
SEMANTIC_EQUIVALENCE,
AI_REASONING_FLOW
)
FLOW_HASH :=
HASH(FLOW_HASH_INPUT)
OUTPUT_MODEL := {
KnowledgeGraphEntityResolution,
TypedKnowledgeGraph,
QueryGraph,
DependencyClosure,
TraversalPaths,
DerivedNodes,
DerivedEdges,
GroundingStatus,
CycleStatus,
ConsistencyStatus,
GraphConvergenceStatus,
Confidence,
Provenance,
Explanation
}
END_FLOW
END OF AI SEARCH FLOW ALGEBRA
Download Code
Copy to Clipboard