Example #1
0
  @Override
  public boolean isEntailed(List<Clause> program, Literal query) {
    DLVWrapper dlv = initialize(program);
    String queryText = query.toString();
    String filter = ((NormalPredicate) query.getPredicate()).getName();
    try {
      return dlv.isEntailed(queryText, filter);
    } catch (DLVInvocationException e) {
      e.printStackTrace();
    }

    return false;
  }
Example #2
0
  @Override
  public List<Literal> query(List<Clause> program, Literal query) {

    //		for(Clause clause: program){
    //			System.out.println(clause);
    //		}

    DLVWrapper dlv = initialize(program);

    String queryText = query.toString();
    String filter = ((NormalPredicate) query.getPredicate()).getName();
    try {
      return dlv.querySM(queryText, filter);
    } catch (DLVInvocationException e) {
      e.printStackTrace();
    }
    return null;
  }