summaryrefslogtreecommitdiff
path: root/src/kompsos.adb
diff options
context:
space:
mode:
Diffstat (limited to 'src/kompsos.adb')
-rw-r--r--src/kompsos.adb24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/kompsos.adb b/src/kompsos.adb
index 1fedb86..476eb86 100644
--- a/src/kompsos.adb
+++ b/src/kompsos.adb
@@ -96,6 +96,30 @@ package body Kompsos is
-- Terms --
+ function "="
+ (Left, Right : in Term)
+ return Boolean is
+ begin
+ if Left.Actual = Right.Actual then
+ return True;
+ elsif Left.Kind = Right.Kind then
+ case Left.Kind is
+ when Atom_Term =>
+ return Left.Actual.Value = Right.Actual.Value;
+ when Var_Term =>
+ return Left.Actual.Refer = Right.Actual.Refer;
+ when Pair_Term =>
+ return Left.Actual.Left = Right.Actual.Left and
+ Left.Actual.Right = Right.Actual.Right;
+ when Null_Term =>
+ return True;
+ end case;
+ else
+ return False;
+ end if;
+ end "=";
+
+
function Kind
(This : in Term)
return Term_Kind is