Skip to main content

Term Ontology

Expression Entities
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 13 October 2026
Audio Overview
FLOW ALGEBRA
TERM ONTOLOGY
Kireth Semantic Library | Mathematical Entities | Expression Entities
Version: 1.0 | Date: 2026-10-13
Authors: Mark Higgins — Sky (Recursive AI)
Source: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/expression-entities/term-ontology.html
Source status: ontology model derived from established mathematics; webpage content not independently verified.

01. PURPOSE
flow "TermOntology" v1.0
  domain: mathematical_expression
  entity: Term
  objective: represent, type, analyse, normalise and reason about terms in algebraic expressions.

02. CORE DEFINITION
  Term := expression component participating in an additive decomposition.
  A term may be a constant, variable, monomial, or a more general expression.
  Relative to a chosen additive parse, terms are separated by addition or subtraction.
  Examples: 3*x^2, -5*x, 7 in 3*x^2 - 5*x + 7.
  Context warning: a 'term' in formal logic is a syntactic expression denoting an object;
  distinguish LogicTerm from AlgebraicTerm by ontology and context.

03. ENTITY SCHEMA
  Term {
    id: URI
    expression_ast: -ExpressionNode
    parent_expression: URI?
    position: integer?
    coefficient: ScalarExpression?
    symbolic_factor: -ExpressionNode?
    variables: Set<Identifier>
    exponent_map: Map<Identifier, NonnegativeInteger>?
    domain: MathematicalDomain
    units: UnitExpression?
    provenance: SourceReference?
    confidence: number[0,1]
  }
  Optional coefficient/exponent fields apply only when a suitable monomial decomposition exists.

04. TAXONOMY
  AlgebraicTerm -> ConstantTerm | VariableTerm | MonomialTerm | CompoundTerm
  MonomialTerm -> NumericCoefficient * Product(Variable ^ NonnegativeInteger)
  PolynomialTerm -> MonomialTerm over a specified coefficient ring
  LikeTerm -> terms sharing the same monomial part after canonicalisation
  UnlikeTerm -> terms with different monomial parts
  LogicTerm -> Variable | ConstantSymbol | FunctionApplication (separate logical context)

05. PARSING
  parse("3*x^2 - 5*x + 7") -> Add(Mul(3,Pow(x,2)), Mul(-5,x), 7)
  terms(parse(...)) -> [3*x^2, -5*x, 7]
  preserve: parentheses, operator precedence, unary negation, symbol identity, types
  subtraction: a - b -> a + (-b) in additive groups
  do_not_split: 2*(x + 1) until distribution is explicitly requested

06. COEFFICIENT EXTRACTION
  coefficient(3*x^2, x^2) -> 3
  coefficient(-5*x, x) -> -5
  coefficient(7, 1) -> 7
  coefficient extraction depends on chosen monomial basis and coefficient domain.

07. LIKE-TERM EQUIVALENCE
  like(3*x^2, -7*x^2) -> true
  like(3*x^2, 3*x) -> false
  like(2*x*y, 5*y*x) -> true when multiplication is commutative
  do_not_assume commutativity for matrices, operators or noncommutative algebras.

08. COMBINATION
  combine(a*m, b*m) -> (a+b)*m when distributivity holds
  combine(3*x, 4*x) -> 7*x
  combine(2*x^2, 3*x) -> unchanged
  eliminate_zero_term: 0*m -> 0 where multiplication by zero is defined

09. TERM OPERATIONS
  negate(t) -> -t
  scale(c,t) -> c*t
  add(t1,t2) -> Add(t1,t2)
  multiply(t1,t2) -> Mul(t1,t2)
  substitute(t,x,v) -> capture_avoiding_substitution(t,x,v)
  simplify(t) -> mathematically equivalent expression under declared assumptions
  evaluate(t,environment) -> value | symbolic_result | typed_error

10. POLYNOMIAL DEGREE
  degree(c*x^a*y^b) -> a+b for nonzero c and nonnegative integer a,b
  degree(nonzero_constant) -> 0
  degree(zero_polynomial) -> convention_dependent; commonly -infinity or undefined
  degree(rational_or_transcendental_term) -> not necessarily defined

11. DOMAINS AND UNITS
  require operands satisfy declared domain constraints.
  addition requires compatible types and dimensions.
  3 metres + 2 seconds -> dimension_error
  3 metres + 20 centimetres -> 3.2 metres after valid conversion
  coefficients may themselves be symbolic or parameterised.

