public static void recordModusPonensJustification(ControlFrame frame, Keyword lastmove) {
    { ControlFrame antecedent = frame.result;

      if (lastmove == Logic.KWD_UP_TRUE) {
        { Proposition goal = ControlFrame.extractSubgoalOfFrame(frame);
          boolean reversepolarityP = frame.reversePolarityP;
          Keyword inferencerule = (reversepolarityP ? Logic.KWD_MODUS_TOLLENS : Logic.KWD_MODUS_PONENS);
          Proposition rule = ((Proposition)(KeyValueList.dynamicSlotValue(frame.dynamicSlots, Logic.SYM_LOGIC_ANTECEDENTS_RULE, null)));
          Proposition ruleconsequent = ((Description)(((inferencerule == Logic.KWD_MODUS_PONENS) ? (rule.arguments.theArray)[1] : (rule.arguments.theArray)[0]))).proposition;
          boolean invertedP = ruleconsequent.kind == Logic.KWD_NOT;

          { Justification self001 = Justification.newJustification();

            self001.inferenceRule = inferencerule;
            self001.proposition = goal;
            { PrimitiveStrategy self002 = PrimitiveStrategy.newPrimitiveStrategy();

              self002.strategy = Logic.KWD_SCAN_PROPOSITIONS;
              self002.proposition = rule;
              self002.truthValue = ((TruthValue)(Stella_Object.accessInContext(rule.truthValue, rule.homeContext, false)));
              self002.positiveScore = ((TruthValue)(Stella_Object.accessInContext(rule.truthValue, rule.homeContext, false))).positiveScore;
              self001.antecedents = Cons.cons(self002, Cons.cons(((Justification)(KeyValueList.dynamicSlotValue(antecedent.dynamicSlots, Logic.SYM_LOGIC_JUSTIFICATION, null))), Stella.NIL));
            }
            { Justification justification = self001;

              ControlFrame.recordGoalJustification(frame, justification);
              justification.reversePolarityP = (reversepolarityP ? (!invertedP) : invertedP);
            }
          }
        }
      }
      else {
      }
    }
  }