1 #include <portability.h>
75 add_to_os_tc (thisAgent, sym,flag);
150 if (referent!=excluded_sym)
164 Symbol *sym_excluded_from_value,
165 Symbol *match_state_to_exclude_test_of_the_operator_off_of) {
168 for ( ; conds!=
NIL; conds=conds->
next) {
169 switch (conds->
type) {
173 match_state_to_exclude_test_of_the_operator_off_of) &&
180 sym_excluded_from_value))
185 sym_excluded_from_value
186 , match_state_to_exclude_test_of_the_operator_off_of
216 if (sym == match_state)
276 Bool o_support,op_elab;
277 Bool operator_proposal;
278 char action_attr[50];
280 wme *lowest_goal_wme;
288 printf(
"\n in calculate_support_for_instantiation_preferences:");
305 operator_proposal =
FALSE;
310 "operator") ==
NIL) &&
314 operator_proposal =
TRUE;
322 if (operator_proposal ==
FALSE) {
345 lowest_goal_wme =
NIL;
347 for (pass = 0; pass != 2; pass++) {
357 if (lowest_goal_wme ==
NIL)
371 (w->
id == lowest_goal_wme->
id)) {
378 act !=
NIL ; act = act->
next) {
412 && (o_support ==
TRUE)) {
414 if (op_elab ==
TRUE ) {
419 print_with_symbols(thisAgent,
"\nWARNING: operator elaborations mixed with operator applications\nget o_support in prod %y", inst->
prod->
name);
422 add_to_growable_string(thisAgent, &gs,
"WARNING: operator elaborations mixed with operator applications\nget o_support in prod ");
429 print_with_symbols(thisAgent,
"\nWARNING: operator elaborations mixed with operator applications\nget i_support in prod %y", inst->
prod->
name);
432 add_to_growable_string(thisAgent, &gs,
"WARNING: operator elaborations mixed with operator applications\nget i_support in prod ");
492 Bool rule_2_or_3, anything_added;
503 for (c=lhs; c!=
NIL; c=c->
next) {
521 anything_added =
FALSE;
524 if ((pref->
id==match_state) &&
530 anything_added =
TRUE;
534 while (anything_added) {
535 anything_added =
FALSE;
540 anything_added =
TRUE;
552 if ((pref->
id==match_state) &&
587 if (referent==sym)
return YES;
604 if (temp==
YES)
return YES;
607 if (maybe_found)
return MAYBE;
632 for (c=lhs; c!=
NIL; c=c->
next) {
659 cons *c, *prev_c, *next_c;
670 for (c=roots; c!=
NIL; c=c->
rest)
678 if (num_root_goals > 1) {
679 for (cond=lhs; cond!=
NIL; cond=cond->
next) {
684 for (c=root_goals; c!=
NIL; c=next_c) {
688 if (prev_c) prev_c->
rest = next_c;
else root_goals = next_c;
691 if (num_root_goals==1)
break;
696 if (num_root_goals==1)
break;
702 if (num_root_goals==1)
732 for (c=lhs; c!=
NIL; c=c->
next) {
758 for ( ; conds!=
NIL; conds=conds->
next) {
759 switch (conds->
type) {
786 for ( ; conds!=
NIL; conds=conds->
next) {
787 switch (conds->
type) {
793 if (ynm ==
NO)
return TRUE;
819 Bool anything_changed;
826 anything_changed =
FALSE;
832 anything_changed =
TRUE;
839 anything_changed =
TRUE;
841 if (! anything_changed)
break;
857 Symbol *match_state, *match_operator;
858 yes_no_maybe lhs_oa_support, lhs_oc_support, lhs_om_support;
862 Bool operator_found, possible_operator_found;
871 operator_found =
FALSE;
872 possible_operator_found =
FALSE;
873 for (cond=lhs; cond!=
NIL; cond=cond->
next) {
876 if (ynm==
YES) { operator_found = possible_operator_found =
TRUE;
break; }
877 if (ynm==
MAYBE) possible_operator_found =
TRUE;
879 if (! operator_found) {
880 for (a=rhs; a!=
NIL; a=a->
next) {
886 { operator_found = possible_operator_found =
TRUE;
break; }
888 possible_operator_found =
TRUE;
890 possible_operator_found =
TRUE;
894 if (! possible_operator_found) {
895 for (a=rhs; a!=
NIL; a=a->
next) {
905 for (c=known_goals; c!=
NIL; c=c->
rest) {
906 for (a=rhs; a!=
NIL; a=a->
next) {
918 if (!match_state)
return;
926 if (possible_operator_found && !operator_found) {
927 possible_operator_found =
FALSE;
928 for (cond=lhs; cond!=
NIL; cond=cond->
next) {
933 { possible_operator_found =
TRUE;
break; }
935 if (! possible_operator_found) {
936 for (a=rhs; a!=
NIL; a=a->
next) {
945 (attr != match_state))
946 { possible_operator_found =
TRUE;
break; }
948 possible_operator_found =
TRUE;
break;
952 if (! possible_operator_found) {
960 lhs_oa_support =
MAYBE;
961 if (match_operator) {
966 lhs_oa_support =
YES;
970 lhs_oc_support =
MAYBE;
971 lhs_om_support =
MAYBE;
980 lhs_oc_support =
YES;
981 for (cond=lhs; cond!=
NIL; cond=cond->
next) {
987 lhs_om_support =
YES;
992 if (lhs_oa_support ==
YES) {
999 for (a=rhs; a!=
NIL; a=a->
next) {
1018 if (lhs_oc_support ==
YES) {
1021 for (a=rhs; a!=
NIL; a=a->
next) {
1037 for (a=rhs; a!=
NIL; a=a->
next) {
1056 printf(
"\n operator creation: setting a->support to I_SUPPORT");
1066 if (lhs_om_support ==
YES) {
1069 for (cond=lhs; cond!=
NIL; cond=cond->
next) {
1080 for (a=rhs; a!=
NIL; a=a->
next) {