Package PrologPlusCG.prolog

Examples of PrologPlusCG.prolog.ExecException


      int niv2) throws ExecException {
    PrologDataIndexPair valIndLeft = env.unification.valueFromUnifStack(rla1, niv1);
    PrologDataIndexPair valIndRight = env.unification.valueFromUnifStack(rla2, niv2);
   
    if ((valIndLeft.pData == null) || (valIndRight.pData == null)) {
      throw new ExecException(
      "Error: for CG operations, relations should have specific values\nand not be free variables.");
    }
   
    // The two PrologData are particular relations
    // Les deux donn?es sont des relations particuliers
View Full Code Here


       Concept CEE2 = LocConcEq(E2, G2);
       if (CEE1 == null || CEE2 == null)
       throw new ExecException("Error: the entry concepts are not in the CG.");
       ********/
      if (!G1.m_vctConcepts.contains(E1)) {
        throw new ExecException(
        "Error: the first entry concept is not in the corresponding CG.");
      }
     
      if (!G2.m_vctConcepts.contains(E2)) {
        throw new ExecException(
        "Error: the second entry concept is not in the corresponding CG.");
      }
     
      bResult = matchWithBack(OperCG, E1, E2, null, null, G1, level1, G2,
          level2, resMatchCG.G3);
View Full Code Here

   
    if (C.m_pdType == null) {
      PrologDataIndexPair ValRef = env.unification.valueFromUnifStack(C.m_pdReferent, niv);
     
      if (ValRef.pData == null) {
        throw new ExecException(
        "Error: The concept to be added should be a specific concept, not a free variable.");
      } else {
        Concept cTmp = (Concept) ValRef.pData.data;
        Cp = cTmp.copyValue(niv);
      }
View Full Code Here

    boolean bResult = false;
    PrologDataIndexPair valIndLeft = env.unification.valueFromUnifStack(Type1, level1);
    PrologDataIndexPair valIndRight = env.unification.valueFromUnifStack(Type2, level2);
   
    if ((valIndLeft.pData == null) || (valIndRight.pData == null)) {
      throw new ExecException(
      "Error: for CG operations, types shoud have specific values.");
    } else {
      // The two PrologData are particular types (not free variables)
     
      Object pData1Left;
      Object pData1Right;
      pData1Left = valIndLeft.pData.data;
      pData1Right = valIndRight.pData.data;
     
      String sData1 = (String) pData1Left;
      String sData2 = (String) pData1Right;
     
      if (env.typeHierarchy == null) {
        throw new ExecException(
        "Error : No type hierarchy is specified (a CG operation needs it).");
      }
     
      switch (OperCG) {
      case e_maximalJoin: {
        if (sData1.equals(sData2)) {
          Type3 = sData1;
        } else {
          Type3 = env.typeHierarchy.maxComSubType(sData1,
              sData2);
        }
       
        bResult = (!Type3.equals("Absurd"));
      }
     
      break;
     
      case e_subsume: {
        bResult = env.typeHierarchy.isSubType(sData2, sData1);
        Type3 = sData2;
      }
     
      break;
     
      case e_subsumeWithoutResult:
      case e_partialContract:
      case e_completeContract:
        bResult = env.typeHierarchy.isSubType(sData2, sData1);
       
        break;
       
      case e_generalize: {
        if (sData1.equals(sData2)) {
          Type3 = sData1;
        } else {
          Type3 = env.typeHierarchy.minComSuperType(sData1,
              sData2);
        }
       
        bResult = (!Type3.equals("Universal") &&
            !Type3.equals("UNIVERSAL"));
      }
     
      break;
     
      default:
        throw new ExecException("Error : CG Operation not predefined.");
      }
     
      if (bResult && (Type3 != null)) {
        C3.m_pdType = new PrologData(uIdentifier, Type3);
      }
View Full Code Here

            (valIndLeft.pData.typeOfData != uString) &&
            (valIndLeft.pData.typeOfData != uSet)) ||
            ((valIndRight.pData.typeOfData != uIdentifier) &&
                (valIndRight.pData.typeOfData != uString) &&
                (valIndRight.pData.typeOfData != uSet))) {
          throw new ExecException("Error: the referent " +
              Ref1.data.toString() + " or " + Ref2.data.toString() +
          " is not an identifier or a string or a set.");
        } else if ((valIndLeft.pData.data instanceof String) &&
            (valIndRight.pData.data instanceof String)) {
          String sval1 = (String) valIndLeft.pData.data;
View Full Code Here

TOP

Related Classes of PrologPlusCG.prolog.ExecException

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.