//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\
// PLEASE DO NOT EDIT WITHOUT THE EXPLICIT CONSENT OF THE AUTHOR! \\
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\

package hlt.language.design.instructions;

/**
 * @version     Last modified on Wed Jun 20 14:29:51 2012 by hak
 * @author      <a href="mailto:hak@acm.org">Hassan A&iuml;t-Kaci</a>
 * @copyright   &copy; <a href="http://www.hassan-ait-kaci.net/">by the author</a>
 */

import hlt.language.tools.Misc;

import hlt.language.design.types.Symbol;
import hlt.language.design.backend.Runtime;
import hlt.language.design.backend.RuntimeInt;
import hlt.language.design.backend.RuntimeReal;

/**
 * This class is the mother of all instructions that may be executed
 * in a <a href="../backend/Runtime.html"><tt>Runtime</tt></a> object. It requires
 * only one method <tt>execute(Runtime)</tt> defining the way it effects
 * the runtime object. It also contains all the static constants defining
 * instructions that do not have parameters and thus need not be duplicated
 * for each occurrence.
 * <p>
 *
 * The complete list of instructions that are currently defined is:
 *
 * <ul>
 *     <li><b>Push instructions</b>:
 *     <ul>
 *     <li><a href="PushClosure.html"><tt>PUSH_CLOSURE</tt></a>
 *     <li><a href="PushNewObject.html"><tt>PUSH_NEW_OBJECT</tt></a>
 *     <li><a href="PushOffsetInt.html"><tt>PUSH_OFFSET_I</tt></a>
 *     <li><a href="PushOffsetObject.html"><tt>PUSH_OFFSET_O</tt></a>
 *     <li><a href="PushOffsetReal.html"><tt>PUSH_OFFSET_R</tt></a>
 *     <li><a href="PushValueInt.html"><tt>PUSH_I</tt></a>
 *     <li><a href="PushValueObject.html"><tt>PUSH_O</tt></a>
 *     <li><a href="PushValueReal.html"><tt>PUSH_R</tt></a>
 *     <li><a href="PushTuple.html"><tt>PUSH_TUPLE</tt></a>
 *     <li><a href="PushIntSet.html"><tt>PUSH_SET_I</tt></a>
 *     <li><a href="PushRealSet.html"><tt>PUSH_SET_R</tt></a>
 *     <li><a href="PushObjectSet.html"><tt>PUSH_SET_O</tt></a>
 *     <li><a href="PushIntRange.html"><tt>PUSH_INT_RNG</tt></a>
 *     <li><a href="PushRealRange.html"><tt>PUSH_REAL_RNG</tt></a>
 *     </ul>
 *     <li><b>Subroutine instructions</b>:
 *     <ul>
 *     <li><a href="NoOp.html"><tt>NO_OP</tt></a>
 *     <li><a href="Apply.html"><tt>APPLY</tt></a>
 *     <li><a href="ApplyIntHomomorphism.html"><tt>APPLY_HOM_I</tt></a>
 *     <li><a href="ApplyRealHomomorphism.html"><tt>APPLY_HOM_R</tt></a>
 *     <li><a href="ApplyObjectHomomorphism.html"><tt>APPLY_HOM_O</tt></a>
 *     <li><a href="ApplyInPlaceIntHomomorphism.html"><tt>APPLY_IP_HOM_I</tt></a>
 *     <li><a href="ApplyInPlaceRealHomomorphism.html"><tt>APPLY_IP_HOM_R</tt></a>
 *     <li><a href="ApplyInPlaceObjectHomomorphism.html"><tt>APPLY_IP_HOM_O</tt></a>
 *     <li><a href="ApplyIntCollection.html"><tt>APPLY_COLL_I</tt></a>
 *     <li><a href="ApplyRealCollection.html"><tt>APPLY_COLL_R</tt></a>
 *     <li><a href="ApplyObjectCollection.html"><tt>APPLY_COLL_O</tt></a>
 *     <li><a href="ApplyIntCollectionHomomorphism.html"><tt>APPLY_COLL_HOM_I</tt></a>
 *     <li><a href="ApplyRealCollectionHomomorphism.html"><tt>APPLY_COLL_HOM_R</tt></a>
 *     <li><a href="ApplyObjectCollectionHomomorphism.html"><tt>APPLY_COLL_HOM_O</tt></a>
 *     <li><a href="ApplyIntFilterHomomorphism.html"><tt>APPLY_FHOM_I</tt></a>
 *     <li><a href="ApplyRealFilterHomomorphism.html"><tt>APPLY_FHOM_R</tt></a>
 *     <li><a href="ApplyObjectFilterHomomorphism.html"><tt>APPLY_FHOM_O</tt></a>
 *     <li><a href="ApplyInPlaceIntFilterHomomorphism.html"><tt>APPLY_IP_FHOM_I</tt></a>
 *     <li><a href="ApplyInPlaceRealFilterHomomorphism.html"><tt>APPLY_IP_FHOM_R</tt></a>
 *     <li><a href="ApplyInPlaceObjectFilterHomomorphism.html"><tt>APPLY_IP_FHOM_O</tt></a>
 *     <li><a href="ApplyIntCollection.html"><tt>APPLY_COLL_I</tt></a>
 *     <li><a href="ApplyRealCollection.html"><tt>APPLY_COLL_R</tt></a>
 *     <li><a href="ApplyObjectCollection.html"><tt>APPLY_COLL_O</tt></a>
 *     <li><a href="ApplyIntCollectionFilterHomomorphism.html"><tt>APPLY_COLL_FHOM_I</tt></a>
 *     <li><a href="ApplyRealCollectionFilterHomomorphism.html"><tt>APPLY_COLL_FHOM_R</tt></a>
 *     <li><a href="ApplyObjectCollectionFilterHomomorphism.html"><tt>APPLY_COLL_FHOM_O</tt></a>
 *     <li><a href="Call.html"><tt>CALL</tt></a>
 *     <li><a href="End.html"><tt>END</tt></a>
 *     <li><a href="Stop.html"><tt>STOP</tt></a>
 *     <li><a href="StopOnFalse.html"><tt>STOP_ON_FALSE</tt></a>
 *     <li><a href="ReturnVoid.html"><tt>RETURN_VOID</tt></a>
 *     <li><a href="ReturnInt.html"><tt>RETURN_I</tt></a>
 *     <li><a href="ReturnObject.html"><tt>RETURN_O</tt></a>
 *     <li><a href="ReturnReal.html"><tt>RETURN_R</tt></a>
 *     <li><a href="NonlocalReturnVoid.html"><tt>NL_RETURN_VOID</tt></a>
 *     <li><a href="NonlocalReturnInt.html"><tt>NL_RETURN_I</tt></a>
 *     <li><a href="NonlocalReturnObject.html"><tt>NL_RETURN_O</tt></a>
 *     <li><a href="NonlocalReturnReal.html"><tt>NL_RETURN_R</tt></a>
 *     </ul>
 *     <li><b>Pop instructions</b>:
 *     <ul>
 *     <li><a href="PopInt.html"><tt>POP_I</tt></a>
 *     <li><a href="PopObject.html"><tt>POP_O</tt></a>
 *     <li><a href="PopReal.html"><tt>POP_R</tt></a>
 *     </ul>
 *     <li><b><a href="Relocatable.html">Relocatable instructions</a></b>:
 *     <ul>
 *     <li><a href="Jump.html"><tt>JUMP</tt></a>
 *     <li><a href="JumpOnFalse.html"><tt>JUMP_ON_FALSE</tt></a>
 *     <li><a href="JumpOnTrue.html"><tt>JUMP_ON_TRUE</tt></a>
 *     </ul>
 *     <li><b>Conversion instructions</b>:
 *     <ul>
 *     <li><a href="IntToObject.html"><tt>I_TO_O</tt></a>
 *     <li><a href="IntToReal.html"><tt>I_TO_R</tt></a>
 *     <li><a href="ObjectToInt.html"><tt>O_TO_I</tt></a>
 *     <li><a href="ObjectToReal.html"><tt>O_TO_R</tt></a>
 *     <li><a href="RealToInt.html"><tt>R_TO_I</tt></a>
 *     <li><a href="RealToObject.html"><tt>R_TO_O</tt></a>
 *     <li><a href="IntArrayToMap.html"><tt>ARRAY_TO_MAP_I</tt></a>
 *     <li><a href="RealArrayToMap.html"><tt>ARRAY_TO_MAP_R</tt></a>
 *     <li><a href="ObjectArrayToMap.html"><tt>ARRAY_TO_MAP_O</tt></a>
 *     <li><a href="MapToArray.html"><tt>MAP_TO_ARRAY_O</tt></a>
 *     <li><a href="CheckArraySize.html"><tt>CHECK_ARRAY_SIZE</tt></a>
 *     <li><a href="ReconcileIndexables.html"><tt>RECONCILE_INDEXABLES</tt></a>
 *     <li><a href="ArrayInitialize.html"><tt>ARRAY_INITIALIZE</tt></a>
 *     <li><a href="ShuffleIntMap.html"><tt>SHUFFLE_MAP_I</tt></a>
 *     <li><a href="ShuffleRealMap.html"><tt>SHUFFLE_MAP_R</tt></a>
 *     <li><a href="ShuffleObjectMap.html"><tt>SHUFFLE_MAP_O</tt></a>
 *     </ul>
 *     <li><b>Assignment instructions</b>:
 *     <ul>
 *     <li><a href="SetGlobal.html"><tt>SET_GLOBAL</tt></a>
 *     <li><a href="SetOffsetInt.html"><tt>SET_OFFSET_I</tt></a>
 *     <li><a href="SetOffsetObject.html"><tt>SET_OFFSET_O</tt></a>
 *     <li><a href="SetOffsetReal.html"><tt>SET_OFFSET_R</tt></a>
 *     </ul>
 *     <li><b>Tuple component instructions</b>:
 *     <ul>
 *     <li><a href="GetIntTupleComponent.html"><tt>GET_TUPLE_I</tt></a>
 *     <li><a href="GetRealTupleComponent.html"><tt>GET_TUPLE_R</tt></a>
 *     <li><a href="GetObjectTupleComponent.html"><tt>GET_TUPLE_O</tt></a>
 *     <li><a href="SetIntTupleComponent.html"><tt>SET_TUPLE_I</tt></a>
 *     <li><a href="SetRealTupleComponent.html"><tt>SET_TUPLE_R</tt></a>
 *     <li><a href="SetObjectTupleComponent.html"><tt>SET_TUPLE_O</tt></a>
 *     </ul>
 *     <li><b>Array/Map allocation instructions</b>:
 *     <ul>
 *     <li><a href="PushIntArray.html"><tt>PUSH_ARRAY_I</tt></a>
 *     <li><a href="PushRealArray.html"><tt>PUSH_ARRAY_R</tt></a>
 *     <li><a href="PushObjectArray.html"><tt>PUSH_ARRAY_O</tt></a>
 *     <li><a href="PushIntMap.html"><tt>PUSH_MAP_I</tt></a>
 *     <li><a href="PushRealMap.html"><tt>PUSH_MAP_R</tt></a>
 *     <li><a href="PushObjectMap.html"><tt>PUSH_MAP_O</tt></a>
 *     <li><a href="MakeIntArray.html"><tt>MAKE_ARRAY_I</tt></a>
 *     <li><a href="MakeRealArray.html"><tt>MAKE_ARRAY_R</tt></a>
 *     <li><a href="MakeObjectArray.html"><tt>MAKE_ARRAY_O</tt></a>
 *     <li><a href="MakeIntMap.html"><tt>MAKE_MAP_I</tt></a>
 *     <li><a href="MakeRealMap.html"><tt>MAKE_MAP_R</tt></a>
 *     <li><a href="MakeObjectMap.html"><tt>MAKE_MAP_O</tt></a>
 *     <li><a href="FillArrayFromIntArray.html"><tt>FILL_ARRAY_IA</tt></a>
 *     <li><a href="FillArrayFromIntMap.html"><tt>FILL_ARRAY_IM</tt></a>
 *     <li><a href="FillArrayFromObjectArray.html"><tt>FILL_ARRAY_OA</tt></a>
 *     <li><a href="FillArrayFromObjectMap.html"><tt>FILL_ARRAY_OM</tt></a>
 *     <li><a href="FillArrayFromRealArray.html"><tt>FILL_ARRAY_RA</tt></a>
 *     <li><a href="FillArrayFromRealMap.html"><tt>FILL_ARRAY_RM</tt></a>
 *     <li><a href="FillMapFromIntArray.html"><tt>FILL_MAP_IA</tt></a>
 *     <li><a href="FillMapFromIntMap.html"><tt>FILL_MAP_IM</tt></a>
 *     <li><a href="FillMapFromObjectArray.html"><tt>FILL_MAP_OA</tt></a>
 *     <li><a href="FillMapFromObjectMap.html"><tt>FILL_MAP_OM</tt></a>
 *     <li><a href="FillMapFromRealArray.html"><tt>FILL_MAP_RA</tt></a>
 *     <li><a href="FillMapFromRealMap.html"><tt>FILL_MAP_RM</tt></a>
 *     </ul>
 *     <li><b>Array/Map slot instructions</b>:
 *     <ul>
 *     <li><a href="GetIntArraySlot.html"><tt>GET_ARRAY_I</tt></a>
 *     <li><a href="GetIntIndexedIntMapSlot.html"><tt>GET_INT_INDEXED_MAP_I</tt></a>
 *     <li><a href="GetIntIndexedObjectMapSlot.html"><tt>GET_INT_INDEXED_MAP_O</tt></a>
 *     <li><a href="GetIntIndexedRealMapSlot.html"><tt>GET_INT_INDEXED_MAP_R</tt></a>
 *     <li><a href="GetIntMapSlot.html"><tt>GET_MAP_I</tt></a>
 *     <li><a href="GetObjectArraySlot.html"><tt>GET_ARRAY_O</tt></a>
 *     <li><a href="GetObjectMapSlot.html"><tt>GET_MAP_O</tt></a>
 *     <li><a href="GetRealArraySlot.html"><tt>GET_ARRAY_R</tt></a>
 *     <li><a href="GetRealMapSlot.html"><tt>GET_MAP_R</tt></a>
 *     <li><a href="SetIntArraySlot.html"><tt>SET_ARRAY_I</tt></a>
 *     <li><a href="SetIntIndexedIntMapSlot.html"><tt>SET_INT_INDEXED_MAP_I</tt></a>
 *     <li><a href="SetIntIndexedObjectMapSlot.html"><tt>SET_INT_INDEXED_MAP_O</tt></a>
 *     <li><a href="SetIntIndexedRealMapSlot.html"><tt>SET_INT_INDEXED_MAP_R</tt></a>
 *     <li><a href="SetIntMapSlot.html"><tt>SET_MAP_I</tt></a>
 *     <li><a href="SetObjectArraySlot.html"><tt>SET_ARRAY_O</tt></a>
 *     <li><a href="SetObjectMapSlot.html"><tt>SET_MAP_O</tt></a>
 *     <li><a href="SetRealArraySlot.html"><tt>SET_ARRAY_R</tt></a>
 *     <li><a href="SetRealMapSlot.html"><tt>SET_MAP_R</tt></a>
 *     </ul>
 *     <li><b><a href="FieldInstruction.html">Field instructions</a></b>:
 *     <ul>
 *     <li><a href="GetIntField.html"><tt>GET_FIELD_I</tt></a>
 *     <li><a href="GetObjectField.html"><tt>GET_FIELD_O</tt></a>
 *     <li><a href="GetRealField.html"><tt>GET_FIELD_R</tt></a>
 *     <li><a href="SetIntField.html"><tt>SET_FIELD_I</tt></a>
 *     <li><a href="SetObjectField.html"><tt>SET_FIELD_O</tt></a>
 *     <li><a href="SetRealField.html"><tt>SET_FIELD_R</tt></a>
 *     </ul>
 *     <li><b>Built-in operations</b>:
 *     <ul>
 *     <li><b>Arithmetic operations</b>:
 *         <ul>
 *         <li><a href="AddIntInt.html"><tt>ADD_II</tt></a>
 *         <li><a href="AddIntReal.html"><tt>ADD_IR</tt></a>
 *         <li><a href="AddRealInt.html"><tt>ADD_RI</tt></a>
 *         <li><a href="AddRealReal.html"><tt>ADD_RR</tt></a>
 *         <li><a href="SubIntInt.html"><tt>SUB_II</tt></a>
 *         <li><a href="SubIntReal.html"><tt>SUB_IR</tt></a>
 *         <li><a href="SubRealInt.html"><tt>SUB_RI</tt></a>
 *         <li><a href="SubRealReal.html"><tt>SUB_RR</tt></a>
 *         <li><a href="MinusInt.html"><tt>MINUS_I</tt></a>
 *         <li><a href="MinusReal.html"><tt>MINUS_R</tt></a>
 *         <li><a href="MulIntInt.html"><tt>MUL_II</tt></a>
 *         <li><a href="MulIntReal.html"><tt>MUL_IR</tt></a>
 *         <li><a href="MulRealInt.html"><tt>MUL_RI</tt></a>
 *         <li><a href="MulRealReal.html"><tt>MUL_RR</tt></a>
 *         <li><a href="DivIntInt.html"><tt>DIV_II</tt></a>
 *         <li><a href="DivIntReal.html"><tt>DIV_IR</tt></a>
 *         <li><a href="DivRealInt.html"><tt>DIV_RI</tt></a>
 *         <li><a href="DivRealReal.html"><tt>DIV_RR</tt></a>
 *         <li><a href="Modulo.html"><tt>MODULO</tt></a>
 *         <li><a href="MinIntInt.html"><tt>MIN_II</tt></a>
 *         <li><a href="MinIntReal.html"><tt>MIN_IR</tt></a>
 *         <li><a href="MinRealInt.html"><tt>MIN_RI</tt></a>
 *         <li><a href="MinRealReal.html"><tt>MIN_RR</tt></a>
 *         <li><a href="MaxIntInt.html"><tt>MAX_II</tt></a>
 *         <li><a href="MaxIntReal.html"><tt>MAX_IR</tt></a>
 *         <li><a href="MaxRealInt.html"><tt>MAX_RI</tt></a>
 *         <li><a href="MaxRealReal.html"><tt>MAX_RR</tt></a>
 *         <li><a href="AbsInt.html"><tt>ABS_I_RI</tt></a>
 *         <li><a href="AbsReal.html"><tt>ABS_R</tt></a>
 *         <li><a href="SquareRoot.html"><tt>SQRT</tt></a>
 *         <li><a href="Power.html"><tt>POWER</tt></a>
 *         <li><a href="Random.html"><tt>RANDOM</tt></a>
 *         </ul>
 *     <li><b>Arithmetic relations</b>:
 *         <ul>
 *         <li><a href="EqualInts.html"><tt>EQU_II</tt></a>
 *         <li><a href="EqualObjects.html"><tt>EQU_OO</tt></a>
 *         <li><a href="EqualReals.html"><tt>EQU_RR</tt></a>
 *         <li><a href="UnequalInts.html"><tt>NEQ_II</tt></a>
 *         <li><a href="UnequalObjects.html"><tt>NEQ_OO</tt></a>
 *         <li><a href="UnequalReals.html"><tt>NEQ_RR</tt></a>
 *         <li><a href="GreaterEqualIntInt.html"><tt>GTE_II</tt></a>
 *         <li><a href="GreaterEqualIntReal.html"><tt>GTE_IR</tt></a>
 *         <li><a href="GreaterEqualRealInt.html"><tt>GTE_RI</tt></a>
 *         <li><a href="GreaterEqualRealReal.html"><tt>GTE_RR</tt></a>
 *         <li><a href="GreaterIntInt.html"><tt>GRT_II</tt></a>
 *         <li><a href="GreaterIntReal.html"><tt>GRT_IR</tt></a>
 *         <li><a href="GreaterRealInt.html"><tt>GRT_RI</tt></a>
 *         <li><a href="GreaterRealReal.html"><tt>GRT_RR</tt></a>
 *         <li><a href="LessEqualIntInt.html"><tt>LTE_II</tt></a>
 *         <li><a href="LessEqualIntReal.html"><tt>LTE_IR</tt></a>
 *         <li><a href="LessEqualRealInt.html"><tt>LTE_RI</tt></a>
 *         <li><a href="LessEqualRealReal.html"><tt>LTE_RR</tt></a>
 *         <li><a href="LessIntInt.html"><tt>LST_II</tt></a>
 *         <li><a href="LessIntReal.html"><tt>LST_IR</tt></a>
 *         <li><a href="LessRealInt.html"><tt>LST_RI</tt></a>
 *         <li><a href="LessRealReal.html"><tt>LST_RR</tt></a>
 *         </ul>
 *     <li><b>Boolean operations</b>:
 *         <ul>
 *         <li><a href="Not.html"><tt>NOT</tt></a>
 *         </ul>
 *     <li><b>Map and Size operations</b>:
 *         <ul>
 *         <li><a href="MapSize.html"><tt>MAP_SIZE</tt></a>
 *         <li><a href="ArraySize.html"><tt>ARRAY_SIZE</tt></a>
 *         <li><a href="IndexableSize.html"><tt>INDEXABLE_SIZE</tt></a>
 *         <li><a href="GetIndexable.html"><tt>GET_INDEXABLE</tt></a>
 *         </ul>
 *     <li><b>Container operations</b>:
 *         <ul>
 *         <li><a href="BelongsInt.html"><tt>BELONGS_I</tt></a>
 *         <li><a href="BelongsObject.html"><tt>BELONGS_O</tt></a>
 *         <li><a href="BelongsReal.html"><tt>BELONGS_R</tt></a>
 *         </ul>
 *     <li><b>Set operations</b>:
 *         <ul>
 *         <li><a href="SetCopy.html"><tt>SET_COPY</tt></a>
 *         <li><a href="MakeIntSet.html"><tt>MAKE_SET_I</tt></a>
 *         <li><a href="MakeObjectSet.html"><tt>MAKE_SET_O</tt></a>
 *         <li><a href="MakeRealSet.html"><tt>MAKE_SET_R</tt></a>
 *         <li><a href="Union.html"><tt>UNION</tt></a>
 *         <li><a href="Intersection.html"><tt>INTER</tt></a>
 *         <li><a href="ExclusiveUnion.html"><tt>XNION</tt></a>
 *         <li><a href="SetDifference.html"><tt>SDIFF</tt></a>
 *         <li><a href="DestructiveUnion1.html"><tt>D_UNION_1</tt></a>
 *         <li><a href="DestructiveIntersection1.html"><tt>D_INTER_1</tt></a>
 *         <li><a href="DestructiveExclusiveUnion1.html"><tt>D_XNION_1</tt></a>
 *         <li><a href="DestructiveUnion2.html"><tt>D_UNION_2</tt></a>
 *         <li><a href="DestructiveIntersection2.html"><tt>D_INTER_2</tt></a>
 *         <li><a href="DestructiveExclusiveUnion2.html"><tt>D_XNION_2</tt></a>
 *         <li><a href="DestructiveSetDifference.html"><tt>D_SDIFF</tt></a>
 *         </ul>
 *     <li><b>Set relations</b>:
 *         <ul>
 *         <li><a href="Subset.html"><tt>SUBSET</tt></a>
 *         </ul>
 *     <li><b>Set element operations</b>:
 *         <ul>
 *         <li><a href="IntSetAdd.html"><tt>SET_ADD_I</tt></a>
 *         <li><a href="RealSetAdd.html"><tt>SET_ADD_R</tt></a>
 *         <li><a href="ObjectSetAdd.html"><tt>SET_ADD_O</tt></a>
 *         <li><a href="IntSetRemove.html"><tt>SET_RMV_I</tt></a>
 *         <li><a href="RealSetRemove.html"><tt>SET_RMV_R</tt></a>
 *         <li><a href="ObjectSetRemove.html"><tt>SET_RMV_O</tt></a>
 *         <li><a href="FirstInt.html"><tt>FIRST_I</tt></a>
 *         <li><a href="FirstObject.html"><tt>FIRST_O</tt></a>
 *         <li><a href="FirstReal.html"><tt>FIRST_R</tt></a>
 *         <li><a href="LastInt.html"><tt>LAST_I</tt></a>
 *         <li><a href="LastObject.html"><tt>LAST_O</tt></a>
 *         <li><a href="LastReal.html"><tt>LAST_R</tt></a>
 *         <li><a href="NextInt.html"><tt>NEXT_I</tt></a>
 *         <li><a href="NextIntCirc.html"><tt>NEXT_C_I</tt></a>
 *         <li><a href="NextObject.html"><tt>NEXT_O</tt></a>
 *         <li><a href="NextObjectCirc.html"><tt>NEXT_C_O</tt></a>
 *         <li><a href="NextReal.html"><tt>NEXT_R</tt></a>
 *         <li><a href="NextRealCirc.html"><tt>NEXT_C_R</tt></a>
 *         <li><a href="OrdInt.html"><tt>ORD_I</tt></a>
 *         <li><a href="OrdObject.html"><tt>ORD_O</tt></a>
 *         <li><a href="OrdReal.html"><tt>ORD_R</tt></a>
 *         <li><a href="PrevInt.html"><tt>PREV_I</tt></a>
 *         <li><a href="PrevIntCirc.html"><tt>PREV_C_I</tt></a>
 *         <li><a href="PrevObject.html"><tt>PREV_O</tt></a>
 *         <li><a href="PrevObjectCirc.html"><tt>PREV_C_O</tt></a>
 *         <li><a href="PrevReal.html"><tt>PREV_R</tt></a>
 *         <li><a href="PrevRealCirc.html"><tt>PREV_C_R</tt></a>
 *         </ul>
 *     <li><b>Range operations</b>:
 *         <ul>
 *         <li><a href="IntRangeUpper.html"><tt>INT_RNG_UB</tt></a>
 *         <li><a href="IntRangeLower.html"><tt>INT_RNG_LB</tt></a>
 *         <li><a href="RealRangeUpper.html"><tt>REAL_RNG_UB</tt></a>
 *         <li><a href="RealRangeLower.html"><tt>REAL_RNG_LB</tt></a>
 *         </ul>
 *     <li><b>String operations</b>:
 *         <ul>
 *         <li><a href="StringConcatenation.html"><tt>STRCON</tt></a>
 *         </ul>
 *     <li><b>I/O operations</b>:
 *         <ul>
 *         <li><a href="WriteInt.html"><tt>WRITE_I</tt></a>
 *         <li><a href="WriteObject.html"><tt>WRITE_O</tt></a>
 *         <li><a href="WriteReal.html"><tt>WRITE_R</tt></a>
 *         </ul>
 *     </ul>
 *     <li><b>Dummy instructions</b>:
 *     <ul>
 *     <li><a href="DummyEqual.html"><tt>DUMMY_EQU</tt></a>
 *     <li><a href="DummyUnequal.html"><tt>DUMMY_NEQ</tt></a>
 *     <li><a href="DummyAnd.html"><tt>DUMMY_AND</tt></a>
 *     <li><a href="DummyOr.html"><tt>DUMMY_OR</tt></a>
 *     <li><a href="DummyStringConcat.html"><tt>DUMMY_STRCON</tt></a>
 *     <li><a href="DummyWrite.html"><tt>DUMMY_WRITE</tt></a>
 *     <li><a href="DummySize.html"><tt>DUMMY_SIZE</tt></a>
 *     <li><a href="DummySetAdd.html"><tt>DUMMY_SET_ADD</tt></a>
 *     <li><a href="DummySetRemove.html"><tt>DUMMY_SET_RMV</tt></a>
 *     <li><a href="DummyBelongs.html"><tt>DUMMY_BELONGS</tt></a>
 *     <li><a href="DummyOrd.html"><tt>DUMMY_ORD</tt></a>
 *     <li><a href="DummyFirst.html"><tt>DUMMY_FIRST</tt></a>
 *     <li><a href="DummyLast.html"><tt>DUMMY_LAST</tt></a>
 *     <li><a href="DummyNext.html"><tt>DUMMY_NEXT</tt></a>
 *     <li><a href="DummyNextCirc.html"><tt>DUMMY_NEXT_C</tt></a>
 *     <li><a href="DummyPrev.html"><tt>DUMMY_PREV</tt></a>
 *     <li><a href="DummyPrevCirc.html"><tt>DUMMY_PREV_C</tt></a>
 *     <li><a href="DummyNext.html"><tt>DUMMY_NEXT_OFFSET</tt></a>
 *     <li><a href="DummyNextCirc.html"><tt>DUMMY_NEXT_C_OFFSET</tt></a>
 *     <li><a href="DummyPrev.html"><tt>DUMMY_PREV_OFFSET</tt></a>
 *     <li><a href="DummyPrevCirc.html"><tt>DUMMY_PREV_C_OFFSET</tt></a>

 *     </ul>
 * </ul>
 */

