login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

Edit detail for SandBoxKernel revision 2 of 6

1 2 3 4 5 6
Editor: Bill Page
Time: 2015/03/20 17:26:09 GMT+0
Note: r1893

changed:
-Test old defintion
-\begin{axiom}
-position(exp(1)::Kernel EXPR INT)
-position(pi()::EXPR INT::Kernel EXPR INT)
-(%e<%pi)$EXPR INT
-\end{axiom}
-
-<h3 onClick="expandcontent(this, 'sc1')" style="cursor:hand; cursor:pointer">
-<span class="showstate"></span>All exp() are sorted before pi()</h3>
-<div id="sc1" class="switchcontent" style="display:none">
-\begin{axiom}
-)clear completely
-\end{axiom}
-
-\begin{axiom}
\begin{spad}
)abbrev category CACHSET CachableSet
++ Sets whose elements can cache an integer
++ Author: Manuel Bronstein
++ Date Created: 31 Oct 1988
++ Date Last Updated: 14 May 1991
++ Description:
++   A cachable set is a set whose elements keep an integer as part
++   of their structure.
CachableSet : Category == SetCategory with
  position   : % -> NonNegativeInteger
    ++ position(x) returns the integer n associated to x.
  setPosition : (%, NonNegativeInteger) -> Void
    ++ setPosition(x, n) associates the integer n to x.

)abbrev package SCACHE SortedCache
++ Cache of elements in a set
++ Author: Manuel Bronstein
++ Date Created: 31 Oct 1988
++ Date Last Updated: 14 May 1991
++   A sorted cache of a cachable set S is a dynamic structure that
++   keeps the elements of S sorted and assigns an integer to each
++   element of S once it is in the cache. This way, equality and ordering
++   on S are tested directly on the integers associated with the elements
++   of S, once they have been entered in the cache.
SortedCache(S : CachableSet) : Exports == Implementation where
  N    ==> NonNegativeInteger
  DIFF ==> 1024

  Exports ==> with
    clearCache  : () -> Void
      ++ clearCache() empties the cache.
    enterInCache : (S, S -> Boolean) -> S
      ++ enterInCache(x, f) enters x in the cache, calling \spad{f(y)} to
      ++ determine whether x is equal to y. It returns x with an integer
      ++ associated with it.
    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.
    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
      ++ \spad{x > y (f(x, y) > 0)}.
      ++ It returns x with an integer associated with it.

  Implementation ==> add
    shiftCache   : (N, N) -> Void
    insertInCache : (N, S, N) -> S
    expandCache : (S) -> Void
    insertBefore : (N, S) -> Void

    cache : PrimitiveArray S := empty()$(PrimitiveArray S)
    cache_size : N := 0
    cache_use : N := 0

    expandCache(x) ==
        if cache_size = cache_use then
            ocache := cache
            cache_size := 2*cache_size + 10
            cache := new(cache_size, x)$(PrimitiveArray S)
            for k in 0..(cache_use - 1) repeat
                cache(k) := ocache(k)
        void

    insertBefore(l, x) ==
        k : Integer
        expandCache(x)
        vscan := cache
        for k in 0..(cache_use - l - 1) repeat
            vscan(cache_use - k) := vscan(cache_use - k - 1)
        vscan(l) := x
        cache_use := cache_use + 1
        void

    shiftCache(l, n) ==
        k : Integer
        vscan := cache
        for k in l..(cache_use - 1) repeat
            x := vscan(k)
            setPosition(x, n + position x)
        void

    clearCache() ==
        k : Integer
        vscan := cache
        for k in 0..(cache_use - 1) repeat
            x := vscan(k)
            setPosition(x, 0)
        cache := empty()$(PrimitiveArray S)
        cache_size := 0
        cache_use := 0
        void

    insertAtEnd(x : S) : Void ==
        expandCache(x)
        cache(cache_use) := x
        cache_use := cache_use + 1
        void

    linearSearch(x : S, equal? : S -> Boolean) ==
        k : Integer := 0
        -- Can not use for loop because equal? can insert new elements
        -- and change cache_use
        while k < cache_use repeat
            vscan := cache
            y := vscan(k)
            equal?(y) =>
                setPosition(x, position y)
                return y
            vscan := cache
            -- skip over elements possibly inserted by equal?
            while not(EQ(y, vscan(k))$Lisp) repeat k := k + 1
            k := k + 1
        return "failed"

    enterInCache(x : S, equal? : S -> Boolean) ==
        (res := linearSearch(x, equal?)) case S =>
            res::S
        setPosition(x, 1 + cache_use)
        insertAtEnd(x)
        x

    enterInCache(x : S, triage : (S, S) -> Integer) ==
        vscan := cache
        l : Integer := -1
        m : Integer := cache_use
        m0 := m
        zero?(cache_use) =>
            setPosition(x, DIFF)
            insertAtEnd(x)
            return x
        while (l + 1) < m repeat
            vl : S
            vm : S
            m0 := cache_use
            if not(l < 0) then
                vl := qelt(vscan, l)
            has_vm := false
            if m < m0 then
                vm := qelt(vscan, m)
                has_vm := true
            i := shift(l + m, -1)
            cp := triage(x, y := qelt(vscan, i))
            zero?(cp) =>
                setPosition(x, position y)
                return y
            vscan := cache
            if not(l < 0) then
                if not(EQ(vl, qelt(vscan, l))$Lisp) then
                    l0 := l
                    while not(EQ(vl, qelt(vscan, l))$Lisp) repeat
                        l := l + 1
                    i := i + l - l0
                    m := m + l - l0
            if not(EQ(y, qelt(vscan, i))$Lisp) then
                i0 := i
                while not(EQ(y, qelt(vscan, i))$Lisp) repeat
                    i := i + 1
                m := m + i - i0
            if has_vm then
                if not(EQ(vm, qelt(vscan, m))$Lisp) then
                    while not(EQ(vm, qelt(vscan, m))$Lisp) repeat
                        m := m + 1
            if cp < 0 then
                m := i
            else
                l := i
        m = cache_use =>
            setPosition(x, (position qelt(vscan, m - 1)) + DIFF)
            insertAtEnd(x)
            return x
        pos : N :=
                l < 0 => 0
                position qelt(vscan, l)
        insertInCache((l+1)::N, x, pos)

    insertInCache(before, x, pos) ==
        y := cache(before)
        if ((pos+1) = position y) then shiftCache(before, DIFF)
        setPosition(x, pos + (((position y) - pos)::N quo 2))
        insertBefore(before, x)
        x

)abbrev domain MKCHSET MakeCachableSet
++ Make a cachable set from any set
++ Author: Manuel Bronstein
++ Date Created: ???
++ Date Last Updated: 14 May 1991
++ Description:
++   MakeCachableSet(S) returns a cachable set which is equal to S as a set.
MakeCachableSet(S : SetCategory) : Exports == Implementation where
  Exports ==> Join(CachableSet, CoercibleTo S) with
    coerce : S -> %
      ++ coerce(s) returns s viewed as an element of %.

  Implementation ==> add
    import from SortedCache(%)

    Rep := Record(setpart : S, pos : NonNegativeInteger)

    clearCache()

    position x             == x.pos
    setPosition(x, n)      == (x.pos := n; void)
    coerce(x : %) : S          == x.setpart
    coerce(x : %) : OutputForm == x::S::OutputForm
    coerce(s : S) : %          == enterInCache([s, 0]$Rep,
                                 (x1 +-> (s = x1::S))@(% -> Boolean))

