コード例 #1
0
  public void propagateFramePartialTruth(ControlFrame target) {
    {
      PartialMatchFrame source = this;

      {
        PartialMatchFrame targetpmf = target.partialMatchFrame;
        boolean flippolarityP = !(source.controlFrame.reversePolarityP == target.reversePolarityP);

        if (targetpmf == null) {
          if (flippolarityP) {
            targetpmf =
                ((PartialMatchFrame)
                    (Surrogate.createObject(
                        source.primaryType(),
                        Stella_Object.cons(
                            Logic.KWD_CONTROL_FRAME,
                            Stella_Object.cons(
                                target,
                                Stella_Object.cons(
                                    Logic.KWD_KIND,
                                    Stella_Object.cons(target.state, Stella.NIL)))))));
            targetpmf.parent = source.parent;
            targetpmf.child = source;
          } else {
            targetpmf = source;
          }
          target.partialMatchFrame = targetpmf;
        }
        if (flippolarityP) {
          targetpmf.positiveScore = 0 - source.positiveScore;
          targetpmf.negativeScore = source.positiveScore;
        } else {
          targetpmf.positiveScore = source.positiveScore;
          targetpmf.negativeScore = source.negativeScore;
        }
        KeyValueList.setDynamicSlotValue(
            ((QueryIterator) (Logic.$QUERYITERATOR$.get())).dynamicSlots,
            Logic.SYM_LOGIC_LATEST_POSITIVE_SCORE,
            FloatWrapper.wrapFloat(targetpmf.positiveScore),
            Stella.NULL_FLOAT_WRAPPER);
      }
    }
  }
コード例 #2
0
  /**
   * Collect all entries of <code>self</code> into a cons list of <code>_LkeyGLvalueG_</code> pairs
   * and return the result.
   *
   * @return Cons
   */
  public Cons consify() {
    {
      StellaHashTable self = this;

      {
        Cons result = Stella.NIL;

        {
          Stella_Object key = null;
          Stella_Object value = null;
          StellaHashTableIterator iter000 = ((StellaHashTableIterator) (self.allocateIterator()));
          Cons collect000 = null;

          while (iter000.nextP()) {
            key = iter000.key;
            value = iter000.value;
            if (collect000 == null) {
              {
                collect000 =
                    Stella_Object.cons(
                        Stella_Object.cons(key, Stella_Object.cons(value, Stella.NIL)), Stella.NIL);
                if (result == Stella.NIL) {
                  result = collect000;
                } else {
                  Cons.addConsToEndOfConsList(result, collect000);
                }
              }
            } else {
              {
                collect000.rest =
                    Stella_Object.cons(
                        Stella_Object.cons(key, Stella_Object.cons(value, Stella.NIL)), Stella.NIL);
                collect000 = collect000.rest;
              }
            }
          }
        }
        return (result);
      }
    }
  }