packages feed

bishbosh 0.0.0.1 → 0.0.0.2

raw patch · 19 files changed

+75/−53 lines, 19 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

bishbosh.cabal view
@@ -14,7 +14,7 @@ -- along with BishBosh.  If not, see <http://www.gnu.org/licenses/>.  Name:		bishbosh-Version:	0.0.0.1+Version:	0.0.0.2 Cabal-version:	>= 1.10 Copyright:	(C) 2018 Dr. Alistair Ward License:	GPL@@ -26,7 +26,7 @@ Description:	A chess-game which can be rendered in a terminal (emulator) in raw ASCII, or used as an engine by xboard. Category:	Game Tested-with:	GHC == 8.0, GHC == 8.2-Homepage:	http://functionalley.eu+Homepage:	https://functionalley.eu/BishBosh/bishbosh.html Maintainer:	mailto:bishbosh@functionalley.eu Bug-reports:	mailto:bishbosh@functionalley.eu @@ -239,7 +239,6 @@ -- Required for 'cabal sdist'.     Other-modules:         BishBosh.Concurrent.Pondering-        BishBosh.Concurrent.SignalHandlers         BishBosh.Input.CommandLineOption         BishBosh.Play         BishBosh.State.ApplicationTerminationReason@@ -247,6 +246,10 @@         BishBosh.Text.Show         BishBosh.UI.CECP         BishBosh.UI.Raw++    if flag(unix)+        Other-modules:+            BishBosh.Concurrent.SignalHandlers      Build-depends:         array >= 0.5.1.1,
bishbosh.spec view
@@ -13,7 +13,7 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License-# along with BishBosh.  If not, see <http://www.gnu.org/licenses/>.+# along with BishBosh.  If not, see <https://www.gnu.org/licenses/>.  %define package		%name-%version %define tarBall		%package.tar.gz@@ -24,13 +24,13 @@  Summary:	BishBosh is a chess-game. Name:		bishbosh-Version:	0.0.0.1+Version:	0.0.0.2 Release:	1 License:	GPLv3 # From '/usr/share/doc/packages/rpm/GROUPS'. Group:		Amusements/Games-# Source0:	http://functionalley.eu/Downloads/sdist/%tarBall-URL:		http://functionalley.eu/BishBosh+# Source0:	https://functionalley.eu/Downloads/sdist/%tarBall+URL:		https://functionalley.eu/BishBosh/%name.html Prefix:		/usr BuildRequires:	haskell-platform 
changelog.markdown view
@@ -2,3 +2,6 @@  ## 0.0.0.1 * First version of the package.++## 0.0.0.2+Minor changes required to build on Windows.
config/CECP/bishbosh_black.xml view
@@ -48,11 +48,11 @@ 		</searchDepthByLogicalColour> 	</searchOptions> 	<ioOptions maximumPGNNames="8">-		<pgnOptions databaseFilePath="pgn/scid_fr.pgn" validateMoves="False">+		<pgnOptions databaseFilePath="pgn/scid.pgn" isStrictlySequential="False" validateMoves="False"> 			<identificationTag tag="ECO"/> 			<identificationTag tag="Variation"/> <!---		</pgnOptions><pgnOptions databaseFilePath="pgn/scid.pgn" isStrictlySequential="False" validateMoves="False">+		</pgnOptions><pgnOptions databaseFilePath="pgn/scid_fr.pgn" validateMoves="False"> 			<identificationTag tag="ECO"/> 			<identificationTag tag="Variation"/> 		</pgnOptions><pgnOptions databaseFilePath="pgn/bundesliga2000.pgn" validateMoves="False">
@@ -5,7 +5,7 @@ 	Copyright (C) 2018 Dr. Alistair Ward. All Rights Reserved.  Home-page:-	http://functionalley.eu+	https://functionalley.eu/BishBosh/bishbosh.html  License: 	GNU GENERAL PUBLIC LICENSE Version 3; see '/usr/share/common-licenses/GPL-3' or '/usr/share/doc/licenses/gpl-3.0.txt' where available, or the local packaged file 'LICENSE'.
man/man1/bishbosh.1 view
@@ -14,7 +14,7 @@ \" GNU General Public License for more details. \"  \" You should have received a copy of the GNU General Public License-\" along with BishBosh.  If not, see <http://www.gnu.org/licenses/>.+\" along with BishBosh.  If not, see <https://www.gnu.org/licenses/>.  .TH bishbosh 1 .SH NAME@@ -59,7 +59,7 @@ On failure to match the position with an archived game, the tree of all possible moves until the end of the game, is constructed & statically sorted to advance the subsequent evaluation of capture-moves, using either \fBhttps://chessprogramming.wikispaces.com/MVV-LVA\fR or \fBhttps://chessprogramming.wikispaces.com/Static+Exchange+Evaluation\fR. On each move, this tree's non-capture moves are dynamically sorted using the \fBhttps://chessprogramming.wikispaces.com/Killer+Heuristic\fR & the \fBhttps://chessprogramming.wikispaces.com/History+Heuristic\fR.-This tree is then searched using a \fBhttps://chessprogramming.wikispaces.com/Negamax\fR algorithm with \fBhttp://chessprogramming.wikispaces.com/Alpha-Beta\fR pruning,+This tree is then searched using a \fBhttps://chessprogramming.wikispaces.com/Negamax\fR algorithm with \fBhttps://chessprogramming.wikispaces.com/Alpha-Beta\fR pruning, over a constant configurable number of plies, to find the optimal move according to the weighted-mean of various criteria described in \fBsection-5\fR of the man-pages. Shortcuts in the search for the optimal move are taken on encountering either \fBhttps://chessprogramming.wikispaces.com/Repetitions\fR in the move-sequence or \fBhttps://chessprogramming.wikispaces.com/Transposition\fRs of sibling games. .SH OPTIONS@@ -135,6 +135,7 @@ .PP .nf .B bishbosh --verbosity=Deafening -i '/usr/share/bishbosh/config/Raw/bishbosh_black.xml' +RTS -N -H100M -RTS+.fi .IP \(bu The application has been instructed to provide maximal feedback. .IP \(bu@@ -144,6 +145,7 @@ .PP .nf .B xboard -fcp 'bishbosh -i /usr/share/bishbosh/config/CECP/bishbosh_black.xml'+.fi .IP \(bu Instruct the \fBxboard\fR GUI to use \fBbishbosh\fR as its first engine. .SH FILES@@ -178,5 +180,16 @@ .PP This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. .PP-You should have received a copy of the GNU General Public License along with this program. If not, see \fBhttp://www.gnu.org/licenses/\fR.+You should have received a copy of the GNU General Public License along with this program. If not, see \fBhttps://www.gnu.org/licenses/\fR.+.SH "SEE ALSO"+.IP \(bu+Home-page: \fBhttps://functionalley.eu/BishBosh/bishbosh.html\fR+.IP \(bu+.B https://hackage.haskell.org/package/bishbosh+.IP \(bu+.B https://github.com/functionalley/BishBosh+.IP \(bu+Source-documentation is generated by "\fBHaddock\fR", & is available in the distribution.+.IP \(bu+.B https://www.haskell.org/haddock/ 
man/man5/bishbosh.5 view
@@ -29,7 +29,6 @@ \fBrandomSeed\fR \fIInt\fR: optionally seed the pseudo-random number-generator to produce a repeatable game. See "\fB--randomSeed\fR" in \fBsection-1\fR of the man-pages. .SS Evaluation-options Each field governs automatic move-evaluation:-.TE .IP \(bu \fBincrementalEvaluation\fR \fIBool\fR; default \fBTrue\fR. Whether to incrementally generate position-hashes & evaluate the piece-square value, from the previous values; otherwise these quantities are evaluated from scratch.@@ -245,7 +244,7 @@ config/bishbosh.rng	A more sophisticated, but slower, \fBRELAX NG\fR definition of the XML-format for the configuration-file. config/{CECP,Raw}/*.xml	Sample configuration-files. man/man1/bishbosh.1	Section-1 of the man-pages for this product, describing the command-line.-pgn/*.pgn	Standard openings & archived games, as described in \fBhttps://en.wikipedia.org/wiki/Portable_Game_Notation\fR.+pgn/*.pgn	Standard openings & archived games, described in \fBhttps://en.wikipedia.org/wiki/Portable_Game_Notation\fR. https://www.oasis-open.org/committees/relax-ng/tutorial-20011203.html	A \fBRELAX NG\fR tutorial. .TE .SH AUTHOR
pgn/scid.pgn view
@@ -4,7 +4,7 @@ 	Copyright (C) 1999-2003 Shane Hudson (sgh@users.sourceforge.net) 	Created: June 1999. 	Last update: January 2011.-	Scid website: http://scid.sourceforge.net/+	Scid website: https://scid.sourceforge.net/ }  [ECO "A00a"]
pgn/scid_fr.pgn view
@@ -1,4 +1,4 @@-; Converted from 'scid_fr.eco'; <http://scid.sourceforge.net/>.+; Converted from 'scid_fr.eco'; <https://scid.sourceforge.net/>.  [ECO "A00"] [Variation "attaque d’Amsterdam"]
src-exe/BishBosh/Concurrent/Pondering.hs view
@@ -42,9 +42,9 @@ import qualified	Control.DeepSeq import qualified	Data.Maybe --- | The premis on which pondering is based & the thread on which it is happening.-data Pondering premis	= MkPondering {-	getPremis	:: premis,+-- | The premise on which pondering is based & the thread on which it is happening.+data Pondering premise	= MkPondering {+	getPremise	:: premise, 	getThreadId	:: Control.Concurrent.ThreadId } @@ -52,21 +52,21 @@ ponder 	:: Control.DeepSeq.NFData answer 	=> (String -> IO ())	-- ^ Used to print arbitrary strings.-	-> premis		-- ^ The basis of the question to which an answer is required.-	-> String		-- ^ A string representing the premis.+	-> premise		-- ^ The basis of the question to which an answer is required.+	-> String		-- ^ A string representing the premise. 	-> answer		-- ^ Actually an unevaluated question. 	-> Control.Concurrent.MVar answer-	-> IO (Pondering premis)-ponder putStrLn' premis premisString answer mVar	= do+	-> IO (Pondering premise)+ponder putStrLn' premise premiseString answer mVar	= do 	threadId	<- Control.Concurrent.forkIO $ do 		Control.Concurrent.putMVar mVar $!! answer -		putStrLn' $ showString "pondering-thread has a response based on " premisString+		putStrLn' $ showString "pondering-thread has a response based on " premiseString -	putStrLn' . showString "pondering (on " . shows threadId $ showString ") a response to " premisString+	putStrLn' . showString "pondering (on " . shows threadId $ showString ") a response to " premiseString  	return {-to IO-monad-} MkPondering {-		getPremis	= premis,+		getPremise	= premise, 		getThreadId	= threadId 	} 
src-exe/BishBosh/UI/CECP.hs view
@@ -1146,15 +1146,15 @@ 								return {-to IO-monad-} searchResult 							 ) ( 								\Concurrent.Pondering.MkPondering {-									Concurrent.Pondering.getPremis		= movePremis,+									Concurrent.Pondering.getPremise		= movePremise, 									Concurrent.Pondering.getThreadId	= threadId-								} -> if Data.Maybe.maybe False ((== movePremis) . Component.QualifiedMove.getMove . Component.Turn.getQualifiedMove) $ Model.Game.maybeLastTurn game'+								} -> if Data.Maybe.maybe False ((== movePremise) . Component.QualifiedMove.getMove . Component.Turn.getQualifiedMove) $ Model.Game.maybeLastTurn game' 									then do-										Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr . Text.ShowList.showsInfoPrefix . showString "move-premis validated => waiting on " $ shows threadId "."+										Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr . Text.ShowList.showsInfoPrefix . showString "move-premise validated => waiting on " $ shows threadId "."  										Control.Concurrent.takeMVar mVar 									else do-										Concurrent.Pondering.abort mVar threadId >>= Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr . Text.ShowList.showsInfoPrefix . showString "pondering invalidated by incorrect move-premis => "+										Concurrent.Pondering.abort mVar threadId >>= Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr . Text.ShowList.showsInfoPrefix . showString "pondering invalidated by incorrect move-premise => "  										return {-to IO-monad-} searchResult 							 ) maybePondering >>= (@@ -1205,14 +1205,14 @@ 										 ) `fmap` if ponderMode && Input.SearchOptions.getUsePondering searchOptions 											then case continuation of 												quantifiedGame' : _	-> let-													turnPremis	= Evaluation.QuantifiedGame.getLastTurn quantifiedGame'+													turnPremise	= Evaluation.QuantifiedGame.getLastTurn quantifiedGame' 												 in fmap Just . ( 													\positionHashQuantifiedGameTree'' -> Concurrent.Pondering.ponder ( 														Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr . Text.ShowList.showsInfoPrefix 													) (-														Component.QualifiedMove.getMove $ Component.Turn.getQualifiedMove turnPremis+														Component.QualifiedMove.getMove $ Component.Turn.getQualifiedMove turnPremise 													) (-														showString "move-premis" . Text.ShowList.showsAssociation $ Notation.MoveNotation.showsNotation moveNotation turnPremis "."+														showString "move-premise" . Text.ShowList.showsAssociation $ Notation.MoveNotation.showsNotation moveNotation turnPremise "." 													) ( 														search searchState' { Search.SearchState.getPositionHashQuantifiedGameTree = positionHashQuantifiedGameTree'' } 													) mVar
src-exe/BishBosh/UI/Raw.hs view
@@ -478,15 +478,15 @@ 									return {-to IO-monad-} searchResult 								 ) ( 									\Concurrent.Pondering.MkPondering {-										Concurrent.Pondering.getPremis		= movePremis,+										Concurrent.Pondering.getPremise		= movePremise, 										Concurrent.Pondering.getThreadId	= threadId-									} -> if Data.Maybe.maybe False ((== movePremis) . Component.QualifiedMove.getMove . Component.Turn.getQualifiedMove) $ Model.Game.maybeLastTurn game'+									} -> if Data.Maybe.maybe False ((== movePremise) . Component.QualifiedMove.getMove . Component.Turn.getQualifiedMove) $ Model.Game.maybeLastTurn game' 										then do-											Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr . Text.ShowList.showsInfoPrefix . showString "move-premis validated => waiting on " $ shows threadId "."+											Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr . Text.ShowList.showsInfoPrefix . showString "move-premise validated => waiting on " $ shows threadId "."  											Control.Concurrent.takeMVar mVar 										else do-											Concurrent.Pondering.abort mVar threadId >>= Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr . Text.ShowList.showsInfoPrefix . showString "pondering invalidated by incorrect move-premis => "+											Concurrent.Pondering.abort mVar threadId >>= Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr . Text.ShowList.showsInfoPrefix . showString "pondering invalidated by incorrect move-premise => "  											return {-to IO-monad-} searchResult 								 ) maybePondering >>= (@@ -523,14 +523,14 @@ 											 ) `fmap` if Input.SearchOptions.getUsePondering searchOptions 												then case continuation of 													quantifiedGame' : _	-> let-														turnPremis	= Evaluation.QuantifiedGame.getLastTurn quantifiedGame'+														turnPremise	= Evaluation.QuantifiedGame.getLastTurn quantifiedGame' 													 in fmap Just . ( 														\positionHashQuantifiedGameTree'' -> Concurrent.Pondering.ponder ( 															Control.Monad.when (verbosity == maxBound) . System.IO.hPutStrLn System.IO.stderr . Text.ShowList.showsInfoPrefix 														) (-															Component.QualifiedMove.getMove $ Component.Turn.getQualifiedMove turnPremis+															Component.QualifiedMove.getMove $ Component.Turn.getQualifiedMove turnPremise 														) (-															showString "move-premis" . Text.ShowList.showsAssociation $ Notation.MoveNotation.showsNotation moveNotation turnPremis "."+															showString "move-premise" . Text.ShowList.showsAssociation $ Notation.MoveNotation.showsNotation moveNotation turnPremise "." 														) ( 															search searchState' { Search.SearchState.getPositionHashQuantifiedGameTree = positionHashQuantifiedGameTree'' } 														) mVar
src-exe/Main.hs view
@@ -33,7 +33,6 @@ -- import		BishBosh.Data.Ratio()	-- Required if either criterionWeight or criterionValue is Rational. import			Control.Arrow((&&&), (***)) import			Control.Category((>>>))-import qualified	BishBosh.Concurrent.SignalHandlers		as Concurrent.SignalHandlers import qualified	BishBosh.ContextualNotation.PGN			as ContextualNotation.PGN import qualified	BishBosh.ContextualNotation.PGNDatabase		as ContextualNotation.PGNDatabase import qualified	BishBosh.ContextualNotation.QualifiedMoveForest	as ContextualNotation.QualifiedMoveForest@@ -88,6 +87,10 @@ import qualified	GHC.Conc #endif +#ifdef USE_UNIX+import qualified	BishBosh.Concurrent.SignalHandlers	as Concurrent.SignalHandlers+#endif+ type Row	= T.Y type Column	= T.X		-- N.B. there's no requirement to be the same type as Row. type Options	= Input.Options.Options Column T.CriterionWeight T.PieceSquareValue T.RankValue Row T.X T.Y@@ -252,7 +255,6 @@ 			generateDTD	= Control.Monad.void . HXT.runX $ HXT.constA (undefined :: Options) >>> HXT.xpickleWriteDTD HXT.xpickle [ 				HXT.withTrace 0 {-valid values in closed interval [0, 4]-} 			 ] "-" {-stdout-}	-- CAVEAT: this DTD requires manual correction of defaulted attributes, which are erroneously defined as 'REQUIRED' rather than 'IMPLIED'.- #ifdef USE_UNIX 	Concurrent.SignalHandlers.handleSignals #endif
src-lib/BishBosh/Attribute/CaptureMoveSortAlgorithm.hs view
@@ -19,7 +19,7 @@ {- |  [@AUTHOR@]	Dr. Alistair Ward - [@DESCRIPTION@]	Defines the algorithm used to sort the immediately available capture-/move/s, before the evaluating the fitness of the resulting positions.+ [@DESCRIPTION@]	Defines the algorithm used to sort the immediately available capture-/move/s, before evaluating the fitness of the resulting positions. -}  module BishBosh.Attribute.CaptureMoveSortAlgorithm(
src-lib/BishBosh/Cartesian/Coordinates.hs view
@@ -19,7 +19,7 @@ {- |  [@AUTHOR@]	Dr. Alistair Ward - [@DESCRaPTION@]	The location of a square on the board.+ [@DESCRIPTION@]	The location of a square on the board. -}  module BishBosh.Cartesian.Coordinates(
src-lib/BishBosh/Component/Turn.hs view
@@ -14,7 +14,7 @@ 	GNU General Public License for more details.  	You should have received a copy of the GNU General Public License-	along with BishBosh.  If not, see <http://www.gnu.org/licenses/>.+	along with BishBosh.  If not, see <https://www.gnu.org/licenses/>. -} {- |  [@AUTHOR@]	Dr. Alistair Ward@@ -146,7 +146,7 @@ compareByLVA evaluateRank MkTurn { getRank = rankL } MkTurn { getRank = rankR }	= Attribute.Rank.compareByLVA evaluateRank rankL rankR  {- |-	* Compares /turn/s by <http://chessprogramming.wikispaces.com/MVV-LVA>.+	* Compares /turn/s by <https://chessprogramming.wikispaces.com/MVV-LVA>.  	* This orders the most valuable victim of an attack first, but when victims are of equal rank, orders the least valuable aggressor first. 
src-lib/BishBosh/Evaluation/PositionHashQuantifiedGameTree.hs view
@@ -21,9 +21,11 @@   [@DESCRIPTION@] -	* Constructs a tree of zobrist-hashes & /quantifiedGame/s, with one of the moves available to its parent node applied, & an evaluation of its fitness.+	* Constructs a tree in which each node contains,+	a zobrist-hash,+	a /quantifiedGame/ with one of the moves available to its parent node applied & evaluation of the fitness of the resulting position. -	* Each forest in the tree is sorted, before evaluation of it's fitness is performed.+	* Each forest in the tree is sorted, before evaluation of its fitness is performed.  	* CAVEAT: promotions are insufficiently frequent to be treated specially when sorting. -}
src-test/BishBosh/Test/HUnit/Model/GameTree.hs view
@@ -14,7 +14,7 @@ 	GNU General Public License for more details.  	You should have received a copy of the GNU General Public License-	along with BishBosh.  If not, see <http://www.gnu.org/licenses/>.+	along with BishBosh.  If not, see <https://www.gnu.org/licenses/>. -} {- |  [@AUTHOR@]	Dr. Alistair Ward@@ -50,7 +50,7 @@ testCases	= Test.HUnit.test [ 	let 		maxDepth	= 4-	in "'BishBosh.Model.GameTree.countGames' failed" ~: map Model.GameTree.countGames [0 .. maxDepth] ~?= take (succ maxDepth) [1, 20, 400, 8902, 197281, 4865609, 119060324, 3195901860, 84998978956],	-- <http://oeis.org/A019319>.+	in "'BishBosh.Model.GameTree.countGames' failed" ~: map Model.GameTree.countGames [0 .. maxDepth] ~?= take (succ maxDepth) [1, 20, 400, 8902, 197281, 4865609, 119060324, 3195901860, 84998978956],	-- <https://oeis.org/A019319>. 	"'BishBosh.Model.GameTree.countMoves' failed" ~: map ( 		\searchDepth -> Model.GameTree.countMoves searchDepth ~?= foldr ( 			(+) . Model.GameTree.countGames
src-test/BishBosh/Test/HUnit/Model/PositionHashTree.hs view
@@ -14,7 +14,7 @@ 	GNU General Public License for more details.  	You should have received a copy of the GNU General Public License-	along with BishBosh.  If not, see <http://www.gnu.org/licenses/>.+	along with BishBosh.  If not, see <https://www.gnu.org/licenses/>. -} {- |  [@AUTHOR@]	Dr. Alistair Ward@@ -42,5 +42,5 @@ 		maxDepth	= 4 	in "'BishBosh.Model.PositionhashTree.countDistinctPositions' failed" ~: map ( 		\i -> Model.PositionHashTree.countDistinctPositions i (Data.Default.def :: Model.PositionHashTree.PositionHashTree T.PositionHash)-	) [0 .. maxDepth] ~?= take (succ maxDepth) [1, 20, 400, 5362, 72078, 822518, 9417681, 96400068, 988187354, 9183421888, 85375278064, 726155461002]	-- <http://oeis.org/A083276>. CAVEAT: the point at which this test fails, depends on the square-root of the bits in 'T.PositionHash'.+	) [0 .. maxDepth] ~?= take (succ maxDepth) [1, 20, 400, 5362, 72078, 822518, 9417681, 96400068, 988187354, 9183421888, 85375278064, 726155461002]	-- <https://oeis.org/A083276>. CAVEAT: the point at which this test fails, depends on the square-root of the bits in 'T.PositionHash'.  ]