From 507c8dd51706fe5750791967fb726cafc5eca1b3 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Thu, 1 Jan 2026 20:42:28 +1300 Subject: Division, logarithm, exponentiation --- src/kompsos-math.ads | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 2 deletions(-) (limited to 'src/kompsos-math.ads') diff --git a/src/kompsos-math.ads b/src/kompsos-math.ads index 093acbf..49f5f8f 100644 --- a/src/kompsos-math.ads +++ b/src/kompsos-math.ads @@ -287,15 +287,65 @@ package Kompsos.Math is with Pre => Inputs'Length = 3; + -- /o -- + -- Inputs = N_Term & M_Term & Quotient_Term & Remainder_Term + function Divide + (This : in Goal; + Inputs : in Term_Array) + return Goal + with Pre => Inputs'Length = 4; + + -- Inputs = N_Term & M_Term & Quotient_Term & Remainder_Term + procedure Divide + (This : in out Goal; + Inputs : in Term_Array) + with Pre => Inputs'Length = 4; + + + -- logo -- + -- Finds solutions to + -- Base^Exponent + Remainder = Power + -- or rather + -- log_Base (Power - Remainder) = Exponent + + -- Inputs = Power_Term & Base_Term & Exponent_Term & Remainder_Term + function Logarithm + (This : in Goal; + Inputs : in Term_Array) + return Goal + with Pre => Inputs'Length = 4; + + -- Inputs = Power_Term & Base_Term & Exponent_Term & Remainder_Term + procedure Logarithm + (This : in out Goal; + Inputs : in Term_Array) + with Pre => Inputs'Length = 4; + + + -- expo -- + -- Inputs = Base_Term & Exponent_Term & Power_Term + function Exponential + (This : in Goal; + Inputs : in Term_Array) + return Goal + with Pre => Inputs'Length = 3; + + -- Inputs = Base_Term & Exponent_Term & Power_Term + procedure Exponential + (This : in out Goal; + Inputs : in Term_Array) + with Pre => Inputs'Length = 3; + + -- repeated-mul -- - -- Inputs = Base_Term & Exponent_Term & Product_Term + -- Inputs = Base_Term & Exponent_Term & Power_Term function Repeated_Multiply (This : in Goal; Inputs : in Term_Array) return Goal with Pre => Inputs'Length = 3; - -- Inputs = Base_Term & Exponent_Term & Product_Term + -- Inputs = Base_Term & Exponent_Term & Power_Term procedure Repeated_Multiply (This : in out Goal; Inputs : in Term_Array) @@ -377,6 +427,38 @@ private with Pre => Inputs'Length = 4; + + -- splito -- + -- Inputs = N_Term & Remainder_Term & Low_Term & High_Term + function Split + (This : in Goal; + Inputs : in Term_Array) + return Goal + with Pre => Inputs'Length = 4; + + -- Inputs = N_Term & Remainder_Term & Low_Term & High_Term + procedure Split + (This : in out Goal; + Inputs : in Term_Array) + with Pre => Inputs'Length = 4; + + + + -- exp2 -- + -- Inputs = Power_Term & Base_Term & Exponent_Term + function Exp_Two + (This : in Goal; + Inputs : in Term_Array) + return Goal + with Pre => Inputs'Length = 3; + + -- Inputs = Power_Term & Base_Term & Exponent_Term + procedure Exp_Two + (This : in out Goal; + Inputs : in Term_Array) + with Pre => Inputs'Length = 3; + + end Kompsos.Math; -- cgit