コード例 #1
0
  public void vizExportModule(Module module) {
    {
      VizInfo self = this;

      Logic.plLog(
          OntosaurusUtil.KWD_MEDIUM,
          Cons.cons(
              StringWrapper.wrapString("powerloom-viz: exporting module: "),
              Cons.cons(module, Stella.NIL)));
      {
        Object old$Module$000 = Stella.$MODULE$.get();
        Object old$Context$000 = Stella.$CONTEXT$.get();

        try {
          Native.setSpecial(Stella.$MODULE$, module);
          Native.setSpecial(Stella.$CONTEXT$, ((Module) (Stella.$MODULE$.get())));
          self.vizExportConcepts(module);

        } finally {
          Stella.$CONTEXT$.set(old$Context$000);
          Stella.$MODULE$.set(old$Module$000);
        }
      }
    }
  }
コード例 #2
0
  public boolean vizExcludedModuleP(Module module) {
    {
      VizInfo self = this;

      return (OntosaurusUtil.$VIZ_EXCLUDED_MODULES$.memberP(module)
          || (!Logic.logicModuleP(module)));
    }
  }
コード例 #3
0
  public void vizExportConcepts(Module module) {
    {
      VizInfo self = this;

      {
        Stella_Object concept = null;
        edu.isi.powerloom.PlIterator iter000 =
            edu.isi.powerloom.PLI.getConceptInstances(
                ((LogicObject) (Logic.getInstance(OntosaurusUtil.SGT_PL_KERNEL_KB_CONCEPT))),
                module,
                null);

        while (iter000.nextP()) {
          concept = iter000.value;
          if (Surrogate.subtypeOfP(
              Stella_Object.safePrimaryType(concept), OntosaurusUtil.SGT_LOGIC_LOGIC_OBJECT)) {
            {
              LogicObject concept000 = ((LogicObject) (concept));

              if ((concept000.homeModule() == module) && self.vizAllowedObjectP(concept000)) {
                self.vizExportConcept(concept000, module);
              }
            }
          } else {
            {
              OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

              stream000.nativeStream.print(
                  "viz-export-concepts: concept not handled: `" + concept + "'");
              throw ((StellaException)
                  (StellaException.newStellaException(stream000.theStringReader())
                      .fillInStackTrace()));
            }
          }
        }
      }
    }
  }
コード例 #4
0
  public Cons vizGetBinaryRelationsOf(LogicObject concept) {
    {
      VizInfo self = this;

      {
        MemoizationTable memoTable000 = null;
        Cons memoizedEntry000 = null;
        Stella_Object memoizedValue000 = null;

        if (Stella.$MEMOIZATION_ENABLEDp$) {
          memoTable000 =
              ((MemoizationTable)
                  (OntosaurusUtil
                      .SGT_ONTOSAURUS_M_VIZ_INFOdVIZ_GET_BINARY_RELATIONS_OF_MEMO_TABLE_000
                      .surrogateValue));
          if (memoTable000 == null) {
            Surrogate.initializeMemoizationTable(
                OntosaurusUtil.SGT_ONTOSAURUS_M_VIZ_INFOdVIZ_GET_BINARY_RELATIONS_OF_MEMO_TABLE_000,
                "(:MAX-VALUES 1000 :TIMESTAMPS (:META-KB-UPDATE))");
            memoTable000 =
                ((MemoizationTable)
                    (OntosaurusUtil
                        .SGT_ONTOSAURUS_M_VIZ_INFOdVIZ_GET_BINARY_RELATIONS_OF_MEMO_TABLE_000
                        .surrogateValue));
          }
          memoizedEntry000 =
              MruMemoizationTable.lookupMruMemoizedValue(
                  ((MruMemoizationTable) (memoTable000)),
                  concept,
                  ((Context) (Stella.$CONTEXT$.get())),
                  Stella.MEMOIZED_NULL_VALUE,
                  null,
                  -1);
          memoizedValue000 = memoizedEntry000.value;
        }
        if (memoizedValue000 != null) {
          if (memoizedValue000 == Stella.MEMOIZED_NULL_VALUE) {
            memoizedValue000 = null;
          }
        } else {
          memoizedValue000 =
              Logic.applyCachedRetrieve(
                  Cons.list$(
                      Cons.cons(
                          OntosaurusUtil.SYM_LOGIC_pRELATION,
                          Cons.cons(
                              OntosaurusUtil.SYM_ONTOSAURUS_pDOMAIN,
                              Cons.cons(Stella.NIL, Stella.NIL)))),
                  Cons.list$(
                      Cons.cons(
                          OntosaurusUtil.SYM_STELLA_AND,
                          Cons.cons(
                              Cons.list$(
                                  Cons.cons(
                                      OntosaurusUtil.SYM_PL_KERNEL_KB_NTH_DOMAIN,
                                      Cons.cons(
                                          OntosaurusUtil.SYM_LOGIC_pRELATION,
                                          Cons.cons(
                                              IntegerWrapper.wrapInteger(0),
                                              Cons.cons(
                                                  OntosaurusUtil.SYM_ONTOSAURUS_pDOMAIN,
                                                  Cons.cons(Stella.NIL, Stella.NIL)))))),
                              Cons.cons(
                                  Cons.list$(
                                      Cons.cons(
                                          OntosaurusUtil.SYM_ONTOSAURUS_BINARY_RELATION,
                                          Cons.cons(
                                              OntosaurusUtil.SYM_LOGIC_pRELATION,
                                              Cons.cons(Stella.NIL, Stella.NIL)))),
                                  Cons.cons(Stella.NIL, Stella.NIL))))),
                  Cons.consList(Cons.cons(null, Cons.cons(concept, Stella.NIL))),
                  Cons.consList(
                      Cons.cons(
                          OntosaurusUtil.KWD_SINGLETONSp,
                          Cons.cons(
                              Stella.TRUE_WRAPPER,
                              Cons.cons(
                                  OntosaurusUtil.KWD_INFERENCE_LEVEL,
                                  Cons.cons(OntosaurusUtil.KWD_SHALLOW, Stella.NIL))))),
                  OntosaurusUtil.SYM_ONTOSAURUS_M_VIZ_INFOdVIZ_GET_BINARY_RELATIONS_OF_QUERY_001,
                  new Object[2]);
          if (Stella.$MEMOIZATION_ENABLEDp$) {
            memoizedEntry000.value =
                ((memoizedValue000 == null) ? Stella.MEMOIZED_NULL_VALUE : memoizedValue000);
          }
        }
        {
          Cons value000 = ((Cons) (memoizedValue000));

          return (value000);
        }
      }
    }
  }