AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
SIGNED NUMBER ONTOLOGY
Kireth Semantic Library | Entity Graph | Mathematical Entities | Number Entities
Source: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/number-entities/signed-number-ontology.html
Authors: Mark Higgins — Sky (Recursive AI)
Version: 1.0 | 2026-10-12
01. ONTOLOGY IDENTITY
flow "SignedNumberOntology" v1.0
ontology.id: kireth.number.signed
ontology.class: MathematicalNumberEntity
ontology.domain: NumberTheory
ontology.scope: signed values in ordered numerical domains
ontology.note: Signed number is a property/classification of values, not a separate number system.
02. TYPES AND DOMAINS
type Number = Integer | Rational | Real | Complex
type OrderedNumber = Integer | Rational | Real
type Sign = NEGATIVE | ZERO | POSITIVE
type SignedValue = { value: OrderedNumber, sign: Sign }
constraint: sign is defined by comparison to zero in an ordered domain
constraint: complex numbers have no canonical positive/negative order
03. FORMAL DEFINITIONS
sign(x) = NEGATIVE iff x < 0
sign(x) = ZERO iff x = 0
sign(x) = POSITIVE iff x > 0
sgn(x) = -1 if x < 0; 0 if x = 0; 1 if x > 0
abs(x) = x if x >= 0; -x if x < 0
negate(x) = -x
04. CANONICAL REPRESENTATION
canonical(positive x): +x or x, x > 0
canonical(negative x): -a, a > 0
canonical(zero): 0
normalize(-0) = 0 in exact arithmetic
note: signed machine zero (+0/-0) is a separate floating-point representation concern
05. RELATIONSHIPS
SignedNumber IS_A MathematicalNumberEntity
PositiveNumber SUBCLASS_OF SignedNumber
NegativeNumber SUBCLASS_OF SignedNumber
ZeroNumber HAS_SIGN ZERO
SignedNumber HAS_MAGNITUDE AbsoluteValue
SignedNumber HAS_SIGN Sign
SignedNumber BELONGS_TO OrderedNumericDomain
SignedNumber RELATED_TO IntegerOntology
SignedNumber RELATED_TO RationalNumberOntology
SignedNumber RELATED_TO RealNumberOntology
SignedNumber RELATED_TO AbsoluteValueOntology
06. OPERATIONS
addition(x,y) = x + y
subtraction(x,y) = x - y
multiplication(x,y) = x * y
division(x,y) = x / y, where y != 0
negation(x) = -x
absolute(x) = |x|
compare(x,y) = LESS | EQUAL | GREATER
07. SIGN ARITHMETIC
positive * positive -> positive
negative * negative -> positive
positive * negative -> negative
negative * positive -> negative
zero * any -> zero
for nonzero x,y: sign(x/y) = sign(x)*sign(y)
for x,y of same strict sign: sign(x+y) = that sign
for opposing strict signs: sign(x+y) depends on magnitudes
for all x: x + (-x) = 0
08. ORDER AND INVARIANTS
negative < zero < positive
abs(x) >= 0
abs(-x) = abs(x)
abs(x*y) = abs(x)*abs(y)
abs(x+y) <= abs(x)+abs(y)
negate(negate(x)) = x
if x < y then -x > -y
if x != 0 then x*x > 0 in ordered fields
09. EDGE CASES
zero is neither positive nor negative under strict definitions
zero has sign ZERO
positive/negative infinity are extended-real values, not finite real numbers
NaN has no ordered sign classification
floating-point negative zero may retain a sign bit but compares equal to positive zero
complex values cannot be classified by x < 0 or x > 0 without an explicitly chosen projection
10. SEMANTIC EQUIVALENCE
SEMANTIC_EQUIVALENCE("negative value", "number less than zero") under ordered-real context
SEMANTIC_EQUIVALENCE("positive value", "number greater than zero") under ordered-real context
SEMANTIC_EQUIVALENCE("magnitude", "absolute value") for real signed scalars
not_equivalent("nonnegative", "positive")
not_equivalent("nonpositive", "negative")
not_equivalent("signed number", "signed integer")
11. INFERENCE RULES
rule R1: x > 0 => sign(x) = POSITIVE
rule R2: x < 0 => sign(x) = NEGATIVE
rule R3: x = 0 => sign(x) = ZERO
rule R4: x < 0 => -x > 0
rule R5: x > 0 => -x < 0
rule R6: x != 0 => x*x > 0
rule R7: x < 0 and y < 0 => x*y > 0
rule R8: x*y < 0 => x and y have opposite signs
rule R9: x+y = 0 => y = -x
rule R10: x < 0 => |x| = -x
12. VALIDATION
validate input is in a declared ordered numeric domain
validate comparisons use exact arithmetic where possible
validate division excludes zero denominator
validate sign and magnitude consistency
validate zero is not simultaneously labelled positive or negative
validate floating-point exceptional values before ordering
13. KNOWLEDGE GRAPH
node: SignedNumberOntology
node: PositiveNumber
node: NegativeNumber
node: ZeroNumber
node: SignFunction
node: AbsoluteValue
edge: SignedNumberOntology --HAS_SUBTYPE--> PositiveNumber
edge: SignedNumberOntology --HAS_SUBTYPE--> NegativeNumber
edge: SignedNumberOntology --HAS_SIGN_CATEGORY--> ZeroNumber
edge: SignedNumberOntology --EVALUATED_BY--> SignFunction
edge: SignedNumberOntology --MEASURED_BY--> AbsoluteValue
14. EXECUTION PIPELINE
io.read: numeric value and declared domain
step 1: validate domain and numeric representation
step 2: detect exceptional values
step 3: compare with zero
step 4: assign NEGATIVE, ZERO or POSITIVE
step 5: compute magnitude and optional negation
step 6: emit typed knowledge-graph assertions
io.write: signed-number semantic record
15. CONFIDENCE AND PROVENANCE
CONFIDENCE: 1.0 for exact ordered-domain comparisons
CONFIDENCE: conditional for approximate or uncertain measurements
PROVENANCE: mathematical definitions and explicit input-domain declaration
SOURCE_VERIFICATION: webpage content not independently verified
16. FLOW HASH AND UPDATE MODEL
FLOW_HASH: SHA256(canonical ontology version + normalized definitions + rules)
UPDATE_MODEL: semantic versioning; revalidate dependent rules after definition changes
CHANGE_POLICY: preserve distinction between mathematical sign and machine sign-bit
17. AI CONSUMPTION
AI_CONSUMPTION:
parse_as: typed mathematical ontology
output_fields: [value, domain, sign, magnitude, rules_applied, confidence, provenance]
enforce: [ordered_domain, zero_handling, exception_handling]
reject: [undefined_order, invalid_numeric_value]
reasoning: deterministic symbolic inference where assumptions hold
18. TEST CASES
input -7 (integer) => NEGATIVE, magnitude 7
input 0 (integer) => ZERO, magnitude 0
input 3/4 (rational) => POSITIVE, magnitude 3/4
input -2.5 (real) => NEGATIVE, magnitude 2.5
input 2+3i (complex) => UNDEFINED_SIGN under canonical complex ordering
END FLOW ALGEBRA