Computer Chess Club Archives


Search

Terms

Messages

Subject: Symbolic: Status report 2005.04.12

Author: Steven Edwards

Date: 00:51:42 04/12/05


Symbolic: Status report 2005.04.12

In ChessLisp, the Window is a supported type that allows for score window
literals.  Each such value is a single atom that contains a 32 bit alpha score
value and a 32 bit beta score value.  Both values are in micropawns and with
special interpretations reserved for mates, losses, infinities, and so forth.  A
window value can be constructed from a pair of Score (also a built in type)
values by:

(MakeWindow alpha beta) ;; General form
(MakeWindow DrawScore PosInfScore) ;; Optimistic
(MakeWindow NegInfScore DrawScore) ;; Pessimistic
(MakeWindow NegInfScore PosInfScore) ;; Wide open

The last of these has a built in constant: FullWindow.  The ChessLisp
interpreter is smart enough to display Score and Window values using symbolic
names (where available) and with decimal pawn values.  So, A FullWindow gets
printed as:

  [NegInf..PosInf]

 And an even to positive infinity window prints as:

  [Even..PosInf]

A typical aspiration window:

  [-1.5..+1.5]

An improved aspiration window:

  [+1.5..MateIn1]

The upshifted version of the above:

  [LoseIn1..-1.5]

The upshifted version of the above:

  [+1.5..MateIn2]

The main advantage of having built in support for Window and Score values and
functions is not speed, but rather improved clarity along with run time type
checking.  Paradise used simple integers for scores (e.g., pawn = 100, king =
320, mate = 1300) and used a dotted pair of these for a window.  For that
program's limited domain, that was sufficient and fast enough.  Symbolic's needs
are greater, and I may add a few more intrinsics supporting the Score and Window
types.

Two important data structures in Symbolic's Lisp source are the KSP (knowledge
sequencer parameter) association list and the Analysis association list.  A KSP
always had a Window association pair, the value of which was a Window using the
ChessLisp Window literal type.  A KSP is the (only) formal parameter to a KS and
all (so far) calls to a KS represent downward (away from the root) motion in
both the plan space and the position space; or, no motion at all.  Now, another
of the association pairs in a KSP is an Analysis, and the Analysis is usually
passed back as a result tucked into a modified KSP.

Now until the past set of revisions, an Analysis had a Score association and an
IsCertain association.  This worked up until now, but it won't work well for an
expanded search that can revisit nodes while at the same time taking maximum
advantage of prior analysis.  So, the Score and IsCertain associations in an
Analysis got replaced with a single ResWindow association that has a Window for
its value.  To reduce confusion, the KSP Window association was renamed to
ActWindow (actual parameter window value).  A certain score is represented by a
non nil window that has its alpha value equal to its beta value.  In those cases
where just a score is wanted from a window, the ChessLisp primitive GetAlfa is
called.  Additionally, a position search tree node (Node association list) has a
Window association instead of a Score association; this aids and abets thievery
of ideas from Berliner's B* search and other techniques that assign range
evaluations to persistently retained search nodes.

So far, the changes seem to survive the regression tests.

Here are some Window functions:

(defun MakeCertainWindow (MyScore)
  "Return a window that represents a certain score."
  (MakeWindow MyScore MyScore))


(defun CertainWindow? (MyWindow)
  "Return t if a window represents a certain score."
  (if (not MyWindow)
    nil
    (ScoreOpEQ (GetAlfa MyWindow) (GetBeta MyWindow))))


(defun CertainAnalysis? (MyAnalysis)
  "Return t if the analysis is certain."
  (CertainWindow? (vassocq ResWindow MyAnalysis)))


(defun UpshiftAnalysis (MyAnalysis MyMV)
  "Move an analysis up one ply."
  (alv-pushq EV MyAnalysis MyMV)
  (let ((ResWindow (vassocq ResWindow MyAnalysis)))
    (when ResWindow
      (nassocq ResWindow MyAnalysis (WindowShiftUp ResWindow))))
  MyAnalysis)

--------

More to come.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.