diff --git a/Core/SoarKernel/src/decision_process/run_soar.cpp b/Core/SoarKernel/src/decision_process/run_soar.cpp index c22361a1f1..debe0d74d7 100644 --- a/Core/SoarKernel/src/decision_process/run_soar.cpp +++ b/Core/SoarKernel/src/decision_process/run_soar.cpp @@ -67,7 +67,6 @@ extern void determine_highest_active_production_level_in_stack_apply(agent* this void abort_with_fatal_error(agent* thisAgent, const char* msg) { - FILE* f; const char* warning = "Soar cannot recover from this error. \nData is still available for inspection, but may be corrupt.\nYou will have to restart Soar to run an agent.\nIf a log was open, it has been closed for safety."; Output_Manager::Get_OM().printa(thisAgent, msg); @@ -77,6 +76,7 @@ void abort_with_fatal_error(agent* thisAgent, const char* msg) xml_generate_error(thisAgent, msg); xml_generate_error(thisAgent, warning); +// FILE* f; // f = fopen("soar_crash_log.txt", "w"); // fprintf(f, "%s", msg); // fprintf(f, "%s", warning); diff --git a/Core/SoarKernel/src/explanation_memory/instantiation_record.cpp b/Core/SoarKernel/src/explanation_memory/instantiation_record.cpp index 0180b080de..229024f5c1 100644 --- a/Core/SoarKernel/src/explanation_memory/instantiation_record.cpp +++ b/Core/SoarKernel/src/explanation_memory/instantiation_record.cpp @@ -187,8 +187,6 @@ void instantiation_record::create_identity_paths(const inst_record_list* pInstPa if (lParentInst && (lParentInst->get_match_level() == match_level)) { lParentInst->create_identity_paths(path_to_base); - } else { - condition_record* lCond = (*it); } } } @@ -465,7 +463,6 @@ void instantiation_record::print_arch_inst_for_explanation_trace(bool isChunk, b condition_record* lCond; bool lInNegativeConditions = false; int lConditionCount = 0; - action* rhs; production* originalProduction = thisAgent->explanationMemory->get_production(original_productionID); /* Print header */ @@ -546,7 +543,6 @@ void instantiation_record::viz_wm_instantiation(visObjectType objectType) Output_Manager* outputManager = thisAgent->outputManager; GraphViz_Visualizer* visualizer = thisAgent->visualizationManager; - condition_record* lCond; if (conditions->empty()) { @@ -616,8 +612,6 @@ void instantiation_record::viz_et_instantiation(visObjectType objectType) int lConditionCount = 0; action* rhs; condition* top, *bottom, *currentNegativeCond, *current_cond, *print_cond; - test id_test_without_goal_test = NULL, id_test_without_goal_test2 = NULL; - bool removed_goal_test, removed_impasse_test; production* originalProduction = thisAgent->explanationMemory->get_production(original_productionID); if (!originalProduction || !originalProduction->p_node) @@ -646,7 +640,7 @@ void instantiation_record::viz_et_instantiation(visObjectType objectType) } outputManager->set_print_test_format(true, false); - thisAgent->visualizationManager->viz_object_start(production_name, instantiationID, objectType); + visualizer->viz_object_start(production_name, instantiationID, objectType); for (condition_record_list::iterator it = conditions->begin(); it != conditions->end(); it++) { @@ -654,12 +648,12 @@ void instantiation_record::viz_et_instantiation(visObjectType objectType) ++lConditionCount; if (lConditionCount > 1) { - thisAgent->visualizationManager->viz_endl(); + visualizer->viz_endl(); } if (!lInNegativeConditions && (lCond->type == CONJUNCTIVE_NEGATION_CONDITION)) { - thisAgent->visualizationManager->viz_NCC_start(); + visualizer->viz_NCC_start(); lInNegativeConditions = true; } @@ -685,7 +679,7 @@ void instantiation_record::viz_et_instantiation(visObjectType objectType) if (!currentNegativeCond) { current_cond = current_cond->next; - thisAgent->visualizationManager->viz_NCC_end(); + visualizer->viz_NCC_end(); lInNegativeConditions = false; } } else { @@ -698,11 +692,11 @@ void instantiation_record::viz_et_instantiation(visObjectType objectType) } if (lInNegativeConditions) { - thisAgent->visualizationManager->viz_NCC_end(); + visualizer->viz_NCC_end(); } else { - thisAgent->visualizationManager->viz_endl(); + visualizer->viz_endl(); } - thisAgent->visualizationManager->viz_seperator(); + visualizer->viz_seperator(); action_record::viz_action_list(thisAgent, actions, originalProduction, rhs, excised_production); @@ -710,7 +704,7 @@ void instantiation_record::viz_et_instantiation(visObjectType objectType) { deallocate_condition_list(thisAgent, top); } - thisAgent->visualizationManager->viz_object_end(objectType); + visualizer->viz_object_end(objectType); } } diff --git a/Core/SoarKernel/src/parsing/lexer.cpp b/Core/SoarKernel/src/parsing/lexer.cpp index 4201cbbc0c..ea43eede5a 100644 --- a/Core/SoarKernel/src/parsing/lexer.cpp +++ b/Core/SoarKernel/src/parsing/lexer.cpp @@ -808,7 +808,6 @@ void Lexer::addExec() Lexeme Lexer::get_lexeme_from_string (agent* thisAgent, const char* input) { Lexer lexer = Lexer(thisAgent, input); - const char * c; lexer.current_lexeme.lex_string = ""; lexer.consume_whitespace_and_comments(); diff --git a/Core/SoarKernel/src/reinforcement_learning/reinforcement_learning.cpp b/Core/SoarKernel/src/reinforcement_learning/reinforcement_learning.cpp index d2b7e66c7c..c52701b5f1 100644 --- a/Core/SoarKernel/src/reinforcement_learning/reinforcement_learning.cpp +++ b/Core/SoarKernel/src/reinforcement_learning/reinforcement_learning.cpp @@ -574,7 +574,6 @@ Symbol* rl_build_template_instantiation(agent* thisAgent, instantiation* my_temp } production* my_template = my_template_instance->prod; - char first_letter; double init_value = 0; condition* cond_top, *cond_bottom; @@ -988,7 +987,6 @@ void rl_perform_update(agent* thisAgent, double op_value, bool op_rl, Symbol* go } // Change value of rule - Symbol* lSym = rhs_value_to_symbol(prod->action_list->referent); deallocate_rhs_value(thisAgent, prod->action_list->referent); prod->action_list->referent = allocate_rhs_value_for_symbol_no_refcount(thisAgent, thisAgent->symbolManager->make_float_constant(new_combined), 0, 0); diff --git a/Core/SoarKernel/src/semantic_memory/smem_activation.cpp b/Core/SoarKernel/src/semantic_memory/smem_activation.cpp index 71ab251ee6..46c750836f 100644 --- a/Core/SoarKernel/src/semantic_memory/smem_activation.cpp +++ b/Core/SoarKernel/src/semantic_memory/smem_activation.cpp @@ -36,7 +36,6 @@ double SMem_Manager::lti_calc_base(uint64_t pLTI_ID, int64_t time_now, uint64_t // get all history SQL->history_get->bind_int(1, pLTI_ID); SQL->history_get->execute(); - bool prohibited = false; //int recent = 0; int64_t recent_time = 0; @@ -296,7 +295,6 @@ double SMem_Manager::lti_activate(uint64_t pLTI_ID, bool add_access, uint64_t nu double spread = 0; double modified_spread = 0; double new_base; - double additional; bool already_in_spread_table = false; std::unordered_map* spreaded_to = smem_spreaded_to; if (settings->spreading->get_value() == on && spreaded_to->find(pLTI_ID) != spreaded_to->end() && (*spreaded_to)[pLTI_ID] != 0) @@ -388,7 +386,7 @@ void SMem_Manager::child_spread(uint64_t lti_id, std::map::iterator edge_begin_it = edge_updates->begin(); std::list::iterator edge_it; - bool prohibited = false; + // bool prohibited = false; double edge_update_decay = thisAgent->SMem->settings->spreading_edge_update_factor->get_value();//.99; for (edge_it = edge_begin_it; edge_it != edge_updates->end(); ++edge_it) { @@ -485,7 +483,6 @@ void SMem_Manager::child_spread(uint64_t lti_id, std::map::iterator updates_begin = old_edge_weight_map_for_children.begin(); std::map::iterator updates_it; - double update_sum = 0; soar_module::sqlite_statement* update_edge = SQL->web_update_child_edge; for (updates_it = updates_begin; updates_it != old_edge_weight_map_for_children.end(); ++updates_it) {// args are edge weight, parent lti it, child lti id. @@ -700,12 +697,10 @@ void SMem_Manager::calc_spread_trajectories() attach(); soar_module::sqlite_statement* lti_all = SQL->lti_all; uint64_t lti_id; - int j = 0; //smem_delete_trajectory_indices();//This is for efficiency. //It's super inefficient to maintain the database indexing during this batch processing //It's way better to delete and rebuild. However, for testing and small DBs, it's fine. I'm testing... so... it's commented for now. // - scijones (Yell at me if you see this.) - double p1 = settings->spreading_continue_probability->get_value(); std::map>*> lti_trajectories; while (lti_all->execute() == soar_module::row) {//loop over all ltis. @@ -949,7 +944,7 @@ void SMem_Manager::calc_spread(std::set* current_candidates, bool do_m { SQL->act_lti_fake_get->bind_int(1,*recipient_it); SQL->act_lti_fake_get->execute(); - double spread = SQL->act_lti_fake_get->column_double(1);//This is the spread before changes. + // double spread = SQL->act_lti_fake_get->column_double(1);//This is the spread before changes. double prev_base = SQL->act_lti_fake_get->column_double(0); SQL->act_lti_fake_get->reinitialize(); SQL->act_lti_fake_delete->bind_int(1, *recipient_it); @@ -1047,7 +1042,7 @@ void SMem_Manager::calc_spread(std::set* current_candidates, bool do_m { SQL->act_lti_fake_get->bind_int(1,*candidate); SQL->act_lti_fake_get->execute(); - double spread = SQL->act_lti_fake_get->column_double(1);//This is the spread before changes. + // double spread = SQL->act_lti_fake_get->column_double(1);//This is the spread before changes. double prev_base = SQL->act_lti_fake_get->column_double(0); SQL->act_lti_fake_get->reinitialize(); SQL->act_lti_fake_delete->bind_int(1, *candidate); diff --git a/Core/SoarKernel/src/semantic_memory/smem_print.cpp b/Core/SoarKernel/src/semantic_memory/smem_print.cpp index 38d32f0776..49c82784d6 100644 --- a/Core/SoarKernel/src/semantic_memory/smem_print.cpp +++ b/Core/SoarKernel/src/semantic_memory/smem_print.cpp @@ -75,12 +75,6 @@ void SMem_Manager::create_store_set(ltm_set* store_set, uint64_t lti_id, uint64_ * scijones Sept 9, 2016. */ soar_module::sqlite_statement* expand_q = thisAgent->SMem->SQL->web_expand; - std::string attr_str; - int64_t attr_int; - double attr_double; - std::string val_str; - int64_t val_int; - double val_double; smem_vis_lti* new_lti; smem_vis_lti* parent_lti; @@ -224,8 +218,6 @@ id_set SMem_Manager::print_LTM(uint64_t pLTI_ID, double lti_act, std::string* re return_val->append("("); get_lti_name(pLTI_ID, *return_val); - bool possible_id, possible_ic, possible_fc, possible_sc, possible_var, is_rereadable; - // get direct children: attr_type, attr_hash, value_type, value_hash, value_letter, value_num, value_lti expand_q->bind_int(1, pLTI_ID); while (expand_q->execute() == soar_module::row) diff --git a/Core/SoarKernel/src/semantic_memory/smem_store.cpp b/Core/SoarKernel/src/semantic_memory/smem_store.cpp index f1bcafa82c..4cc532bcaf 100644 --- a/Core/SoarKernel/src/semantic_memory/smem_store.cpp +++ b/Core/SoarKernel/src/semantic_memory/smem_store.cpp @@ -617,7 +617,7 @@ void SMem_Manager::STM_to_LTM(Symbol* pSTI, smem_storage_type store_type, bool u wme_list* children = get_direct_augs_of_id(pSTI, tc); wme_list::iterator w; - uint64_t l_val_ID, l_LTM_ID = get_current_LTI_for_iSTI(pSTI, use_lookup, pOverwriteOldLinkToLTM); + uint64_t l_LTM_ID = get_current_LTI_for_iSTI(pSTI, use_lookup, pOverwriteOldLinkToLTM); // encode this level { diff --git a/Core/SoarKernel/src/soar_representation/instantiation.cpp b/Core/SoarKernel/src/soar_representation/instantiation.cpp index f9771c4734..d1a9c2ef1e 100644 --- a/Core/SoarKernel/src/soar_representation/instantiation.cpp +++ b/Core/SoarKernel/src/soar_representation/instantiation.cpp @@ -920,7 +920,6 @@ void add_deep_copy_prefs_to_inst(agent* thisAgent, preference* pref, instantiati deep_copy_wme* lNewDC_WME; goal_stack_level glbDeepCopyWMELevel = 0; - condition* prev_cond = NULL; preference* lPref; glbDeepCopyWMELevel = pref->id->id->level; diff --git a/Core/SoarKernel/src/soar_representation/production.cpp b/Core/SoarKernel/src/soar_representation/production.cpp index 66828f87ca..2092ba32d8 100644 --- a/Core/SoarKernel/src/soar_representation/production.cpp +++ b/Core/SoarKernel/src/soar_representation/production.cpp @@ -224,8 +224,6 @@ void add_symbol_to_tc(agent* thisAgent, Symbol* sym, tc_number tc, cons** id_lis void add_test_to_tc(agent* thisAgent, test t, tc_number tc, cons** id_list, cons** var_list) { - cons* c; - if (!t) return; add_symbol_to_tc(thisAgent, t->eq_test->data.referent, tc, id_list, var_list); diff --git a/Core/SoarKernel/src/soar_representation/production_reorder.cpp b/Core/SoarKernel/src/soar_representation/production_reorder.cpp index fa22a81771..2fad41bd75 100644 --- a/Core/SoarKernel/src/soar_representation/production_reorder.cpp +++ b/Core/SoarKernel/src/soar_representation/production_reorder.cpp @@ -812,12 +812,13 @@ cons* collect_root_variables(agent* thisAgent, for (auto it = new_vars_from_id_slot->begin(); it != new_vars_from_id_slot->end(); it++) { + chunk_element* lOldMatchedSym = (*it); found_goal_impasse_test = false; for (cond = cond_list; cond != NIL; cond = cond->next) { if (cond->type != POSITIVE_CONDITION) continue; - if ((cond->data.tests.id_test->eq_test->data.referent == (*it)->variable_sym) && + if ((cond->data.tests.id_test->eq_test->data.referent == lOldMatchedSym->variable_sym) && test_includes_goal_or_impasse_id_test(cond->data.tests.id_test, true, true)) { found_goal_impasse_test = true; @@ -826,21 +827,20 @@ cons* collect_root_variables(agent* thisAgent, } if (! found_goal_impasse_test) { - if (add_ungrounded && isNewUngroundedElement(ungrounded_syms, (*it)->instantiated_sym, (*it)->inst_identity)) + if (add_ungrounded && isNewUngroundedElement(ungrounded_syms, lOldMatchedSym->instantiated_sym, lOldMatchedSym->inst_identity)) { chunk_element* lNewUngroundedSym; thisAgent->memoryManager->allocate_with_pool(MP_chunk_element, &lNewUngroundedSym); - chunk_element* lOldMatchedSym = (*it); - lNewUngroundedSym->variable_sym = (*it)->variable_sym; - lNewUngroundedSym->instantiated_sym = (*it)->instantiated_sym; - lNewUngroundedSym->inst_identity = (*it)->inst_identity; + lNewUngroundedSym->variable_sym = lOldMatchedSym->variable_sym; + lNewUngroundedSym->instantiated_sym = lOldMatchedSym->instantiated_sym; + lNewUngroundedSym->inst_identity = lOldMatchedSym->inst_identity; ungrounded_syms->push_back(lNewUngroundedSym); } else { // TODO: we should reject the rule entirely, not just print a warning. sp {hello-world ( ^results )-->} if (thisAgent->outputManager->settings[OM_WARNINGS]) { thisAgent->outputManager->sprinta_sf(thisAgent, errorStr, "\nWarning: On the LHS of production %s, identifier %y is not connected to any goal or impasse.\n", - thisAgent->name_of_production_being_reordered, (*it)->variable_sym); + thisAgent->name_of_production_being_reordered, lOldMatchedSym->variable_sym); thisAgent->outputManager->printa(thisAgent, errorStr.c_str()); xml_generate_warning(thisAgent, errorStr.c_str()); } diff --git a/Core/SoarKernel/src/soar_representation/rhs_functions.cpp b/Core/SoarKernel/src/soar_representation/rhs_functions.cpp index 3b11fb46e5..adcb3e07d4 100644 --- a/Core/SoarKernel/src/soar_representation/rhs_functions.cpp +++ b/Core/SoarKernel/src/soar_representation/rhs_functions.cpp @@ -475,7 +475,7 @@ get_lti_id_rhs_function_code(agent* thisAgent, cons* args, void* /*user_data*/) Symbol* set_lti_id_rhs_function_code(agent* thisAgent, cons* args, void* /*user_data*/) { - Symbol* sym, *ltiIDSym, *returnSym; + Symbol* sym, *ltiIDSym; if (!args) { @@ -713,8 +713,6 @@ Symbol* trim_rhs_function_code(agent* thisAgent, cons* args, void* /*user_data*/ */ Symbol* string_rhs_function_code(agent* thisAgent, cons* args, void* /*user_data*/) { - char* symbol_to_convert; - if (!args) { thisAgent->outputManager->printa_sf(thisAgent, "%eError: 'string' function called with no arguments.\n"); @@ -1096,7 +1094,7 @@ Symbol* xmltowme_from_xml_internal(agent* thisAgent, ElementXML_Handle element, Symbol* value = xmltowme_get_value(thisAgent, child, linkMap, links); // add wme - wme* w = soar_module::add_module_wme(thisAgent, targetId, attribute, value, false); + soar_module::add_module_wme(thisAgent, targetId, attribute, value, false); const char* link = soarxml_GetAttribute(child, "link-id"); if (link != NULL) { @@ -1128,7 +1126,7 @@ Symbol* xmltowme_from_xml(agent* thisAgent, ElementXML_Handle element, Symbol* t auto targetIt = linkMap.find(std::string(link.linkTo)); if (targetIt != linkMap.end()) { - wme* w = soar_module::add_module_wme(thisAgent, link.from, link.attribute, targetIt->second, false); + soar_module::add_module_wme(thisAgent, link.from, link.attribute, targetIt->second, false); } else { diff --git a/Core/SoarKernel/src/soar_representation/symbol.cpp b/Core/SoarKernel/src/soar_representation/symbol.cpp index 09a0258ad7..2fc5686f3c 100644 --- a/Core/SoarKernel/src/soar_representation/symbol.cpp +++ b/Core/SoarKernel/src/soar_representation/symbol.cpp @@ -81,7 +81,6 @@ bool make_string_rereadable(std::string &pStr) { bool possible_id, possible_var, possible_sc, possible_ic, possible_fc; bool is_rereadable; - bool has_angle_bracket; const char* pCStr = pStr.c_str(); short pLength = pStr.size(); @@ -89,7 +88,7 @@ bool make_string_rereadable(std::string &pStr) soar::Lexer::determine_possible_symbol_types_for_string(pCStr, pLength, &possible_id, &possible_var, &possible_sc, &possible_ic, &possible_fc, &is_rereadable); -// has_angle_bracket = pCStr[0] == '<' || pCStr[pLength - 1] == '>'; + // bool has_angle_bracket = pCStr[0] == '<' || pCStr[pLength - 1] == '>'; if ((!possible_sc) || possible_var || possible_ic || possible_fc || possible_id || (!is_rereadable)) { diff --git a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/RemoteDialog.java b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/RemoteDialog.java index c2a907f88c..54a72ea6bb 100644 --- a/Java/Debugger/src/edu/umich/soar/debugger/dialogs/RemoteDialog.java +++ b/Java/Debugger/src/edu/umich/soar/debugger/dialogs/RemoteDialog.java @@ -1,12 +1,12 @@ /******************************************************************************************** * * RemoteDialog.java - * - * Description: - * + * + * Description: + * * Created on Mar 16, 2005 * @author Douglas Pearson - * + * * Developed by ThreePenny Software www.threepenny.net ********************************************************************************************/ package edu.umich.soar.debugger.dialogs; @@ -26,10 +26,10 @@ import edu.umich.soar.debugger.helpers.FormDataHelper; /************************************************************************ - * + * * Asks the user for an IP address and port to use to connect to a remote Soar * instance. - * + * ************************************************************************/ public class RemoteDialog extends BaseDialog { @@ -59,9 +59,9 @@ public int getPort() private MainFrame m_Frame; /******************************************************************************************** - * + * * Create a simple dialog asking the user for input (a single string). - * + * * @param parent * The parent for this dialog (we'll center the dialog within * this window) @@ -85,10 +85,10 @@ public static RemoteInfo showDialog(MainFrame frame, String title) } /******************************************************************************************** - * + * * Create the dialog -- the constructor is private because we use a static * method to build this. - * + * ********************************************************************************************/ private RemoteDialog(MainFrame frame, String title) { @@ -144,7 +144,7 @@ private RemoteDialog(MainFrame frame, String title) | SWT.READ_ONLY); help .setText("You can leave the IP address blank if you are connecting to a process on the same machine. The default port number for Soar is " - + Kernel.GetDefaultPort()); + + Kernel.GetDefaultPort() + "."); FormData form = FormDataHelper.anchorTop(0); group.setLayoutData(form); @@ -159,9 +159,9 @@ private RemoteDialog(MainFrame frame, String title) } /******************************************************************************************** - * + * * Close the dialog -- either successfully or cancelled. - * + * ********************************************************************************************/ protected void endDialog(boolean ok) {