public abstract class Instruction
{
  /**
   * Execute this instruction in the specified runtime by changing the
   * runtime's state according to this instruction's operational semantics.
   */
  public void execute (Runtime runtime) throws Exception
    {
    }

  public boolean isReturn ()
    {
      return false;
    }

  protected String _name = null;

  protected final String setName (String name)
    {
      _name = name.intern();
      return _name;
    }

  public int hashCode ()
    {
      return name().hashCode();
    }     

  public boolean equals (Object object)
    {
      if (!(object instanceof Instruction))
        return false;

      Instruction other = (Instruction)object;

      return name() == other.name();
    }     

  public String name ()
    {
      if (_name == null)
        _name = Misc.simpleClassName(this);
      return _name;
    }

  public String toString ()
    {
      return name();
    }

  /**
   * Conveniences for dummy instructions...
   */

  private boolean _isDummy = false;
    
  public final boolean isDummy ()
    {
      return _isDummy;
    }

  public final void dummify ()
    {
      _isDummy = true;
    }

  public static final Instruction DUMMY_EQU     = new DummyEqual();
  public static final Instruction DUMMY_NEQ     = new DummyUnequal();
  public static final Instruction DUMMY_AND     = new DummyAnd();
  public static final Instruction DUMMY_OR      = new DummyOr();
  public static final Instruction DUMMY_STRCON  = new DummyStringConcat();
  public static final Instruction DUMMY_WRITE   = new DummyWrite();
  public static final Instruction DUMMY_SIZE    = new DummySize();
  public static final Instruction DUMMY_SET_ADD = new DummySetAdd();
  public static final Instruction DUMMY_SET_RMV = new DummySetRemove();
  public static final Instruction DUMMY_BELONGS = new DummyBelongs();
  public static final Instruction DUMMY_ORD     = new DummyOrd();
  public static final Instruction DUMMY_FIRST   = new DummyFirst();
  public static final Instruction DUMMY_LAST    = new DummyLast();
  public static final Instruction DUMMY_NEXT    = new DummyNext();
  public static final Instruction DUMMY_NEXT_C  = new DummyNextCirc();
  public static final Instruction DUMMY_PREV    = new DummyPrev();
  public static final Instruction DUMMY_PREV_C  = new DummyPrevCirc();
  public static final Instruction DUMMY_NEXT_OFFSET    = new DummyNextOffSet();
  public static final Instruction DUMMY_NEXT_C_OFFSET  = new DummyNextCircOffSet();
  public static final Instruction DUMMY_PREV_OFFSET    = new DummyPrevOffSet();
  public static final Instruction DUMMY_PREV_C_OFFSET  = new DummyPrevCircOffSet();
  
