Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/08/16 12:04:25 (7 years ago)
Author:
pkimmesw
Message:

#2665 Set .NET version to 4.5, C# version to 5.0, Added expression templates and factory

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.Algorithms.PushGP/HeuristicLab.Algorithms.PushGP/OpCode.cs

    r14320 r14328  
    1818        /// <summary>
    1919        /// BOOLEAN.DEFINE:
    20         /// Defines the name on top of the NAME stack as an instruction that will push the top item of the BOOLEAN stack onto the EXEC stack.
     20        /// Defines the name on top of the NAME stack as an inclassion that will push the top item of the BOOLEAN stack onto the EXEC stack.
    2121        /// </summary>
    2222        BooleanDefine,
     
    2424        /// <summary>
    2525        /// BOOLEAN.DUP:
    26         /// Duplicates the top item on the BOOLEAN stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!)
    27         /// </summary>
    28         BooleanDup,
     26        /// Duplicatelicates the top item on the BOOLEAN stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!)
     27        /// </summary>
     28        BooleanDuplicate,
    2929
    3030        /// <summary>
     
    109109        /// Pushes a copy of an indexed item "deep" in the stack onto the top of the stack, without removing the deep item. The index is taken from the INTEGER stack.
    110110        /// </summary>
    111         BooleanYankDup,
     111        BooleanYankDuplicate,
    112112        #endregion Boolean
    113113
     
    123123        /// <summary>
    124124        /// CODE.APPEND:
    125         /// Pushes the result of appending the top two pieces of code. If one of the pieces of code is a single instruction or literal (that is, something not surrounded by parentheses) then it is surrounded by parentheses first.
     125        /// Pushes the result of appending the top two pieces of code. If one of the pieces of code is a single inclassion or literal (that is, something not surrounded by parentheses) then it is surrounded by parentheses first.
    126126        /// </summary>
    127127        CodeAppend,
     
    129129        /// <summary>
    130130        /// CODE.ATOM:
    131         /// Pushes TRUE onto the BOOLEAN stack if the top piece of code is a single instruction or a literal, and FALSE otherwise (that is, if it is something surrounded by parentheses).
     131        /// Pushes TRUE onto the BOOLEAN stack if the top piece of code is a single inclassion or a literal, and FALSE otherwise (that is, if it is something surrounded by parentheses).
    132132        /// </summary>
    133133        CodeAtom,
     
    165165        /// <summary>
    166166        /// CODE.DEFINE:
    167         /// Defines the name on top of the NAME stack as an instruction that will push the top item of the CODE stack onto the EXEC stack.
     167        /// Defines the name on top of the NAME stack as an inclassion that will push the top item of the CODE stack onto the EXEC stack.
    168168        /// </summary>
    169169        CodeDefine,
     
    171171        /// <summary>
    172172        /// CODE.DEFINITION:
    173         /// Pushes the definition associated with the top NAME on the NAME stack (if any) onto the CODE stack. This extracts the definition for inspection/manipulation, rather than for immediate execution (although it may then be executed with a call to CODE.DO or a similar instruction).
     173        /// Pushes the definition associated with the top NAME on the NAME stack (if any) onto the CODE stack. This extracts the definition for inspection/manipulation, rather than for immediate execution (although it may then be executed with a call to CODE.DO or a similar inclassion).
    174174        /// </summary>
    175175        CodeDefinition,
     
    178178        /// CODE.DESCREPANCY:
    179179        /// Pushes a measure of the discrepancy between the top two CODE stack items onto the INTEGER stack. This will be zero if the top two items are equivalent, and will be higher the 'more different' the items are from one another. The calculation is as follows:
    180         /// 1. Construct a list of all of the unique items in both of the lists (where uniqueness is determined by equalp). Sub-lists and atoms all count as items.
     180        /// 1. Conclass a list of all of the unique items in both of the lists (where uniqueness is determined by equalp). Sub-lists and atoms all count as items.
    181181        /// 2. Initialize the result to zero.
    182182        /// 3. For each unique item increment the result by the difference between the number of occurrences of the item in the two pieces of code.
     
    199199        /// <summary>
    200200        /// CODE.DO*COUNT:
    201         /// An iteration instruction that performs a loop (the body of which is taken from the CODE stack) the number of times indicated by the INTEGER argument, pushing an index (which runs from zero to one less than the number of iterations) onto the INTEGER stack prior to each execution of the loop body. This should be implemented as a macro that expands into a call to CODE.DO*RANGE. CODE.DO*COUNT takes a single INTEGER argument (the number of times that the loop will be executed) and a single CODE argument (the body of the loop). If the provided INTEGER argument is negative or zero then this becomes a NOOP. Otherwise it expands into:
     201        /// An iteration inclassion that performs a loop (the body of which is taken from the CODE stack) the number of times indicated by the INTEGER argument, pushing an index (which runs from zero to one less than the number of iterations) onto the INTEGER stack prior to each execution of the loop body. This should be implemented as a macro that expands into a call to CODE.DO*RANGE. CODE.DO*COUNT takes a single INTEGER argument (the number of times that the loop will be executed) and a single CODE argument (the body of the loop). If the provided INTEGER argument is negative or zero then this becomes a NOOP. Otherwise it expands into:
    202202        /// ( 0 '1 - IntegerArg' CODE.QUOTE <CodeArg> CODE.DO*RANGE )
    203203        /// </summary>
     
    206206        /// <summary>
    207207        /// CODE.DO*RANGE:
    208         /// An iteration instruction that executes the top item on the CODE stack a number of times that depends on the top two integers, while also pushing the loop counter onto the INTEGER stack for possible access during the execution of the body of the loop. The top integer is the "destination index" and the second integer is the "current index." First the code and the integer arguments are saved locally and popped. Then the integers are compared. If the integers are equal then the current index is pushed onto the INTEGER stack and the code (which is the "body" of the loop) is pushed onto the EXEC stack for subsequent execution. If the integers are not equal then the current index will still be pushed onto the INTEGER stack but two items will be pushed onto the EXEC stack -- first a recursive call to CODE.DO*RANGE (with the same code and destination index, but with a current index that has been either incremented or decremented by 1 to be closer to the destination index) and then the body code. Note that the range is inclusive of both endpoints; a call with integer arguments 3 and 5 will cause its body to be executed 3 times, with the loop counter having the values 3, 4, and 5. Note also that one can specify a loop that "counts down" by providing a destination index that is less than the specified current index.
     208        /// An iteration inclassion that executes the top item on the CODE stack a number of times that depends on the top two integers, while also pushing the loop counter onto the INTEGER stack for possible access during the execution of the body of the loop. The top integer is the "destination index" and the second integer is the "current index." First the code and the integer arguments are saved locally and popped. Then the integers are compared. If the integers are equal then the current index is pushed onto the INTEGER stack and the code (which is the "body" of the loop) is pushed onto the EXEC stack for subsequent execution. If the integers are not equal then the current index will still be pushed onto the INTEGER stack but two items will be pushed onto the EXEC stack -- first a recursive call to CODE.DO*RANGE (with the same code and destination index, but with a current index that has been either incremented or decremented by 1 to be closer to the destination index) and then the body code. Note that the range is inclusive of both endpoints; a call with integer arguments 3 and 5 will cause its body to be executed 3 times, with the loop counter having the values 3, 4, and 5. Note also that one can specify a loop that "counts down" by providing a destination index that is less than the specified current index.
    209209        /// </summary>
    210210        CodeDoXRange,
     
    218218        /// <summary>
    219219        /// CODE.DUP:
    220         /// Duplicates the top item on the CODE stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!).
    221         /// </summary>
    222         CodeDup,
     220        /// Duplicatelicates the top item on the CODE stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!).
     221        /// </summary>
     222        CodeDuplicate,
    223223
    224224        /// <summary>
    225225        /// CODE.EXTRACT:
    226         /// Pushes the sub-expression of the top item of the CODE stack that is indexed by the top item of the INTEGER stack. The indexing here counts "points," where each parenthesized expression and each literal/instruction is considered a point, and it proceeds in depth first order. The entire piece of code is at index 0; if it is a list then the first item in the list is at index 1, etc. The integer used as the index is taken modulo the number of points in the overall expression (and its absolute value is taken in case it is negative) to ensure that it is within the meaningful range.
     226        /// Pushes the sub-expression of the top item of the CODE stack that is indexed by the top item of the INTEGER stack. The indexing here counts "points," where each parenthesized expression and each literal/inclassion is considered a point, and it proceeds in depth first order. The entire piece of code is at index 0; if it is a list then the first item in the list is at index 1, etc. The integer used as the index is taken modulo the number of points in the overall expression (and its absolute value is taken in case it is negative) to ensure that it is within the meaningful range.
    227227        /// </summary>
    228228        CodeExtract,
     
    265265
    266266        /// <summary>
     267        /// CODE.INSTRUCTIONS:
     268        /// Pushes a list of all active instructions in the interpreter's current configuration.
     269        /// </summary>
     270        CodeInstructions,
     271
     272        /// <summary>
    267273        /// CODE.INSERT:
    268274        /// Pushes the result of inserting the second item of the CODE stack into the first item, at the position indexed by the top item of the INTEGER stack (and replacing whatever was there formerly). The indexing is computed as in CODE.EXTRACT.
     
    272278        /// <summary>
    273279        /// CODE.INSTRUCTIONS:
    274         /// Pushes a list of all active instructions in the interpreter's current configuration.
    275         /// </summary>
    276         CodeInstructions,
     280        /// Pushes a list of all active inclassions in the interpreter's current configuration.
     281        /// </summary>
     282        CodeInclassions,
    277283
    278284        /// <summary>
     
    311317
    312318        /// <summary>
     319        /// CODE.NULL: Pushes TRUE onto the BOOLEAN stack if the top item of the CODE stack is an empty list, or FALSE otherwise.
     320        /// </summary>
     321        CodeNull,
     322
     323        /// <summary>
     324        /// CODE.POSITION:
     325        /// Pushes onto the INTEGER stack the position of the second item on the CODE stack within the first item (which is coerced to a list if necessary). Pushes -1 if no match is found.
     326        /// </summary>
     327        CodePosition,
     328
     329        /// <summary>
    313330        /// CODE.QUOTE:
    314331        /// Specifies that the next expression submitted for execution will instead be pushed literally onto the CODE stack. This can be implemented by moving the top item on the EXEC stack onto the CODE stack.
     
    334351
    335352        /// <summary>
    336         /// CODE.SIZE: Pushes the number of "points" in the top piece of CODE onto the INTEGER stack. Each instruction, literal, and pair of parentheses counts as a point.
     353        /// CODE.SIZE: Pushes the number of "points" in the top piece of CODE onto the INTEGER stack. Each inclassion, literal, and pair of parentheses counts as a point.
    337354        /// </summary>
    338355        CodeSize,
     
    364381        /// Pushes a copy of an indexed item "deep" in the stack onto the top of the stack, without removing the deep item. The index is taken from the INTEGER stack.
    365382        /// </summary>
    366         CodeYankDup,
     383        CodeYankDuplicate,
    367384        #endregion Code
    368385
     
    380397        /// <summary>
    381398        /// EXEC.DEFINE:
    382         /// Defines the name on top of the NAME stack as an instruction that will push the top item of the EXEC stack back onto the EXEC stack.
     399        /// Defines the name on top of the NAME stack as an inclassion that will push the top item of the EXEC stack back onto the EXEC stack.
    383400        /// </summary>
    384401        ExecDefine,
     
    386403        /// <summary>
    387404        /// EXEC.DO*COUNT:
    388         /// An iteration instruction that performs a loop (the body of which is taken from the EXEC stack) the number of times indicated by the INTEGER argument, pushing an index (which runs from zero to one less than the number of iterations) onto the INTEGER stack prior to each execution of the loop body. This is similar to CODE.DO*COUNT except that it takes its code argument from the EXEC stack. This should be implemented as a macro that expands into a call to EXEC.DO*RANGE. EXEC.DO*COUNT takes a single INTEGER argument (the number of times that the loop will be executed) and a single EXEC argument (the body of the loop). If the provided INTEGER argument is negative or zero then this becomes a NOOP. Otherwise it expands into:
     405        /// An iteration inclassion that performs a loop (the body of which is taken from the EXEC stack) the number of times indicated by the INTEGER argument, pushing an index (which runs from zero to one less than the number of iterations) onto the INTEGER stack prior to each execution of the loop body. This is similar to CODE.DO*COUNT except that it takes its code argument from the EXEC stack. This should be implemented as a macro that expands into a call to EXEC.DO*RANGE. EXEC.DO*COUNT takes a single INTEGER argument (the number of times that the loop will be executed) and a single EXEC argument (the body of the loop). If the provided INTEGER argument is negative or zero then this becomes a NOOP. Otherwise it expands into:
    389406        /// ( 0 <1 - IntegerArg> EXEC.DO*RANGE <ExecArg> )
    390407        /// </summary>
     
    393410        /// <summary>
    394411        /// EXEC.DO*RANGE:
    395         /// An iteration instruction that executes the top item on the EXEC stack a number of times that depends on the top two integers, while also pushing the loop counter onto the INTEGER stack for possible access during the execution of the body of the loop. This is similar to CODE.DO*COUNT except that it takes its code argument from the EXEC stack. The top integer is the "destination index" and the second integer is the "current index." First the code and the integer arguments are saved locally and popped. Then the integers are compared. If the integers are equal then the current index is pushed onto the INTEGER stack and the code (which is the "body" of the loop) is pushed onto the EXEC stack for subsequent execution. If the integers are not equal then the current index will still be pushed onto the INTEGER stack but two items will be pushed onto the EXEC stack -- first a recursive call to EXEC.DO*RANGE (with the same code and destination index, but with a current index that has been either incremented or decremented by 1 to be closer to the destination index) and then the body code. Note that the range is inclusive of both endpoints; a call with integer arguments 3 and 5 will cause its body to be executed 3 times, with the loop counter having the values 3, 4, and 5. Note also that one can specify a loop that "counts down" by providing a destination index that is less than the specified current index.
     412        /// An iteration inclassion that executes the top item on the EXEC stack a number of times that depends on the top two integers, while also pushing the loop counter onto the INTEGER stack for possible access during the execution of the body of the loop. This is similar to CODE.DO*COUNT except that it takes its code argument from the EXEC stack. The top integer is the "destination index" and the second integer is the "current index." First the code and the integer arguments are saved locally and popped. Then the integers are compared. If the integers are equal then the current index is pushed onto the INTEGER stack and the code (which is the "body" of the loop) is pushed onto the EXEC stack for subsequent execution. If the integers are not equal then the current index will still be pushed onto the INTEGER stack but two items will be pushed onto the EXEC stack -- first a recursive call to EXEC.DO*RANGE (with the same code and destination index, but with a current index that has been either incremented or decremented by 1 to be closer to the destination index) and then the body code. Note that the range is inclusive of both endpoints; a call with integer arguments 3 and 5 will cause its body to be executed 3 times, with the loop counter having the values 3, 4, and 5. Note also that one can specify a loop that "counts down" by providing a destination index that is less than the specified current index.
    396413        /// </summary>
    397414        ExecDoXRange,
     
    405422        /// <summary>
    406423        /// EXEC.DUP:
    407         /// Duplicates the top item on the EXEC stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!). This may be thought of as a "DO TWICE" instruction.
    408         /// </summary>
    409         ExecDup,
     424        /// Duplicatelicates the top item on the EXEC stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!). This may be thought of as a "DO TWICE" inclassion.
     425        /// </summary>
     426        ExecDuplicate,
    410427
    411428        /// <summary>
    412429        /// EXEC.FLUSH:
    413         /// Empties the EXEC stack. This may be thought of as a "HALT" instruction.
     430        /// Empties the EXEC stack. This may be thought of as a "HALT" inclassion.
    414431        /// </summary>
    415432        ExecFlush,
     
    428445
    429446        /// <summary>
    430         /// EXEC.POP: Pops the EXEC stack. This may be thought of as a "DONT" instruction.
     447        /// EXEC.POP: Pops the EXEC stack. This may be thought of as a "DONT" inclassion.
    431448        /// </summary>
    432449        ExecPop,
     
    439456
    440457        /// <summary>
     458        /// EXEC.S:
     459        /// The Push implementation of the "S combinator". Pops 3 items from the EXEC stack, which we will call A, B, and C (with A being the first one popped). Then pushes a list containing B and C back onto the EXEC stack, followed by another instance of C, followed by another instance of A.
     460        /// </summary>
     461        ExecS,
     462
     463        /// <summary>
    441464        /// EXEC.SHOVE:
    442         /// Inserts the top EXEC item "deep" in the stack, at the position indexed by the top INTEGER. This may be thought of as a "DO LATER" instruction.
     465        /// Inserts the top EXEC item "deep" in the stack, at the position indexed by the top INTEGER. This may be thought of as a "DO LATER" inclassion.
    443466        /// </summary>
    444467        ExecShove,
     
    464487        /// <summary>
    465488        /// EXEC.YANK:
    466         /// Removes an indexed item from "deep" in the stack and pushes it on top of the stack. The index is taken from the INTEGER stack. This may be thought of as a "DO SOONER" instruction.
     489        /// Removes an indexed item from "deep" in the stack and pushes it on top of the stack. The index is taken from the INTEGER stack. This may be thought of as a "DO SOONER" inclassion.
    467490        /// </summary>
    468491        ExecYank,
     
    472495        /// Pushes a copy of an indexed item "deep" in the stack onto the top of the stack, without removing the deep item. The index is taken from the INTEGER stack.
    473496        /// </summary>
    474         ExecYankDup,
     497        ExecYankDuplicate,
    475498        #endregion Exec
    476499
     
    533556        /// <summary>
    534557        /// FLOAT.DEFINE:
    535         /// Defines the name on top of the NAME stack as an instruction that will push the top item of the FLOAT stack onto the EXEC stack.
     558        /// Defines the name on top of the NAME stack as an inclassion that will push the top item of the FLOAT stack onto the EXEC stack.
    536559        /// </summary>
    537560        FloatDefine,
     
    539562        /// <summary>
    540563        /// FLOAT.DUP:
    541         /// Duplicates the top item on the FLOAT stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!).
    542         /// </summary>
    543         FloatDup,
     564        /// Duplicatelicates the top item on the FLOAT stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!).
     565        /// </summary>
     566        FloatDuplicate,
    544567
    545568        /// <summary>
     
    636659        /// Pushes a copy of an indexed item "deep" in the stack onto the top of the stack, without removing the deep item. The index is taken from the INTEGER stack.
    637660        /// </summary>
    638         FloatYankDup,
     661        FloatYankDuplicate,
    639662
    640663        #endregion Float
     
    692715
    693716        /// <summary>
    694         /// INTEGER.COS:
    695         /// Pushes the cosine of the top item.
    696         /// </summary>
    697         IntegerCos,
    698 
    699         /// <summary>
    700717        /// INTEGER.DEFINE:
    701         /// Defines the name on top of the NAME stack as an instruction that will push the top item of the INTEGER stack onto the EXEC stack.
     718        /// Defines the name on top of the NAME stack as an inclassion that will push the top item of the INTEGER stack onto the EXEC stack.
    702719        /// </summary>
    703720        IntegerDefine,
     
    705722        /// <summary>
    706723        /// INTEGER.DUP:
    707         /// Duplicates the top item on the INTEGER stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!).
    708         /// </summary>
    709         IntegerDup,
     724        /// Duplicatelicates the top item on the INTEGER stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!).
     725        /// </summary>
     726        IntegerDuplicate,
    710727
    711728        /// <summary>
     
    769786
    770787        /// <summary>
    771         /// INTEGER.SIN:
    772         /// Pushes the sine of the top item.
    773         /// </summary>
    774         IntegerSin,
    775 
    776         /// <summary>
    777788        /// INTEGER.STACKDEPTH:
    778789        /// Pushes the stack depth onto the INTEGER stack.
     
    787798
    788799        /// <summary>
    789         /// INTEGER.TAN:
    790         /// Pushes the tangent of the top item.
    791         /// </summary>
    792         IntegerTan,
    793 
    794         /// <summary>
    795800        /// INTEGER.YANK:
    796801        /// Removes an indexed item from "deep" in the stack and pushes it on top of the stack. The index is taken from the INTEGER stack.
     
    802807        /// Pushes a copy of an indexed item "deep" in the stack onto the top of the stack, without removing the deep item. The index is taken from the INTEGER stack.
    803808        /// </summary>
    804         IntegerYankDup,
     809        IntegerYankDuplicate,
    805810
    806811        #endregion Integer
     
    823828        /// <summary>
    824829        /// NAME.DUP:
    825         /// Duplicates the top item on the NAME stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!).
    826         /// </summary>
    827         NameDup,
     830        /// Duplicatelicates the top item on the NAME stack. Does not pop its argument (which, if it did, would negate the effect of the duplication!).
     831        /// </summary>
     832        NameDuplicate,
    828833
    829834        /// <summary>
     
    890895        /// Pushes a copy of an indexed item "deep" in the stack onto the top of the stack, without removing the deep item. The index is taken from the INTEGER stack.
    891896        /// </summary>
    892         NameYankDup,
     897        NameYankDuplicate,
    893898        #endregion Name
    894899    }
Note: See TracChangeset for help on using the changeset viewer.