From 84e5c7b1dfa8ada51dfb02f49cc73d4cfe4fa054 Mon Sep 17 00:00:00 2001 From: Rowan Torbitzky-Lane Date: Tue, 11 Feb 2025 17:05:16 -0600 Subject: [PATCH] update instructions list/formatting --- Makefile | 2 +- TODO.md | 2 +- src/HushGP/Instructions.hs | 1155 ++++++++++------- src/HushGP/Instructions/StringInstructions.hs | 9 - src/HushGP/Instructions/Utility.hs | 10 + src/HushGP/Push.hs | 26 +- src/HushGP/State.hs | 10 +- 7 files changed, 685 insertions(+), 529 deletions(-) diff --git a/Makefile b/Makefile index bd281ee..79a3b29 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ test: # Runs unit tests. runghc -i./src/ test/Main.hs format: # Formats code using ormolu. - ormolu --mode inplace app/*.hs src/*.hs test/*.hs + ormolu --mode inplace app/*.hs src/HushGP/*.hs test/*.hs hlint: # HLint for lint suggestions. hlint src/*.hs diff --git a/TODO.md b/TODO.md index b9a46a6..b7d6c54 100644 --- a/TODO.md +++ b/TODO.md @@ -13,7 +13,7 @@ - [X] Write haddock documentation for each function - [X] Refactor all functions to take state as the final parameter - [X] Standardize the pattern matching parameter names, such as c1 : cs -- [ ] Write unit/quickcheck tests for all of the instructions +- [ ] Write unit/quickcheck tests for the generic functions ~~[ ] Use template haskell to generate function lists~~ - [X] Move utility functions to their own file - [ ] Make add/sub/mult/div/mod instructions generic diff --git a/src/HushGP/Instructions.hs b/src/HushGP/Instructions.hs index acfa87c..fcc9be3 100644 --- a/src/HushGP/Instructions.hs +++ b/src/HushGP/Instructions.hs @@ -12,530 +12,685 @@ module HushGP.Instructions module HushGP.Instructions.VectorStringInstructions, module HushGP.Instructions.VectorBoolInstructions, module HushGP.Instructions.VectorCharInstructions, - -- allIntInstructions, - -- allFloatInstructions, - -- allBoolInstructions, - -- allCharInstructions, - -- allCodeInstructions, - -- allExecInstructions, - -- allStringInstructions, - -- allVectorIntInstructions, - -- allVectorFloatInstructions, - -- allVectorCharInstructions, - -- allVectorStringInstructions, - -- allVectorBoolInstructions, - -- allInstructions + allIntInstructions, + allFloatInstructions, + allBoolInstructions, + allCharInstructions, + allCodeInstructions, + allExecInstructions, + allStringInstructions, + allVectorIntInstructions, + allVectorFloatInstructions, + allVectorCharInstructions, + allVectorStringInstructions, + allVectorBoolInstructions, + allInstructions, ) where +import HushGP.Instructions.BoolInstructions import HushGP.Instructions.CharInstructions import HushGP.Instructions.CodeInstructions import HushGP.Instructions.ExecInstructions import HushGP.Instructions.FloatInstructions import HushGP.Instructions.GenericInstructions import HushGP.Instructions.IntInstructions -import HushGP.Instructions.BoolInstructions import HushGP.Instructions.StringInstructions +import HushGP.Instructions.VectorBoolInstructions import HushGP.Instructions.VectorCharInstructions import HushGP.Instructions.VectorFloatInstructions import HushGP.Instructions.VectorIntInstructions -import HushGP.Instructions.VectorBoolInstructions import HushGP.Instructions.VectorStringInstructions --- import HushGP.State +import HushGP.State --- allIntInstructions :: [Gene] --- allIntInstructions = map StateFunc [ --- (instructionIntFromFloat, "instructionIntFromFloat"), --- (instructionIntFromBool, "instructionIntFromBool"), --- (instructionIntAdd, "instructionIntAdd"), --- (instructionIntSub, "instructionIntSub"), --- (instructionIntMul, "instructionIntMul"), --- (instructionIntDiv, "instructionIntDiv"), --- (instructionIntMod, "instructionIntMod"), --- (instructionIntMin, "instructionIntMin"), --- (instructionIntMax, "instructionIntMax"), --- (instructionIntInc, "instructionIntInc"), --- (instructionIntDec, "instructionIntDec"), --- (instructionIntLT, "instructionIntLT"), --- (instructionIntGT, "instructionIntGT"), --- (instructionIntLTE, "instructionIntLTE"), --- (instructionIntGTE, "instructionIntGTE"), --- (instructionIntDup, "instructionIntDup"), --- (instructionIntPop, "instructionIntPop"), --- (instructionIntDupN, "instructionIntDupN"), --- (instructionIntSwap, "instructionIntSwap"), --- (instructionIntRot, "instructionIntRot"), --- (instructionIntFlush, "instructionIntFlush"), --- (instructionIntEq, "instructionIntEq"), --- (instructionIntYank, "instructionIntYank"), --- (instructionIntYankDup, "instructionIntYankDup"), --- (instructionIntShove, "instructionIntShove"), --- (instructionIntIsStackEmpty, "instructionIntIsStackEmpty"), --- (instructionIntFromChar, "instructionIntFromChar"), --- (instructionIntFromString, "instructionIntFromString"), --- (instructionIntDupItems, "instructionIntDupItems") --- ] +allIntInstructions :: [Gene] +allIntInstructions = + map + StateFunc + [ (instructionIntFromFloat, "instructionIntFromFloat"), + (instructionIntFromBool, "instructionIntFromBool"), + (instructionIntAdd, "instructionIntAdd"), + (instructionIntSub, "instructionIntSub"), + (instructionIntMul, "instructionIntMul"), + (instructionIntDiv, "instructionIntDiv"), + (instructionIntMod, "instructionIntMod"), + (instructionIntMin, "instructionIntMin"), + (instructionIntMax, "instructionIntMax"), + (instructionIntInc, "instructionIntInc"), + (instructionIntDec, "instructionIntDec"), + (instructionIntLT, "instructionIntLT"), + (instructionIntGT, "instructionIntGT"), + (instructionIntLTE, "instructionIntLTE"), + (instructionIntGTE, "instructionIntGTE"), + (instructionIntDup, "instructionIntDup"), + (instructionIntPop, "instructionIntPop"), + (instructionIntDupN, "instructionIntDupN"), + (instructionIntSwap, "instructionIntSwap"), + (instructionIntRot, "instructionIntRot"), + (instructionIntFlush, "instructionIntFlush"), + (instructionIntEq, "instructionIntEq"), + (instructionIntYank, "instructionIntYank"), + (instructionIntYankDup, "instructionIntYankDup"), + (instructionIntShove, "instructionIntShove"), + (instructionIntIsStackEmpty, "instructionIntIsStackEmpty"), + (instructionIntFromChar, "instructionIntFromChar"), + (instructionIntFromString, "instructionIntFromString"), + (instructionIntDupItems, "instructionIntDupItems") + ] --- allFloatInstructions :: [Gene] --- allFloatInstructions = map StateFunc [ --- (instructionFloatFromInt, "instructionFloatFromInt"), --- (instructionFloatFromBool, "instructionFloatFromBool"), --- (instructionFloatAdd, "instructionFloatAdd"), --- (instructionFloatSub, "instructionFloatSub"), --- (instructionFloatMul, "instructionFloatMul"), --- (instructionFloatDiv, "instructionFloatDiv"), --- (instructionFloatMod, "instructionFloatMod"), --- (instructionFloatMin, "instructionFloatMin"), --- (instructionFloatMax, "instructionFloatMax"), --- (instructionFloatInc, "instructionFloatInc"), --- (instructionFloatDec, "instructionFloatDec"), --- (instructionFloatLT, "instructionFloatLT"), --- (instructionFloatGT, "instructionFloatGT"), --- (instructionFloatLTE, "instructionFloatLTE"), --- (instructionFloatGTE, "instructionFloatGTE"), --- (instructionFloatDup, "instructionFloatDup"), --- (instructionFloatPop, "instructionFloatPop"), --- (instructionFloatDupN, "instructionFloatDupN"), --- (instructionFloatSwap, "instructionFloatSwap"), --- (instructionFloatRot, "instructionFloatRot"), --- (instructionFloatFlush, "instructionFloatFlush"), --- (instructionFloatEq, "instructionFloatEq"), --- (instructionFloatYank, "instructionFloatYank"), --- (instructionFloatYankDup, "instructionFloatYankDup"), --- (instructionFloatShove, "instructionFloatShove"), --- (instructionFloatIsStackEmpty, "instructionFloatIsStackEmpty"), --- (instructionFloatFromChar, "instructionFloatFromChar"), --- (instructionFloatFromString, "instructionFloatFromString"), --- (instructionFloatDupItems, "instructionFloatDupItems") --- ] +allFloatInstructions :: [Gene] +allFloatInstructions = + map + StateFunc + [ (instructionFloatFromInt, "instructionFloatFromInt"), + (instructionFloatFromBool, "instructionFloatFromBool"), + (instructionFloatAdd, "instructionFloatAdd"), + (instructionFloatSub, "instructionFloatSub"), + (instructionFloatMul, "instructionFloatMul"), + (instructionFloatDiv, "instructionFloatDiv"), + (instructionFloatMod, "instructionFloatMod"), + (instructionFloatMin, "instructionFloatMin"), + (instructionFloatMax, "instructionFloatMax"), + (instructionFloatInc, "instructionFloatInc"), + (instructionFloatDec, "instructionFloatDec"), + (instructionFloatLT, "instructionFloatLT"), + (instructionFloatGT, "instructionFloatGT"), + (instructionFloatLTE, "instructionFloatLTE"), + (instructionFloatGTE, "instructionFloatGTE"), + (instructionFloatDup, "instructionFloatDup"), + (instructionFloatPop, "instructionFloatPop"), + (instructionFloatDupN, "instructionFloatDupN"), + (instructionFloatSwap, "instructionFloatSwap"), + (instructionFloatRot, "instructionFloatRot"), + (instructionFloatFlush, "instructionFloatFlush"), + (instructionFloatEq, "instructionFloatEq"), + (instructionFloatYank, "instructionFloatYank"), + (instructionFloatYankDup, "instructionFloatYankDup"), + (instructionFloatShove, "instructionFloatShove"), + (instructionFloatIsStackEmpty, "instructionFloatIsStackEmpty"), + (instructionFloatFromChar, "instructionFloatFromChar"), + (instructionFloatFromString, "instructionFloatFromString"), + (instructionFloatDupItems, "instructionFloatDupItems") + ] --- allBoolInstructions :: [Gene] --- allBoolInstructions = map StateFunc [ --- (instructionBoolFromInt, "instructionBoolFromInt"), --- (instructionBoolFromFloat, "instructionBoolFromFloat"), --- (instructionBoolAnd, "instructionBoolAnd"), --- (instructionBoolInvertFirstThenAnd, "instructionBoolInvertFirstThenAnd"), --- (instructionBoolInvertSecondThenAnd, "instructionBoolInvertSecondThenAnd"), --- (instructionBoolOr, "instructionBoolOr"), --- (instructionBoolXor, "instructionBoolXor"), --- (instructionBoolPop, "instructionBoolPop"), --- (instructionBoolDup, "instructionBoolDup"), --- (instructionBoolDupN, "instructionBoolDupN"), --- (instructionBoolSwap, "instructionBoolSwap"), --- (instructionBoolRot, "instructionBoolRot"), --- (instructionBoolFlush, "instructionBoolFlush"), --- (instructionBoolEq, "instructionBoolEq"), --- (instructionBoolStackDepth, "instructionBoolStackDepth"), --- (instructionBoolYank, "instructionBoolYank"), --- (instructionBoolYankDup, "instructionBoolYankDup"), --- (instructionBoolShove, "instructionBoolShove"), --- (instructionBoolShoveDup, "instructionBoolShoveDup"), --- (instructionBoolIsStackEmpty, "instructionBoolIsStackEmpty"), --- (instructionBoolDupItems, "instructionBoolDupItems") --- ] +allBoolInstructions :: [Gene] +allBoolInstructions = + map + StateFunc + [ (instructionBoolFromInt, "instructionBoolFromInt"), + (instructionBoolFromFloat, "instructionBoolFromFloat"), + (instructionBoolAnd, "instructionBoolAnd"), + (instructionBoolInvertFirstThenAnd, "instructionBoolInvertFirstThenAnd"), + (instructionBoolInvertSecondThenAnd, "instructionBoolInvertSecondThenAnd"), + (instructionBoolOr, "instructionBoolOr"), + (instructionBoolXor, "instructionBoolXor"), + (instructionBoolPop, "instructionBoolPop"), + (instructionBoolDup, "instructionBoolDup"), + (instructionBoolDupN, "instructionBoolDupN"), + (instructionBoolSwap, "instructionBoolSwap"), + (instructionBoolRot, "instructionBoolRot"), + (instructionBoolFlush, "instructionBoolFlush"), + (instructionBoolEq, "instructionBoolEq"), + (instructionBoolStackDepth, "instructionBoolStackDepth"), + (instructionBoolYank, "instructionBoolYank"), + (instructionBoolYankDup, "instructionBoolYankDup"), + (instructionBoolShove, "instructionBoolShove"), + (instructionBoolShoveDup, "instructionBoolShoveDup"), + (instructionBoolIsStackEmpty, "instructionBoolIsStackEmpty"), + (instructionBoolDupItems, "instructionBoolDupItems") + ] --- allCharInstructions :: [Gene] --- allCharInstructions = map StateFunc [ --- (instructionCharConcat, "instructionCharConcat"), --- (instructionCharFromFirstChar, "instructionCharFromFirstChar"), --- (instructionCharFromLastChar, "instructionCharFromLastChar"), --- (instructionCharFromNthChar, "instructionCharFromNthChar"), --- (instructionCharIsWhitespace, "instructionCharIsWhitespace"), --- (instructionCharIsLetter, "instructionCharIsLetter"), --- (instructionCharIsDigit, "instructionCharIsDigit"), --- (instructionCharFromBool, "instructionCharFromBool"), --- (instructionCharFromAsciiInt, "instructionCharFromAsciiInt"), --- (instructionCharFromAsciiFloat, "instructionCharFromAsciiFloat"), --- (instructionCharsFromString, "instructionCharsFromString"), --- (instructionCharPop, "instructionCharPop"), --- (instructionCharDup, "instructionCharDup"), --- (instructionCharDupN, "instructionCharDupN"), --- (instructionCharSwap, "instructionCharSwap"), --- (instructionCharRot, "instructionCharRot"), --- (instructionCharFlush, "instructionCharFlush"), --- (instructionCharEq, "instructionCharEq"), --- (instructionCharStackDepth, "instructionCharStackDepth"), --- (instructionCharYank, "instructionCharYank"), --- (instructionCharYankDup, "instructionCharYankDup"), --- (instructionCharShove, "instructionCharShove"), --- (instructionCharShoveDup, "instructionCharShoveDup"), --- (instructionCharIsStackEmpty, "instructionCharIsStackEmpty"), --- (instructionCharDupItems, "instructionCharDupItems") --- ] +allCharInstructions :: [Gene] +allCharInstructions = + map + StateFunc + [ (instructionCharConcat, "instructionCharConcat"), + (instructionCharFromFirstChar, "instructionCharFromFirstChar"), + (instructionCharFromLastChar, "instructionCharFromLastChar"), + (instructionCharFromNthChar, "instructionCharFromNthChar"), + (instructionCharIsWhitespace, "instructionCharIsWhitespace"), + (instructionCharIsLetter, "instructionCharIsLetter"), + (instructionCharIsDigit, "instructionCharIsDigit"), + (instructionCharFromBool, "instructionCharFromBool"), + (instructionCharFromAsciiInt, "instructionCharFromAsciiInt"), + (instructionCharFromAsciiFloat, "instructionCharFromAsciiFloat"), + (instructionCharsFromString, "instructionCharsFromString"), + (instructionCharPop, "instructionCharPop"), + (instructionCharDup, "instructionCharDup"), + (instructionCharDupN, "instructionCharDupN"), + (instructionCharSwap, "instructionCharSwap"), + (instructionCharRot, "instructionCharRot"), + (instructionCharFlush, "instructionCharFlush"), + (instructionCharEq, "instructionCharEq"), + (instructionCharStackDepth, "instructionCharStackDepth"), + (instructionCharYank, "instructionCharYank"), + (instructionCharYankDup, "instructionCharYankDup"), + (instructionCharShove, "instructionCharShove"), + (instructionCharShoveDup, "instructionCharShoveDup"), + (instructionCharIsStackEmpty, "instructionCharIsStackEmpty"), + (instructionCharDupItems, "instructionCharDupItems") + ] --- allCodeInstructions :: [Gene] --- allCodeInstructions = map StateFunc [ --- (instructionCodePop, "instructionCodePop"), --- (instructionCodeIsCodeBlock, "instructionCodeIsCodeBlock"), --- (instructionCodeIsSingular, "instructionCodeIsSingular"), --- (instructionCodeLength, "instructionCodeLength"), --- (instructionCodeFirst, "instructionCodeFirst"), --- (instructionCodeLast, "instructionCodeLast"), --- (instructionCodeTail, "instructionCodeTail"), --- (instructionCodeInit, "instructionCodeInit"), --- (instructionCodeWrap, "instructionCodeWrap"), --- (instructionCodeList, "instructionCodeList"), --- (instructionCodeCombine, "instructionCodeCombine"), --- (instructionCodeDo, "instructionCodeDo"), --- (instructionCodeDoDup, "instructionCodeDoDup"), --- (instructionCodeDoThenPop, "instructionCodeDoThenPop"), --- (instructionCodeDoRange, "instructionCodeDoRange"), --- (instructionCodeDoCount, "instructionCodeDoCount"), --- (instructionCodeDoTimes, "instructionCodeDoTimes"), --- (instructionCodeIf, "instructionCodeIf"), --- (instructionCodeWhen, "instructionCodeWhen"), --- (instructionCodeMember, "instructionCodeMember"), --- (instructionCodeN, "instructionCodeN"), --- (instructionMakeEmptyCodeBlock, "instructionMakeEmptyCodeBlock"), --- (instructionIsEmptyCodeBlock, "instructionIsEmptyCodeBlock"), --- (instructionCodeSize, "instructionCodeSize"), --- (instructionCodeExtract, "instructionCodeExtract"), --- (instructionCodeInsert, "instructionCodeInsert"), --- (instructionCodeFirstPosition, "instructionCodeFirstPosition"), --- (instructionCodeReverse, "instructionCodeReverse"), --- (instructionCodeDup, "instructionCodeDup"), --- (instructionCodeDupN, "instructionCodeDupN"), --- (instructionCodeDup, "instructionCodeDup"), --- (instructionCodeDupN, "instructionCodeDupN"), --- (instructionCodeSwap, "instructionCodeSwap"), --- (instructionCodeRot, "instructionCodeRot"), --- (instructionCodeFlush, "instructionCodeFlush"), --- (instructionCodeEq, "instructionCodeEq"), --- (instructionCodeStackDepth, "instructionCodeStackDepth"), --- (instructionCodeYank, "instructionCodeYank"), --- (instructionCodeYankDup, "instructionCodeYankDup"), --- (instructionCodeShove, "instructionCodeShove"), --- (instructionCodeShoveDup, "instructionCodeShoveDup"), --- (instructionCodeIsStackEmpty, "instructionCodeIsStackEmpty"), --- (instructionCodeFromBool, "instructionCodeFromBool"), --- (instructionCodeFromInt, "instructionCodeFromInt"), --- (instructionCodeFromChar, "instructionCodeFromChar"), --- (instructionCodeFromFloat, "instructionCodeFromFloat"), --- (instructionCodeFromString, "instructionCodeFromString"), --- (instructionCodeFromVectorInt, "instructionCodeFromVectorInt"), --- (instructionCodeFromVectorFloat, "instructionCodeFromVectorFloat"), --- (instructionCodeFromVectorString, "instructionCodeFromVectorString"), --- (instructionCodeFromVectorBool, "instructionCodeFromVectorBool"), --- (instructionCodeFromVectorChar, "instructionCodeFromVectorChar"), --- (instructionCodeFromExec, "instructionCodeFromExec"), --- (instructionCodeContainer, "instructionCodeContainer"), --- (instructionCodeDiscrepancy, "instructionCodeDiscrepancy"), --- (instructionCodeNoOp, "instructionCodeNoOp"), --- (instructionCodeTailN, "instructionCodeTailN"), --- (instructionCodeDupItems, "instructionCodeDupItems") --- ] +allCodeInstructions :: [Gene] +allCodeInstructions = + map + StateFunc + [ (instructionCodePop, "instructionCodePop"), + (instructionCodeIsCodeBlock, "instructionCodeIsCodeBlock"), + (instructionCodeIsSingular, "instructionCodeIsSingular"), + (instructionCodeLength, "instructionCodeLength"), + (instructionCodeFirst, "instructionCodeFirst"), + (instructionCodeLast, "instructionCodeLast"), + (instructionCodeTail, "instructionCodeTail"), + (instructionCodeInit, "instructionCodeInit"), + (instructionCodeWrap, "instructionCodeWrap"), + (instructionCodeList, "instructionCodeList"), + (instructionCodeCombine, "instructionCodeCombine"), + (instructionCodeDo, "instructionCodeDo"), + (instructionCodeDoDup, "instructionCodeDoDup"), + (instructionCodeDoThenPop, "instructionCodeDoThenPop"), + (instructionCodeDoRange, "instructionCodeDoRange"), + (instructionCodeDoCount, "instructionCodeDoCount"), + (instructionCodeDoTimes, "instructionCodeDoTimes"), + (instructionCodeIf, "instructionCodeIf"), + (instructionCodeWhen, "instructionCodeWhen"), + (instructionCodeMember, "instructionCodeMember"), + (instructionCodeN, "instructionCodeN"), + (instructionMakeEmptyCodeBlock, "instructionMakeEmptyCodeBlock"), + (instructionIsEmptyCodeBlock, "instructionIsEmptyCodeBlock"), + (instructionCodeSize, "instructionCodeSize"), + (instructionCodeExtract, "instructionCodeExtract"), + (instructionCodeInsert, "instructionCodeInsert"), + (instructionCodeFirstPosition, "instructionCodeFirstPosition"), + (instructionCodeReverse, "instructionCodeReverse"), + (instructionCodeDup, "instructionCodeDup"), + (instructionCodeDupN, "instructionCodeDupN"), + (instructionCodeDup, "instructionCodeDup"), + (instructionCodeDupN, "instructionCodeDupN"), + (instructionCodeSwap, "instructionCodeSwap"), + (instructionCodeRot, "instructionCodeRot"), + (instructionCodeFlush, "instructionCodeFlush"), + (instructionCodeEq, "instructionCodeEq"), + (instructionCodeStackDepth, "instructionCodeStackDepth"), + (instructionCodeYank, "instructionCodeYank"), + (instructionCodeYankDup, "instructionCodeYankDup"), + (instructionCodeShove, "instructionCodeShove"), + (instructionCodeShoveDup, "instructionCodeShoveDup"), + (instructionCodeIsStackEmpty, "instructionCodeIsStackEmpty"), + (instructionCodeFromBool, "instructionCodeFromBool"), + (instructionCodeFromInt, "instructionCodeFromInt"), + (instructionCodeFromChar, "instructionCodeFromChar"), + (instructionCodeFromFloat, "instructionCodeFromFloat"), + (instructionCodeFromString, "instructionCodeFromString"), + (instructionCodeFromVectorInt, "instructionCodeFromVectorInt"), + (instructionCodeFromVectorFloat, "instructionCodeFromVectorFloat"), + (instructionCodeFromVectorString, "instructionCodeFromVectorString"), + (instructionCodeFromVectorBool, "instructionCodeFromVectorBool"), + (instructionCodeFromVectorChar, "instructionCodeFromVectorChar"), + (instructionCodeFromExec, "instructionCodeFromExec"), + (instructionCodeContainer, "instructionCodeContainer"), + (instructionCodeDiscrepancy, "instructionCodeDiscrepancy"), + (instructionCodeNoOp, "instructionCodeNoOp"), + (instructionCodeTailN, "instructionCodeTailN"), + (instructionCodeDupItems, "instructionCodeDupItems") + ] --- allExecInstructions :: [Gene] --- allExecInstructions = map StateFunc [ --- (instructionExecIf, "instructionExecIf"), --- (instructionExecDup, "instructionExecDup"), --- (instructionExecDupN, "instructionExecDupN"), --- (instructionExecPop, "instructionExecPop"), --- (instructionExecSwap, "instructionExecSwap"), --- (instructionExecRot, "instructionExecRot"), --- (instructionExecFlush, "instructionExecFlush"), --- (instructionExecEq, "instructionExecEq"), --- (instructionExecStackDepth, "instructionExecStackDepth"), --- (instructionExecYank, "instructionExecYank"), --- (instructionExecYankDup, "instructionExecYankDup"), --- (instructionExecShove, "instructionExecShove"), --- (instructionExecShoveDup, "instructionExecShoveDup"), --- (instructionExecIsStackEmpty, "instructionExecIsStackEmpty"), --- (instructionExecDoRange, "instructionExecDoRange"), --- (instructionExecDoCount, "instructionExecDoCount"), --- (instructionExecDoTimes, "instructionExecDoTimes"), --- (instructionExecWhile, "instructionExecWhile"), --- (instructionExecDoWhile, "instructionExecDoWhile"), --- (instructionExecWhen, "instructionExecWhen"), --- (instructionExecK, "instructionExecK"), --- (instructionExecS, "instructionExecS"), --- (instructionExecY, "instrucitonExecY"), --- (instructionExecDupItems, "instructionExecDupItems") --- ] +allExecInstructions :: [Gene] +allExecInstructions = + map + StateFunc + [ (instructionExecIf, "instructionExecIf"), + (instructionExecDup, "instructionExecDup"), + (instructionExecDupN, "instructionExecDupN"), + (instructionExecPop, "instructionExecPop"), + (instructionExecSwap, "instructionExecSwap"), + (instructionExecRot, "instructionExecRot"), + (instructionExecFlush, "instructionExecFlush"), + (instructionExecEq, "instructionExecEq"), + (instructionExecStackDepth, "instructionExecStackDepth"), + (instructionExecYank, "instructionExecYank"), + (instructionExecYankDup, "instructionExecYankDup"), + (instructionExecShove, "instructionExecShove"), + (instructionExecShoveDup, "instructionExecShoveDup"), + (instructionExecIsStackEmpty, "instructionExecIsStackEmpty"), + (instructionExecDoRange, "instructionExecDoRange"), + (instructionExecDoCount, "instructionExecDoCount"), + (instructionExecDoTimes, "instructionExecDoTimes"), + (instructionExecWhile, "instructionExecWhile"), + (instructionExecDoWhile, "instructionExecDoWhile"), + (instructionExecWhen, "instructionExecWhen"), + (instructionExecK, "instructionExecK"), + (instructionExecS, "instructionExecS"), + (instructionExecY, "instrucitonExecY"), + (instructionExecDupItems, "instructionExecDupItems") + ] --- allStringInstructions :: [Gene] --- allStringInstructions = map StateFunc [ --- (instructionStringConcat, "instructionStringConcat"), --- (instructionStringSwap, "instructionStringSwap"), --- (instructionStringInsertString, "instructionStringInsertString"), --- (instructionStringFromFirstChar, "instructionStringFromFirstChar"), --- (instructionStringFromLastChar, "instructionStringFromLastChar"), --- (instructionStringFromNthChar, "instructionStringFromNthChar"), --- (instructionStringIndexOfString, "instructionStringIndexOfString"), --- (instructionStringContainsString, "instructionStringContainsString"), --- (instructionStringSplitOnString, "instructionStringSplitOnString"), --- (instructionStringReplaceFirstString, "instructionStringReplaceFirstString"), --- (instructionStringReplaceNString, "instructionStringReplaceNString"), --- (instructionStringReplaceAllString, "instructionStringReplaceAllString"), --- (instructionStringRemoveFirstString, "instructionStringRemoveFirstString"), --- (instructionStringRemoveNString, "instructionStringRemoveNString"), --- (instructionStringRemoveAllString, "instructionStringRemoveAllString"), --- (instructionStringOccurrencesOfString, "instructionStringOccurrencesOfString"), --- (instructionStringInsertChar, "instructionStringInsertChar"), --- (instructionStringContainsChar, "instructionStringContainsChar"), --- (instructionStringIndexOfChar, "instructionStringIndexOfChar"), --- (instructionStringSplitOnChar, "instructionStringSplitOnChar"), --- (instructionStringReplaceFirstChar, "instructionStringReplaceFirstChar"), --- (instructionStringReplaceNChar, "instructionStringReplaceNChar"), --- (instructionStringReplaceAllChar, "instructionStringReplaceAllChar"), --- (instructionStringRemoveFirstChar, "instructionStringRemoveFirstChar"), --- (instructionStringRemoveNChar, "instructionStringRemoveNChar"), --- (instructionStringRemoveAllChar, "instructionStringRemoveAllChar"), --- (instructionStringOccurrencesOfChar, "instructionStringOccurrencesOfChar"), --- (instructionStringReverse, "instructionStringReverse"), --- (instructionStringHead, "instructionStringHead"), --- (instructionStringTail, "instructionStringTail"), --- (instructionStringAppendChar, "instructionStringAppendChar"), --- (instructionStringRest, "instructionStringRest"), --- (instructionStringButLast, "instructionStringButLast"), --- (instructionStringDrop, "instructionStringDrop"), --- (instructionStringButLastN, "instructionStringButLastN"), --- (instructionStringLength, "instructionStringLength"), --- (instructionStringMakeEmpty, "instructionStringMakeEmpty"), --- (instructionStringIsEmptyString, "instructionStringIsEmptyString"), --- (instructionStringRemoveNth, "instructionStringRemoveNth"), --- (instructionStringSetNth, "instructionStringSetNth"), --- (instructionStringStripWhitespace, "instructionStringStripWhitespace"), --- (instructionStringFromBool, "instructionStringFromBool"), --- (instructionStringFromInt, "instructionStringFromInt"), --- (instructionStringFromFloat, "instructionStringFromFloat"), --- (instructionStringFromChar, "instructionStringFromChar"), --- (instructionStringPop, "instructionStringPop"), --- (instructionStringDup, "instructionStringDup"), --- (instructionStringDupN, "instructionStringDupN"), --- (instructionStringSwap, "instructionStringSwap"), --- (instructionStringRot, "instructionStringRot"), --- (instructionStringFlush, "instructionStringFlush"), --- (instructionStringEq, "instructionStringEq"), --- (instructionStringStackDepth, "instructionStringStackDepth"), --- (instructionStringYank, "instructionStringYank"), --- (instructionStringYankDup, "instructionStringYankDup"), --- (instructionStringShove, "instructionStringShove"), --- (instructionStringShoveDup, "instructionStringShoveDup"), --- (instructionStringIsStackEmpty, "instructionStringIsStackEmpty"), --- (instructionStringSort, "instructionStringSort"), --- (instructionStringSortReverse, "instructionStringSortReverse"), --- (instructionStringDupItems, "instructionStringDupItems"), --- (instructionStringParseToChar, "instructionStringParseToChar"), --- (instructionStringSubString, "instructionStringSubString") --- ] +allStringInstructions :: [Gene] +allStringInstructions = + map + StateFunc + [ (instructionStringConcat, "instructionStringConcat"), + (instructionStringSwap, "instructionStringSwap"), + (instructionStringInsertString, "instructionStringInsertString"), + (instructionStringFromFirstChar, "instructionStringFromFirstChar"), + (instructionStringFromLastChar, "instructionStringFromLastChar"), + (instructionStringFromNthChar, "instructionStringFromNthChar"), + (instructionStringIndexOfString, "instructionStringIndexOfString"), + (instructionStringContainsString, "instructionStringContainsString"), + (instructionStringSplitOnString, "instructionStringSplitOnString"), + (instructionStringReplaceFirstString, "instructionStringReplaceFirstString"), + (instructionStringReplaceNString, "instructionStringReplaceNString"), + (instructionStringReplaceAllString, "instructionStringReplaceAllString"), + (instructionStringRemoveFirstString, "instructionStringRemoveFirstString"), + (instructionStringRemoveNString, "instructionStringRemoveNString"), + (instructionStringRemoveAllString, "instructionStringRemoveAllString"), + (instructionStringOccurrencesOfString, "instructionStringOccurrencesOfString"), + (instructionStringInsertChar, "instructionStringInsertChar"), + (instructionStringContainsChar, "instructionStringContainsChar"), + (instructionStringIndexOfChar, "instructionStringIndexOfChar"), + (instructionStringSplitOnChar, "instructionStringSplitOnChar"), + (instructionStringReplaceFirstChar, "instructionStringReplaceFirstChar"), + (instructionStringReplaceNChar, "instructionStringReplaceNChar"), + (instructionStringReplaceAllChar, "instructionStringReplaceAllChar"), + (instructionStringRemoveFirstChar, "instructionStringRemoveFirstChar"), + (instructionStringRemoveNChar, "instructionStringRemoveNChar"), + (instructionStringRemoveAllChar, "instructionStringRemoveAllChar"), + (instructionStringOccurrencesOfChar, "instructionStringOccurrencesOfChar"), + (instructionStringReverse, "instructionStringReverse"), + (instructionStringHead, "instructionStringHead"), + (instructionStringTail, "instructionStringTail"), + (instructionStringPrependChar, "instructionStringPrependChar"), + (instructionStringAppendChar, "instructionStringAppendChar"), + (instructionStringRest, "instructionStringRest"), + (instructionStringButLast, "instructionStringButLast"), + (instructionStringDrop, "instructionStringDrop"), + (instructionStringButLastN, "instructionStringButLastN"), + (instructionStringLength, "instructionStringLength"), + (instructionStringMakeEmpty, "instructionStringMakeEmpty"), + (instructionStringIsEmptyString, "instructionStringIsEmptyString"), + (instructionStringRemoveNth, "instructionStringRemoveNth"), + (instructionStringSetNth, "instructionStringSetNth"), + (instructionStringStripWhitespace, "instructionStringStripWhitespace"), + (instructionStringFromBool, "instructionStringFromBool"), + (instructionStringFromInt, "instructionStringFromInt"), + (instructionStringFromFloat, "instructionStringFromFloat"), + (instructionStringFromChar, "instructionStringFromChar"), + (instructionStringPop, "instructionStringPop"), + (instructionStringDup, "instructionStringDup"), + (instructionStringDupN, "instructionStringDupN"), + (instructionStringSwap, "instructionStringSwap"), + (instructionStringRot, "instructionStringRot"), + (instructionStringFlush, "instructionStringFlush"), + (instructionStringEq, "instructionStringEq"), + (instructionStringStackDepth, "instructionStringStackDepth"), + (instructionStringYank, "instructionStringYank"), + (instructionStringYankDup, "instructionStringYankDup"), + (instructionStringShove, "instructionStringShove"), + (instructionStringShoveDup, "instructionStringShoveDup"), + (instructionStringIsStackEmpty, "instructionStringIsStackEmpty"), + (instructionStringSort, "instructionStringSort"), + (instructionStringSortReverse, "instructionStringSortReverse"), + (instructionStringDupItems, "instructionStringDupItems"), + (instructionStringParseToChar, "instructionStringParseToChar"), + (instructionStringSubString, "instructionStringSubString") + ] --- allVectorIntInstructions :: [Gene] --- allVectorIntInstructions = map StateFunc [ --- (instructionVectorIntConcat, "instructionVectorIntConcat"), --- (instructionVectorIntConj, "instructionVectorIntConj"), --- (instructionVectorIntTakeN, "instructionVectorIntTakeN"), --- (instructionVectorIntSubVector, "instructionVectorIntSubVector"), --- (instructionVectorIntFirst, "instructionVectorIntFirst"), --- (instructionVectorIntLast, "instructionVectorIntLast"), --- (instructionVectorIntNth, "instructionVectorIntNth"), --- (instructionVectorIntRest, "instructionVectorIntRest"), --- (instructionVectorIntButLast, "instructionVectorIntButLast"), --- (instructionVectorIntLength, "instructionVectorIntLength"), --- (instructionVectorIntReverse, "instructionVectorIntReverse"), --- (instructionVectorIntPushAll, "instructionVectorIntPushAll"), --- (instructionVectorIntMakeEmpty, "instructionVectorIntMakeEmpty"), --- (instructionVectorIntIsEmpty, "instructionVectorIntIsEmpty"), --- (instructionVectorIntIndexOf, "instructionVectorIntIndexOf"), --- (instructionVectorIntOccurrencesOf, "instructionVectorIntOccurrencesOf"), --- (instructionVectorIntSetNth, "instructionVectorIntSetNth"), --- (instructionVectorIntReplace, "instructionVectorIntReplace"), --- (instructionVectorIntReplaceFirst, "instructionVectorIntReplaceFirst"), --- (instructionVectorIntRemove, "instructionVectorIntRemove"), --- (instructionVectorIntIterate, "instructionVectorIntIterate"), --- (instructionVectorIntPop, "instructionVectorIntPop"), --- (instructionVectorIntDup, "instructionVectorIntDup"), --- (instructionVectorIntDupN, "instructionVectorIntDupN"), --- (instructionVectorIntSwap, "instructionVectorIntSwap"), --- (instructionVectorIntRot, "instructionVectorIntRot"), --- (instructionVectorIntFlush, "instructionVectorIntFlush"), --- (instructionVectorIntEq, "instructionVectorIntEq"), --- (instructionVectorIntStackDepth, "instructionVectorIntStackDepth"), --- (instructionVectorIntYank, "instructionVectorIntYank"), --- (instructionVectorIntYankDup, "instructionVectorIntYankDup"), --- (instructionVectorIntShove, "instructionVectorIntShove"), --- (instructionVectorIntShoveDup, "instructionVectorIntShoveDup"), --- (instructionVectorIntIsStackEmpty, "instructionVectorIntIsStackEmpty"), --- (instructionVectorIntSort, "instructionVectorIntSort"), --- (instructionVectorIntSortReverse, "instructionVectorIntSortReverse"), --- (instructionVectorIntDupItems, "instructionVectorIntDupItems") --- ] +allVectorIntInstructions :: [Gene] +allVectorIntInstructions = + map + StateFunc + [ (instructionVectorIntConcat, "instructionVectorIntConcat"), + (instructionVectorIntConj, "instructionVectorIntConj"), + (instructionVectorIntConjEnd, "instructionVectorIntConjEnd"), + (instructionVectorIntTakeN, "instructionVectorIntTakeN"), + (instructionVectorIntSubVector, "instructionVectorIntSubVector"), + (instructionVectorIntFirst, "instructionVectorIntFirst"), + (instructionVectorIntFromFirstPrim, "instructionVectorFirstFromPrim"), + (instructionVectorIntFromPrim, "instructionVectorFromPrim"), + (instructionVectorIntLast, "instructionVectorIntLast"), + (instructionVectorIntFromLastPrim, "instructionVectorIntFromLastPrim"), + (instructionVectorIntNth, "instructionVectorIntNth"), + (instructionVectorIntFromNthPrim, "instructionVectorIntFromNthPrim"), + (instructionVectorIntRest, "instructionVectorIntRest"), + (instructionVectorIntButLast, "instructionVectorIntButLast"), + (instructionVectorIntDrop, "instructionVectorIntDrop"), + (instructionVectorIntDropR, "instructionVectorIntDropR"), + (instructionVectorIntLength, "instructionVectorIntLength"), + (instructionVectorIntReverse, "instructionVectorIntReverse"), + (instructionVectorIntPushAll, "instructionVectorIntPushAll"), + (instructionVectorIntMakeEmpty, "instructionVectorIntMakeEmpty"), + (instructionVectorIntIsEmpty, "instructionVectorIntIsEmpty"), + (instructionVectorIntContains, "instructionVectorIntContains"), + (instructionVectorIntContainsVectorInt, "instructionVectorIntContainsVectorInt"), + (instructionVectorIntIndexOf, "instructionVectorIntIndexOf"), + (instructionVectorIntIndexOfVectorInt, "instructionVectorIntIndexOfVectorInt"), + (instructionVectorIntOccurrencesOf, "instructionVectorIntOccurrencesOf"), + (instructionVectorIntOccurrencesOfVectorInt, "instructionVectorIntOccurrencesOfVectorInt"), + (instructionVectorIntParseToInt, "instructionVectorIntParseToInt"), + (instructionVectorIntSetNth, "instructionVectorIntSetNth"), + (instructionVectorIntSplitOn, "instructionVectorIntSplitOn"), + (instructionVectorIntSplitOnVectorInt, "instructionVectorIntSplitOnVectorInt"), + (instructionVectorIntReplaceFirst, "instructionVectorIntReplaceFirst"), + (instructionVectorIntReplaceN, "instructionVectorIntReplaceN"), + (instructionVectorIntReplaceAll, "instructionVectorIntReplaceAll"), + (instructionVectorIntReplaceFirstVectorInt, "instructionVectorIntReplaceFirstVectorInt"), + (instructionVectorIntReplaceVectorIntN, "instructionVectorIntReplaceVectorIntN"), + (instructionVectorIntReplaceAllVectorInt, "instructionVectorIntReplaceAllVectorInt"), + (instructionVectorIntRemoveFirst, "instructionVectorIntRemoveFirst"), + (instructionVectorIntRemoveN, "instructionVectorIntRemoveN"), + (instructionVectorIntRemoveAll, "instructionVectorIntRemoveAll"), + (instructionVectorIntRemoveFirstVectorInt, "instructionVectorIntRemoveFirstVectorInt"), + (instructionVectorIntRemoveNVectorInt, "instructionVectorIntRemoveNVectorInt"), + (instructionVectorIntRemoveAllVectorInt, "instructionVectorIntRemoveAllVectorInt"), + (instructionVectorIntIterate, "instructionVectorIntIterate"), + (instructionVectorIntInsert, "instructionVectorIntInsert"), + (instructionVectorIntInsertVectorInt, "instructionVectorIntInsertVectorInt"), + (instructionVectorIntPop, "instructionVectorIntPop"), + (instructionVectorIntDup, "instructionVectorIntDup"), + (instructionVectorIntDupN, "instructionVectorIntDupN"), + (instructionVectorIntSwap, "instructionVectorIntSwap"), + (instructionVectorIntRot, "instructionVectorIntRot"), + (instructionVectorIntFlush, "instructionVectorIntFlush"), + (instructionVectorIntEq, "instructionVectorIntEq"), + (instructionVectorIntStackDepth, "instructionVectorIntStackDepth"), + (instructionVectorIntYank, "instructionVectorIntYank"), + (instructionVectorIntYankDup, "instructionVectorIntYankDup"), + (instructionVectorIntShove, "instructionVectorIntShove"), + (instructionVectorIntShoveDup, "instructionVectorIntShoveDup"), + (instructionVectorIntDupItems, "intsructionVectorIntDupItems"), + (instructionVectorIntIsStackEmpty, "instructionVectorIntIsStackEmpty"), + (instructionVectorIntSort, "instructionVectorIntSort"), + (instructionVectorIntSortReverse, "instructionVectorIntSortReverse"), + (instructionVectorIntDupItems, "instructionVectorIntDupItems") + ] --- allVectorFloatInstructions :: [Gene] --- allVectorFloatInstructions = map StateFunc [ --- (instructionVectorFloatConcat, "instructionVectorFloatConcat"), --- (instructionVectorFloatConj, "instructionVectorFloatConj"), --- (instructionVectorFloatTakeN, "instructionVectorFloatTakeN"), --- (instructionVectorFloatSubVector, "instructionVectorFloatSubVector"), --- (instructionVectorFloatFirst, "instructionVectorFloatFirst"), --- (instructionVectorFloatLast, "instructionVectorFloatLast"), --- (instructionVectorFloatNth, "instructionVectorFloatNth"), --- (instructionVectorFloatRest, "instructionVectorFloatRest"), --- (instructionVectorFloatButLast, "instructionVectorFloatButLast"), --- (instructionVectorFloatLength, "instructionVectorFloatLength"), --- (instructionVectorFloatReverse, "instructionVectorFloatReverse"), --- (instructionVectorFloatPushAll, "instructionVectorFloatPushAll"), --- (instructionVectorFloatMakeEmpty, "instructionVectorFloatMakeEmpty"), --- (instructionVectorFloatIsEmpty, "instructionVectorFloatIsEmpty"), --- (instructionVectorFloatIndexOf, "instructionVectorFloatIndexOf"), --- (instructionVectorFloatOccurrencesOf, "instructionVectorFloatOccurrencesOf"), --- (instructionVectorFloatSetNth, "instructionVectorFloatSetNth"), --- (instructionVectorFloatReplace, "instructionVectorFloatReplace"), --- (instructionVectorFloatReplaceFirst, "instructionVectorFloatReplaceFirst"), --- (instructionVectorFloatRemove, "instructionVectorFloatRemove"), --- (instructionVectorFloatIterate, "instructionVectorFloatIterate"), --- (instructionVectorFloatPop, "instructionVectorFloatPop"), --- (instructionVectorFloatDup, "instructionVectorFloatDup"), --- (instructionVectorFloatDupN, "instructionVectorFloatDupN"), --- (instructionVectorFloatSwap, "instructionVectorFloatSwap"), --- (instructionVectorFloatRot, "instructionVectorFloatRot"), --- (instructionVectorFloatFlush, "instructionVectorFloatFlush"), --- (instructionVectorFloatEq, "instructionVectorFloatEq"), --- (instructionVectorFloatStackDepth, "instructionVectorFloatStackDepth"), --- (instructionVectorFloatYank, "instructionVectorFloatYank"), --- (instructionVectorFloatYankDup, "instructionVectorFloatYankDup"), --- (instructionVectorFloatShove, "instructionVectorFloatShove"), --- (instructionVectorFloatShoveDup, "instructionVectorFloatShoveDup"), --- (instructionVectorFloatIsStackEmpty, "instructionVectorFloatIsStackEmpty"), --- (instructionVectorFloatSort, "instructionVectorFloatSort"), --- (instructionVectorFloatSortReverse, "instructionVectorFloatSortReverse"), --- (instructionVectorFloatDupItems, "instructionVectorFloatDupItems") --- ] +allVectorFloatInstructions :: [Gene] +allVectorFloatInstructions = + map + StateFunc + [ (instructionVectorFloatConcat, "instructionVectorFloatConcat"), + (instructionVectorFloatConj, "instructionVectorFloatConj"), + (instructionVectorFloatConjEnd, "instructionVectorFloatConjEnd"), + (instructionVectorFloatTakeN, "instructionVectorFloatTakeN"), + (instructionVectorFloatSubVector, "instructionVectorFloatSubVector"), + (instructionVectorFloatFirst, "instructionVectorFloatFirst"), + (instructionVectorFloatFromFirstPrim, "instructionVectorFirstFromPrim"), + (instructionVectorFloatFromPrim, "instructionVectorFromPrim"), + (instructionVectorFloatLast, "instructionVectorFloatLast"), + (instructionVectorFloatFromLastPrim, "instructionVectorFloatFromLastPrim"), + (instructionVectorFloatNth, "instructionVectorFloatNth"), + (instructionVectorFloatFromNthPrim, "instructionVectorFloatFromNthPrim"), + (instructionVectorFloatRest, "instructionVectorFloatRest"), + (instructionVectorFloatButLast, "instructionVectorFloatButLast"), + (instructionVectorFloatDrop, "instructionVectorFloatDrop"), + (instructionVectorFloatDropR, "instructionVectorFloatDropR"), + (instructionVectorFloatLength, "instructionVectorFloatLength"), + (instructionVectorFloatReverse, "instructionVectorFloatReverse"), + (instructionVectorFloatPushAll, "instructionVectorFloatPushAll"), + (instructionVectorFloatMakeEmpty, "instructionVectorFloatMakeEmpty"), + (instructionVectorFloatIsEmpty, "instructionVectorFloatIsEmpty"), + (instructionVectorFloatContains, "instructionVectorFloatContains"), + (instructionVectorFloatContainsVectorFloat, "instructionVectorFloatContainsVectorFloat"), + (instructionVectorFloatIndexOf, "instructionVectorFloatIndexOf"), + (instructionVectorFloatIndexOfVectorFloat, "instructionVectorFloatIndexOfVectorFloat"), + (instructionVectorFloatOccurrencesOf, "instructionVectorFloatOccurrencesOf"), + (instructionVectorFloatOccurrencesOfVectorFloat, "instructionVectorFloatOccurrencesOfVectorFloat"), + (instructionVectorFloatParseToFloat, "instructionVectorFloatParseToFloat"), + (instructionVectorFloatSetNth, "instructionVectorFloatSetNth"), + (instructionVectorFloatSplitOn, "instructionVectorFloatSplitOn"), + (instructionVectorFloatSplitOnVectorFloat, "instructionVectorFloatSplitOnVectorFloat"), + (instructionVectorFloatReplaceFirst, "instructionVectorFloatReplaceFirst"), + (instructionVectorFloatReplaceN, "instructionVectorFloatReplaceN"), + (instructionVectorFloatReplaceAll, "instructionVectorFloatReplaceAll"), + (instructionVectorFloatReplaceFirstVectorFloat, "instructionVectorFloatReplaceFirstVectorFloat"), + (instructionVectorFloatReplaceVectorFloatN, "instructionVectorFloatReplaceVectorFloatN"), + (instructionVectorFloatReplaceAllVectorFloat, "instructionVectorFloatReplaceAllVectorFloat"), + (instructionVectorFloatRemoveFirst, "instructionVectorFloatRemoveFirst"), + (instructionVectorFloatRemoveN, "instructionVectorFloatRemoveN"), + (instructionVectorFloatRemoveAll, "instructionVectorFloatRemoveAll"), + (instructionVectorFloatRemoveFirstVectorFloat, "instructionVectorFloatRemoveFirstVectorFloat"), + (instructionVectorFloatRemoveNVectorFloat, "instructionVectorFloatRemoveNVectorFloat"), + (instructionVectorFloatRemoveAllVectorFloat, "instructionVectorFloatRemoveAllVectorFloat"), + (instructionVectorFloatIterate, "instructionVectorFloatIterate"), + (instructionVectorFloatInsert, "instructionVectorFloatInsert"), + (instructionVectorFloatInsertVectorFloat, "instructionVectorFloatInsertVectorFloat"), + (instructionVectorFloatPop, "instructionVectorFloatPop"), + (instructionVectorFloatDup, "instructionVectorFloatDup"), + (instructionVectorFloatDupN, "instructionVectorFloatDupN"), + (instructionVectorFloatSwap, "instructionVectorFloatSwap"), + (instructionVectorFloatRot, "instructionVectorFloatRot"), + (instructionVectorFloatFlush, "instructionVectorFloatFlush"), + (instructionVectorFloatEq, "instructionVectorFloatEq"), + (instructionVectorFloatStackDepth, "instructionVectorFloatStackDepth"), + (instructionVectorFloatYank, "instructionVectorFloatYank"), + (instructionVectorFloatYankDup, "instructionVectorFloatYankDup"), + (instructionVectorFloatShove, "instructionVectorFloatShove"), + (instructionVectorFloatShoveDup, "instructionVectorFloatShoveDup"), + (instructionVectorFloatDupItems, "intsructionVectorFloatDupItems"), + (instructionVectorFloatIsStackEmpty, "instructionVectorFloatIsStackEmpty"), + (instructionVectorFloatSort, "instructionVectorFloatSort"), + (instructionVectorFloatSortReverse, "instructionVectorFloatSortReverse"), + (instructionVectorFloatDupItems, "instructionVectorFloatDupItems") + ] --- allVectorCharInstructions :: [Gene] --- allVectorCharInstructions = map StateFunc [ --- (instructionVectorCharConcat, "instructionVectorCharConcat"), --- (instructionVectorCharConj, "instructionVectorCharConj"), --- (instructionVectorCharTakeN, "instructionVectorCharTakeN"), --- (instructionVectorCharSubVector, "instructionVectorCharSubVector"), --- (instructionVectorCharFirst, "instructionVectorCharFirst"), --- (instructionVectorCharLast, "instructionVectorCharLast"), --- (instructionVectorCharNth, "instructionVectorCharNth"), --- (instructionVectorCharRest, "instructionVectorCharRest"), --- (instructionVectorCharButLast, "instructionVectorCharButLast"), --- (instructionVectorCharLength, "instructionVectorCharLength"), --- (instructionVectorCharReverse, "instructionVectorCharReverse"), --- (instructionVectorCharPushAll, "instructionVectorCharPushAll"), --- (instructionVectorCharMakeEmpty, "instructionVectorCharMakeEmpty"), --- (instructionVectorCharIsEmpty, "instructionVectorCharIsEmpty"), --- (instructionVectorCharIndexOf, "instructionVectorCharIndexOf"), --- (instructionVectorCharOccurrencesOf, "instructionVectorCharOccurrencesOf"), --- (instructionVectorCharSetNth, "instructionVectorCharSetNth"), --- (instructionVectorCharReplace, "instructionVectorCharReplace"), --- (instructionVectorCharReplaceFirst, "instructionVectorCharReplaceFirst"), --- (instructionVectorCharRemove, "instructionVectorCharRemove"), --- (instructionVectorCharIterate, "instructionVectorCharIterate"), --- (instructionVectorCharPop, "instructionVectorCharPop"), --- (instructionVectorCharDup, "instructionVectorCharDup"), --- (instructionVectorCharDupN, "instructionVectorCharDupN"), --- (instructionVectorCharSwap, "instructionVectorCharSwap"), --- (instructionVectorCharRot, "instructionVectorCharRot"), --- (instructionVectorCharFlush, "instructionVectorCharFlush"), --- (instructionVectorCharEq, "instructionVectorCharEq"), --- (instructionVectorCharStackDepth, "instructionVectorCharStackDepth"), --- (instructionVectorCharYank, "instructionVectorCharYank"), --- (instructionVectorCharYankDup, "instructionVectorCharYankDup"), --- (instructionVectorCharShove, "instructionVectorCharShove"), --- (instructionVectorCharShoveDup, "instructionVectorCharShoveDup"), --- (instructionVectorCharIsStackEmpty, "instructionVectorCharIsStackEmpty"), --- (instructionVectorCharSort, "instructionVectorCharSort"), --- (instructionVectorCharSortReverse, "instructionVectorCharSortReverse"), --- (instructionVectorCharDupItems, "instructionVectorCharDupItems") --- ] +allVectorCharInstructions :: [Gene] +allVectorCharInstructions = + map + StateFunc + [ (instructionVectorCharConcat, "instructionVectorCharConcat"), + (instructionVectorCharConj, "instructionVectorCharConj"), + (instructionVectorCharConjEnd, "instructionVectorCharConjEnd"), + (instructionVectorCharTakeN, "instructionVectorCharTakeN"), + (instructionVectorCharSubVector, "instructionVectorCharSubVector"), + (instructionVectorCharFirst, "instructionVectorCharFirst"), + (instructionVectorCharFromFirstPrim, "instructionVectorFirstFromPrim"), + (instructionVectorCharFromPrim, "instructionVectorFromPrim"), + (instructionVectorCharLast, "instructionVectorCharLast"), + (instructionVectorCharFromLastPrim, "instructionVectorCharFromLastPrim"), + (instructionVectorCharNth, "instructionVectorCharNth"), + (instructionVectorCharFromNthPrim, "instructionVectorCharFromNthPrim"), + (instructionVectorCharRest, "instructionVectorCharRest"), + (instructionVectorCharButLast, "instructionVectorCharButLast"), + (instructionVectorCharDrop, "instructionVectorCharDrop"), + (instructionVectorCharDropR, "instructionVectorCharDropR"), + (instructionVectorCharLength, "instructionVectorCharLength"), + (instructionVectorCharReverse, "instructionVectorCharReverse"), + (instructionVectorCharPushAll, "instructionVectorCharPushAll"), + (instructionVectorCharMakeEmpty, "instructionVectorCharMakeEmpty"), + (instructionVectorCharIsEmpty, "instructionVectorCharIsEmpty"), + (instructionVectorCharContains, "instructionVectorCharContains"), + (instructionVectorCharContainsVectorChar, "instructionVectorCharContainsVectorChar"), + (instructionVectorCharIndexOf, "instructionVectorCharIndexOf"), + (instructionVectorCharIndexOfVectorChar, "instructionVectorCharIndexOfVectorChar"), + (instructionVectorCharOccurrencesOf, "instructionVectorCharOccurrencesOf"), + (instructionVectorCharOccurrencesOfVectorChar, "instructionVectorCharOccurrencesOfVectorChar"), + (instructionVectorCharParseToChar, "instructionVectorCharParseToChar"), + (instructionVectorCharSetNth, "instructionVectorCharSetNth"), + (instructionVectorCharSplitOn, "instructionVectorCharSplitOn"), + (instructionVectorCharSplitOnVectorChar, "instructionVectorCharSplitOnVectorChar"), + (instructionVectorCharReplaceFirst, "instructionVectorCharReplaceFirst"), + (instructionVectorCharReplaceN, "instructionVectorCharReplaceN"), + (instructionVectorCharReplaceAll, "instructionVectorCharReplaceAll"), + (instructionVectorCharReplaceFirstVectorChar, "instructionVectorCharReplaceFirstVectorChar"), + (instructionVectorCharReplaceVectorCharN, "instructionVectorCharReplaceVectorCharN"), + (instructionVectorCharReplaceAllVectorChar, "instructionVectorCharReplaceAllVectorChar"), + (instructionVectorCharRemoveFirst, "instructionVectorCharRemoveFirst"), + (instructionVectorCharRemoveN, "instructionVectorCharRemoveN"), + (instructionVectorCharRemoveAll, "instructionVectorCharRemoveAll"), + (instructionVectorCharRemoveFirstVectorChar, "instructionVectorCharRemoveFirstVectorChar"), + (instructionVectorCharRemoveNVectorChar, "instructionVectorCharRemoveNVectorChar"), + (instructionVectorCharRemoveAllVectorChar, "instructionVectorCharRemoveAllVectorChar"), + (instructionVectorCharIterate, "instructionVectorCharIterate"), + (instructionVectorCharInsert, "instructionVectorCharInsert"), + (instructionVectorCharInsertVectorChar, "instructionVectorCharInsertVectorChar"), + (instructionVectorCharPop, "instructionVectorCharPop"), + (instructionVectorCharDup, "instructionVectorCharDup"), + (instructionVectorCharDupN, "instructionVectorCharDupN"), + (instructionVectorCharSwap, "instructionVectorCharSwap"), + (instructionVectorCharRot, "instructionVectorCharRot"), + (instructionVectorCharFlush, "instructionVectorCharFlush"), + (instructionVectorCharEq, "instructionVectorCharEq"), + (instructionVectorCharStackDepth, "instructionVectorCharStackDepth"), + (instructionVectorCharYank, "instructionVectorCharYank"), + (instructionVectorCharYankDup, "instructionVectorCharYankDup"), + (instructionVectorCharShove, "instructionVectorCharShove"), + (instructionVectorCharShoveDup, "instructionVectorCharShoveDup"), + (instructionVectorCharDupItems, "intsructionVectorCharDupItems"), + (instructionVectorCharIsStackEmpty, "instructionVectorCharIsStackEmpty"), + (instructionVectorCharSort, "instructionVectorCharSort"), + (instructionVectorCharSortReverse, "instructionVectorCharSortReverse"), + (instructionVectorCharDupItems, "instructionVectorCharDupItems") + ] --- allVectorStringInstructions :: [Gene] --- allVectorStringInstructions = map StateFunc [ --- (instructionVectorStringConcat, "instructionVectorStringConcat"), --- (instructionVectorStringConj, "instructionVectorStringConj"), --- (instructionVectorStringTakeN, "instructionVectorStringTakeN"), --- (instructionVectorStringSubVector, "instructionVectorStringSubVector"), --- (instructionVectorStringFirst, "instructionVectorStringFirst"), --- (instructionVectorStringLast, "instructionVectorStringLast"), --- (instructionVectorStringNth, "instructionVectorStringNth"), --- (instructionVectorStringRest, "instructionVectorStringRest"), --- (instructionVectorStringButLast, "instructionVectorStringButLast"), --- (instructionVectorStringLength, "instructionVectorStringLength"), --- (instructionVectorStringReverse, "instructionVectorStringReverse"), --- (instructionVectorStringPushAll, "instructionVectorStringPushAll"), --- (instructionVectorStringMakeEmpty, "instructionVectorStringMakeEmpty"), --- (instructionVectorStringIsEmpty, "instructionVectorStringIsEmpty"), --- (instructionVectorStringIndexOf, "instructionVectorStringIndexOf"), --- (instructionVectorStringOccurrencesOf, "instructionVectorStringOccurrencesOf"), --- (instructionVectorStringSetNth, "instructionVectorStringSetNth"), --- (instructionVectorStringReplace, "instructionVectorStringReplace"), --- (instructionVectorStringReplaceFirst, "instructionVectorStringReplaceFirst"), --- (instructionVectorStringRemove, "instructionVectorStringRemove"), --- (instructionVectorStringIterate, "instructionVectorStringIterate"), --- (instructionVectorStringPop, "instructionVectorStringPop"), --- (instructionVectorStringDup, "instructionVectorStringDup"), --- (instructionVectorStringDupN, "instructionVectorStringDupN"), --- (instructionVectorStringSwap, "instructionVectorStringSwap"), --- (instructionVectorStringRot, "instructionVectorStringRot"), --- (instructionVectorStringFlush, "instructionVectorStringFlush"), --- (instructionVectorStringEq, "instructionVectorStringEq"), --- (instructionVectorStringStackDepth, "instructionVectorStringStackDepth"), --- (instructionVectorStringYank, "instructionVectorStringYank"), --- (instructionVectorStringYankDup, "instructionVectorStringYankDup"), --- (instructionVectorStringShove, "instructionVectorStringShove"), --- (instructionVectorStringShoveDup, "instructionVectorStringShoveDup"), --- (instructionVectorStringIsStackEmpty, "instructionVectorStringIsStackEmpty"), --- (instructionVectorStringSort, "instructionVectorStringSort"), --- (instructionVectorStringSortReverse, "instructionVectorStringSortReverse"), --- (instructionVectorStringDupItems, "instructionVectorStringDupItems") --- ] +allVectorStringInstructions :: [Gene] +allVectorStringInstructions = + map + StateFunc + [ (instructionVectorStringConcat, "instructionVectorStringConcat"), + (instructionVectorStringConj, "instructionVectorStringConj"), + (instructionVectorStringConjEnd, "instructionVectorStringConjEnd"), + (instructionVectorStringTakeN, "instructionVectorStringTakeN"), + (instructionVectorStringSubVector, "instructionVectorStringSubVector"), + (instructionVectorStringFirst, "instructionVectorStringFirst"), + (instructionVectorStringFromFirstPrim, "instructionVectorFirstFromPrim"), + (instructionVectorStringFromPrim, "instructionVectorFromPrim"), + (instructionVectorStringLast, "instructionVectorStringLast"), + (instructionVectorStringFromLastPrim, "instructionVectorStringFromLastPrim"), + (instructionVectorStringNth, "instructionVectorStringNth"), + (instructionVectorStringFromNthPrim, "instructionVectorStringFromNthPrim"), + (instructionVectorStringRest, "instructionVectorStringRest"), + (instructionVectorStringButLast, "instructionVectorStringButLast"), + (instructionVectorStringDrop, "instructionVectorStringDrop"), + (instructionVectorStringDropR, "instructionVectorStringDropR"), + (instructionVectorStringLength, "instructionVectorStringLength"), + (instructionVectorStringReverse, "instructionVectorStringReverse"), + (instructionVectorStringPushAll, "instructionVectorStringPushAll"), + (instructionVectorStringMakeEmpty, "instructionVectorStringMakeEmpty"), + (instructionVectorStringIsEmpty, "instructionVectorStringIsEmpty"), + (instructionVectorStringContains, "instructionVectorStringContains"), + (instructionVectorStringContainsVectorString, "instructionVectorStringContainsVectorString"), + (instructionVectorStringIndexOf, "instructionVectorStringIndexOf"), + (instructionVectorStringIndexOfVectorString, "instructionVectorStringIndexOfVectorString"), + (instructionVectorStringOccurrencesOf, "instructionVectorStringOccurrencesOf"), + (instructionVectorStringOccurrencesOfVectorString, "instructionVectorStringOccurrencesOfVectorString"), + (instructionVectorStringParseToString, "instructionVectorStringParseToString"), + (instructionVectorStringSetNth, "instructionVectorStringSetNth"), + (instructionVectorStringSplitOn, "instructionVectorStringSplitOn"), + (instructionVectorStringSplitOnVectorString, "instructionVectorStringSplitOnVectorString"), + (instructionVectorStringReplaceFirst, "instructionVectorStringReplaceFirst"), + (instructionVectorStringReplaceN, "instructionVectorStringReplaceN"), + (instructionVectorStringReplaceAll, "instructionVectorStringReplaceAll"), + (instructionVectorStringReplaceFirstVectorString, "instructionVectorStringReplaceFirstVectorString"), + (instructionVectorStringReplaceVectorStringN, "instructionVectorStringReplaceVectorStringN"), + (instructionVectorStringReplaceAllVectorString, "instructionVectorStringReplaceAllVectorString"), + (instructionVectorStringRemoveFirst, "instructionVectorStringRemoveFirst"), + (instructionVectorStringRemoveN, "instructionVectorStringRemoveN"), + (instructionVectorStringRemoveAll, "instructionVectorStringRemoveAll"), + (instructionVectorStringRemoveFirstVectorString, "instructionVectorStringRemoveFirstVectorString"), + (instructionVectorStringRemoveNVectorString, "instructionVectorStringRemoveNVectorString"), + (instructionVectorStringRemoveAllVectorString, "instructionVectorStringRemoveAllVectorString"), + (instructionVectorStringIterate, "instructionVectorStringIterate"), + (instructionVectorStringInsert, "instructionVectorStringInsert"), + (instructionVectorStringInsertVectorString, "instructionVectorStringInsertVectorString"), + (instructionVectorStringPop, "instructionVectorStringPop"), + (instructionVectorStringDup, "instructionVectorStringDup"), + (instructionVectorStringDupN, "instructionVectorStringDupN"), + (instructionVectorStringSwap, "instructionVectorStringSwap"), + (instructionVectorStringRot, "instructionVectorStringRot"), + (instructionVectorStringFlush, "instructionVectorStringFlush"), + (instructionVectorStringEq, "instructionVectorStringEq"), + (instructionVectorStringStackDepth, "instructionVectorStringStackDepth"), + (instructionVectorStringYank, "instructionVectorStringYank"), + (instructionVectorStringYankDup, "instructionVectorStringYankDup"), + (instructionVectorStringShove, "instructionVectorStringShove"), + (instructionVectorStringShoveDup, "instructionVectorStringShoveDup"), + (instructionVectorStringDupItems, "intsructionVectorStringDupItems"), + (instructionVectorStringIsStackEmpty, "instructionVectorStringIsStackEmpty"), + (instructionVectorStringSort, "instructionVectorStringSort"), + (instructionVectorStringSortReverse, "instructionVectorStringSortReverse"), + (instructionVectorStringDupItems, "instructionVectorStringDupItems") + ] --- allVectorBoolInstructions :: [Gene] --- allVectorBoolInstructions = map StateFunc [ --- (instructionVectorBoolConcat, "instructionVectorBoolConcat"), --- (instructionVectorBoolConj, "instructionVectorBoolConj"), --- (instructionVectorBoolTakeN, "instructionVectorBoolTakeN"), --- (instructionVectorBoolSubVector, "instructionVectorBoolSubVector"), --- (instructionVectorBoolFirst, "instructionVectorBoolFirst"), --- (instructionVectorBoolLast, "instructionVectorBoolLast"), --- (instructionVectorBoolNth, "instructionVectorBoolNth"), --- (instructionVectorBoolRest, "instructionVectorBoolRest"), --- (instructionVectorBoolButLast, "instructionVectorBoolButLast"), --- (instructionVectorBoolLength, "instructionVectorBoolLength"), --- (instructionVectorBoolReverse, "instructionVectorBoolReverse"), --- (instructionVectorBoolPushAll, "instructionVectorBoolPushAll"), --- (instructionVectorBoolMakeEmpty, "instructionVectorBoolMakeEmpty"), --- (instructionVectorBoolIsEmpty, "instructionVectorBoolIsEmpty"), --- (instructionVectorBoolIndexOf, "instructionVectorBoolIndexOf"), --- (instructionVectorBoolOccurrencesOf, "instructionVectorBoolOccurrencesOf"), --- (instructionVectorBoolSetNth, "instructionVectorBoolSetNth"), --- (instructionVectorBoolReplace, "instructionVectorBoolReplace"), --- (instructionVectorBoolReplaceFirst, "instructionVectorBoolReplaceFirst"), --- (instructionVectorBoolRemove, "instructionVectorBoolRemove"), --- (instructionVectorBoolIterate, "instructionVectorBoolIterate"), --- (instructionVectorBoolPop, "instructionVectorBoolPop"), --- (instructionVectorBoolDup, "instructionVectorBoolDup"), --- (instructionVectorBoolDupN, "instructionVectorBoolDupN"), --- (instructionVectorBoolSwap, "instructionVectorBoolSwap"), --- (instructionVectorBoolRot, "instructionVectorBoolRot"), --- (instructionVectorBoolFlush, "instructionVectorBoolFlush"), --- (instructionVectorBoolEq, "instructionVectorBoolEq"), --- (instructionVectorBoolStackDepth, "instructionVectorBoolStackDepth"), --- (instructionVectorBoolYank, "instructionVectorBoolYank"), --- (instructionVectorBoolYankDup, "instructionVectorBoolYankDup"), --- (instructionVectorBoolShove, "instructionVectorBoolShove"), --- (instructionVectorBoolShoveDup, "instructionVectorBoolShoveDup"), --- (instructionVectorBoolIsStackEmpty, "instructionVectorBoolIsStackEmpty"), --- (instructionVectorBoolSort, "instructionVectorBoolSort"), --- (instructionVectorBoolSortReverse, "instructionVectorBoolSortReverse"), --- (instructionVectorBoolDupItems, "instructionVectorBoolDupItems") --- ] +allVectorBoolInstructions :: [Gene] +allVectorBoolInstructions = + map + StateFunc + [ (instructionVectorBoolConcat, "instructionVectorBoolConcat"), + (instructionVectorBoolConj, "instructionVectorBoolConj"), + (instructionVectorBoolConjEnd, "instructionVectorBoolConjEnd"), + (instructionVectorBoolTakeN, "instructionVectorBoolTakeN"), + (instructionVectorBoolSubVector, "instructionVectorBoolSubVector"), + (instructionVectorBoolFirst, "instructionVectorBoolFirst"), + (instructionVectorBoolFromFirstPrim, "instructionVectorFirstFromPrim"), + (instructionVectorBoolFromPrim, "instructionVectorFromPrim"), + (instructionVectorBoolLast, "instructionVectorBoolLast"), + (instructionVectorBoolFromLastPrim, "instructionVectorBoolFromLastPrim"), + (instructionVectorBoolNth, "instructionVectorBoolNth"), + (instructionVectorBoolFromNthPrim, "instructionVectorBoolFromNthPrim"), + (instructionVectorBoolRest, "instructionVectorBoolRest"), + (instructionVectorBoolButLast, "instructionVectorBoolButLast"), + (instructionVectorBoolDrop, "instructionVectorBoolDrop"), + (instructionVectorBoolDropR, "instructionVectorBoolDropR"), + (instructionVectorBoolLength, "instructionVectorBoolLength"), + (instructionVectorBoolReverse, "instructionVectorBoolReverse"), + (instructionVectorBoolPushAll, "instructionVectorBoolPushAll"), + (instructionVectorBoolMakeEmpty, "instructionVectorBoolMakeEmpty"), + (instructionVectorBoolIsEmpty, "instructionVectorBoolIsEmpty"), + (instructionVectorBoolContains, "instructionVectorBoolContains"), + (instructionVectorBoolContainsVectorBool, "instructionVectorBoolContainsVectorBool"), + (instructionVectorBoolIndexOf, "instructionVectorBoolIndexOf"), + (instructionVectorBoolIndexOfVectorBool, "instructionVectorBoolIndexOfVectorBool"), + (instructionVectorBoolOccurrencesOf, "instructionVectorBoolOccurrencesOf"), + (instructionVectorBoolOccurrencesOfVectorBool, "instructionVectorBoolOccurrencesOfVectorBool"), + (instructionVectorBoolParseToBool, "instructionVectorBoolParseToBool"), + (instructionVectorBoolSetNth, "instructionVectorBoolSetNth"), + (instructionVectorBoolSplitOn, "instructionVectorBoolSplitOn"), + (instructionVectorBoolSplitOnVectorBool, "instructionVectorBoolSplitOnVectorBool"), + (instructionVectorBoolReplaceFirst, "instructionVectorBoolReplaceFirst"), + (instructionVectorBoolReplaceN, "instructionVectorBoolReplaceN"), + (instructionVectorBoolReplaceAll, "instructionVectorBoolReplaceAll"), + (instructionVectorBoolReplaceFirstVectorBool, "instructionVectorBoolReplaceFirstVectorBool"), + (instructionVectorBoolReplaceVectorBoolN, "instructionVectorBoolReplaceVectorBoolN"), + (instructionVectorBoolReplaceAllVectorBool, "instructionVectorBoolReplaceAllVectorBool"), + (instructionVectorBoolRemoveFirst, "instructionVectorBoolRemoveFirst"), + (instructionVectorBoolRemoveN, "instructionVectorBoolRemoveN"), + (instructionVectorBoolRemoveAll, "instructionVectorBoolRemoveAll"), + (instructionVectorBoolRemoveFirstVectorBool, "instructionVectorBoolRemoveFirstVectorBool"), + (instructionVectorBoolRemoveNVectorBool, "instructionVectorBoolRemoveNVectorBool"), + (instructionVectorBoolRemoveAllVectorBool, "instructionVectorBoolRemoveAllVectorBool"), + (instructionVectorBoolIterate, "instructionVectorBoolIterate"), + (instructionVectorBoolInsert, "instructionVectorBoolInsert"), + (instructionVectorBoolInsertVectorBool, "instructionVectorBoolInsertVectorBool"), + (instructionVectorBoolPop, "instructionVectorBoolPop"), + (instructionVectorBoolDup, "instructionVectorBoolDup"), + (instructionVectorBoolDupN, "instructionVectorBoolDupN"), + (instructionVectorBoolSwap, "instructionVectorBoolSwap"), + (instructionVectorBoolRot, "instructionVectorBoolRot"), + (instructionVectorBoolFlush, "instructionVectorBoolFlush"), + (instructionVectorBoolEq, "instructionVectorBoolEq"), + (instructionVectorBoolStackDepth, "instructionVectorBoolStackDepth"), + (instructionVectorBoolYank, "instructionVectorBoolYank"), + (instructionVectorBoolYankDup, "instructionVectorBoolYankDup"), + (instructionVectorBoolShove, "instructionVectorBoolShove"), + (instructionVectorBoolShoveDup, "instructionVectorBoolShoveDup"), + (instructionVectorBoolDupItems, "intsructionVectorBoolDupItems"), + (instructionVectorBoolIsStackEmpty, "instructionVectorBoolIsStackEmpty"), + (instructionVectorBoolSort, "instructionVectorBoolSort"), + (instructionVectorBoolSortReverse, "instructionVectorBoolSortReverse"), + (instructionVectorBoolDupItems, "instructionVectorBoolDupItems") + ] --- allInstructions :: [Gene] --- allInstructions = --- allIntInstructions <> --- allFloatInstructions <> --- allBoolInstructions <> --- allCharInstructions <> --- allCodeInstructions <> --- allExecInstructions <> --- allStringInstructions <> --- allVectorIntInstructions <> --- allVectorFloatInstructions <> --- allVectorCharInstructions <> --- allVectorStringInstructions <> --- allVectorBoolInstructions +allInstructions :: [Gene] +allInstructions = + allIntInstructions + <> allFloatInstructions + <> allBoolInstructions + <> allCharInstructions + <> allCodeInstructions + <> allExecInstructions + <> allStringInstructions + <> allVectorIntInstructions + <> allVectorFloatInstructions + <> allVectorCharInstructions + <> allVectorStringInstructions + <> allVectorBoolInstructions diff --git a/src/HushGP/Instructions/StringInstructions.hs b/src/HushGP/Instructions/StringInstructions.hs index cab2a5a..04dcab5 100644 --- a/src/HushGP/Instructions/StringInstructions.hs +++ b/src/HushGP/Instructions/StringInstructions.hs @@ -3,7 +3,6 @@ module HushGP.Instructions.StringInstructions where import HushGP.State import HushGP.Instructions.GenericInstructions import HushGP.Instructions.Utility -import Control.Lens -- |Concats the top two strings on the string stack and pushes the result. instructionStringConcat :: State -> State @@ -221,14 +220,6 @@ instructionStringStripWhitespace :: State -> State instructionStringStripWhitespace state@(State {_string = s1 : ss}) = state{_string = strip s1 : ss} instructionStringStripWhitespace state = state --- |Utility Function: Casts a type based on a lens to a string. Pushes the result --- to the string stack. -instructionStringFromLens :: Show a => Lens' State [a] -> State -> State -instructionStringFromLens accessor state@(State {_string = ss}) = - case uncons (view accessor state) of - Nothing -> state - Just (x1,_) -> state{_string = show x1 : ss} - -- |Converts the top bool from the bool stack to a string. Pushes the result to -- the string stack. instructionStringFromBool :: State -> State diff --git a/src/HushGP/Instructions/Utility.hs b/src/HushGP/Instructions/Utility.hs index 31b0cb5..b58ebb7 100644 --- a/src/HushGP/Instructions/Utility.hs +++ b/src/HushGP/Instructions/Utility.hs @@ -247,3 +247,13 @@ lstrip s = case s of -- this is a tad inefficient rstrip :: String -> String rstrip = reverse . lstrip . reverse + +-- string utility + +-- |Utility Function: Casts a type based on a lens to a string. Pushes the result +-- to the string stack. +instructionStringFromLens :: Show a => Lens' State [a] -> State -> State +instructionStringFromLens accessor state@(State {_string = ss}) = + case uncons (view accessor state) of + Nothing -> state + Just (x1,_) -> state{_string = show x1 : ss} diff --git a/src/HushGP/Push.hs b/src/HushGP/Push.hs index f243be5..342968e 100644 --- a/src/HushGP/Push.hs +++ b/src/HushGP/Push.hs @@ -12,8 +12,8 @@ import HushGP.State -- Everntually, this can be part of the apply func to state helpers, -- which should take the number and type of parameter they have. --- |This is one of the push genome functions itself, not infrastructure. --- Optionally, split this off into independent functions +-- | This is one of the push genome functions itself, not infrastructure. +-- Optionally, split this off into independent functions instructionParameterLoad :: State -> State instructionParameterLoad state@(State {_parameter = (p : _)}) = case p of (GeneInt val) -> state & int .~ val : view int state @@ -32,20 +32,20 @@ instructionParameterLoad state@(State {_parameter = (p : _)}) = case p of (Block xs) -> state & exec .~ xs <> view exec state instructionParameterLoad state = state --- |Loads a genome into the exec stack +-- | Loads a genome into the exec stack loadProgram :: [Gene] -> State -> State loadProgram newstack state = state & exec .~ newstack --- |Takes a Push state, and generates the next push state via: --- If the first item on the EXEC stack is a single instruction --- then pop it and execute it. --- Else if the first item on the EXEC stack is a literal --- then pop it and push it onto the appropriate stack. --- Else (the first item must be a list) pop it and push all of the --- items that it contains back onto the EXEC stack individually, --- in reverse order (so that the item that was first in the list --- ends up on top). --- The empty-stack safety of interpretExec on empty stacks depends on the functions it calls. +-- | Takes a Push state, and generates the next push state via: +-- If the first item on the EXEC stack is a single instruction +-- then pop it and execute it. +-- Else if the first item on the EXEC stack is a literal +-- then pop it and push it onto the appropriate stack. +-- Else (the first item must be a list) pop it and push all of the +-- items that it contains back onto the EXEC stack individually, +-- in reverse order (so that the item that was first in the list +-- ends up on top). +-- The empty-stack safety of interpretExec on empty stacks depends on the functions it calls. interpretExec :: State -> State interpretExec state@(State {_exec = e : es}) = case e of diff --git a/src/HushGP/State.hs b/src/HushGP/State.hs index 62afec4..97f73ce 100644 --- a/src/HushGP/State.hs +++ b/src/HushGP/State.hs @@ -8,10 +8,10 @@ import Data.Map qualified as Map import GHC.Generics import Test.QuickCheck --- |The exec stack must store heterogenous types, --- and we must be able to detect that type at runtime. --- One solution is for the exec stack to be a list of [Gene]. --- The parameter stack could be singular [Gene] or multiple [atomic] types. +-- | The exec stack must store heterogenous types, +-- and we must be able to detect that type at runtime. +-- One solution is for the exec stack to be a list of [Gene]. +-- The parameter stack could be singular [Gene] or multiple [atomic] types. data Gene = GeneInt Int | GeneFloat Float @@ -83,7 +83,7 @@ instance Arbitrary Gene where return Close ] --- |The structure that holds all of the values. +-- | The structure that holds all of the values. data State = State { _exec :: [Gene], _code :: [Gene],