  /**
   * Handy names for some Built-in (<i>i.e.</i>, canonical) instructions.
   */

  public static final Instruction NO_OP = new NoOp();
  public static final Instruction END   = new End();
  public static final Instruction STOP  = new Stop();
  public static final Instruction STOP_ON_FALSE  = new StopOnFalse();

  public static final Instruction APPLY_HOM_I = new ApplyIntHomomorphism();
  public static final Instruction APPLY_HOM_R = new ApplyRealHomomorphism();
  public static final Instruction APPLY_HOM_O = new ApplyObjectHomomorphism();

  public static final Instruction APPLY_IP_HOM_I = new ApplyInPlaceIntHomomorphism();
  public static final Instruction APPLY_IP_HOM_R = new ApplyInPlaceRealHomomorphism();
  public static final Instruction APPLY_IP_HOM_O = new ApplyInPlaceObjectHomomorphism();

  public static final Instruction APPLY_FHOM_I = new ApplyIntFilterHomomorphism();
  public static final Instruction APPLY_FHOM_R = new ApplyRealFilterHomomorphism();
  public static final Instruction APPLY_FHOM_O = new ApplyObjectFilterHomomorphism();

  public static final Instruction APPLY_IP_FHOM_I = new ApplyInPlaceIntFilterHomomorphism();
  public static final Instruction APPLY_IP_FHOM_R = new ApplyInPlaceRealFilterHomomorphism();
  public static final Instruction APPLY_IP_FHOM_O = new ApplyInPlaceObjectFilterHomomorphism();

