Exemple #1
0
 public void modify(Mutable m) {
   if (m instanceof Proposition) {
     Proposition prop = (Proposition) m;
     if (prop.getName().equals(DEFAULT_VAL)) prop.setAtomName(REPLACEMENT);
   } else if (m instanceof FeatureStructure) {
     FeatureStructure fs = (FeatureStructure) m;
     for (Iterator<String> it = fs.getAttributes().iterator(); it.hasNext(); ) {
       String attr = it.next();
       Object val = fs.getValue(attr);
       if (val instanceof SimpleType && ((SimpleType) val).getName().equals(DEFAULT_VAL)) {
         fs.setFeature(attr, grammar.types.getSimpleType(REPLACEMENT));
       }
     }
   }
 }
Exemple #2
0
      public void check_precondition() {

        Player playerProponent = DialogueGame.this.getProponent();
        CommitmentStore commitmentStoreStore = playerProponent.getStore();
        Set setContent = commitmentStoreStore.getContent();
        Proposition propositionThesis = DialogueGame.this.thesis;
        MoveContent moveContentGetNegation = propositionThesis.getNegation();
        boolean bIncludes = CollectionUtilities.includes(setContent, moveContentGetNegation);
        Player playerOpponent = DialogueGame.this.getOpponent();
        CommitmentStore commitmentStoreStore0 = playerOpponent.getStore();
        Set setContent0 = commitmentStoreStore0.getContent();
        Proposition propositionThesis0 = DialogueGame.this.thesis;
        boolean bIncludes0 = CollectionUtilities.includes(setContent0, propositionThesis0);
        boolean bOr = bIncludes || bIncludes0;
        if (!bOr) {
          System.err.println("precondition 'precondition' failed for object " + DialogueGame.this);
        }
      }
Exemple #3
0
 public void modify(Mutable m) {
   if (!(m instanceof SatOp)) return;
   SatOp satop = (SatOp) m;
   if (!(satop.getArg() instanceof Proposition)) return;
   Proposition prop = (Proposition) satop.getArg();
   if (!prop.getName().equals(DEFAULT_VAL)) return;
   if (!(satop.getNominal() instanceof NominalVar)) return;
   NominalVar nv = (NominalVar) satop.getNominal();
   SimpleType st = nv.getType();
   // check equality
   if (st.equals(SEMCLASS)) return;
   // otherwise unify types, update nv
   try {
     SimpleType stU = (SimpleType) st.unify(SEMCLASS, null);
     nv.setType(stU);
   } catch (UnifyFailure uf) {
     throw new TypePropagationException(st, SEMCLASS);
   }
 }
  public void vizAddConceptRulesToDotNode(LogicObject concept, Module module) {
    {
      VizInfo self = this;

      {
        OutputStream stream = self.stream;
        boolean firstP = true;

        {
          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())));
            {
              Object old$PrettyprintlogicalformsP$000 = Logic.$PRETTYPRINTLOGICALFORMSp$.get();

              try {
                Native.setBooleanSpecial(Logic.$PRETTYPRINTLOGICALFORMSp$, true);
                {
                  Proposition rule = null;
                  edu.isi.powerloom.PlIterator iter000 =
                      edu.isi.powerloom.PLI.getRules(concept, module, null);

                  while (iter000.nextP()) {
                    rule = ((Proposition) (iter000.value));
                    if (!Proposition.simpleSubrelationPropositionP(rule)) {
                      if (!(firstP)) {
                        stream.nativeStream.print("\\l");
                      }
                      firstP = false;
                      stream.nativeStream.print(
                          OntosaurusUtil.vizDotString(Native.stringify(rule)));
                    }
                  }
                }

              } finally {
                Logic.$PRETTYPRINTLOGICALFORMSp$.set(old$PrettyprintlogicalformsP$000);
              }
            }

          } finally {
            Stella.$CONTEXT$.set(old$Context$000);
            Stella.$MODULE$.set(old$Module$000);
          }
        }
      }
    }
  }