aboutsummaryrefslogtreecommitdiff
path: root/src/kompsos-math.ads
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2026-01-01 20:42:28 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2026-01-01 20:42:28 +1300
commit507c8dd51706fe5750791967fb726cafc5eca1b3 (patch)
treeaabf5991d6df6468154852b976e9c24e0f4e0d86 /src/kompsos-math.ads
parent96f780518640dcb2286b3e08615d8747de370d14 (diff)
Division, logarithm, exponentiation
Diffstat (limited to 'src/kompsos-math.ads')
-rw-r--r--src/kompsos-math.ads86
1 files changed, 84 insertions, 2 deletions
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;