  public static final Instruction APPLY_COLL_I = new ApplyIntCollection();
  public static final Instruction APPLY_COLL_R = new ApplyRealCollection();
  public static final Instruction APPLY_COLL_O = new ApplyObjectCollection();

  public static final Instruction POP_I = new PopInt();
  public static final Instruction POP_R = new PopReal();
  public static final Instruction POP_O = new PopObject();

  public static final Instruction RETURN_VOID = new ReturnVoid();
  public static final Instruction RETURN_I    = new ReturnInt();
  public static final Instruction RETURN_R    = new ReturnReal();
  public static final Instruction RETURN_O    = new ReturnObject();

  public static final Instruction NL_RETURN_VOID = new NonlocalReturnVoid();
  public static final Instruction NL_RETURN_I    = new NonlocalReturnInt();
  public static final Instruction NL_RETURN_R    = new NonlocalReturnReal();
  public static final Instruction NL_RETURN_O    = new NonlocalReturnObject();

  public static final Instruction I_TO_R = new IntToReal();
  public static final Instruction R_TO_I = new RealToInt();

  public static final Instruction I_TO_O = new IntToObject();
  public static final Instruction O_TO_I = new ObjectToInt();

  public static final Instruction R_TO_O = new RealToObject();
  public static final Instruction O_TO_R = new ObjectToReal();