--    x < y ==
--      if position(x) = 0 then enterInCache(x, x1+->(x::S = x1::S))
--      if position(y) = 0 then enterInCache(y, x1+->(y::S = x1::S))
--      position(x) < position(y)

    x = y ==
      if position(x) = 0 then enterInCache(x,
                                 (x1 +-> (x::S = x1::S))@(% -> Boolean))
      if position(y) = 0 then enterInCache(y,
                                 (x1 +-> (y::S = x1::S))@(% -> Boolean))
      position(x) = position(y)


changed:
-Kernel(S:OrderedSet): Exports == Implementation where
Kernel(S : Comparable) : Exports == Implementation where

changed:
-  EF ==> Expression Float
-
-  SYMBOL  ==> "%symbol"
-  PMPRED  ==> "%pmpredicate"
-  PMOPT   ==> "%pmoptional"
-  PMMULT  ==> "%pmmultiple"
-  PMCONST ==> "%pmconstant"
-  SPECIALDISP  ==> "%specialDisp"
-  SPECIALEQUAL ==> "%specialEqual"
-  SPECIALINPUT ==> "%specialInput"
-
-  Exports ==> Join(CachableSet, Patternable S) with

  Exports ==> Join(CachableSet, OrderedSet, Patternable S) with

changed:
-      ++ name(op(a1,...,an)) returns the name of op.
-    operator: % -> OP
-      ++ operator(op(a1,...,an)) returns the operator op.
-    argument: % -> List S
-      ++ argument(op(a1,...,an)) returns \spad{[a1,...,an]}.
      ++ name(op(a1, ..., an)) returns the name of op.
    operator : % -> OP
      ++ operator(op(a1, ..., an)) returns the operator op.
    argument : % -> List S
      ++ argument(op(a1, ..., an)) returns \spad{[a1, ..., an]}.

changed:
-      ++ kernel(op, [a1,...,an], m) returns the kernel \spad{op(a1,...,an)}
      ++ kernel(op, [a1, ..., an], m) returns the kernel \spad{op(a1, ..., an)}

changed:
-      ++ Error: if op is k-ary for some k not equal to m.
      ++ Error: if op is k-ary for some k not equal to n.

changed:
-    symbolIfCan: % -> Union(Symbol, "failed")
    symbolIfCan : % -> Union(Symbol, "failed")

changed:
-      ++ is?(op(a1,...,an), f) tests if op = f.
      ++ is?(op(a1, ..., an), f) tests if op = f.

changed:
-      ++ is?(op(a1,...,an), s) tests if the name of op is s.
      ++ is?(op(a1, ..., an), s) tests if the name of op is s.

changed:
-    import SortedCache(%)
-
-    Rep := Record(op:OP, arg:List S, nest:N, posit:N)
    import from SortedCache(%)

    operator(k : %) : OP == SPAD_-KERNEL_-OP(k)$Lisp
    argument(k : %) : List S == SPAD_-KERNEL_-ARG(k)$Lisp
    height(k) == SPAD_-KERNEL_-NEST(k)$Lisp
    position(k : %) : N == SPAD_-KERNEL_-POSIT(k)$Lisp
    setPosition(k, n) == SET_-SPAD_-KERNEL_-POSIT(k, n)$Lisp
    mkKer(o : OP, a : List S, n : N) : % == makeSpadKernel(o, a, n)$Lisp

    SYMBOL  := '%symbol
    PMPRED  := '%pmpredicate
    PMOPT   := '%pmoptional
    PMMULT  := '%pmmultiple
    PMCONST := '%pmconstant
    SPECIALDISP  := '%specialDisp
    SPECIALEQUAL := '%specialEqual
    SPECIALINPUT := '%specialInput


changed:
-    triage: (%, %)  -> Integer
    triage : (%, %)  -> Integer

changed:
-    is?(k:%, s:Symbol) == is?(operator k, s)
-    is?(k:%, o:OP)     == (operator k) = o
    is?(k : %, s : Symbol) == is?(operator k, s)
    is?(k : %, o : OP)     == (operator k) = o

removed:
-    height k           == k.nest
-    operator k         == k.op
-    argument k         == k.arg
-    position k         == k.posit
-    setPosition(k, n)  == k.posit := n

changed:
-    kernel s           == kernel(assert(operator(s,0),SYMBOL), nil(), 1)
    kernel s           == kernel(assert(operator(s, 0), SYMBOL), nil(), 1)