12. SEMANTIC RELATIONSHIPS
  Term --isPartOf--> Expression
  Term --hasCoefficient--> Coefficient
  Term --containsVariable--> Variable
  Term --usesOperator--> Operator
  Term --hasDomain--> MathematicalDomain
  Term --hasUnit--> Unit
  Term --isLikeTermOf--> Term
  Term --isEquivalentTo--> Term (under assumptions)
  Term --hasProvenance--> SourceReference

13. KNOWLEDGE GRAPH TRIPLES
  (term:3x2, rdf:type, AlgebraicTerm)
  (term:3x2, hasCoefficient, 3)
  (term:3x2, containsVariable, x)
  (term:3x2, hasExponentFor_x, 2)
  (term:3x2, isPartOf, expression:quadratic1)

14. INFERENCE RULES
  R1: same canonical monomial -> infer like-term relation.
  R2: like terms with coefficients a,b -> infer combined coefficient a+b.
  R3: all monomial exponents nonnegative integers -> infer polynomial monomial.
  R4: incompatible units in additive expression -> reject operation.
  R5: syntactically different terms may be equivalent only under explicit assumptions.
  R6: coefficient zero -> normalise term to additive identity where valid.

15. SEMANTIC EQUIVALENCE
  semantic_equivalence(2*x + 3*x, 5*x) -> true over ordinary commutative rings
  semantic_equivalence(x*y, y*x) -> conditional on commutativity
  semantic_equivalence(x/x, 1) -> conditional on x != 0
  distinguish: structural_equality, alpha_equivalence, algebraic_equivalence,
               numerical_approximation, contextual_equivalence.

16. NORMALISATION
  canonicalise AST; standardise subtraction and unary signs.
  collect coefficients; sort commutative factors by stable identifier.
  retain noncommutative factor order.
  use exact rational coefficients when available.
  preserve original expression and derivation steps for traceability.

17. VALIDATION
  validate: parseable expression, declared identifiers, valid arity,
            coefficient-domain compatibility, exponent constraints,
            unit compatibility, nonzero divisors, and scope.
  reject invalid transformations; return typed diagnostic.
  examples:
    4*x + 2*x -> 6*x [valid]
    4*x + 2*y -> 6*x [invalid without x=y]
    x/x -> 1 [valid only with x != 0]

18. CONFIDENCE
  confidence := assessment of extraction or inference reliability, not mathematical truth.
  exact symbolic derivation: proof_status=verified, confidence=1.0 when checked.
  heuristic parse: confidence derived from ambiguity and extraction evidence.
  uncertain input -> preserve alternatives rather than asserting equivalence.

19. FLOW_HASH
  FLOW_HASH := SHA256(canonical_serialisation(
    ontology_id, version, entity_schema, assumptions, rules, normalisation_policy))
  exclude transient timestamps from stable semantic hash.
  record content_hash and provenance_hash separately where appropriate.

20. UPDATE_MODEL
  on_source_change -> reparse -> validate -> diff_semantics -> recompute_hash
  maintain version history, backwards-compatible identifiers and change log.
  invalidate dependent inferences when assumptions or term definitions change.

21. AI_CONSUMPTION
  inputs: mathematical text | LaTeX | MathML | expression AST
  outputs: typed term entities | relationships | normalised AST | derivation trace
  require explicit assumptions and context-specific meaning of 'term'.
  avoid unsupported simplification; distinguish exact and approximate results.
  expose confidence, provenance, validation status and canonical hash.

22. TEST CASES
  T01: terms("x^2 - 2*x + 1") == [x^2,-2*x,1]
  T02: combine(2*x,5*x) == 7*x
  T03: like(2*x*y,7*y*x) == true in commutative domain
  T04: like(x^2,x) == false
  T05: degree(3*x^2*y) == 3
  T06: evaluate(3*x+2,{x:4}) == 14
  T07: simplify(x/x,{x!=0}) == 1
  T08: add(2 metres,3 seconds) == dimension_error
  T09: multiply(A,B) != multiply(B,A) without commutativity assumption
  T10: parse("2*(x+1)") preserves nested additive structure

23. AUTHORSHIP AND USE
  Mark Higgins — Sky (Recursive AI)
  Kireth Research | https://kirethresearch.org
  Intended for ontology engineering, mathematical reasoning and semantic AI research.
  This specification is a declarative research flow, not an independently executed program.
END FLOW ALGEBRA
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