  public static final Instruction ARRAY_TO_MAP_I = new IntArrayToMap();
  public static final Instruction ARRAY_TO_MAP_R = new RealArrayToMap();
  public static final Instruction ARRAY_TO_MAP_O = new ObjectArrayToMap();

  public static final Instruction MAP_TO_ARRAY = new MapToArray();

  public static final Instruction CHECK_ARRAY_SIZE = new CheckArraySize();
  public static final Instruction RECONCILE_INDEXABLES = new  ReconcileIndexables();
  public static final Instruction ARRAY_INITIALIZE = new ArrayInitialize();

  public static final Instruction PUSH_ARRAY_I = new PushIntArray();
  public static final Instruction PUSH_ARRAY_R = new PushRealArray();
  public static final Instruction PUSH_ARRAY_O = new PushObjectArray();

  public static final Instruction MAKE_ARRAY_I = new MakeIntArray();
  public static final Instruction MAKE_ARRAY_R = new MakeRealArray();
  public static final Instruction MAKE_ARRAY_O = new MakeObjectArray();

  public static final Instruction FILL_ARRAY_IA = new FillArrayFromIntArray();
  public static final Instruction FILL_ARRAY_OA = new FillArrayFromObjectArray();
  public static final Instruction FILL_ARRAY_RA = new FillArrayFromRealArray();

