MCPcopy Create free account
hub / github.com/SoarGroup/Soar / explain_cond_list

Function explain_cond_list

Core/SoarKernel/src/explain.cpp:549–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

547 **************************************************************************/
548
549void explain_cond_list(agent* thisAgent, char* chunk_name)
550{
551
552 explain_chunk_str* chunk;
553 condition* cond, *ground;
554 int i;
555
556 chunk = find_chunk(thisAgent, thisAgent->explain_chunk_list, chunk_name);
557 /* AGR 564 In previous statement, current_agent(...) was added. 2-May-94 */
558
559 if (chunk == NULL)
560 {
561 return;
562 }
563
564 /* First print out the production in "normal" form */
565
566 print(thisAgent, "(sp %s\n ", chunk->name);
567 print_condition_list(thisAgent, chunk->conds, 2, false);
568 print(thisAgent, "\n-->\n ");
569 print_action_list(thisAgent, chunk->actions, 3, false);
570 print(thisAgent, ")\n\n");
571
572 /* Then list each condition and the associated "ground" WME */
573
574 i = 0;
575 ground = chunk->all_grounds;
576
577 for (cond = chunk->conds; cond != NIL; cond = cond->next)
578 {
579 i++;
580 print(thisAgent, " %2d : ", i);
581 print_condition(thisAgent, cond);
582 while (get_printer_output_column(thisAgent) < COLUMNS_PER_LINE - 40)
583 {
584 print(thisAgent, " ");
585 }
586
587 print(thisAgent, " Ground :");
588 print_condition(thisAgent, ground);
589 print(thisAgent, "\n");
590 ground = ground->next;
591 }
592}
593
594
595/***************************************************************************

Callers

nothing calls this directly

Calls 6

find_chunkFunction · 0.85
printFunction · 0.85
print_condition_listFunction · 0.85
print_action_listFunction · 0.85
print_conditionFunction · 0.85

Tested by

no test coverage detected