Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Symbolic: Example outline of a search

Author: Matthew Hull

Date: 12:08:16 03/17/04

Go up one level in this thread


On March 17, 2004 at 12:44:38, Steven Edwards wrote:

>Symbolic: Example outline of a search
>
>Here's WAC.001:
>
>[D] 2rr3k/pp3pp1/1nnqbN1p/3pN3/2pP4/2P3Q1/PPB4P/R4RK1 w - - 0 1
>
>Symbolic gets the position from the stream interface, does a few validity
>checks, creates the root of the move tree, probes the opening book and the
>tablebases, checks for mate-in-1, etc.  When none of the easy attempts work, it
>then starts the real search.
>
>The root position is submitted to the pattern matcher with the directive to run
>all of the patterns in the bootstrap group and to associate the resulting
>instances with the root node.
>
>The matcher generates instances for all the matched bootstrap patterns including
>the legal moves, hung pieces, pins, etc.  The very last pattern it runs is the
>Surveyor pattern.  Surveyor takes a global look at all of the bootstrap
>instances and decides which additional pattern groups to activate (i.e., make
>eligible) for pattern matching.  In the above position, Surveyor notices that an
>attack on Black's king is a reasonable possibility, so it activates the KingHunt
>pattern Group.
>
>The KingHunt group includes the AlmostMate pattern:
>
>    (AlmostMate ((Move move1) (ManSq (man2 sq2)))
>
>which matches the condition that move m1 would be a mate in one if it only
>weren't for the presence of man man2 on square sq2.  This pattern gets a match
>producing the instance:
>
>    (AlmostMate (Move Ng6+) (ManSq (BlackPawn SqF7)))
>
>The KingHunt group  also includes the ThreatensMateInOne pattern:
>
>    (ThreatenMateInOne (Move move1))
>
>which gets an instance:
>
>    (ThreatenMateInOne (Move Qg6))
>
>This in turn triggers a match of a more general pattern, ForcedReply:
>
>    (ForcedReply (Move move1) (Move move2))
>
>giving the instance:
>
>    (ForcedReply (Move Qg6) (Move fxg6))
>
>When no more pattern matches occur, Symbolic then invokes its plan generator on
>all the instances associated with the root node.  After rummaging around with
>the instances, it has tied together the above matches and produced a plan:
>
>    ((Play Qg6)
>        (Replies
>            ((fxg6) (TryToMate Ng6))
>            ((Other (fxg6)) (TryToMate Qh7))))
>
>Symbolic sends this plan to the plan verification process, and this expands a
>handful of nodes.  The plan is shown to be correct.  Symbolic notes the selected
>move, the PV, and the expectation.  Seeing that nothing better can be had, it
>records the results, sends them back via the stream interface, and exits.


How long did all this take in real time?



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.