  public static final Instruction FILL_ARRAY_IM = new FillArrayFromIntMap();
  public static final Instruction FILL_ARRAY_OM = new FillArrayFromObjectMap();
  public static final Instruction FILL_ARRAY_RM = new FillArrayFromRealMap();

  public static final Instruction GET_ARRAY_I = new GetIntArraySlot();
  public static final Instruction GET_ARRAY_O = new GetObjectArraySlot();
  public static final Instruction GET_ARRAY_R = new GetRealArraySlot();

  public static final Instruction SET_ARRAY_I = new SetIntArraySlot();
  public static final Instruction SET_ARRAY_O = new SetObjectArraySlot();
  public static final Instruction SET_ARRAY_R = new SetRealArraySlot();

  public static final Instruction PUSH_MAP_I = new PushIntMap();
  public static final Instruction PUSH_MAP_R = new PushRealMap();
  public static final Instruction PUSH_MAP_O = new PushObjectMap();

  public static final Instruction MAKE_MAP_I = new MakeIntMap();
  public static final Instruction MAKE_MAP_R = new MakeRealMap();
  public static final Instruction MAKE_MAP_O = new MakeObjectMap();

  public static final Instruction SHUFFLE_MAP_I = new ShuffleIntMap();
  public static final Instruction SHUFFLE_MAP_R = new ShuffleRealMap();
  public static final Instruction SHUFFLE_MAP_O = new ShuffleObjectMap();

