1 #include <portability.h>
87 switch (sym->common.symbol_type) {
116 if (ch !=
'*')
return ch;
131 cons *c, *first, *prev;
133 if (! sym_list)
return NIL;
137 sym_list = sym_list->
rest;
144 sym_list = sym_list->
rest;
161 sym_list = sym_list->
rest;
232 Bool *removed_impasse) {
243 *removed_goal =
TRUE;
246 *removed_impasse =
TRUE;
312 #define quickly_deallocate_test(thisAgent, t) { \
313 if (! test_is_blank_test(t)) { \
314 if (test_is_blank_or_equality_test(t)) { \
315 symbol_remove_ref (thisAgent, referent_of_equality_test(t)); \
317 deallocate_test (thisAgent, t); } } }
344 Bool already_a_conjunctive_test;
354 already_a_conjunctive_test =
FALSE;
360 if (! already_a_conjunctive_test) {
463 std::list<test> copy2;
465 copy2.push_back(static_cast<test>(c2->
first));
467 std::list<test>::iterator iter;
471 for(iter = copy2.begin(); iter != copy2.end(); ++iter)
478 if (iter == copy2.end())
538 strncpy (msg,
"production.c: Error: bad test type in hash_test\n",
BUFFER_MSG_SIZE);
554 #define NON_EQUAL_TEST_RETURN_VAL 0
570 return sym->common.hash_id;
578 #define CANONICAL_TEST_ORDER canonical_test
673 }
else if (test_order_1 == test_order_2 &&
714 Bool look_for_impasse) {
745 strncpy (msg,
"Internal error: can't find equality test in test\n",
BUFFER_MSG_SIZE);
757 strncpy (msg,
"Internal error: can't find equality test in test\n",
BUFFER_MSG_SIZE);
778 cond_list = cond_list->
next;
798 if (!cond)
return NIL;
802 switch (cond->
type) {
834 if (prev) prev->
next = New;
else *dest_top = New;
837 top_cond = top_cond->
next;
839 if (prev) prev->
next =
NIL;
else *dest_top =
NIL;
873 if (c1==c2)
return TRUE;
888 switch (cond->
type) {
891 result = (result << 24) | (result >> 8);
893 result = (result << 24) | (result >> 8);
900 result = (result << 24) | (result >> 8);
902 result = (result << 24) | (result >> 8);
910 result = (result << 24) | (result >> 8);
915 strncpy (msg,
"Internal error: bad cond type in hash_condition\n",
BUFFER_MSG_SIZE);
955 cons *c, *new_c, *prev_new_c;
968 prev_new_c->
rest = new_c;
988 actions = actions->
next;
1033 free_with_pool (&thisAgent->
not_pool, temp);
1101 if ((ident)->
id.tc_num != (tc))
1103 (ident)->
id.tc_num = (tc);
1105 push (thisAgent, (ident),(*(id_list)));
1116 if ((v)->var.tc_num != (tc))
1118 (v)->var.tc_num = (tc);
1119 if (var_list)
push (thisAgent, (v),(*(var_list)));
1129 next = id_list->
rest;
1142 next = var_list->
rest;
1192 for (c=cond_list; c!=
NIL; c=c->
next)
1261 for (c=cond_list; c!=
NIL; c=c->
next)
1321 for (a=actions; a!=
NIL; a=a->
next)
1429 Bool anything_changed;
1431 list *new_ids, *new_vars;
1442 anything_changed =
FALSE;
1448 anything_changed =
TRUE;
1450 if (! anything_changed)
break;
1491 action *actions_with_vars_to_avoid) {
1510 for (c=var_list; c!=
NIL; c=c->
rest)
1516 #define GENERATE_NEW_VARIABLE_BUFFER_SIZE 200
1521 first_letter = *prefix;
1522 if (isalpha(first_letter)) {
1523 if (isupper(first_letter)) first_letter =
static_cast<char>(tolower(first_letter));
1568 Bool reorder_nccs) {
1581 if (!
reorder_lhs (thisAgent, lhs_top, lhs_bottom, reorder_nccs))
return NIL;
1585 print( thisAgent,
"ungrounded LTI in production\n" );
1589 #ifdef DO_COMPILE_TIME_O_SUPPORT_CALCS
1591 #ifdef LIST_COMPILE_TIME_O_SUPPORT_FAILURES
1592 for (a = *rhs_top; a!=
NIL; a=a->
next)
1608 print (thisAgent,
"Internal error: make_production called with name %s\n",
1610 print (thisAgent,
"for which a production already exists\n");
1656 strncpy (msg,
"Internal error: deallocating prod. that still has inst's\n",
BUFFER_MSG_SIZE);
1687 if (print_sharp_sign)
print (thisAgent,
"#");
1695 Bool print_sharp_sign) {
1706 Bool print_sharp_sign) {
1711 static_cast<byte>(i),