Introduce namespace Pawns

And retire old struct PawnTable along the same lines
of previous patch.

No functional change.
Small tweak in is_pseudo_legal()

This is difficult code becuase a bug here could lead
to very subtle crashes in case of SMP games where we
have TT move corruption due to concurrent access.

Anyhow I have fully verified te code throwing at it
random moves. It shoudl work.

No functional change.
Retire Position::move_is_legal()

Use the new contains() method of struct MoveList

No functional change.
Retire Position::in_check()

It is redundant with Position::checkers()

No functional change.
Fix a couple of extra spaces

No functional change.
Introduce Null Threat extension

In case of null search at low depths returns a fail low
due to a threat then, rather than return beta-1 (to cause
a re-search at full depth in the parent node), we set a flag
threatExtension = true (false by default) that will cause
moves that prevent the threat to be extended of one ply
in the following search.

Idea and patch is by Lucas Braesch.

Lucas also did the tests:
1500 games in 5"+0.05":
SF_threatExtension vs SF_20121222: 366 - 331 - 803 [51.2%] LOS=90.8%

3000 games in 10"+0.1":
SF_threatExtension vs SF_20121222: 610 - 559 - 1831 [50.8%] LOS=93.2%

Tests confirmed by Gary after 10570 games,
ELO: 2.79 +- 99%: 8.72 95%: 6.63
LOS: 94.08%
Wins: 1523 Losses: 1438 Draws: 7607

And finally by me at 15"+0.05, single thread, 3824 games
threatExtension vs master 768 - 692 - 2364  +7 ELO

bench 4918443
Rename yields_to_threat and prevents_threat

Follow Lucas suggestions and better name these
two functions.

No functional change.
Remove two obsolete asserts in prevents_move

Now that this function is called also to calculate
move's extensions the asserts are no more valid.

No functional change.
Add checkers info to Position::pretty()

In case current position is under check, list the
squares of the checker(s) pieces.

This should satisfy a specific user request.

No functional change.
Add list of legal moves to Position::pretty()

Along the same lines of previous patch now we add
the list of the legal moves in the given position.

No functional change.
Revert evaluation cache

And return on using TT as backing store for position
evaluations.

Tests (even on single thread) show eval cache was a regression.
In multi thread result should be even worst because eval cache
is a per-thread struct, while TT is shared.

After 4957 games at 15"+0.05 (single thread)
eval cache vs master 969 - 1093 - 2895  -9 ELO

So previous reported result of +18 ELO was probably due to an
issue in the testing framework (a bug in cutechess-cli) that
has been fixed in the meanwhile.

bench: 5386711
Handle UCI command "mate in x moves"

Following a user request I added the handling of UCI:

go mate x

Currently we just return from a PV node if x moves have been
done. Probably not the best approach. I have looked at Fruit/Toga
sources and there is even simpler: engine falls back on a fixed
depth search.

No functional change.
Add 'mate' limit to 'bench' command

It is now possible to run SF on a 'mate in x' testsuite.

For instance in case of a file with fen strings of
positions with mate in 10 we can now 'bench' on it:

stockfish bench 128 1 10 mate_in_10.epd mate

No functional change.
Micro-optimization in evaluate_space()

Since &-ing with SpaceMask restricts the set to the home
half of the board, it is possible to use just one popcount
instead of 2 by shifting "safe" to the other half of the
board. This gives a small speedup especially on systems
where hardware popcount is not available.

Patch kindly sent by Richard Vida.

No functional change.
Allow to pass a 'seed' to RKISS

This somewhat simplifies the code.

Suggested by Lucas Braesch.

No functional change.
Remove some obsolete asserts on TT values

Now that insert_pv_in_tt() stores VALUE_NONE in
TT's position evaluation those 2 asserts are
obselete.

No functional change.
Reformat FEN construction

Simplify and shrink code.

No functional change.
Teach file_to_char() about upper/lower case

This allows to further simplify Position::fen()

No functional change.
Don't exit if unable to find bench file

Now that we can call 'bench' command also from
interactive terminal it makes no more sense to
exit the application if the user types a wrong
file name.

No functional change.
Retire 'mate in x' hack

Sometimes is faster, but not always and on very long mates
produces strange scores probably due to truncation of PV
artifacts.

So simply perform normal search also in case of UCI 'mate x'
command, with the only difference that when a mate in x is
found search returns immediately.

No functional change.