  public static final Instruction FILL_MAP_IA = new FillMapFromIntArray();
  public static final Instruction FILL_MAP_OA = new FillMapFromObjectArray();
  public static final Instruction FILL_MAP_RA = new FillMapFromRealArray();

  public static final Instruction FILL_MAP_IM = new FillMapFromIntMap();
  public static final Instruction FILL_MAP_OM = new FillMapFromObjectMap();
  public static final Instruction FILL_MAP_RM = new FillMapFromRealMap();

  public static final Instruction GET_MAP_I = new GetIntMapSlot();
  public static final Instruction GET_MAP_O = new GetObjectMapSlot();
  public static final Instruction GET_MAP_R = new GetRealMapSlot();

  public static final Instruction SET_MAP_I = new SetIntMapSlot();
  public static final Instruction SET_MAP_O = new SetObjectMapSlot();
  public static final Instruction SET_MAP_R = new SetRealMapSlot();

  public static final Instruction GET_INT_INDEXED_MAP_I = new GetIntIndexedIntMapSlot();
  public static final Instruction GET_INT_INDEXED_MAP_O = new GetIntIndexedObjectMapSlot();
  public static final Instruction GET_INT_INDEXED_MAP_R = new GetIntIndexedRealMapSlot();

  public static final Instruction SET_INT_INDEXED_MAP_I = new SetIntIndexedIntMapSlot();
  public static final Instruction SET_INT_INDEXED_MAP_O = new SetIntIndexedObjectMapSlot();
  public static final Instruction SET_INT_INDEXED_MAP_R = new SetIntIndexedRealMapSlot();

  public static final Instruction PUSH_INT_RNG = new PushIntRange();
  public static final Instruction INT_RNG_LB   = new IntRangeLower();
  public static final Instruction INT_RNG_UB   = new IntRangeUpper();

  public static final Instruction PUSH_REAL_RNG = new PushRealRange();
  public static final Instruction REAL_RNG_LB   = new RealRangeLower();
  public static final Instruction REAL_RNG_UB   = new RealRangeUpper();

  public static final Instruction INDEXABLE_SIZE = new IndexableSize();
  public static final Instruction SET_COPY = new SetCopy();

  public static final Instruction PUSH_SET_I = new PushIntSet();
  public static final Instruction PUSH_SET_R = new PushRealSet();
  public static final Instruction PUSH_SET_O = new PushObjectSet();

  public static final Instruction MAKE_SET_I = new MakeIntSet();
  public static final Instruction MAKE_SET_R = new MakeRealSet();
  public static final Instruction MAKE_SET_O = new MakeObjectSet();

  public static final Instruction SET_ADD_I = new IntSetAdd();
  public static final Instruction SET_ADD_R = new RealSetAdd();
  public static final Instruction SET_ADD_O = new ObjectSetAdd();

  public static final Instruction SET_RMV_I = new IntSetRemove();
  public static final Instruction SET_RMV_R = new RealSetRemove();
  public static final Instruction SET_RMV_O = new ObjectSetRemove();

  public static final Instruction BELONGS_I = new BelongsInt();
  public static final Instruction BELONGS_R = new BelongsReal();
  public static final Instruction BELONGS_O = new BelongsObject();

  public static final Instruction ORD_I = new OrdInt();
  public static final Instruction ORD_R = new OrdReal();
  public static final Instruction ORD_O = new OrdObject();

  public static final Instruction FIRST_I = new FirstInt();
  public static final Instruction FIRST_R = new FirstReal();
  public static final Instruction FIRST_O = new FirstObject();

  public static final Instruction LAST_I = new LastInt();
  public static final Instruction LAST_R = new LastReal();
  public static final Instruction LAST_O = new LastObject();

  public static final Instruction NEXT_I = new NextInt();
  public static final Instruction NEXT_R = new NextReal();
  public static final Instruction NEXT_O = new NextObject();

  public static final Instruction NEXT_C_I = new NextIntCirc();
  public static final Instruction NEXT_C_R = new NextRealCirc();
  public static final Instruction NEXT_C_O = new NextObjectCirc();

  public static final Instruction NEXT_I_OFFSET = new NextIntOffSet();
  public static final Instruction NEXT_R_OFFSET = new NextRealOffSet();
  public static final Instruction NEXT_O_OFFSET = new NextObjectOffSet();

  public static final Instruction NEXT_C_I_OFFSET = new NextIntCircOffSet();
  public static final Instruction NEXT_C_R_OFFSET = new NextRealCircOffSet();
  public static final Instruction NEXT_C_O_OFFSET = new NextObjectCircOffSet();

  public static final Instruction PREV_I = new PrevInt();
  public static final Instruction PREV_R = new PrevReal();
  public static final Instruction PREV_O = new PrevObject();

  public static final Instruction PREV_C_I = new PrevIntCirc();
  public static final Instruction PREV_C_R = new PrevRealCirc();
  public static final Instruction PREV_C_O = new PrevObjectCirc();
  
