public static void recordPrimitiveJustification(ControlFrame frame, Keyword lastmove) {
    if ((lastmove == Logic.KWD_UP_TRUE) ||
        (lastmove == Logic.KWD_UP_FAIL)) {
      { Keyword strategy = ((lastmove == Logic.KWD_UP_FAIL) ? Logic.KWD_FAILURE : frame.currentStrategy);
        Justification justification = null;

        if ((frame.justifications != null) &&
            (!frame.justifications.emptyP())) {
          justification = ((Justification)(frame.justifications.first()));
        }
        else if (frame.result != null) {
          if (((Justification)(KeyValueList.dynamicSlotValue(frame.result.dynamicSlots, Logic.SYM_LOGIC_JUSTIFICATION, null))) != null) {
            { PrimitiveStrategy self000 = PrimitiveStrategy.newPrimitiveStrategy();

              self000.strategy = strategy;
              self000.antecedents = Cons.cons(((Justification)(KeyValueList.dynamicSlotValue(frame.result.dynamicSlots, Logic.SYM_LOGIC_JUSTIFICATION, null))), Stella.NIL);
              justification = self000;
            }
          }
          else if ((frame.result.proposition != null) &&
              frame.result.proposition.forwardJustifications().nonEmptyP()) {
            justification = ((Justification)(frame.result.proposition.forwardJustifications().first()));
          }
        }
        else if ((frame.proposition != null) &&
            frame.proposition.forwardJustifications().nonEmptyP()) {
          System.out.println("RECORD-PRIMITIVE-JUSTIFICATION:  Test to see if clause needed.");
          justification = ((Justification)(frame.proposition.forwardJustifications().first()));
        }
        else {
        }
        if (justification == null) {
          { PrimitiveStrategy self001 = PrimitiveStrategy.newPrimitiveStrategy();

            self001.strategy = strategy;
            justification = self001;
          }
        }
        ControlFrame.recordGoalJustification(frame, justification);
      }
    }
    else {
    }
  }