Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Symbolic: From bitboards to ideas

Author: martin fierz

Date: 04:03:35 03/15/04

Go up one level in this thread


On March 13, 2004 at 11:52:07, Steven Edwards wrote:

>Consider the position BWTC.0025:
>
>[D] r1bq1r1k/ppp1N1p1/7p/2bp1pN1/2Bn1B1Q/8/PP3PP1/R3R1K1 w - - 0 1
>
>It's a mate in three starting with 1. Qxh6+; however, I picked it for an example
>as it also has a number of possible knight forks for White.
>
>A traditional chess programs can discover knight forks only by search.

you seem to underestimate traditional chess programs...

>  A goal
>for Symbolic is to recognize tactical motifs via pattern matching, use these
>ideas for plan formation, and then use the plan to guide a very narrow search to
>produce a verification of the plan.
>
>So, here's some sample test code to recognize, without search, potentially
>interesting knight forks.  It's an example of bridging the gap between bitboards
>and ideas.
>
>(defun SKF (MyFEN)
>    "Interactive tester for SuggestKnightForks"
>    (let* ((PosVal (PosValFromFEN MyFEN)) (MoveVals (GenerateVal PosVal)))
>        (SuggestKnightForks PosVal MoveVals)))
>
>(defun SuggestKnightForks (MyPosVal MyMoveVals)
>    "Return a list of potential knight fork ideas"
>    (let*
>        (
>            (Ideas nil)
>            (AColor (ActiveColorFromPosVal MyPosVal))
>            (PColor (OtherColor AColor))
>            (VictimBB
>                (BBAndNot
>                    (BBLocByColorPV MyPosVal PColor)
>                    (BBLocByManPV MyPosVal (ManFromColorPiece PColor Knight))))
>            (MoveVals
>                (SelectMoveValsByFrMan
>                    MyMoveVals
>                    (ManFromColorPiece AColor Knight)))
>        )
>        (dolist (MoveVal MoveVals)
>            (let ((Idea nil) (VictimManSqList nil))
>                (setf VictimManSqList
>                    (SortRevManSqList
>                        (ManSqListFromPosValBB
>                            MyPosVal
>                            (BBAnd
>                                (AttackByKnightBB (ToSqFromMoveVal MoveVal))
>                                VictimBB))))
>                (when (> (length VictimManSqList) 1)
>                    (setf Idea
>                        (list
>                            (list 'try MoveVal)
>                            (list 'escape (first VictimManSqList))
>                            (list 'capture (second VictimManSqList))))
>                    (format t "Idea: %u %n" Idea)
>                    (push Idea Ideas))))
>        Ideas))
>
>Running the above with BWTC.0025 produces:
>
>Idea: ((try Nxf5) (escape (BlackPawn h6)) (capture (BlackPawn g7)))
>Idea: ((try Ng6+) (escape (BlackKing h8)) (capture (BlackRook f8)))
>Idea: ((try Nf7+) (escape (BlackKing h8)) (capture (BlackQueen d8)))
>Idea: ((try Ne6) (escape (BlackQueen d8)) (capture (BlackRook f8)))
>Idea: ((try Nc6) (escape (BlackQueen d8)) (capture (BlackPawn a7)))

....where is anything in this that a "traditional program" couldn't do? i.e. i
can very easily generate a set of squares where my knight jumps to and makes a
fork on black pieces. in a traditional program, i can simply order these moves
toward the top of the move list - or to the top, depending on what other moves
are available (no winning captures for example). i can do a SEE on the square i
want to jump to with my knight to detect whether it's a safe knight fork,
thereby eliminating stupid moves like Nc6 / Ne6 / Nf7+ / Nxf5, which your
supposedly non-traditional approach generates as "idea".

finally, if i really wanted, i could take the knight forks and extend them
before searching other moves - but it looks like a bad idea... in any case, this
simple sort of planning, which can hardly be called planning at all, can also be
done by a traditional program, and it can be done better than your suggestion.

cheers
  martin



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.