  public static final Instruction PREV_I_OFFSET = new PrevIntOffSet();
  public static final Instruction PREV_R_OFFSET = new PrevRealOffSet();
  public static final Instruction PREV_O_OFFSET = new PrevObjectOffSet();

  public static final Instruction PREV_C_I_OFFSET = new PrevIntCircOffSet();
  public static final Instruction PREV_C_R_OFFSET = new PrevRealCircOffSet();
  public static final Instruction PREV_C_O_OFFSET = new PrevObjectCircOffSet();

  public static final Instruction SUBSET = new Subset();

  public static final Instruction UNION = new Union();
  public static final Instruction INTER = new Intersection();
  public static final Instruction XNION = new ExclusiveUnion();
  public static final Instruction SDIFF = new SetDifference();

  public static final Instruction D_UNION_1 = new DestructiveUnion1();
  public static final Instruction D_INTER_1 = new DestructiveIntersection1();
  public static final Instruction D_XNION_1 = new DestructiveExclusiveUnion1();
  public static final Instruction D_UNION_2 = new DestructiveUnion2();
  public static final Instruction D_INTER_2 = new DestructiveIntersection2();
  public static final Instruction D_XNION_2 = new DestructiveExclusiveUnion2();
  public static final Instruction D_SDIFF  =  new DestructiveSetDifference();

  public static final Instruction ADD_II = new AddIntInt();
  public static final Instruction ADD_IR = new AddIntReal();
  public static final Instruction ADD_RI = new AddRealInt();
  public static final Instruction ADD_RR = new AddRealReal();

  public static final Instruction MINUS_I = new MinusInt();
  public static final Instruction MINUS_R = new MinusReal();

  public static final Instruction SUB_II = new SubIntInt();
  public static final Instruction SUB_IR = new SubIntReal();
  public static final Instruction SUB_RI = new SubRealInt();
  public static final Instruction SUB_RR = new SubRealReal();

  public static final Instruction MUL_II = new MulIntInt();
  public static final Instruction MUL_IR = new MulIntReal();
  public static final Instruction MUL_RI = new MulRealInt();
  public static final Instruction MUL_RR = new MulRealReal();

  public static final Instruction DIV_II = new DivIntInt();
  public static final Instruction DIV_IR = new DivIntReal();
  public static final Instruction DIV_RI = new DivRealInt();
  public static final Instruction DIV_RR = new DivRealReal();

  public static final Instruction MODULO = new Modulo();

  public static final Instruction ABS_I = new AbsInt();
  public static final Instruction ABS_R = new AbsReal();

  public static final Instruction MIN_II = new MinIntInt();
  public static final Instruction MIN_IR = new MinIntReal();
  public static final Instruction MIN_RI = new MinRealInt();
  public static final Instruction MIN_RR = new MinRealReal();

  public static final Instruction MAX_II = new MaxIntInt();
  public static final Instruction MAX_IR = new MaxIntReal();
  public static final Instruction MAX_RI = new MaxRealInt();
  public static final Instruction MAX_RR = new MaxRealReal();

  public static final Instruction SQRT   = new SquareRoot();
  public static final Instruction POWER  = new Power();
  public static final Instruction RANDOM = new Random();

  public static final Instruction EQU_II = new EqualInts();
  public static final Instruction EQU_RR = new EqualReals();
  public static final Instruction EQU_OO = new EqualObjects();

  public static final Instruction NEQ_II = new UnequalInts();
  public static final Instruction NEQ_RR = new UnequalReals();
  public static final Instruction NEQ_OO = new UnequalObjects();

  public static final Instruction NOT = new Not();

  public static final Instruction LST_II = new LessIntInt();
  public static final Instruction LST_IR = new LessIntReal();
  public static final Instruction LST_RI = new LessRealInt();
  public static final Instruction LST_RR = new LessRealReal();

  public static final Instruction LTE_II = new LessEqualIntInt();
  public static final Instruction LTE_IR = new LessEqualIntReal();
  public static final Instruction LTE_RI = new LessEqualRealInt();
  public static final Instruction LTE_RR = new LessEqualRealReal();

  public static final Instruction GRT_II = new GreaterIntInt();
  public static final Instruction GRT_IR = new GreaterIntReal();
  public static final Instruction GRT_RI = new GreaterRealInt();
  public static final Instruction GRT_RR = new GreaterRealReal();

  public static final Instruction GTE_II = new GreaterEqualIntInt();
  public static final Instruction GTE_IR = new GreaterEqualIntReal();
  public static final Instruction GTE_RI = new GreaterEqualRealInt();
  public static final Instruction GTE_RR = new GreaterEqualRealReal();

  public static final Instruction ARRAY_SIZE = new ArraySize();
  public static final Instruction MAP_SIZE   = new MapSize();
  public static final Instruction GET_INDEXABLE = new GetIndexable();

  public static final Instruction WRITE_R = new WriteReal();

  /**
   * Handy names for some oft used instructions.
   */

  public static final Instruction PUSH_VOID = NO_OP; // new PushValueInt(Runtime.VOID);
  public static final Instruction PUSH_FALSE = new PushValueInt(Runtime.FALSE);
  public static final Instruction PUSH_TRUE = new PushValueInt(Runtime.TRUE);
  public static final Instruction PUSH_BOXED_VOID = new PushValueObject(Runtime.BOXED_VOID);
  public static final Instruction PUSH_BOXED_FALSE = new PushValueObject(Runtime.BOXED_FALSE);
  public static final Instruction PUSH_BOXED_TRUE = new PushValueObject(Runtime.BOXED_TRUE);
  public static final Instruction PUSH_NULL = new PushValueObject(null);
  public static final Instruction PUSH_ZERO_I = new PushValueObject(RuntimeInt.ZERO);
  public static final Instruction PUSH_ZERO_R = new PushValueObject(RuntimeReal.ZERO);
  public static final Instruction PUSH_ONE = new PushValueObject(RuntimeInt.ONE);
  public static final Instruction PUSH_EMPTY_STR = new PushValueObject("");
  public static final Instruction PUSH_0_I = new PushValueInt(0);
  public static final Instruction PUSH_1_I = new PushValueInt(1);
  public static final Instruction PUSH_0_R = new PushValueReal(0.0);
}
