Changes for 1.17 (2020-12-28) New header files. * Added the new header file `sig.h' with declarations related to signal identifiers. It contains the declarations of `qsmm_sig_t' type and QSMM_SIG_INVALID and QSMM_SIG_MAX macros moved there from the header file `qsmm.h'. The header file `qsmm.h' includes the header file `sig.h'. * The new type `qsmm_ssig_t' declared in the header file `sig.h' is for creating signed integer variables holding signal identifiers or the numbers of signals. The range of allowed values for this type always includes (-QSMM_SIG_MAX-1..QSMM_SIG_MAX+1) and QSMM_SIG_INVALID. * Changed the definition of QSMM_SIG_MAX macro to make value QSMM_SIG_MAX+1 be in the range of `qsmm_sig_t' and `qsmm_ssig_t' datatypes and not equal to QSMM_SIG_INVALID. This change was necessary for the ability to use those datatypes to hold the numbers of signals. Such a number is equal to QSMM_SIG_MAX+1 if it includes all possible signals in the range (0..QSMM_SIG_MAX). Besides that, the new definition of QSMM_SIG_MAX may be necessary for passing signal ranges to API functions where the upper bound of a range can be equal to a maximum value allowed by the range plus 1. The value of QSMM_SIG_MAX+1 may not exceed SIZE_MAX. * Changed the definition of QSMM_SIG_INVALID macro to provide that: (1) the datatypes `qsmm_sig_t' and `qsmm_ssig_t' can hold its value; (2) its value does not lie in the range (0..QSMM_SIG_MAX+1) of `qsmm_sig_t' datatype; (3) its value does not lie in the range (-QSMM_SIG_MAX-1..QSMM_SIG_MAX+1) of `qsmm_ssig_t' datatype. The value of QSMM_SIG_INVALID may not exceed SIZE_MAX. * The changes made for the definitions of QSMM_SIG_MAX and QSMM_SIG_INVALID macros now make it possible to define the `qsmm_sig_t' and `qsmm_ssig_t' types as integer types where sizeof(qsmm_sig_t)== sizeof(qsmm_ssig_t), the type `qsmm_sig_t' is an unsigned integer type, and the type `qsmm_ssig_t' is a signed integer type. * Added the macros QSMM_FMT_PRI_SIG and QSMM_FMT_PRI_SSIG. They define conversion specifiers in format strings for `printf' and similar functions for printing values of `qsmm_sig_t' and `qsmm_ssig_t' types respectively. * Added the macro QSMM_FMT_SCN_SIG. It defines a conversion specifier in format strings for `scanf' and similar functions for scanning values of `qsmm_sig_t' type. * Added the new header file `handle.h'. It contains declarations related to object handle types. The header file `qsmm.h' includes the header file `handle.h'. * The new enumeration `qsmm_handle_e' declared in the header file `handle.h' contains elements for possible object handle types. * The header file `handle.h' contains the declarations of the object handle types `qsmm_t', `qsmm_actor_t', `qsmm_actpair_t', `qsmm_instr_t', `qsmm_iter_t', `qsmm_map_t', `qsmm_msg_t', `qsmm_msglist_t', `qsmm_prg_t', `qsmm_rng_t', `qsmm_storage_t', and `qsmm_vec_t' moved from the header file `qsmm.h' and the declaration of the object handle type `qsmm_side_t' moved from the header file `side.h'. * The new union `qsmm_handle_u' declared in the header file `handle.h' contains fields for all available object handle types. The union also contains the field `void *raw_p' for the raw pointer representation of an object handle. * The new structure `qsmm_handle_s' declared in the header file `handle.h' contains the type of an object handle and the handle itself. * Added the new header file `refe.h'. It contains declarations related to entity types and identifiers acting as entity references. The header file `qsmm.h' includes the header file `refe.h'. * The new structure `qsmm_instr_class_s' declared in the header file `refe.h' holds an instruction class descriptor. Instruction class descriptors identify instruction classes by the following sets of parameters: (1) an instruction meta-class name; (2) the text representation of instruction parameters; (3) the binary representation of instruction parameters; (4) an instruction class index. * The new enumeration `qsmm_lref_e' declared in the header file `refe.h' contains elements for possible local entity reference types and supersedes the enumeration `qsmm_ent_e' now marked as deprecated. The enumeration `qsmm_lref_e' contains the elements QSMM_LREF_INVALID, QSMM_LREF_INSTR_CLASS_SET, QSMM_LREF_INSTR_META_CLASS, QSMM_LREF_NODE, QSMM_LREF_PROB_VAR_CTRL, QSMM_LREF_PROB_VAR_OUT, QSMM_LREF_PROB_ARR_OUT, QSMM_LREF_INSTR_CLASS, QSMM_LREF_COUNT, and obsolete elements QSMM_ENT_* of `qsmm_ent_e' enumeration. * The new union `qsmm_lref_u' declared in the header file `refe.h' represents a local entity identifier and supersedes the union `qsmm_ent_u' now marked as deprecated. In comparison with the fields of `qsmm_ent_u' union, the union `qsmm_lref_u' contains the new field `qsmm_sig_t sig' for holding an entity identifier represented by a signal (QSMM_LREF_NODE type) and the new field `struct qsmm_instr_class_s instr_class' for holding an instruction class descriptor. The field `id' for holding an integer entity identifier becomes deprecated in `qsmm_lref_u'. * The new structure `qsmm_lref_s' declared in the header file `refe.h' holds a local entity reference consisting of its type and a local entity identifier. * Introduced the notion of global entity reference. A global entity reference uniquely identifies an entity in a process address space. * The new enumeration `qsmm_gref_e' declared in the header file `refe.h' contains elements for possible global entity reference types: invalid global entity reference (QSMM_GREF_INVALID), a pair consisting of the handle of an object and a local entity reference within the object (QSMM_GREF_HANDLE_LREF), or a triple consisting of the handle of an object, the local entity reference of a containing entity within the object, and a local entity reference within this container (QSMM_GREF_HANDLE_LREF2). * The new structure `qsmm_handle_lref_s' declared in the header file `refe.h' contains the handle of an object and a local entity reference within the object. * The new structure `qsmm_handle_lref2_s' declared in the header file `refe.h' holds the handle of an object, the local entity reference of a containing entity within the object, and a local entity reference within this container. * The new union `qsmm_gref_u' declared in the header file `refe.h' holds a global entity identifier that has the `struct qsmm_handle_lref_s' or `struct qsmm_handle_lref2_s' type. * The new structure `qsmm_gref_s' declared in the header file `refe.h' holds a global entity reference consisting of its type and a global entity identifier. * Added the new header file `err.h'. It contains the definitions of QSMM_ERR_* error codes and the declarations of `qsmm_err_handler_func_t' type, qsmm_except_* structures, and `qsmm_err_str' and `qsmm_except_dump' functions moved there from the header file `qsmm.h'. The header file `qsmm.h' includes the header file `err.h'. Changes for actor. * The new element QSMM_PROB_LEARNED of `qsmm_prob_e' enumeration supersedes the element QSMM_PROB_LEARNT now marked as deprecated. The word "learnt" is chiefly a British English word, and the project intents on using American English where possible. * Large actors now interpret the probability type QSMM_PROB_LEARNED as QSMM_PROB_AGGR. The calculation of QSMM_PROB_LEARNED probabilities was too expensive for large actors. * The new field `is_sig_out_p' of `qsmm_actor_sig_spec_mask_s' structure supersedes the now deprecated field `is_sig_ctrl_p' of this structure. The package source code and documentation now tend towards reducing the synonyms "action signal" and "controlled signal" to the common term "output signal". * The new type `qsmm_enum_ngram_callback_func_t' supersedes the type `qsmm_enum_ngrams_callback_func_t' now marked as deprecated. The old type is available as an alias. * The field `compat' of `qsmm_actor_desc_s' structure now has new supported value 2. This value is for use in new programs. * If the field `compat' of `qsmm_actor_desc_s' structure is equal to 2, the function `qsmm_actor_calc_action_prob' called with QSMM_PROB_FQ calculates probabilities based on actual numbers of output signals emitted by the actor. For lesser values of that field, the numbers of output signals used for the calculation can sometimes be less by 1 compared to their actual numbers. * If the field `compat' of `qsmm_actor_desc_s' structure is equal to 2, the function `qsmm_get_actor_sig_action' called for a small actor does not use a random number generator if only one signal has positive relative probability--that function simply selects this signal. * The actor now does not use functions from the MPFR library. Instead, it readjusts the logarithms of relative probabilities to a constant maximum logarithm value. Using this method, evaluating the exponents of large logarithm values never causes an overflow, and the exponents of significantly smaller logarithm values safely evaluate to 0. * A relative probability function QSMM_RELPROB_USER1 or QSMM_RELPROB_USER2 may now return NaN to indicate a failure to calculate a relative probability. In this case, the function `qsmm_actor_calc_action_prob' and the function `qsmm_get_actor_sig_action' called for a large actor return QSMM_ERR_CALLBACK. * The functions `qsmm_get_actor_profile_nsig_ctrl', `qsmm_actor_reg_sig_in', `qsmm_actor_reg_sig_action', `qsmm_actor_calc_action_prob', and `qsmm_get_actor_sig_action' now do not have special code paths for the condition "current discrete time is less than n-gram length". The buffer for an n-gram of signals from the event history should always contain a valid n-gram before calling those functions. * The function `qsmm_actor_create' now initializes the buffer for an n-gram of signals from the event history with minimum allowed signal identifiers. The fields `sig_spec_type', `sig_spec', and `range_sig_p' of `qsmm_actor_desc_s' structure define those minimum allowed identifiers. * The functions `qsmm_actor_profile_add', `qsmm_actor_remove_ngram', `qsmm_set_actor_ngram_profile', `qsmm_get_actor_profile_nsig_ctrl', `qsmm_actor_reg_sig_in', `qsmm_actor_reg_sig_action', `qsmm_actor_calc_action_prob', `qsmm_get_actor_sig_action', and `qsmm_actor_enum_ngrams' may now return QSMM_ERR_ILSEQ, for example, in case of failing to convert a multibyte string to a wide string when creating an error message for adding it to a storage message list. * The function `qsmm_actor_time_delta' now returns QSMM_ERR_INFIN (instead of QSMM_ERR_INVAL) if the sum of a current time value and a time increment is going to be infinite. * The function `qsmm_actor_spur_delta' now returns QSMM_ERR_INFIN (instead of QSMM_ERR_INVAL) if the sum of a current spur value and a spur increment is going to be infinite. * The function `qsmm_actor_profile_add' now returns QSMM_ERR_INFIN (instead of QSMM_ERR_INVAL) if the sum of output signal weights passed to it is infinite. * The function `qsmm_actor_reg_sig_in' now returns QSMM_ERR_INFIN if the automatic spur increment is infinite or the sum of spur increments for a cycle type is going to be infinite. * The function `qsmm_get_actor_sig_action' now returns QSMM_ERR_INFIN if the sum of relative probabilities of output signals of a small actor is infinite or the function `qsmm_actor_reg_sig_in' or `qsmm_get_actor_sig_action' implicitly called for a small actor associated with a large actor returns QSMM_ERR_INFIN. * The function `qsmm_actor_enum_ngrams' no longer returns QSMM_ERR_NOSYS. * The functions `qsmm_actor_reg_sig_in', `qsmm_actor_calc_action_prob', and `qsmm_get_actor_sig_action' called for a large actor now return QSMM_ERR_STATS if they detect an inconsistency in action choice state condition or cycle type statistics. The functions `qsmm_actor_calc_action_prob' and `qsmm_get_actor_sig_action' may also return QSMM_ERR_STATS if a user overrode built-in storage redirection functions set for a small actor associated with the large actor, and the new functions return unexpected results. * The functions `qsmm_get_actor_profile_nsig_ctrl' and `qsmm_actor_reg_sig_action' now return QSMM_ERR_STATS if they detect an inconsistency in action choice state condition. * The function `qsmm_actor_enum_ngrams' called for a large actor now returns QSMM_ERR_STATS if it detects an inconsistency in action choice state condition. * Actor API functions no longer attempt to clear storage message lists on function entry. To get the handle of failed storage of a large actor on QSMM_ERR_STORAGE, a program should find storage with a non-empty message list and rely on that all storage message lists were empty before calling an Actor API function. Changes for statistics storage. * Storage redirection functions of `qsmm_get_state_stats_func_t' type should now return a positive value if they modified the constant default condition (preinitialized condition) or 0 when they did not do that. * Storage redirection functions of `qsmm_get_cycle_stats_func_t' type should now return a positive value if they modified the constant default statistics (preinitialized statistics) or 0 when they did not do that. * Storage redirection functions of `qsmm_get_state_stats_func_t', `qsmm_get_cycle_stats_func_t', and `qsmm_get_cycle_next_func_t' types may now return QSMM_ERR_STATS if they detect inconsistent statistics on an action choice state or cycle type. * Storage redirection functions of `qsmm_get_state_stats_func_t', `qsmm_get_cycle_stats_func_t', and `qsmm_get_cycle_next_func_t' types may now return QSMM_ERR_ILSEQ, for example, in case of failing to convert a multibyte string to a wide string when creating an error message for adding it to the storage message list. * The function `qsmm_get_storage_state_stats' now returns a positive value if it retrieved the condition of a specified action choice state. If that condition did not exist, and the redirection function has not retrieved it, `qsmm_get_storage_state_stats' returns value 0 and the constant default condition. * The function `qsmm_get_storage_cycle_stats' now returns a positive value if it retrieved statistics on a specified cycle type. If that statistics did not exist, and the redirection function has not retrieved it, the function `qsmm_get_storage_cycle_stats' returns value 0 and the constant default statistics. * The function `qsmm_get_storage_cycle_stats' now returns QSMM_ERR_INVAL if a specified cycle type direction is invalid. * The function `qsmm_storage_enum_states' now returns QSMM_ERR_INVAL if n-gram prefix length is negative or greater than the length of n-grams supported by storage. * The function `qsmm_set_storage_cycle_stats' may now return QSMM_ERR_INVAL if cycle type direction or cycle type statistics are invalid. * The functions `qsmm_storage_remove_state', `qsmm_get_storage_state_stats', `qsmm_set_storage_state_stats', `qsmm_get_storage_cycle_stats', `qsmm_set_storage_cycle_stats', and `qsmm_get_storage_cycle_next' now return QSMM_ERR_INVAL if storage does not support n-grams with specified length. * The functions `qsmm_storage_remove_state', `qsmm_get_storage_state_stats', `qsmm_set_storage_state_stats', `qsmm_get_storage_cycle_stats', `qsmm_set_storage_cycle_stats', and `qsmm_get_storage_cycle_next' now always return QSMM_ERR_NGRAM if storage does not support holding information about a specified n-gram with valid length. * The function `qsmm_get_storage_state_stats' now returns QSMM_ERR_STATS if it detects an inconsistency in action choice state condition. * The function `qsmm_set_storage_state_stats' now returns QSMM_ERR_STATS (instead of QSMM_ERR_INVAL) if it detects an inconsistency in action choice state condition. * The function `qsmm_get_storage_cycle_stats' now returns QSMM_ERR_STATS if it detects an inconsistency in cycle type statistics. * The function `qsmm_set_storage_cycle_stats' now returns QSMM_ERR_STATS (instead of QSMM_ERR_INVAL) if it detects an inconsistency in cycle type statistics. * The functions `qsmm_storage_enum_states', `qsmm_get_storage_state_stats', `qsmm_set_storage_state_stats', `qsmm_get_storage_cycle_stats', `qsmm_set_storage_cycle_stats', and `qsmm_get_storage_cycle_next' may now return QSMM_ERR_ILSEQ, for example, in case of failing to convert a multibyte string to a wide string when creating an error message for adding it to the storage message list. * Added the function type `qsmm_update_cycle_stats_func_t' for a hook called on updating statistics for a cycle type by the function `qsmm_set_storage_cycle_stats'. The hook has access to current statistics for the cycle type and to new statistics that should replace the current statistics. The hook can report errors QSMM_ERR_STORAGE, QSMM_ERR_NOMEM, QSMM_ERR_ILSEQ, and QSMM_ERR_STATS, return zero to copy the new statistics over the old statistics, or return a positive value to skip this copying. * Added the function `qsmm_set_storage_cycle_update_hook' for setting a hook `qsmm_update_cycle_stats_func_t' and its user parameter for a storage handle. The hook might track statistics updated for cycle types and make an actor keep and use only latest statistics over a particular time period. * Added the function `qsmm_get_storage_cycle_update_hook' for retrieving a hook `qsmm_update_cycle_stats_func_t' and its user parameter previously set for a storage handle. * The type `qsmm_enum_state_callback_func_t' supersedes the type `qsmm_enum_states_callback_func_t' now marked as deprecated. The old type is available as an alias. Changes for multinode model. * The function `qsmm_create' now does not return QSMM_ERR_INVAL if the pointer to a model handle it should set is NULL. Instead, that function creates a multinode model, destroys it straight away, and returns 0. This behavior makes it possible to check the correctness of a model descriptor without creating a multinode model or check that sufficient memory is available for creating a model. * If the field `is_large_opt' or `is_determ_opt' of `qsmm_desc_s' structure is non-zero, the function `qsmm_create' creates a model as if the field `dont_use_instr_class_weights' of this structure was non-zero. * The field `compat' of `qsmm_desc_s' structure now has new supported value 2. This value changes the behavior of `qsmm_get_nnode' function, makes consistent incrementing discrete time by the environment state identification engine and instruction emitting engine, corrects calculating relative probabilities with the type QSMM_RELPROB_BUILTIN1 by those engines, and turns on optimized setting instruction classes weights. * In optimized mode of setting instruction classes weights, the function `qsmm_node_call_default' sets all output signal weights for the instruction emitting engine in two cases only: just after transferring control to a node and just after returning control to the node. The functions `qsmm_set_instr_meta_class_weight', `qsmm_set_instr_class_weight', and `qsmm_set_instr_class_weight_by_name_f' update the weight of an individual output signal of the instruction emitting engine if the identifier of a currently executed node is equal to the identifier of a node passed to those functions. * If the field `compat' of `qsmm_desc_s' structure specified when creating a model is equal to 2, and the environment state identification engine or the instruction emitting engine uses the relative probability function QSMM_RELPROB_BUILTIN1, that function computes relative probabilities always independently of the number of nodes in the model and its look-ahead signal segment length. * If the field `compat' of `qsmm_desc_s' structure specified when creating a model is equal to 2, the environment state identification engine increments discrete time regardless whether or not the choice of a new state is deterministic, and the instruction emitting engine increments discrete time regardless whether or not the choice of an instruction is deterministic. The purpose of this simplified approach is to make model behavior well-defined for deterministic output signal choices. * The function `qsmm_get_nnode' now returns `qsmm_sig_t' instead of `int' as the number of nodes in a model. If the field `compat' of `qsmm_desc_s' structure specified when creating the model is equal to 2, that function returns the actual number of existing nodes in the model. If that field is less than 2, `qsmm_get_nnode' returns a maximum value among the maximum identifier of a node created so far and a maximum identifier reserved by the function `qsmm_node_reserve'. * The function `qsmm_get_ent_type_by_name' now returns the type `enum qsmm_lref_e' instead of the deprecated type `enum qsmm_ent_e'. * The function `qsmm_enum_ent' now has the argument `ent_type' of `enum qsmm_lref_e' type instead of the deprecated type `enum qsmm_ent_e'. * The function pointer type `qsmm_enum_ent_callback_func_t' has two changed arguments: the `enum qsmm_lref_e lref_type' argument instead of `enum qsmm_ent_e ent_type' argument referencing the deprecated enumeration `qsmm_ent_e' and the `const union qsmm_lref_u *lref_p' argument instead of `const union qsmm_ent_u *ent_p' argument referencing the deprecated union `qsmm_ent_u'. * Added the macro QSMM_EXCEPT_NOTFOUND for passing as a bitmask via the `flags' argument to some functions taking that argument. This bitmask causes reporting QSMM_ERR_NOTFOUND if a requested entity not found rather than signaling this error condition via output arguments of those functions. * Added the macro QSMM_EXCEPT_TYPE for passing as a bitmask via the `flags' argument to some functions taking that argument. This bitmask causes reporting QSMM_ERR_TYPE if a requested entity has an inappropriate type rather than signaling this error condition via output arguments of those functions. * Added the macro QSMM_EXCEPT_ALL equal to (QSMM_EXCEPT_NOTFOUND| QSMM_EXCEPT_TYPE) for passing as a bitmask via the argument `flags' to some functions taking that argument to enable calling a model error handler for all errors those functions can report. Otherwise, those functions report some error conditions via special values of their output arguments rather than by raising exceptions. * The new function `qsmm_get_instr_class_set_sz_v2' supersedes the function `qsmm_get_instr_class_set_sz' now marked as deprecated. That new function returns the number of instruction classes in an instruction class set via the pointer to a variable of `qsmm_sig_t' type instead of returning a number of `int' type. Additionally, the new function returns 2 if the instruction class set contains multiple instruction classes, 1 if the instruction class set contains a single instruction class, or 0 if the instruction class set is empty. * The function `qsmm_get_instr_class_set_sz_v2' has the argument `flags'. That argument can specify a bitmask combined as a subset of the new macros QSMM_EXCEPT_NOTFOUND and QSMM_EXCEPT_TYPE (or the new macro QSMM_EXCEPT_ALL combining both of them). * On passing the bitmask QSMM_EXCEPT_NOTFOUND to the function `qsmm_get_instr_class_set_sz_v2', if a specified instruction class set name is not the name of an existing entity, that function reports QSMM_ERR_NOTFOUND. Otherwise, that function reports this error condition by returning 0 and the number of instruction classes equal to QSMM_SIG_INVALID. * On passing the bitmask QSMM_EXCEPT_TYPE to the function `qsmm_get_instr_class_set_sz_v2', if a specified instruction class set name is the name of an existing entity, and this entity is not an instruction class set, that function reports QSMM_ERR_TYPE. Otherwise, that function reports this error condition by returning 0 and the number of instruction classes equal to QSMM_SIG_INVALID. * The new function `qsmm_reg_instr_class_v2' supersedes the function `qsmm_reg_instr_class' now marked as deprecated. That new function takes an instruction meta-class name as the first argument and an instruction class set name as the second argument instead of taking those arguments in reverse order. The function also uses the type `size_t' rather than `int' for the size of binary parameters of an instruction class and returns the index of a registered instruction class via the pointer to a variable of `qsmm_sig_t' type instead of returning an index of `int' type. * Added the macro QSMM_REG_INSTR_META_CLASS_PARAM to use instead of QSMM_REG_INSTR_META_CLASS macro. The latter macro becomes deprecated and is now an alias for the former macro. * Added the macro QSMM_REG_INSTR_CLASS_SET_PARAM to use instead of QSMM_REG_INSTR_CLASS_SET macro. The latter macro becomes deprecated and is now an alias for the former macro. * The macros QSMM_REG_INSTR_CLASS and QSMM_REG_INSTR_CLASS_PARAM now call the function `qsmm_reg_instr_class_v2' instead of the deprecated function `qsmm_reg_instr_class', so they do not return the index of a registered instruction class on successful completion. Those macros return a negative error code on failure. * The new function `qsmm_get_instr_class_noutcome_v2' supersedes the function `qsmm_get_instr_class_noutcome' now marked as deprecated. That new function takes an instruction class index of `qsmm_sig_t' type instead of `int' type and returns the number of instruction class outcomes via the pointer to a variable of `qsmm_sig_t' type instead of returning a number of `int' type. The new function returns 2 if that number is greater than 1, 1 if that number is equal to 1, of 0 if that number is zero. * The new function `qsmm_get_instr_class_param_bin' supersedes the function `qsmm_get_instr_class_param' now marked as deprecated. That new function takes an instruction class index of `qsmm_sig_t' type instead of `int' type and returns the size of binary parameters of an instruction class via the pointer to a variable of `size_t' type instead of returning size of `int' type. The new function returns a positive value if the size is positive, or 0 if the size is zero. * The new functions `qsmm_find_instr_class_in_set_f_v2' and `qsmm_find_instr_class_in_set_fv_v2' supersede the functions `qsmm_find_instr_class_in_set_f' and `qsmm_find_instr_class_in_set_fv' respectively now marked as deprecated. Those new functions return the index of an instruction class via the pointer to a variable of `qsmm_sig_t' type instead of returning an index of `int' type. * The functions `qsmm_find_instr_class_in_set_f_v2' and `qsmm_find_instr_class_in_set_fv_v2' have the argument `flags'. That argument can specify a bitmask defined by the new macro QSMM_EXCEPT_NOTFOUND (or QSMM_EXCEPT_ALL). For this bitmask, if an instruction class not found in a specified existing instruction class set, those functions report QSMM_ERR_NOTFOUND. Otherwise, those functions report this error condition by returning instruction class index QSMM_SIG_INVALID. * The new function `qsmm_get_nstate_max_v2' supersedes the function `qsmm_get_nstate_max' now marked as deprecated. That new function returns the maximum number of states of a node class via the pointer to a variable of `qsmm_sig_t' type instead of returning a number of `int' type. * The function `qsmm_get_nstate_max_v2' has the argument `flags'. That argument can specify a bitmask combined as a subset of the new macros QSMM_EXCEPT_NOTFOUND and QSMM_EXCEPT_TYPE (or the new macro QSMM_EXCEPT_ALL combining both of them). * On passing the bitmask QSMM_EXCEPT_NOTFOUND to the function `qsmm_get_nstate_max_v2', if a specified node class name is not the name of an existing entity, that function reports QSMM_ERR_NOTFOUND. Otherwise, that function reports this error condition by returning the maximum number of states equal to QSMM_SIG_INVALID. * On passing the bitmask QSMM_EXCEPT_TYPE to the function `qsmm_get_nstate_max_v2', if a specified node class name is the name of an existing entity, and this entity is not a node class, that function reports QSMM_ERR_TYPE. Otherwise, that function reports this error condition by returning the maximum number of states equal to QSMM_SIG_INVALID. * The function `qsmm_set_nstate_max' now takes the argument `nstate' of `qsmm_sig_t' type instead of `int' type. * The functions `qsmm_get_instr_class_meta_name' and `qsmm_get_instr_class_name' now take the argument `instr_class' of `qsmm_sig_t' type instead of `int' type. * The function `qsmm_get_instr_class_param_str' now takes the argument `instr_class' of `qsmm_sig_t' type instead of `int' type. This function now returns a positive value if the text parameters of an instruction class have positive length, or 0 if those text parameters are the empty string. * The new function `qsmm_node_create_v2' supersedes the function `qsmm_node_create' now marked as deprecated. That new function takes or returns a node identifier via the pointer to a variable of `qsmm_sig_t' type instead of using the `int' type for node identifiers. * The macro QSMM_NODE_CREATE now calls the new function `qsmm_node_create_v2' instead of the deprecated function `qsmm_node_create' and does not return any value. * The new function `qsmm_get_node_nstate_v2' supersedes the function `qsmm_get_node_nstate' now marked as deprecated. That new function takes the argument `node' of `qsmm_sig_t' type instead of `int' type and returns the number of node states via the pointer to a variable of `qsmm_sig_t' type instead of returning a number of `int' type. * The function `qsmm_get_node_nstate_v2' has the argument `flags'. That argument can specify a bitmask defined by the new macro QSMM_EXCEPT_NOTFOUND (or QSMM_EXCEPT_ALL). For this bitmask, if a specified node not found, that function reports QSMM_ERR_NOTFOUND. Otherwise, that function reports this error condition by returning the number of node states equal to QSMM_SIG_INVALID. * The new functions `qsmm_mat_goto_dump_v2' and `qsmm_mat_action_dump_v2' supersede the functions `qsmm_mat_goto_dump' and `qsmm_mat_action_dump' now marked as deprecated. Those new functions take the argument `node' of `qsmm_sig_t' type instead of `int' type. The value QSMM_SIG_INVALID of that argument indicates to dump the state transition matrices or action emission matrices of all nodes of a multinode model. * Changed the type of `node' and `nstate' arguments of `qsmm_set_node_nstate' function from `int' to `qsmm_sig_t'. * Changed the type of `node' and `instr_class' arguments of `qsmm_get_instr_class_weight' and `qsmm_set_instr_class_weight' functions from `int' to `qsmm_sig_t'. * Changed the type of `node' argument of the functions `qsmm_get_node_class_name', `qsmm_get_node_fq', `qsmm_get_node_recurs', `qsmm_set_instr_meta_class_weight', `qsmm_get_instr_class_weight_by_name_f', `qsmm_set_instr_class_weight_by_name_f', `qsmm_get_node_ptr', `qsmm_set_node_ptr', `qsmm_node_call_default', and `qsmm_node_destroy' from `int' to `qsmm_sig_t'. * Changed the return type of `qsmm_get_stack_frame_sz' function from `int' to `size_t'. * Changed the type of `sz' argument of `qsmm_set_stack_frame_sz' function from `int' to `size_t'. * The functions `qsmm_node_call_default', `qsmm_node_destroy', `qsmm_mat_goto_dump_v2', and `qsmm_mat_action_dump_v2' may now report QSMM_ERR_ILSEQ, for example, in case of failing to convert a multibyte string to a wide string when creating an error message by a storage access function. * The functions `qsmm_node_call_default', `qsmm_mat_goto_dump_v2', and `qsmm_mat_action_dump_v2' now report QSMM_ERR_CALLBACK when a relative probability function QSMM_RELPROB_USER1 or QSMM_RELPROB_USER2 reports an error by returning NaN. * The function `qsmm_time_delta' now reports QSMM_ERR_INFIN (instead of QSMM_ERR_INVAL) if the sum of a current time value and a time increment is infinite. * The function `qsmm_spur_delta' now reports QSMM_ERR_INFIN (instead of QSMM_ERR_INVAL) if the sum of a current spur value and a spur increment is infinite. * The function `qsmm_node_call_default' now reports QSMM_ERR_INFIN if the automatic spur or the sum of relative probabilities of output signals or the sum of spur increments for a cycle type is going to become infinite. * The functions `qsmm_node_call_default', `qsmm_mat_goto_dump_v2', and `qsmm_mat_action_dump_v2' now report QSMM_ERR_STATS if they detect an inconsistency in action choice state condition or cycle type statistics. * The functions `qsmm_set_state' and `qsmm_get_action' now have the `deprecated' attribute, because both functions are applicable to C function node classes only, and they are deprecated. * A map with keys equal to node identifiers now holds model nodes. Previously, a contiguous array of pointers where the index of an array element was equal to a node identifier contained references to model nodes. This map reduces the amount of memory necessary for storing nodes with identifiers separated by large gaps of unused identifiers. An additional map of segments of allocated node identifiers makes it possible to quickly find the first unused node identifier when creating a new node. Changes for assembler program processing. * Changed the type of `node' argument of `qsmm_node_asm' and `qsmm_node_disasm' functions from `int' to `qsmm_sig_t'. * The new function `qsmm_get_prg_nstate_v2' supersedes the function `qsmm_get_prg_nstate' now marked as deprecated. That new function returns the number of states corresponding to an assembler program as the `qsmm_sig_t' type instead of `int' type. * The function `qsmm_get_prg_nstate_v2' additionally supports flags defined by the new macros QSMM_EXCEPT_NOTFOUND and QSMM_EXCEPT_TYPE (or the new macro QSMM_EXCEPT_ALL combining both of them). * On passing the bitmask QSMM_EXCEPT_NOTFOUND to the function `qsmm_get_prg_nstate_v2', if an instruction class set with a specified name not found, the function reports QSMM_ERR_NOTFOUND. Otherwise, that function reports this error condition by returning the number of states equal to QSMM_SIG_INVALID. * On passing the bitmask QSMM_EXCEPT_TYPE to the function `qsmm_get_prg_nstate_v2', if a specified instruction class set name is the name of an existing entity, and this entity is not an instruction class set, the function reports QSMM_EXCEPT_TYPE. Otherwise, that function reports this error condition by returning the number of states equal to QSMM_SIG_INVALID. * The functions `qsmm_get_prg_nstate_v2' and `qsmm_node_asm' now attempt to continue processing the memory representation of an assembler program after encountering errors in it and collect as much error and warning messages as possible. If at the end of execution of those functions the message list contains errors, the functions report QSMM_ERR_PRG. * The new warning the functions `qsmm_get_prg_nstate_v2' and `qsmm_node_asm' can generate: "instruction has no effect because jump probability is 0". * The functions `qsmm_get_prg_nstate_v2' and `qsmm_node_asm' generate the new error "infinite looping is possible" if a `joe', `jprob', or `case' instruction with a positive jump probability less than 1 (i.e. specifying a possible jump) can cause infinite looping. * The functions `qsmm_get_prg_nstate_v2' and `qsmm_node_asm' now extend the error message "user or mixed-type instruction expected" with the hint "you may need to consider all transfers of control to a label here" if an instruction that caused this error has one or more location labels defined. * The functions `qsmm_get_prg_nstate_v2' and `qsmm_node_asm' now do not print the index of a nested instruction but print the correct line number of this nested instruction in error and warning messages for instructions nested in `choice' instruction blocks. * Changed the type of `bufsz' argument of `qsmm_instr_str' function from `int' to `size_t'. * Changed the type of `label_idx' argument of `qsmm_get_instr_label' function from `int' to `size_t' because in certain cases the number of location labels of an instruction can be large. * Changed the type of `nested_idx' argument of `qsmm_get_instr_nested' function from `int' to `size_t' as the number of instructions nested in another instruction can be greater than QSMM_SIG_MAX. * Changed the return type of `qsmm_get_instr_nlabel' function from `int' to `size_t' because in certain cases the number of location labels of an instruction can be large. * Changed the return type of `qsmm_get_instr_nnested' function from `int' to `size_t' because the number of instructions nested in another instruction can be greater than QSMM_SIG_MAX. * Added the field `do_print_comment_below' to the structure `qsmm_dump_instr_desc_s'. This field enables or disables moving the comment of an instruction normally printed at the tail of its line to a line that follows the instruction if its text is too long and this comment is going to start at a greater column than a column specified in the field `col_comment'. However, the correct assignment of these moved comments to corresponding instructions while parsing an assembler program is not yet implemented. * Added the field `out_sz' to the structure `qsmm_dump_instr_desc_s'. The function `qsmm_instr_str' sets this field equal to the length of an instruction text printed. The type of this field is `size_t', so it can hold length greater than INT_MAX. If the length is less than INT_MAX, then that function also returns it. Otherwise, the function returns INT_MAX. * Changed the type of the fields `col_name', `col_param', `col_comment', `margin_right', `margin_right_param', `nline_comment_right', and `nline_param' of `qsmm_dump_instr_desc_s' structure from `int' to `long' as the types of column and line numbers in the source code are now changing to `long'. * The function `qsmm_node_disasm' now does not return QSMM_ERR_INVAL if the pointer to a program handle it should set is NULL. Instead, that function generates the memory representation of an assembler program, destroys it straight away, and returns 0. * Added the element QSMM_MAT_COUNT to the enumeration `qsmm_mat_e'. The element QSMM_MAT_COUNT is equal to the number of elements in the enumeration excluding that element. * The function `qsmm_reg_var_prob' now additionally returns the index of a registered controlled probability variable via the argument `size_t *var_idx_p'. It was the argument `int rez1' in previous package versions. If that index is less than INT_MAX, then the function returns it. Otherwise, the function returns INT_MAX. * Changed the type of `node' argument of the functions `qsmm_get_node_var_prob_out', `qsmm_get_node_var_prob_mat', `qsmm_get_node_array_prob_mat', `qsmm_get_node_var_prob_cycle', and `qsmm_enum_var_prob_out' from `int' to `qsmm_sig_t'. * The function `qsmm_get_node_var_prob_out' now returns 2 on success or 0 if a specified output probability variable is ambiguous. In the latter case, this function returns the probability value equal to -1. * The function `qsmm_get_node_var_prob_out' now calculates the values of output probability variables corresponding to multiple cells of the state transition matrix only if the requested probability type is QSMM_PROB_FQ or QSMM_PROB_PROFILE (assuming profile probabilities in those multiple cells are equal). If an output probability variable corresponds to multiple cells of the state transition matrix, and the requested probability type is not QSMM_PROB_FQ and QSMM_PROB_PROFILE, that function returns 1 and the probability value equal to -2. * The functions `qsmm_get_node_var_prob_cycle' and `qsmm_get_node_array_prob_cycle' now return INT_MAX if the number of aggregated cycle types is greater than INT_MAX. * The function `qsmm_get_node_array_prob_cycle' now takes the argument `node' of `qsmm_sig_t' type and the argument `offs' of `size_t' type instead of `int' type. * The function `qsmm_get_node_array_prob_out' now takes the argument `node' of `qsmm_sig_t' type and the arguments `from' and `to' of `size_t' type instead of `int' type. * The function `qsmm_get_node_array_prob_out' now returns INT_MAX if the number of elements in a segment of an output probabilities array is greater than INT_MAX. * The function `qsmm_get_node_state_by_name' now takes the argument `node' of `qsmm_sig_t' type instead of `int' type and the argument `state_p' of `qsmm_sig_t *' type instead of `int *' type. * Changed the type of `node_from' and `node_to' arguments of `qsmm_set_node_profile_source' and `qsmm_node_profile_clone' functions from `int' to `qsmm_sig_t'. * Changed the type of `node' and `state' arguments of `qsmm_get_node_state_name' function from `int' to `qsmm_sig_t'. * Changed the type of `node' argument of the functions `qsmm_node_unload', `qsmm_get_node_var_prob', `qsmm_set_node_var_prob', `qsmm_node_var_realize', and `qsmm_node_var_out_forget' from `int' to `qsmm_sig_t'. * The functions `qsmm_node_unload', `qsmm_get_prg_nstate', `qsmm_node_asm', `qsmm_node_disasm', `qsmm_get_node_var_prob_out', `qsmm_get_node_array_prob_out', `qsmm_get_node_var_prob_cycle', and `qsmm_get_node_array_prob_cycle' may now report QSMM_ERR_ILSEQ, for example, in case of failing to convert a multibyte string to a wide string when generating an error message by a storage access function. * The functions `qsmm_node_disasm', `qsmm_get_node_var_prob_out', and `qsmm_get_node_array_prob_out' now report QSMM_ERR_CALLBACK when a relative probability function QSMM_RELPROB_USER1 or QSMM_RELPROB_USER2 reports an error by returning NaN. * The functions `qsmm_node_asm', `qsmm_node_disasm', `qsmm_get_node_var_prob_out', `qsmm_get_node_array_prob_out', `qsmm_get_node_var_prob_cycle', `qsmm_get_node_array_prob_cycle', `qsmm_node_var_realize', `qsmm_set_node_profile_source', and `qsmm_node_profile_clone' now report QSMM_ERR_STATS if they detect an inconsistency in action choice state condition or cycle type statistics. * The assembler preprocessor now supports the placement of labels at columns greater than 1 after whitespace characters at the beginnings of lines. * Probabilities lists become deprecated because of obscure syntax of related assembler statements. The element QSMM_INSTR_CASELS of `qsmm_instr_e' enumeration, the field `margin_right_ls' of `qsmm_dump_prg_desc_s' structure, the functions `qsmm_get_instr_ls_name' and `qsmm_get_prg_ls_nprob', the assembler instruction `casels', and the assembler directives `probls' and `probeq' become deprecated too. Use `choice' instruction blocks instead of `casels' instructions. Changes for ordinary and sparse vectors. * Vectors now support up to SIZE_MAX elements. * Changed the return type of `qsmm_get_vec_npos' function from `int' to `size_t'. * Added the function `qsmm_get_vec_pos_by_idx_v2'. It supersedes the function `qsmm_get_vec_pos_by_idx' now marked as deprecated. The main differences between the new and old function are in the use of `size_t' type instead of `int' type for the argument `idx' and in the additional argument `size_t *pos_p' for returning an access position greater than INT_MAX. Besides that, the new function returns 0 on success, QSMM_ERR_INVAL if a specified value of `idx' argument is greater than or equal to the number of vector dimensions, or QSMM_ERR_NOTFOUND if the access position does not exist. * Added the function `qsmm_get_vec_elm_by_pos_d'. It supersedes the function `qsmm_get_vec_elm_by_pos' now marked as deprecated. The new function differs from the old one in the use of `size_t' type instead of `int' type for the argument `pos' and in the additional argument `size_t *idx_p' for returning an index greater than INT_MAX. Besides that, the new function returns 0 on success or QSMM_ERR_INVAL if a specified value of `pos' argument is greater than or equal to the number of access positions of the vector. Changes for message lists. * Added the element QSMM_MSG_COUNT to the end of `qsmm_msg_e' enumeration. This element is equal to the number of supported message categories. * Added the structure `qsmm_dump_msg_desc_s' representing a message dump descriptor. Its field `char is_compile' controls whether to prepend a program name to a message that has a file name associated and a line number assigned; programs behaving like compilers should not prepend a program name to such messages. The field `char do_print_type' controls whether to print the category of a message. The field `prg_name_p' can contain the program name. The field `fln_p' can contain the name of an associated file. The field `out_sz' contains the length of a generated message; the function `qsmm_msg_str' sets this field. * Added the function `qsmm_msg_str' for retrieving the text of a message. This function takes the pointer to a buffer for retrieved text, the size of this buffer, the handle of the message, and the address of an instance of `qsmm_dump_msg_desc_s' structure specifying the parameters of retrieving a message text. * Added the functions `qsmm_msg_append_f' and `qsmm_msg_append_fv' for appending formatted text to a message. The format arguments of those functions are similar to the format arguments of `printf' and `vprintf' functions respectively. If the functions fail to convert a multibyte string to a wide string according to a current locale, they return QSMM_ERR_ILSEQ. * Added the function `qsmm_msg_clone' for creating a copy of a message. * Added the function `qsmm_get_msg_type'. It returns the category of a message. That category is an element of `qsmm_msg_e' enumeration. * Changed the type of `lineno' argument of `qsmm_set_msg_lineno' function from `int' to `long', as line numbers can be large. * The functions `qsmm_msg_create_f' and `qsmm_msg_create_fv' now support passing the NULL pointer to a returned message handle and the NULL format string. The NULL pointer to a returned message handle means to create a message and destroy it straight away. The NULL format string means to create a message initially without a text. Those functions can now return QSMM_ERR_ILSEQ if they fail to convert a multibyte string to a wide string according to a current locale. * The function `qsmm_msglist_create' now supports passing the NULL pointer to a returned message list handle. Passing the NULL pointer means to create a message list and destroy it straight away. * Added the function `qsmm_get_msglist_msg'. It returns the handle of a message with a specified index contained in a message list. If the index is out of range, that function returns NULL. * Added the function `qsmm_get_msglist_sz_type'. It retrieves the number of messages belonging to a specified category in a message list. * The function `qsmm_get_msglist_sz' now returns `size_t' instead of `int' because message indices have the type `size_t'. * The function `qsmm_msglist_extend' now returns QSMM_ERR_INVAL if one of its message list handle arguments is NULL, or they are equal. * The function `qsmm_msglist_dump' now returns an `int' error code instead of `void'. The possible error codes are QSMM_ERR_NOMEM and QSMM_ERR_ILSEQ. To help upgrade existing applications, that function now has the attribute `warn_unused_result'. Changes for the Side API. * The function `qsmm_side_create' now supports specifying the NULL side name. The function `qsmm_get_side_name' returns NULL in this case. * The function `qsmm_side_recv' now supports messages with sizes up to SIZE_MAX. It takes the arguments `size_t sz' and `void *msgp' for the size and address of a message buffer. If the size of a retrieved message is less than INT_MAX, the function returns that size or returns INT_MAX otherwise. * The function `qsmm_side_send' now supports messages of sizes up to SIZE_MAX. It takes the arguments `size_t sz' and `const void *msgp' for the size and address of a message buffer. * The constants QSMM_ERR_* supersede the constants QSMM_SIDE_ERR_* now marked as deprecated. The macros for those deprecated constants now expand to the new macros for compatibility. * The common type `qsmm_err_handler_func_t' supersedes the type `qsmm_side_err_handler_func_t' now marked as deprecated. The deprecated type is available as an alias for the new type. The function `qsmm_set_side_err_handler' now takes an argument of `qsmm_err_handler_func_t' type. The function `qsmm_get_side_err_handler' now takes an argument of `qsmm_err_handler_func_t *' type. * The common structure `qsmm_except_s' supersedes the structure `qsmm_side_except_s' now marked as deprecated. The deprecated structure name is now a macro expanding to `qsmm_except_s' for compatibility. Changes for error handling. * The function `qsmm_except_dump' now dumps an exception as an object in JSON format. * The function `qsmm_err_str' now returns "?" if an error code passed to it is unknown. * The type `qsmm_err_handler_func_t' becomes generalized so that error handlers do not take a model handle as an argument. The argument for passing a model handle changed to `void *rez1'. For compatibility, when the function `qsmm_set_err_handler' assigned an error handler to a multinode model, the error handler receives the handle of this multinode model in the argument `rez1'. Modified structures qsmm_except_* now contain references to a multinode model associated with an exception. * Added error code QSMM_ERR_STATS. This error code means detecting an inconsistency in action choice state condition or cycle type statistics. This error code may also mean that storage redirection functions set for a small actor associated with a large actor return unexpected results. * Added error code QSMM_ERR_INFIN. This error code means that an arithmetic operation invoked while executing a function yielded an infinite result. * Added error code QSMM_ERR_PTHREAD. This error code means that a POSIX threads API function returned an error. * Replaced returning or raising QSMM_ERR_MNODE with returning or raising QSMM_ERR_UNTIMELY. The former error code becomes deprecated. * Error code QSMM_ERR_NOSYS renamed to QSMM_ERR_NOTSUP. The phrase "not supported" reflects the meaning of this error code more clearly than the description of reference error code ENOSYS, "function not implemented". The deprecated old constant is available as an alias. * Error code QSMM_ERR_NOSAMENC renamed to QSMM_ERR_NOEQCLAS. The new abbreviation for "not equal classes" seems more sound than the old abbreviation for "not same node classes". The deprecated old constant is available as an alias. * Renamed the structure `qsmm_except_nosamenc_s' to `qsmm_except_noeqclas_s'. The deprecated old name is available as an alias. Added the new fields `qsmm_sig_t node1', `qsmm_sig_t node2', and `qsmm_t model' to the structure `qsmm_except_noeqclas_s'. They hold the identifier of a node belonging to the first node class, the identifier of a node belonging to the second node class, and the handle of a multinode model containing the node classes. If `node1' and/or `node2' are equal to QSMM_SIG_INVALID, then respective node identifiers are not applicable to the exception. * The union `qsmm_except_u' contains the new field `struct qsmm_except_noeqclas_s noeqclas' superseding the currently deprecated field `struct qsmm_except_nosamenc_s nosamenc'. * Added the field `struct qsmm_gref_s gref' to the structure `qsmm_except_notfound_s'. That field supersedes the fields `type' and `ent' now marked as deprecated. The new field holds a global reference to a not found entity. * Added the field `struct qsmm_gref_s gref' to the structure `qsmm_except_type_s'. That field supersedes the fields `type' and `ent' now marked as deprecated. The new field holds a global reference to an entity with an invalid type. * Added the field `struct qsmm_gref_s gref' to the structure `qsmm_except_exist_s'. That field supersedes the fields `type' and `ent' now marked as deprecated. The new field holds a global reference to an already existing entity. * Added the fields `qsmm_sig_t noutcome', `qsmm_t model', and `struct qsmm_instr_class_s instr_class' to the structure `qsmm_except_outcome_s'. They hold the number of instruction outcomes, the handle of a multinode model, and an instruction class descriptor respectively. The added fields deprecate the fields `instr_meta_class_name' and `instr_param_str_p' because the instruction class descriptor now conveys this information. Changed the types of `node' and `outcome' fields from `int' to `qsmm_sig_t'. * Added the field `qsmm_t model' to the structure `qsmm_except_nodclass_s'. That field holds the handle of a multinode model containing the node that has an inappropriate class type. The type of `node' field changed from `int' to `qsmm_sig_t'. * Added the field `struct qsmm_gref_s gref' to the structure `qsmm_except_evthndlr_s'. That field supersedes the fields `type' and `ent' now marked as deprecated. The new field holds a global reference to an entity sending events processed by the event handler function. * Added the fields `qsmm_sig_t nnode_user' and `qsmm_t model' to the structure `qsmm_except_profsrcp_s'. The field `nnode_user' supersedes the field `int n_profile_user' now marked as deprecated. The field `model' holds the handle of a multinode model containing a node acting as a probability profile source for other nodes. * Added the field `qsmm_t model' to the structure `qsmm_except_profsrcu_s'. That field holds the handle of a multinode model containing nodes acting as a probability profile source and probability profile user. Changed the type of `node_provider' and `node_user' fields from `int' to `qsmm_sig_t'. * Added the field `qsmm_t model' to the structure `qsmm_except_psumgt1_s'. That field holds the handle of a multinode model containing a node with a state corresponding to the `choice' instruction block. Changed the type of `node' and `state' fields from `int' to `qsmm_sig_t'. Changes for sample programs. * Added the sample program `pic-guess'. It demonstrates learning a correlation between a boolean vector and a fractional value with the goal to find the vector maximizing the value. That value is a measure of similarity between an input boolean vector and a set of fixed boolean masks with various weights. The program attempts to uncover a fixed boolean mask with maximum weight representing the image of letter "A", "B", "C", "D", or "E". The program displays a currently guessed mask on the screen. Program execution finishes when the guessed mask becomes equal to a letter mask. * The sample program `langlearn-test' replaced with `topdown'. The new program is a probabilistic adaptive top-down parser for learning a grammar for an input token sequence using a template grammar supplied in regular expression format. The main learning mode is iterative determinization of this template grammar. * Added the auxiliary program `pcfg-generate-seq' for generating a random terminal symbol sequence according to a specified PCFG. Generating the random sequence was a function of `langlearn-test' program. The new program expands the initial nonterminal symbol of an input PCFG repeatedly and can terminate generating the sequence on a parse unit boundary. * Added the auxiliary program `pcfg-predict-eval' for calculating an upper bound on the number of predicted terminal symbols in a terminal symbol sequence generated according to a specified PCFG. This calculation was a function of `langlearn-test' program. The new program has improved performance and less memory consumption. * Added the auxiliary program `pcfg-reach' for debugging parsing and dumping a PCFG, removing unreachable productions from the PCFG, and simplifying it. * Added the auxiliary program `rege-asm' for debugging generating an assembler program that parses terminal symbol sequences according to a specified regular expression. The program also helps debug generating a context-free grammar for a regular expression. * Added the auxiliary program `rege-test' for debugging parsing and dumping a regular expression grammar, finding FIRST sets for it, generating assembler programs for the nonterminal symbols of this grammar, removing unreachable productions from it, and simplifying it. * Added the auxiliary program `least-sq-test' for debugging finding a square regression function for a set of points and finding a solution of this function for y=x. The sample program `topdown' uses least-squares regression to calculate the length of token history for keeping the frequencies of PCFG productions and statistics on cycle types. Limiting token history length improves grammar learning by trying more variants of parsing a token sequence. * Added the auxiliary script `mk-rg-vit.sh' for generating a template regular expression grammar for dividing a token sequence into words. This template grammar provides one-level Viterbi-style token sequence segmentation for probabilistic parsing. * The sample program `labyr2' now does not offer to display the gradients after showing movements of the agent in the labyrinth. Instead, it creates the files `labyr_0.asy' and `labyr_1.asy' describing a labyrinth configuration, the frequencies of visiting labyrinth cells, and gradient magnitudes at labyrinth cells for each of the four possible directions. The file `labyr_0.asy' describes the labyrinth before taking the gold. The file `labyr_1.asy' describes the labyrinth after taking the gold. The Asymptote tool should process both files to produce images based on their descriptions. Both files include the file `labyr.asy' containing function definitions. * The sample program `maze-asm' now does not disassemble a node and dump a disassembled program. * Renamed the assembler program file `prg_maze' to `maze.asm', added comments to that file, and replaced the deprecated `casels' instruction with a `choice' instruction block. * Corrected the content of an initial action choice state n-gram passed to an actor that tracks environment states in the sample program `test'. Because of this change, the output of `test' may differ from the output of previous versions of this program in some modes. * Temporarily removed the sample programs `apsamp', `fqtab', `fw-simple', `maze', `maze-mt', `optact', `optact-p', `optpath', `predict-test', and `tohuff-test'. * Removed the sample program `asmat'. Changes for the package building procedure. * The source code now requires a C99 compatible compiler. If such a compiler not found, the `configure' script terminates with an error message. * The package now uses the GNU Scientific Library by default. This library provides an implementation of a high-quality pseudo-random number generator. The option `--without-gsl' disables the use of this library by the package. * The source code for computing the relative probabilities of output signals now readjusts the logarithms of those probabilities. This readjustment eliminates the need to handle large exponents by the MPFR and GNU MP libraries. The package no longer depends on these libraries. * The list of compiler options for building the package now does not include the option `-Wall' by default. If necessary, a user may specify that option on the command line of `configure' script as a part of the value of CFLAGS variable. Main bug fixes. * Prevent calling a large actor representing the environment state identification engine to generate an output signal if the node probability profile specifies a deterministic state transition. * Prevent calling a large actor representing the instruction emitting engine to generate an output signal if the node probability profile specifies a deterministic instruction emission. * Prevent calling a large actor representing the instruction emitting engine to generate an output signal if the instruction class set contains a single instruction class (i.e. its emission is deterministic). This bug manifests itself when the node does not have a probability profile loaded.