Package PrologPlusCG.prolog

Examples of PrologPlusCG.prolog.PrologData


            }
           
            Relation Rp = new Relation();
           
            PrologDataIndexPair ValRel1 = env.unification.valueFromUnifStack(rel1.m_pdRelationName, niv1);
            Rp.m_pdRelationName = new PrologData(uIdentifier,ValRel1.pData.data);
            ValRel1 = null;
           
            if (BranchDirection == e_inComeBranch) {
              Rp.m_concSource = Ca3;
              Rp.m_concDestination = C3;
View Full Code Here


  // ------------------------------------------------------------------
  void addRel(int N, Concept CP, Relation R, int niv, Concept CF, CG Gt) {
    Relation Rp = new Relation();
    PrologDataIndexPair ValRel = env.unification.valueFromUnifStack(R.m_pdRelationName, niv);
    String sRel = (String) ValRel.pData.data;
    Rp.m_pdRelationName = new PrologData(uIdentifier, sRel);
   
    Rp.m_concSource = CP;
    Rp.m_concDestination = CF;
   
    CP.m_vctOutgoingRelations.addElement(Rp);
View Full Code Here

    case e_project: {
      C3 = new Concept(env);
     
      String Typ1 = (String) C1.m_pdType.data;
      String Typ2 = (String) C2.m_pdType.data;
      C3.m_pdType = new PrologData(uIdentifier,
          "match(" + Typ1 + "," + Typ2 + ")");
      C3.m_pdReferent = new PrologData(uIdentifier, "matchedReferent"); //(" + C1.GetRef() + "," + C2.GetRef() + ")";
    }
   
    break;
    }
   
View Full Code Here

      default:
        throw new ExecException("Error : CG Operation not predefined.");
      }
     
      if (bResult && (Type3 != null)) {
        C3.m_pdType = new PrologData(uIdentifier, Type3);
      }
    }
   
    return bResult;
  }
View Full Code Here

          PrologList setVal2 = (PrologList) valIndRight.pData.data;
          PrologList setVal3 = null;
         
          if (OperCG == e_maximalJoin) { // Determiner l'union
            setVal3 = env.compile.union(setVal1, setVal2);
            C3.m_pdReferent = new PrologData(uSet, setVal3);
            bResult = aUnifyCG.conform(C3.m_pdReferent, valIndLeft.index,
                (String) C3.m_pdType.data); // et si le type est une variable qui a une valeur..?      
          } else if (OperCG == e_generalize) { // Determiner l'intersection
            setVal3 = env.compile.intersection(setVal1, setVal2);
            C3.m_pdReferent = new PrologData(uSet, setVal3);
          } else if ((OperCG == e_subsume) ||
              (OperCG == e_subsumeWithoutResult) ||
              (OperCG == e_partialContract) ||
              (OperCG == e_completeContract)) { // Determiner inclusion
           
            if (env.compile.set1IsSubsetOfSet2(setVal1, setVal2)) {
              if (OperCG == e_subsume) {
                C3.m_pdReferent = valIndRight.pData.myCopy();
              }
            } else {
              bResult = false;
            }
          }
        } else if ((valIndLeft.pData.data instanceof String) &&
            (valIndRight.pData.data instanceof PrologList)) {
          // Traiter le cas ou l'un est un ref et l'autre un ensemble
          String sVal1 = (String) valIndLeft.pData.data;
          PrologList setVal2 = (PrologList) valIndRight.pData.data;
          PrologList setVal3 = null;
         
          if (OperCG == e_maximalJoin) {
            setVal3 = env.compile.union(valIndLeft.pData, setVal2);
            C3.m_pdReferent = new PrologData(uSet, setVal3);
            bResult = aUnifyCG.conform(C3.m_pdReferent, valIndLeft.index,
                (String) C3.m_pdType.data); // et si le type est une variable qui a une valeur..?         
          } else if (OperCG == e_generalize) { // Determiner l'intersection
           
            if (env.compile.hasString(sVal1, setVal2)) {
              C3.m_pdReferent = valIndLeft.pData.myCopy();
            } else {
              C3.m_pdReferent = null;
            }
          } else if ((OperCG == e_subsume) ||
              (OperCG == e_subsumeWithoutResult) ||
              (OperCG == e_partialContract) ||
              (OperCG == e_completeContract)) { // Determiner inclusion
           
            if (env.compile.hasString(sVal1, setVal2)) {
              if (OperCG == e_subsume) {
                C3.m_pdReferent = valIndRight.pData.myCopy();
              }
            } else {
              bResult = false;
            }
          }
        } else if ((valIndLeft.pData.data instanceof PrologList) &&
            (valIndRight.pData.data instanceof String)) {
          // Traiter le cas ou l'un est un ref et l'autre un ensemble
          PrologList setVal1 = (PrologList) valIndLeft.pData.data;
          String sVal2 = (String) valIndRight.pData.data;
          PrologList setVal3 = null;
         
          if (OperCG == e_maximalJoin) {
            setVal3 = env.compile.union(valIndRight.pData, setVal1);
            C3.m_pdReferent = new PrologData(uSet, setVal3);
            bResult = aUnifyCG.conform(C3.m_pdReferent, valIndLeft.index,
                (String) C3.m_pdType.data); // et si le type est une variable qui a une valeur..?             
          } else if (OperCG == e_generalize) { // Determiner l'intersection
           
            if (env.compile.hasString(sVal2, setVal1)) {
View Full Code Here

          operCGImb = null;
         
          if (bResult &&
              ((OperCG == e_maximalJoin) ||
                  (OperCG == e_subsume) || (OperCG == e_generalize))) {
            C3.m_pdValue = new PrologData(uCG, resMatchCG.G3);
          }
         
          resMatchCG = null;
        } else if (valuesAreEqual(valIndLeft.pData, valIndRight.pData)) {
          if ((OperCG == e_maximalJoin) || (OperCG == e_subsume) ||
              (OperCG == e_generalize)) {
            C3.m_pdValue = new PrologData(valIndLeft.pData.typeOfData,
                valIndRight.pData.data);
          }
        } else if (OperCG == e_generalize) {
          C3.m_pdValue = null;
        } else {
          bResult = false;
        }
      } else {
        switch (OperCG) {
        case e_maximalJoin: {
          if ((valIndLeft != null) && (valIndLeft.pData != null)) {
            C3.m_pdValue = new PrologData(valIndLeft.pData.typeOfData,
                valIndLeft.pData.data);
          } else if ((valIndRight != null) &&
              (valIndRight.pData != null)) {
            C3.m_pdValue = new PrologData(valIndRight.pData.typeOfData,
                valIndRight.pData.data);
          }
        }
        break;
       
        case e_subsume: {
          bResult = ((Val1 == null) || (valIndLeft.pData == null));
          C3.m_pdValue = new PrologData(valIndRight.pData.typeOfData,
              valIndRight.pData.data);
        }
        break;
       
        case e_subsumeWithoutResult:
View Full Code Here

        BRes = E.Var2.equals(sRef2);
      }
     
      if (BRes) {
        if ((E.Var3 != null) && !in(OperCG, setOpersId, 2)) {
          C3.m_pdReferent = new PrologData(uVariable, E.Var3);
        }
      }
    } else if (isCoreferent(Ref1) || isCoreferent(Ref2)) { // Il n'est pas localis?; il faut ajouter le couple, si au moins un des referents est une variable
      if (OperCG == e_subsume) {
        if ((sRef1 != null) && (sRef2 == null)) {
View Full Code Here

TOP

Related Classes of PrologPlusCG.prolog.PrologData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.