added:
    kerEqual(k1 : %, k2 : %, f : (%, %) -> Boolean) : Boolean ==
        height(k1)   ~= height(k2)   => false
        operator(k1) ~= operator(k2) => false
        (n1 := #(argument k1)) ~= (n2 := #(argument k2)) => false
        f(k1, k2)

    kernelEnterInCache(k : %) : % ==
        if (f0 := property(operator k, SPECIALEQUAL)) case None then
            f1 := (f0::None)  pretend ((%, %) -> Boolean)
            (res := linearSearch(k, y +-> kerEqual(k, y, f1))) case % =>
                return res::%
        enterInCache(k, triage)


changed:
-      if k1.posit = 0 then enterInCache(k1, triage)
-      if k2.posit = 0 then enterInCache(k2, triage)
-      k1.posit = k2.posit
      if position(k1) = 0 then k1 := kernelEnterInCache(k1)
      if position(k2) = 0 then k2 := kernelEnterInCache(k2)
      position(k1) = position(k2)

changed:
-      if k1.posit = 0 then enterInCache(k1, triage)
-      if k2.posit = 0 then enterInCache(k2, triage)
-      k1.posit < k2.posit
      if position(k1) = 0 then k1 := kernelEnterInCache(k1)
      if position(k2) = 0 then k2 := kernelEnterInCache(k2)
      position(k1) < position(k2)

changed:
-      ((u := arity fn) case N) and (#x ^= u::N)
      ((u := arity fn) case N) and (#x ~= u::N)

changed:
-      enterInCache([fn, x, n, 0]$Rep, triage)
      kernelEnterInCache(mkKer(fn, x, n))

changed:
-    coerce(k:%):OutputForm ==
    coerce(k : %) : OutputForm ==

changed:
-      is?(k1,"pi"::Symbol) and is?(k2,"exp"::Symbol) =>  1
-      is?(k2,"pi"::Symbol) and is?(k1,"exp"::Symbol) => -1
-      k1.nest   ^= k2.nest   => B2Z(k1.nest   < k2.nest)
-      k1.op ^= k2.op => B2Z(k1.op < k2.op)
-      (n1 := #(argument k1)) ^= (n2 := #(argument k2)) => B2Z(n1 < n2)
-      ((func := property(operator k1, SPECIALEQUAL)) case None) and
-        (((func::None) pretend ((%, %) -> Boolean)) (k1, k2)) => 0
      height(k1)   ~= height(k2)   => B2Z(height(k1)   < height(k2))
      operator(k1) ~= operator(k2) => B2Z(operator(k1) < operator(k2))
      (n1 := #(argument k1)) ~= (n2 := #(argument k2)) => B2Z(n1 < n2)
      -- Handled by linear search earlier
      -- ((func := property(operator k1, SPECIALEQUAL)) case None) and
      --  (((func::None) pretend ((%, %) -> Boolean)) (k1, k2)) => 0

changed:
-        x1 ^= x2 => return B2Z(x1 < x2)
        x1 ~= x2 => return B2Z(smaller?(x1, x2))

changed:
-      convert(k:%):InputForm ==
      convert(k : %) : InputForm ==

changed:
-      convert(k:%):Pattern(Integer) ==
      convert(k : %) : Pattern(Integer) ==

changed:
-        o [convert x for x in k.arg]$List(Pattern Integer)
        o [convert x for x in argument(k)]$List(Pattern Integer)


changed:
-      convert(k:%):Pattern(Float) ==
      convert(k : %) : Pattern(Float) ==

changed:
-        o [convert x for x in k.arg]$List(Pattern Float)
-\end{axiom}
-
-Test new defintion
-\begin{axiom}
-position(exp(1)::Kernel EXPR INT)
-position(pi()::EXPR INT::Kernel EXPR INT)
-(%e<%pi)$EXPR INT
-\end{axiom}
-
-\begin{axiom}
-position(atan(%pi/4)::Kernel EXPR INT)
-position(exp(2)::Kernel EXPR INT)
-atan(%pi/4) < exp(2)
-\end{axiom}
-
-\begin{axiom}
-)clear completely
-\end{axiom}
-</div>
-
-<h3 onClick="expandcontent(this, 'sc2')" style="cursor:hand; cursor:pointer">
-<span class="showstate"></span>All Kernels compared numerically if possible</h3>
-<div id="sc2" class="switchcontent" style="display:block">
-\begin{axiom}
-)clear completely
-\end{axiom}
-
-\begin{axiom}
-)abbrev domain KERNEL Kernel
-++ Operators applied to elements of a set
-++ Author: Manuel Bronstein
-++ Date Created: 22 March 1988
-++ Date Last Updated: 10 August 1994
        o [convert x for x in argument(k)]$List(Pattern Float)

)abbrev package KERNEL2 KernelFunctions2

changed:
-++ A kernel over a set S is an operator applied to a given list
-++ of arguments from S.
-Kernel(S:OrderedSet): Exports == Implementation where
-  O  ==> OutputForm
-  N  ==> NonNegativeInteger
-  OP ==> BasicOperator
-  EF ==> Expression Float
-
-  SYMBOL  ==> "%symbol"
-  PMPRED  ==> "%pmpredicate"
-  PMOPT   ==> "%pmoptional"
-  PMMULT  ==> "%pmmultiple"
-  PMCONST ==> "%pmconstant"
-  SPECIALDISP  ==> "%specialDisp"
-  SPECIALEQUAL ==> "%specialEqual"
-  SPECIALINPUT ==> "%specialInput"
-
-  Exports ==> Join(CachableSet, Patternable S) with
-    name    : % -> Symbol
-      ++ name(op(a1,...,an)) returns the name of op.
-    operator: % -> OP
-      ++ operator(op(a1,...,an)) returns the operator op.
-    argument: % -> List S
-      ++ argument(op(a1,...,an)) returns \spad{[a1,...,an]}.
-    height  : % -> N
-      ++ height(k) returns the nesting level of k.
-    kernel  : (OP, List S, N) -> %
-      ++ kernel(op, [a1,...,an], m) returns the kernel \spad{op(a1,...,an)}
-      ++ of nesting level m.
-      ++ Error: if op is k-ary for some k not equal to m.
-    kernel  : Symbol -> %
-      ++ kernel(x) returns x viewed as a kernel.
-    symbolIfCan: % -> Union(Symbol, "failed")
-      ++ symbolIfCan(k) returns k viewed as a symbol if k is a symbol, and
-      ++ "failed" otherwise.
-    is?     : (%, OP) -> Boolean
-      ++ is?(op(a1,...,an), f) tests if op = f.
-    is?     : (%, Symbol) -> Boolean
-      ++ is?(op(a1,...,an), s) tests if the name of op is s.
-    if S has ConvertibleTo InputForm then ConvertibleTo InputForm
-
-  Implementation ==> add
-    import SortedCache(%)
-
-    Rep := Record(op:OP, arg:List S, nest:N, posit:N)
-
-    clearCache()
-
-    B2Z   : Boolean -> Integer
-    triage: (%, %)  -> Integer
-    preds : OP      -> List Any
-
-    is?(k:%, s:Symbol) == is?(operator k, s)
-    is?(k:%, o:OP)     == (operator k) = o
-    name k             == name operator k
-    height k           == k.nest
-    operator k         == k.op
-    argument k         == k.arg
-    position k         == k.posit
-    setPosition(k, n)  == k.posit := n
-    B2Z flag           == (flag => -1; 1)
-    kernel s           == kernel(assert(operator(s,0),SYMBOL), nil(), 1)
-
-    preds o ==
-      (u := property(o, PMPRED)) case "failed" => nil()
-      (u::None) pretend List(Any)
-
-    symbolIfCan k ==
-      has?(operator k, SYMBOL) => name operator k
-      "failed"
-
-    k1 = k2 ==
-      if k1.posit = 0 then enterInCache(k1, triage)
-      if k2.posit = 0 then enterInCache(k2, triage)
-      k1.posit = k2.posit
-
-    k1 < k2 ==
-      if k1.posit = 0 then enterInCache(k1, triage)
-      if k2.posit = 0 then enterInCache(k2, triage)
-      k1.posit < k2.posit
-
-    kernel(fn, x, n) ==
-      ((u := arity fn) case N) and (#x ^= u::N)
-                                    => error "Wrong number of arguments"
-      enterInCache([fn, x, n, 0]$Rep, triage)
-
-    -- SPECIALDISP contains a map List S -> OutputForm
-    -- it is used when the converting the arguments first is not good,
-    -- for instance with formal derivatives.
-    coerce(k:%):OutputForm ==
-      (v := symbolIfCan k) case Symbol => v::Symbol::OutputForm
-      (f := property(o := operator k, SPECIALDISP)) case None =>
-        ((f::None) pretend (List S -> OutputForm)) (argument k)
-      l := [x::OutputForm for x in argument k]$List(OutputForm)
-      (u := display o) case "failed" => prefix(name(o)::OutputForm, l)
-      (u::(List OutputForm -> OutputForm)) l
-
-    triage(k1:%, k2:%) ==
-      n1:=numericIfCan(k1)
-      n2:=numericIfCan(k2)
-      n1 case Float and n2 case Float => B2Z(n1<n2)
---    is?(k1,"pi"::Symbol) and is?(k2,"exp"::Symbol) =>  1
---    is?(k2,"pi"::Symbol) and is?(k1,"exp"::Symbol) => -1
-      k1.nest   ^= k2.nest   => B2Z(k1.nest   < k2.nest)
-      k1.op ^= k2.op => B2Z(k1.op < k2.op)
-      (n1 := #(argument k1)) ^= (n2 := #(argument k2)) => B2Z(n1 < n2)
-      ((func := property(operator k1, SPECIALEQUAL)) case None) and
-        (((func::None) pretend ((%, %) -> Boolean)) (k1, k2)) => 0
-      for x1 in argument(k1) for x2 in argument(k2) repeat
-        x1 ^= x2 => return B2Z(x1 < x2)
-      0
-
-    if S has ConvertibleTo InputForm then
-      convert(k:%):InputForm ==
-        (v := symbolIfCan k) case Symbol => convert(v::Symbol)@InputForm
-        (f := property(o := operator k, SPECIALINPUT)) case None =>
-          ((f::None) pretend (List S -> InputForm)) (argument k)
-        l := [convert x for x in argument k]$List(InputForm)
-        (u := input operator k) case "failed" =>
-          convert concat(convert name operator k, l)
-        (u::(List InputForm -> InputForm)) l
-
-    if S has ConvertibleTo Pattern Integer then
-      convert(k:%):Pattern(Integer) ==
-        o := operator k
-        (v := symbolIfCan k) case Symbol =>
-          s  := patternVariable(v::Symbol,
-                      has?(o, PMCONST), has?(o, PMOPT), has?(o, PMMULT))
-          empty?(l := preds o) => s
-          setPredicates(s, l)
-        o [convert x for x in k.arg]$List(Pattern Integer)
-    if S has ConvertibleTo Pattern Float then
-      convert(k:%):Pattern(Float) ==
-        o := operator k
-        (v := symbolIfCan k) case Symbol =>
-          s  := patternVariable(v::Symbol,
-                      has?(o, PMCONST), has?(o, PMOPT), has?(o, PMMULT))
-          empty?(l := preds o) => s
-          setPredicates(s, l)
-        o [convert x for x in k.arg]$List(Pattern Float)
-\end{axiom}
-
-Test new defintion
-\begin{axiom}
-position(exp(1)::Kernel EXPR INT)
-position(pi()::EXPR INT::Kernel EXPR INT)
-(%e<%pi)$EXPR INT
-\end{axiom}
-
-
-\begin{axiom}
-position(atan(%pi/4)::Kernel EXPR INT)
-position(exp(2)::Kernel EXPR INT)
-atan(%pi/4) < exp(2)
-(atan(%pi/4)::Kernel EXPR INT) < (exp(2)::Kernel EXPR INT)
-\end{axiom}
-
-Compare this with:
-
-\begin{axiom}
-ke:=exp(2)::Kernel EXPR INT
-kat:=atan(%pi/4)::Kernel EXPR INT
-ke1o:=operator(ke)
-ke1a:=argument(ke)
-ke1:=(operator(ke) argument(ke))
-kat1:=(operator(kat) argument(kat))
-ke1 < kat1
-ke2:=numericIfCan(operator(ke) argument(ke))
-kat2:= numericIfCan(operator(kat) argument(kat))
-ke2 < kat2
-\end{axiom}
-
-I don't know why the compiled code behave differently. Perhaps because 'argument' returns a list?
-</div>
-
-From unknown Thu Jul 21 17:28:17 -0500 2005
-From: unknown
-Date: Thu, 21 Jul 2005 17:28:17 -0500
-Subject: No, it is still wrong
-Message-ID: <20050721172817-0500@page.axiom-developer.org>
-
-Results for 15, 16, 23 are wrong. Result of 26 is right.
-
-From kratt6 Sat Jul 23 02:07:46 -0500 2005
-From: kratt6
-Date: Sat, 23 Jul 2005 02:07:46 -0500
-Subject: Does NOT compile
-Message-ID: <20050723020746-0500@page.axiom-developer.org>
-
-You did note that your code does not compile?
-
-I tried an explanation in
-
-http://lists.nongnu.org/archive/html/axiom-developer/2005-07/msg00222.html
-
-Martin
++ This package exports some auxiliary functions on kernels
KernelFunctions2(R : Comparable, S : Comparable) : with
  constantKernel : R -> Kernel S
        ++ constantKernel(r) \undocumented
  constantIfCan : Kernel S -> Union(R, "failed")
        ++ constantIfCan(k) \undocumented

 == add
  import from BasicOperatorFunctions1(R)

  constantKernel r == kernel(constantOperator r, nil(), 1)
  constantIfCan k  == constantOpIfCan operator k

--Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
--All rights reserved.
--
--Redistribution and use in source and binary forms, with or without
--modification, are permitted provided that the following conditions are
--met:
--
--    - Redistributions of source code must retain the above copyright
--      notice, this list of conditions and the following disclaimer.
--
--    - Redistributions in binary form must reproduce the above copyright
--      notice, this list of conditions and the following disclaimer in
--      the documentation and/or other materials provided with the
--      distribution.
--
--    - Neither the name of The Numerical ALgorithms Group Ltd. nor the
--      names of its contributors may be used to endorse or promote products
--      derived from this software without specific prior written permission.
--
--THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
--IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
--TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
--PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
--OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
--EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
--PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
--PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
--LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
--NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
--SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-- SPAD files for the functional world should be compiled in the
-- following order:
--
--   op  KL  expr function
\end{spad}

spad
)abbrev category CACHSET CachableSet
++ Sets whose elements can cache an integer
++ Author: Manuel Bronstein
++ Date Created: 31 Oct 1988
++ Date Last Updated: 14 May 1991
++ Description:
++   A cachable set is a set whose elements keep an integer as part
++   of their structure.
CachableSet : Category == SetCategory with
  position   : % -> NonNegativeInteger
    ++ position(x) returns the integer n associated to x.
  setPosition : (%, NonNegativeInteger) -> Void
    ++ setPosition(x, n) associates the integer n to x.
)abbrev package SCACHE SortedCache ++ Cache of elements in a set ++ Author: Manuel Bronstein ++ Date Created: 31 Oct 1988 ++ Date Last Updated: 14 May 1991 ++ A sorted cache of a cachable set S is a dynamic structure that ++ keeps the elements of S sorted and assigns an integer to each ++ element of S once it is in the cache. This way, equality and ordering ++ on S are tested directly on the integers associated with the elements ++ of S, once they have been entered in the cache. SortedCache(S : CachableSet) : Exports == Implementation where N ==> NonNegativeInteger DIFF ==> 1024
Exports ==> with clearCache : () -> Void ++ clearCache() empties the cache. enterInCache : (S, S -> Boolean) -> S ++ enterInCache(x, f) enters x in the cache, calling \spad{f(y)} to ++ determine whether x is equal to y. It returns x with an integer ++ associated with it. 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. 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 ++ \spad{x > y (f(x, y) > 0)}. ++ It returns x with an integer associated with it.
Implementation ==> add shiftCache : (N, N) -> Void insertInCache : (N, S, N) -> S expandCache : (S) -> Void insertBefore : (N, S) -> Void
cache : PrimitiveArray S := empty()$(PrimitiveArray S) cache_size : N := 0 cache_use : N := 0
expandCache(x) == if cache_size = cache_use then ocache := cache cache_size := 2*cache_size + 10 cache := new(cache_size, x)$(PrimitiveArray S) for k in 0..(cache_use - 1) repeat cache(k) := ocache(k) void
insertBefore(l, x) == k : Integer expandCache(x) vscan := cache for k in 0..(cache_use - l - 1) repeat vscan(cache_use - k) := vscan(cache_use - k - 1) vscan(l) := x cache_use := cache_use + 1 void
shiftCache(l, n) == k : Integer vscan := cache for k in l..(cache_use - 1) repeat x := vscan(k) setPosition(x, n + position x) void
clearCache() == k : Integer vscan := cache for k in 0..(cache_use - 1) repeat x := vscan(k) setPosition(x, 0) cache := empty()$(PrimitiveArray S) cache_size := 0 cache_use := 0 void
insertAtEnd(x : S) : Void == expandCache(x) cache(cache_use) := x cache_use := cache_use + 1 void
linearSearch(x : S, equal? : S -> Boolean) == k : Integer := 0 -- Can not use for loop because equal? can insert new elements -- and change cache_use while k < cache_use repeat vscan := cache y := vscan(k) equal?(y) => setPosition(x, position y) return y vscan := cache -- skip over elements possibly inserted by equal? while not(EQ(y, vscan(k))$Lisp) repeat k := k + 1 k := k + 1 return "failed"
enterInCache(x : S, equal? : S -> Boolean) == (res := linearSearch(x, equal?)) case S => res::S setPosition(x, 1 + cache_use) insertAtEnd(x) x
enterInCache(x : S, triage : (S, S) -> Integer) == vscan := cache l : Integer := -1 m : Integer := cache_use m0 := m zero?(cache_use) => setPosition(x, DIFF) insertAtEnd(x) return x while (l + 1) < m repeat vl : S vm : S m0 := cache_use if not(l < 0) then vl := qelt(vscan, l) has_vm := false if m < m0 then vm := qelt(vscan, m) has_vm := true i := shift(l + m, -1) cp := triage(x, y := qelt(vscan, i)) zero?(cp) => setPosition(x, position y) return y vscan := cache if not(l < 0) then if not(EQ(vl, qelt(vscan, l))$Lisp) then l0 := l while not(EQ(vl, qelt(vscan, l))$Lisp) repeat l := l + 1 i := i + l - l0 m := m + l - l0 if not(EQ(y, qelt(vscan, i))$Lisp) then i0 := i while not(EQ(y, qelt(vscan, i))$Lisp) repeat i := i + 1 m := m + i - i0 if has_vm then if not(EQ(vm, qelt(vscan, m))$Lisp) then while not(EQ(vm, qelt(vscan, m))$Lisp) repeat m := m + 1 if cp < 0 then m := i else l := i m = cache_use => setPosition(x, (position qelt(vscan, m - 1)) + DIFF) insertAtEnd(x) return x pos : N := l < 0 => 0 position qelt(vscan, l) insertInCache((l+1)::N, x, pos)
insertInCache(before, x, pos) == y := cache(before) if ((pos+1) = position y) then shiftCache(before, DIFF) setPosition(x, pos + (((position y) - pos)::N quo 2)) insertBefore(before, x) x
)abbrev domain MKCHSET MakeCachableSet ++ Make a cachable set from any set ++ Author: Manuel Bronstein ++ Date Created: ??? ++ Date Last Updated: 14 May 1991 ++ Description: ++ MakeCachableSet(S) returns a cachable set which is equal to S as a set. MakeCachableSet(S : SetCategory) : Exports == Implementation where Exports ==> Join(CachableSet, CoercibleTo S) with coerce : S -> % ++ coerce(s) returns s viewed as an element of %.
Implementation ==> add import from SortedCache(%)
Rep := Record(setpart : S, pos : NonNegativeInteger)
clearCache()
position x == x.pos setPosition(x, n) == (x.pos := n; void) coerce(x : %) : S == x.setpart coerce(x : %) : OutputForm == x::S::OutputForm coerce(s : S) : % == enterInCache([s, 0]$Rep, (x1 +-> (s = x1::S))@(% -> Boolean))
-- x < y == -- if position(x) = 0 then enterInCache(x, x1+->(x::S = x1::S)) -- if position(y) = 0 then enterInCache(y, x1+->(y::S = x1::S)) -- position(x) < position(y)
x = y == if position(x) = 0 then enterInCache(x, (x1 +-> (x::S = x1::S))@(% -> Boolean)) if position(y) = 0 then enterInCache(y, (x1 +-> (y::S = x1::S))@(% -> Boolean)) position(x) = position(y)
)abbrev domain KERNEL Kernel ++ Operators applied to elements of a set ++ Author: Manuel Bronstein ++ Date Created: 22 March 1988 ++ Date Last Updated: 10 August 1994 ++ Description: ++ A kernel over a set S is an operator applied to a given list ++ of arguments from S. Kernel(S : Comparable) : Exports == Implementation where O ==> OutputForm N ==> NonNegativeInteger OP ==> BasicOperator
Exports ==> Join(CachableSet, OrderedSet, Patternable S) with name : % -> Symbol ++ name(op(a1, ..., an)) returns the name of op. operator : % -> OP ++ operator(op(a1, ..., an)) returns the operator op. argument : % -> List S ++ argument(op(a1, ..., an)) returns \spad{[a1, ..., an]}. height : % -> N ++ height(k) returns the nesting level of k. kernel : (OP, List S, N) -> % ++ kernel(op, [a1, ..., an], m) returns the kernel \spad{op(a1, ..., an)} ++ of nesting level m. ++ Error: if op is k-ary for some k not equal to n. kernel : Symbol -> % ++ kernel(x) returns x viewed as a kernel. symbolIfCan : % -> Union(Symbol, "failed") ++ symbolIfCan(k) returns k viewed as a symbol if k is a symbol, and ++ "failed" otherwise. is? : (%, OP) -> Boolean ++ is?(op(a1, ..., an), f) tests if op = f. is? : (%, Symbol) -> Boolean ++ is?(op(a1, ..., an), s) tests if the name of op is s. if S has ConvertibleTo InputForm then ConvertibleTo InputForm
Implementation ==> add import from SortedCache(%)
operator(k : %) : OP == SPAD_-KERNEL_-OP(k)$Lisp argument(k : %) : List S == SPAD_-KERNEL_-ARG(k)$Lisp height(k) == SPAD_-KERNEL_-NEST(k)$Lisp position(k : %) : N == SPAD_-KERNEL_-POSIT(k)$Lisp setPosition(k, n) == SET_-SPAD_-KERNEL_-POSIT(k, n)$Lisp mkKer(o : OP, a : List S, n : N) : % == makeSpadKernel(o, a, n)$Lisp
SYMBOL := '%symbol PMPRED := '%pmpredicate PMOPT := '%pmoptional PMMULT := '%pmmultiple PMCONST := '%pmconstant SPECIALDISP := '%specialDisp SPECIALEQUAL := '%specialEqual SPECIALINPUT := '%specialInput
clearCache()
B2Z : Boolean -> Integer triage : (%, %) -> Integer preds : OP -> List Any
is?(k : %, s : Symbol) == is?(operator k, s) is?(k : %, o : OP) == (operator k) = o name k == name operator k B2Z flag == (flag => -1; 1) kernel s == kernel(assert(operator(s, 0), SYMBOL), nil(), 1)
preds o == (u := property(o, PMPRED)) case "failed" => nil() (u::None) pretend List(Any)
symbolIfCan k == has?(operator k, SYMBOL) => name operator k "failed"
kerEqual(k1 : %, k2 : %, f : (%, %) -> Boolean) : Boolean == height(k1) ~= height(k2) => false operator(k1) ~= operator(k2) => false (n1 := #(argument k1)) ~= (n2 := #(argument k2)) => false f(k1, k2)
kernelEnterInCache(k : %) : % == if (f0 := property(operator k, SPECIALEQUAL)) case None then f1 := (f0::None) pretend ((%, %) -> Boolean) (res := linearSearch(k, y +-> kerEqual(k, y, f1))) case % => return res::% enterInCache(k, triage)
k1 = k2 == if position(k1) = 0 then k1 := kernelEnterInCache(k1) if position(k2) = 0 then k2 := kernelEnterInCache(k2) position(k1) = position(k2)
k1 < k2 == if position(k1) = 0 then k1 := kernelEnterInCache(k1) if position(k2) = 0 then k2 := kernelEnterInCache(k2) position(k1) < position(k2)
kernel(fn, x, n) == ((u := arity fn) case N) and (#x ~= u::N) => error "Wrong number of arguments" kernelEnterInCache(mkKer(fn, x, n))
-- SPECIALDISP contains a map List S -> OutputForm -- it is used when the converting the arguments first is not good, -- for instance with formal derivatives. coerce(k : %) : OutputForm == (v := symbolIfCan k) case Symbol => v::Symbol::OutputForm (f := property(o := operator k, SPECIALDISP)) case None => ((f::None) pretend (List S -> OutputForm)) (argument k) l := [x::OutputForm for x in argument k]$List(OutputForm) (u := display o) case "failed" => prefix(name(o)::OutputForm, l) (u::(List OutputForm -> OutputForm)) l
triage(k1, k2) == height(k1) ~= height(k2) => B2Z(height(k1) < height(k2)) operator(k1) ~= operator(k2) => B2Z(operator(k1) < operator(k2)) (n1 := #(argument k1)) ~= (n2 := #(argument k2)) => B2Z(n1 < n2) -- Handled by linear search earlier -- ((func := property(operator k1, SPECIALEQUAL)) case None) and -- (((func::None) pretend ((%, %) -> Boolean)) (k1, k2)) => 0 for x1 in argument(k1) for x2 in argument(k2) repeat x1 ~= x2 => return B2Z(smaller?(x1, x2)) 0
if S has ConvertibleTo InputForm then convert(k : %) : InputForm == (v := symbolIfCan k) case Symbol => convert(v::Symbol)@InputForm (f := property(o := operator k, SPECIALINPUT)) case None => ((f::None) pretend (List S -> InputForm)) (argument k) l := [convert x for x in argument k]$List(InputForm) (u := input operator k) case "failed" => convert concat(convert name operator k, l) (u::(List InputForm -> InputForm)) l
if S has ConvertibleTo Pattern Integer then convert(k : %) : Pattern(Integer) == o := operator k (v := symbolIfCan k) case Symbol => s := patternVariable(v::Symbol, has?(o, PMCONST), has?(o, PMOPT), has?(o, PMMULT)) empty?(l := preds o) => s setPredicates(s, l) o [convert x for x in argument(k)]$List(Pattern Integer)
if S has ConvertibleTo Pattern Float then convert(k : %) : Pattern(Float) == o := operator k (v := symbolIfCan k) case Symbol => s := patternVariable(v::Symbol, has?(o, PMCONST), has?(o, PMOPT), has?(o, PMMULT)) empty?(l := preds o) => s setPredicates(s, l) o [convert x for x in argument(k)]$List(Pattern Float)
)abbrev package KERNEL2 KernelFunctions2 ++ Description: ++ This package exports some auxiliary functions on kernels KernelFunctions2(R : Comparable, S : Comparable) : with constantKernel : R -> Kernel S ++ constantKernel(r) \undocumented constantIfCan : Kernel S -> Union(R, "failed") ++ constantIfCan(k) \undocumented
== add import from BasicOperatorFunctions1(R)
constantKernel r == kernel(constantOperator r, nil(), 1) constantIfCan k == constantOpIfCan operator k
--Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd. --All rights reserved. -- --Redistribution and use in source and binary forms, with or without --modification, are permitted provided that the following conditions are --met: -- -- - Redistributions of source code must retain the above copyright -- notice, this list of conditions and the following disclaimer. -- -- - Redistributions in binary form must reproduce the above copyright -- notice, this list of conditions and the following disclaimer in -- the documentation and/or other materials provided with the -- distribution. -- -- - Neither the name of The Numerical ALgorithms Group Ltd. nor the -- names of its contributors may be used to endorse or promote products -- derived from this software without specific prior written permission. -- --THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS --IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED --TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A --PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER --OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, --EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, --PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR --PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF --LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING --NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS --SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-- SPAD files for the functional world should be compiled in the -- following order: -- -- op KL expr function
spad
   Compiling FriCAS source code from file 
      /var/lib/zope2.10/instance/axiom-wiki/var/LatexWiki/5050370142117117550-25px001.spad
      using old system compiler.
   CACHSET abbreviates category CachableSet 
------------------------------------------------------------------------
   initializing NRLIB CACHSET for CachableSet 
   compiling into NRLIB CACHSET 
;;; *** |CachableSet| REDEFINED Time: 0 SEC.
finalizing NRLIB CACHSET Processing CachableSet for Browser database: --------constructor--------- --------(position ((NonNegativeInteger) %))--------- --------(setPosition ((Void) % (NonNegativeInteger)))--------- ; compiling file "/var/aw/var/LatexWiki/CACHSET.NRLIB/CACHSET.lsp" (written 20 MAR 2015 05:26:09 PM):
; /var/aw/var/LatexWiki/CACHSET.NRLIB/CACHSET.fasl written ; compilation finished in 0:00:00.005 ------------------------------------------------------------------------ CachableSet is now explicitly exposed in frame initial CachableSet will be automatically loaded when needed from /var/aw/var/LatexWiki/CACHSET.NRLIB/CACHSET
SCACHE abbreviates package SortedCache ------------------------------------------------------------------------ initializing NRLIB SCACHE for SortedCache compiling into NRLIB SCACHE compiling local expandCache : S -> Void Time: 0.02 SEC.
compiling local insertBefore : (NonNegativeInteger,S) -> Void Time: 0 SEC.
compiling local shiftCache : (NonNegativeInteger,NonNegativeInteger) -> Void Time: 0 SEC.
compiling exported clearCache : () -> Void Time: 0.01 SEC.
compiling local insertAtEnd : S -> Void Time: 0 SEC.
compiling exported linearSearch : (S,S -> Boolean) -> Union(S,failed) Time: 0 SEC.
compiling exported enterInCache : (S,S -> Boolean) -> S Time: 0 SEC.
compiling exported enterInCache : (S,(S,S) -> Integer) -> S Time: 0.01 SEC.
compiling local insertInCache : (NonNegativeInteger,S,NonNegativeInteger) -> S Time: 0 SEC.
(time taken in buildFunctor: 0)
;;; *** |SortedCache| REDEFINED
;;; *** |SortedCache| REDEFINED Time: 0 SEC.
Warnings: [1] enterInCache: vl has no value [2] enterInCache: m has no value [3] enterInCache: vm has no value [4] enterInCache: l has no value
Cumulative Statistics for Constructor SortedCache Time: 0.04 seconds
finalizing NRLIB SCACHE Processing SortedCache for Browser database: --------constructor--------- --------(position ((NonNegativeInteger) %))--------- --------(setPosition ((Void) % (NonNegativeInteger)))--------- --------constructor--------- --------(clearCache ((Void)))--------- --------(enterInCache (S S (Mapping (Boolean) S)))--------- --------(linearSearch ((Union S failed) S (Mapping (Boolean) S)))--------- --------(enterInCache (S S (Mapping (Integer) S S)))--------- --->/usr/local/lib/fricas/target/x86_64-unknown-linux/../../src/algebra/SCACHE.spad-->SortedCache(): Spurious comments: \indented{1}{Cache of elements in a set} Author: Manuel Bronstein Date Created: 31 Oct 1988 Date Last Updated: 14 May 1991 \indented{2}{A sorted cache of a cachable set \spad{S} is a dynamic structure that} \indented{2}{keeps the elements of \spad{S} sorted and assigns an integer to each} \indented{2}{element of \spad{S} once it is in the cache. This way,{} equality and ordering} \indented{2}{on \spad{S} are tested directly on the integers associated with the elements} \indented{2}{of \spad{S},{} once they have been entered in the cache.} ; compiling file "/var/aw/var/LatexWiki/SCACHE.NRLIB/SCACHE.lsp" (written 20 MAR 2015 05:26:09 PM):
; /var/aw/var/LatexWiki/SCACHE.NRLIB/SCACHE.fasl written ; compilation finished in 0:00:00.101 ------------------------------------------------------------------------ SortedCache is now explicitly exposed in frame initial SortedCache will be automatically loaded when needed from /var/aw/var/LatexWiki/SCACHE.NRLIB/SCACHE
MKCHSET abbreviates domain MakeCachableSet ------------------------------------------------------------------------ initializing NRLIB MKCHSET for MakeCachableSet compiling into NRLIB MKCHSET importing SortedCache $ compiling exported position : $ -> NonNegativeInteger MKCHSET;position;$Nni;1 is replaced by QCDR Time: 0.01 SEC.
compiling exported setPosition : ($,NonNegativeInteger) -> Void Time: 0 SEC.
compiling exported coerce : $ -> S MKCHSET;coerce;$S;3 is replaced by QCAR Time: 0 SEC.
compiling exported coerce : $ -> OutputForm Time: 0 SEC.
compiling exported coerce : S -> $ Time: 0 SEC.
compiling exported = : ($,$) -> Boolean Time: 0 SEC.
(time taken in buildFunctor: 0)
;;; *** |MakeCachableSet| REDEFINED
;;; *** |MakeCachableSet| REDEFINED Time: 0 SEC.
Warnings: [1] position: pos has no value [2] setPosition: pos has no value [3] coerce: setpart has no value
Cumulative Statistics for Constructor MakeCachableSet Time: 0.01 seconds
finalizing NRLIB MKCHSET Processing MakeCachableSet for Browser database: --------constructor--------- --------(position ((NonNegativeInteger) %))--------- --------(setPosition ((Void) % (NonNegativeInteger)))--------- --------constructor--------- --------(clearCache ((Void)))--------- --------(enterInCache (S S (Mapping (Boolean) S)))--------- --------(linearSearch ((Union S failed) S (Mapping (Boolean) S)))--------- --------(enterInCache (S S (Mapping (Integer) S S)))--------- --------constructor--------- --------(coerce (% S))--------- --->/usr/local/lib/fricas/target/x86_64-unknown-linux/../../src/algebra/MKCHSET.spad-->MakeCachableSet(): Spurious comments: \indented{1}{Cache of elements in a set} Author: Manuel Bronstein Date Created: 31 Oct 1988 Date Last Updated: 14 May 1991 \indented{2}{A sorted cache of a cachable set \spad{S} is a dynamic structure that} \indented{2}{keeps the elements of \spad{S} sorted and assigns an integer to each} \indented{2}{element of \spad{S} once it is in the cache. This way,{} equality and ordering} \indented{2}{on \spad{S} are tested directly on the integers associated with the elements} \indented{2}{of \spad{S},{} once they have been entered in the cache.} --->/usr/local/lib/fricas/target/x86_64-unknown-linux/../../src/algebra/MKCHSET.spad-->MakeCachableSet(): Spurious comments: MakeCachableSet(\spad{S}) returns a cachable set which is equal to \spad{S} as a set. ; compiling file "/var/aw/var/LatexWiki/MKCHSET.NRLIB/MKCHSET.lsp" (written 20 MAR 2015 05:26:09 PM):
; /var/aw/var/LatexWiki/MKCHSET.NRLIB/MKCHSET.fasl written ; compilation finished in 0:00:00.027 ------------------------------------------------------------------------ MakeCachableSet is now explicitly exposed in frame initial MakeCachableSet will be automatically loaded when needed from /var/aw/var/LatexWiki/MKCHSET.NRLIB/MKCHSET
KERNEL abbreviates domain Kernel ------------------------------------------------------------------------ initializing NRLIB KERNEL for Kernel compiling into NRLIB KERNEL importing SortedCache $ compiling exported operator : $ -> BasicOperator KERNEL;operator;$Bo;1 is replaced by SPAD-KERNEL-OP Time: 0 SEC.
compiling exported argument : $ -> List S KERNEL;argument;$L;2 is replaced by SPAD-KERNEL-ARG Time: 0 SEC.
compiling exported height : $ -> NonNegativeInteger KERNEL;height;$Nni;3 is replaced by SPAD-KERNEL-NEST Time: 0 SEC.
compiling exported position : $ -> NonNegativeInteger KERNEL;position;$Nni;4 is replaced by SPAD-KERNEL-POSIT Time: 0 SEC.
compiling exported setPosition : ($,NonNegativeInteger) -> Void KERNEL;setPosition;$NniV;5 is replaced by SET-SPAD-KERNEL-POSIT Time: 0 SEC.
compiling local mkKer : (BasicOperator,List S,NonNegativeInteger) -> $ KERNEL;mkKer is replaced by makeSpadKernel Time: 0 SEC.
compiling exported is? : ($,Symbol) -> Boolean Time: 0 SEC.
compiling exported is? : ($,BasicOperator) -> Boolean Time: 0.01 SEC.
compiling exported name : $ -> Symbol Time: 0 SEC.
compiling local B2Z : Boolean -> Integer Time: 0 SEC.
compiling exported kernel : Symbol -> $ Time: 0 SEC.
compiling local preds : BasicOperator -> List Any Time: 0 SEC.
compiling exported symbolIfCan : $ -> Union(Symbol,failed) Time: 0 SEC.
compiling local kerEqual : ($,$,($,$) -> Boolean) -> Boolean Time: 0.01 SEC.
compiling local kernelEnterInCache : $ -> $ Time: 0.01 SEC.
compiling exported = : ($,$) -> Boolean Time: 0 SEC.
compiling exported < : ($,$) -> Boolean Time: 0 SEC.
compiling exported kernel : (BasicOperator,List S,NonNegativeInteger) -> $ Time: 0 SEC.
compiling exported coerce : $ -> OutputForm Time: 0.02 SEC.
compiling local triage : ($,$) -> Integer Time: 0.01 SEC.
****** Domain: S already in scope augmenting S: (ConvertibleTo (InputForm)) compiling exported convert : $ -> InputForm Time: 0.03 SEC.
****** Domain: S already in scope augmenting S: (ConvertibleTo (Pattern (Integer))) compiling exported convert : $ -> Pattern Integer Time: 0.02 SEC.
****** Domain: S already in scope augmenting S: (ConvertibleTo (Pattern (Float))) compiling exported convert : $ -> Pattern Float Time: 0 SEC.
****** Domain: S already in scope augmenting S: (ConvertibleTo (InputForm)) ****** Domain: S already in scope augmenting S: (ConvertibleTo (Pattern (Float))) ****** Domain: S already in scope augmenting S: (ConvertibleTo (Pattern (Integer))) (time taken in buildFunctor: 10)
;;; *** |Kernel| REDEFINED
;;; *** |Kernel| REDEFINED Time: 0.01 SEC.
Cumulative Statistics for Constructor Kernel Time: 0.12 seconds
finalizing NRLIB KERNEL Processing Kernel for Browser database: --------constructor--------- --------(position ((NonNegativeInteger) %))--------- --------(setPosition ((Void) % (NonNegativeInteger)))--------- --------constructor--------- --------(clearCache ((Void)))--------- --------(enterInCache (S S (Mapping (Boolean) S)))--------- --------(linearSearch ((Union S failed) S (Mapping (Boolean) S)))--------- --------(enterInCache (S S (Mapping (Integer) S S)))--------- --------constructor--------- --------(coerce (% S))--------- --------constructor--------- --------(name ((Symbol) %))--------- --------(operator ((BasicOperator) %))--------- --------(argument ((List S) %))--------- --------(height ((NonNegativeInteger) %))--------- --------(kernel (% (BasicOperator) (List S) (NonNegativeInteger)))--------- --------(kernel (% (Symbol)))--------- --------(symbolIfCan ((Union (Symbol) failed) %))--------- --------(is? ((Boolean) % (BasicOperator)))--------- --------(is? ((Boolean) % (Symbol)))--------- --->/usr/local/lib/fricas/target/x86_64-unknown-linux/../../src/algebra/KERNEL.spad-->Kernel(): Spurious comments: \indented{1}{Cache of elements in a set} Author: Manuel Bronstein Date Created: 31 Oct 1988 Date Last Updated: 14 May 1991 \indented{2}{A sorted cache of a cachable set \spad{S} is a dynamic structure that} \indented{2}{keeps the elements of \spad{S} sorted and assigns an integer to each} \indented{2}{element of \spad{S} once it is in the cache. This way,{} equality and ordering} \indented{2}{on \spad{S} are tested directly on the integers associated with the elements} \indented{2}{of \spad{S},{} once they have been entered in the cache.} --->/usr/local/lib/fricas/target/x86_64-unknown-linux/../../src/algebra/KERNEL.spad-->Kernel(): Spurious comments: MakeCachableSet(\spad{S}) returns a cachable set which is equal to \spad{S} as a set. --->/usr/local/lib/fricas/target/x86_64-unknown-linux/../../src/algebra/KERNEL.spad-->Kernel(): Spurious comments: A kernel over a set \spad{S} is an operator applied to a given list of arguments from \spad{S}. ; compiling file "/var/aw/var/LatexWiki/KERNEL.NRLIB/KERNEL.lsp" (written 20 MAR 2015 05:26:10 PM):
; /var/aw/var/LatexWiki/KERNEL.NRLIB/KERNEL.fasl written ; compilation finished in 0:00:00.110 ------------------------------------------------------------------------ Kernel is now explicitly exposed in frame initial Kernel will be automatically loaded when needed from /var/aw/var/LatexWiki/KERNEL.NRLIB/KERNEL
KERNEL2 abbreviates package KernelFunctions2 ------------------------------------------------------------------------ initializing NRLIB KERNEL2 for KernelFunctions2 compiling into NRLIB KERNEL2 importing BasicOperatorFunctions1 R compiling exported constantKernel : R -> Kernel S Time: 0 SEC.
compiling exported constantIfCan : Kernel S -> Union(R,failed) Time: 0 SEC.
(time taken in buildFunctor: 0)
;;; *** |KernelFunctions2| REDEFINED
;;; *** |KernelFunctions2| REDEFINED Time: 0 SEC.
Cumulative Statistics for Constructor KernelFunctions2 Time: 0 seconds
finalizing NRLIB KERNEL2 Processing KernelFunctions2 for Browser database: --------constructor--------- --------(position ((NonNegativeInteger) %))--------- --------(setPosition ((Void) % (NonNegativeInteger)))--------- --------constructor--------- --------(clearCache ((Void)))--------- --------(enterInCache (S S (Mapping (Boolean) S)))--------- --------(linearSearch ((Union S failed) S (Mapping (Boolean) S)))--------- --------(enterInCache (S S (Mapping (Integer) S S)))--------- --------constructor--------- --------(coerce (% S))--------- --------constructor--------- --------(name ((Symbol) %))--------- --------(operator ((BasicOperator) %))--------- --------(argument ((List S) %))--------- --------(height ((NonNegativeInteger) %))--------- --------(kernel (% (BasicOperator) (List S) (NonNegativeInteger)))--------- --------(kernel (% (Symbol)))--------- --------(symbolIfCan ((Union (Symbol) failed) %))--------- --------(is? ((Boolean) % (BasicOperator)))--------- --------(is? ((Boolean) % (Symbol)))--------- --------constructor--------- --------(constantKernel ((Kernel S) R))--------- --------(constantIfCan ((Union R failed) (Kernel S)))--------- --->/usr/local/lib/fricas/target/x86_64-unknown-linux/../../src/algebra/KERNEL2.spad-->KernelFunctions2(): Spurious comments: \indented{1}{Cache of elements in a set} Author: Manuel Bronstein Date Created: 31 Oct 1988 Date Last Updated: 14 May 1991 \indented{2}{A sorted cache of a cachable set \spad{S} is a dynamic structure that} \indented{2}{keeps the elements of \spad{S} sorted and assigns an integer to each} \indented{2}{element of \spad{S} once it is in the cache. This way,{} equality and ordering} \indented{2}{on \spad{S} are tested directly on the integers associated with the elements} \indented{2}{of \spad{S},{} once they have been entered in the cache.} --->/usr/local/lib/fricas/target/x86_64-unknown-linux/../../src/algebra/KERNEL2.spad-->KernelFunctions2(): Spurious comments: MakeCachableSet(\spad{S}) returns a cachable set which is equal to \spad{S} as a set. --->/usr/local/lib/fricas/target/x86_64-unknown-linux/../../src/algebra/KERNEL2.spad-->KernelFunctions2(): Spurious comments: A kernel over a set \spad{S} is an operator applied to a given list of arguments from \spad{S}. --->/usr/local/lib/fricas/target/x86_64-unknown-linux/../../src/algebra/KERNEL2.spad-->KernelFunctions2(): Spurious comments: This package exports some auxiliary functions on kernels ; compiling file "/var/aw/var/LatexWiki/KERNEL2.NRLIB/KERNEL2.lsp" (written 20 MAR 2015 05:26:10 PM):
; /var/aw/var/LatexWiki/KERNEL2.NRLIB/KERNEL2.fasl written ; compilation finished in 0:00:00.012 ------------------------------------------------------------------------ KernelFunctions2 is now explicitly exposed in frame initial KernelFunctions2 will be automatically loaded when needed from /var/aw/var/LatexWiki/KERNEL2.NRLIB/KERNEL2