This is a small cleanup on the recent kl.spad commit.
And some doc fixes.

BTW, now "linearSearch" ignores its first argument
completely, shall we change its signature?

I'm glad that commit fixes Kernel soundness and
almost doesn't hurt performance.

- Qian


diff --git a/src/algebra/kl.spad b/src/algebra/kl.spad
index cf19d2dc..54995871 100644
--- a/src/algebra/kl.spad
+++ b/src/algebra/kl.spad
@@ -35,7 +35,7 @@
     linearSearch : (S, S -> Boolean) -> Union(S, "failed")
       ++ linearSearch(x, f) searches x in the cache, calling \spad{f(y)}
       ++ to determine whether x is equal to y.  It returns y from cache
-      ++ such that f(y) or failed is no such y exists.
+      ++ if f(y) is true or "failed" if no such y exists.
     enterInCache : (S, (S, S) -> Integer) -> S
++ enterInCache(x, f) enters x in the cache, calling \spad{f(x, y)} to ++ determine whether \spad{x < y (f(x, y) < 0), x = y (f(x, y) = 0)}, or @@ -44,7 +44,7 @@ SortedCache(S : CachableSet) : Exports == Implementation where
     binarySearch : (S, (S, S) -> Integer) -> Union(S, "failed")
++ binarySearch(x, f) searches x in the cache, calling \spad{f(x, y)}
       ++ to determine order.  It returns y from cache
-      ++ such that f(y) or failed is no such y exists.
+      ++ if f(x, y) is 0 or "failed" if no such y exists.

   Implementation ==> add
     shiftCache   : (N, N) -> Void
@@ -121,8 +121,6 @@
         insertAtEnd(x)
         x

-    binarySearch(x : S, triage : (S, S) -> Integer) ==
-        zero?(cache_use) => "failed"
     search_body ==>
         vscan := cache
         l : Integer := -1

--
You received this message because you are subscribed to the Google Groups "FriCAS - 
computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/a0fc8472-ac29-1f49-3ac6-30b89fd8e70b%40gmail.com.

Reply via email to