本文整理汇总了Java中de.learnlib.api.Query类的典型用法代码示例。如果您正苦于以下问题:Java Query类的具体用法?Java Query怎么用?Java Query使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Query类属于de.learnlib.api包,在下文中一共展示了Query类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processQueries
import de.learnlib.api.Query; //导入依赖的package包/类
@Override
public final void processQueries(
Collection<? extends Query<SymbolicMethodSymbol, Boolean>> clctn) {
ArrayList<Query<SymbolicMethodSymbol, Boolean>> queries = new ArrayList<>();
for (Query<SymbolicMethodSymbol, Boolean> q : clctn) {
boolean test = evaluateQuery(q);
if (!test) {
q.answer(false);
continue;
}
if (next == null) {
q.answer(true);
continue;
}
queries.add(q);
}
if (!queries.isEmpty()) {
next.processQueries(queries);
}
}
示例2: processQuery
import de.learnlib.api.Query; //导入依赖的package包/类
private void processQuery(
Query<SymbolicMethodSymbol, SymbolicQueryOutput> query) {
Word<SymbolicQueryOutput> out = getPotentialOutput(query.getInput());
int uniformIdx = getUniformIndex(out);
if (uniformIdx == 0) {
query.answer(SymbolicQueryOutput.OK);
return;
}
if (uniformIdx == out.length()) {
this.oracle.processQueries(Collections.singleton(query));
return;
}
Word<SymbolicMethodSymbol> prefix = query.getInput().prefix(uniformIdx);
DefaultQuery<SymbolicMethodSymbol, SymbolicQueryOutput> dQuery =
new DefaultQuery<>(prefix);
this.oracle.processQueries(Collections.singleton(dQuery));
query.answer(dQuery.getOutput());
}
示例3: processQueries
import de.learnlib.api.Query; //导入依赖的package包/类
@Override
public void processQueries(Collection<? extends Query<I, Word<D>>> queries) {
for (Query<I,Word<D>> q : queries) {
Word<D> output = answerQuery(q.getPrefix(), q.getSuffix());
q.answer(output);
}
}
示例4: processQueries
import de.learnlib.api.Query; //导入依赖的package包/类
@Override
public void processQueries(Collection<? extends Query<SymbolicMethodSymbol, SymbolicExecutionResult>> clctn) {
for (Query<SymbolicMethodSymbol, SymbolicExecutionResult> query : clctn) {
SymbolicExecutionResult result = processQuery(query.getInput());
query.answer(result);
}
}
示例5: processQueries
import de.learnlib.api.Query; //导入依赖的package包/类
@Override
public void processQueries(Collection<? extends
Query<SymbolicMethodSymbol, SymbolicQueryOutput>> clctn) {
for (Query<SymbolicMethodSymbol, SymbolicQueryOutput> query : clctn) {
if (termination.isDone()) {
throw new Terminate(termination);
}
this.oracle.processQueries(Collections.singleton(query));
}
}
示例6: processQueries
import de.learnlib.api.Query; //导入依赖的package包/类
@Override
public void processQueries(Collection<? extends Query<SymbolicMethodSymbol, SymbolicQueryOutput>> clctn) {
ArrayList<WrapperQuery> queries = new ArrayList<>();
for (Query<SymbolicMethodSymbol, SymbolicQueryOutput> q : clctn) {
queries.add(new WrapperQuery(q));
}
this.oracle.processQueries(queries);
}
示例7: processQueries
import de.learnlib.api.Query; //导入依赖的package包/类
@Override
public void processQueries(Collection<? extends
Query<SymbolicMethodSymbol, SymbolicQueryOutput>> clctn) {
for (Query<SymbolicMethodSymbol, SymbolicQueryOutput> query : clctn) {
DefaultQuery<SymbolicMethodSymbol, SymbolicQueryOutput> _query =
new DefaultQuery<>(query.getInput());
this.oracle.processQueries(Collections.singleton(_query));
if (!_query.getOutput().isUniform()) {
throw new RefinementNeeded(_query);
}
query.answer(_query.getOutput());
}
}
示例8: processQueries
import de.learnlib.api.Query; //导入依赖的package包/类
@Override
public void processQueries(
Collection<? extends
Query<SymbolicMethodSymbol, SymbolicExecutionResult>> clctn) {
for (Query<SymbolicMethodSymbol, SymbolicExecutionResult> query : clctn) {
processQuery(query);
}
}
示例9: processQuery
import de.learnlib.api.Query; //导入依赖的package包/类
private void processQuery(
Query<SymbolicMethodSymbol, SymbolicExecutionResult> query) {
ArrayList<Path> ok = new ArrayList<>();
ArrayList<Path> err = new ArrayList<>();
ArrayList<Path> dk = new ArrayList<>();
Collection<PathQuery> paths = PathUtil.explode(query.getInput(), inputs);
for (PathQuery q : paths) {
Path p = PathUtil.executeSymbolically(
q.getMethods(), q.getPaths(), inputs.getInitialValuation());
// TODO: maybe add model to path
if (!sat(p.getPathCondition())) {
continue;
}
switch (p.getState()) {
case OK:
ok.add(p);
break;
case ERROR:
err.add(p);
break;
case DONT_KNOW:
dk.add(p);
break;
}
}
query.answer(new SymbolicExecutionResult(ok, err, dk));
}
示例10: processQueries
import de.learnlib.api.Query; //导入依赖的package包/类
@Override
public void processQueries(Collection<? extends Query<SymbolicMethodSymbol,
SymbolicQueryOutput>> clctn) {
Collection<Query<SymbolicMethodSymbol, SymbolicQueryOutput>> lCol =
new ArrayList<>();
for (Query<SymbolicMethodSymbol, SymbolicQueryOutput> query : clctn) {
lCol.add(new LoggingQuery(query));
}
this.oracle.processQueries(lCol);
}
示例11: processQueries
import de.learnlib.api.Query; //导入依赖的package包/类
@Override
public void processQueries(
Collection<? extends
Query<SymbolicMethodSymbol, SymbolicQueryOutput>> clctn) {
for (Query<SymbolicMethodSymbol, SymbolicQueryOutput> q : clctn) {
processQuery(q);
}
}
示例12: processQuery
import de.learnlib.api.Query; //导入依赖的package包/类
private void processQuery(Query<SymbolicMethodSymbol,
SymbolicQueryOutput> q) {
String[] test = queryToString(q.getInput());
SymbolicQueryOutput result = table.getSimulatedResult(test);
if (result == null) {
DefaultQuery<SymbolicMethodSymbol, SymbolicQueryOutput> defq =
new DefaultQuery<>(q.getInput());
this.oracle.processQueries(Collections.singleton(defq));
result = defq.getOutput();
table.setResult(test, result);
}
q.answer(result);
}
示例13: processQuery
import de.learnlib.api.Query; //导入依赖的package包/类
private void processQuery(Query<SymbolicMethodSymbol,
SymbolicQueryOutput> query) {
Word<SymbolicMethodSymbol> sEps = Word.epsilon();
Word<Path> pEps = Word.epsilon();
ExecutionTree tree = new ExecutionTree(pEps, sEps, query.getInput());
query.answer(tree.getOutput());
}
示例14: evaluateQuery
import de.learnlib.api.Query; //导入依赖的package包/类
@Override
public boolean evaluateQuery(Query<SymbolicMethodSymbol, Boolean> query) {
Word<SymbolicMethodSymbol> input = query.getInput();
// constructor + 1 will always be executed
if (input.size() < 3) {
return false;
}
String lastName = input.getSymbol(1).getConcolicMethodConfig().getId();
Pair<BitSet,BitSet> lastMethod = po.get(lastName);
for (int i=2; i<input.size(); i++) {
String curName = input.getSymbol(i).getConcolicMethodConfig().getId();
Pair<BitSet,BitSet> cur = po.get(curName);
if (cur != null && lastMethod != null) {
if (curName.compareTo(lastName) < 0
&& !lastMethod._1.intersects(cur._2) // read-write
&& !lastMethod._2.intersects(cur._1) // write-read
&& !lastMethod._2.intersects(cur._2) // write-write
) {
return false;
}
}
lastName = curName;
lastMethod = cur;
}
return true;
}
示例15: processQueries
import de.learnlib.api.Query; //导入依赖的package包/类
@Override
public void processQueries(Collection<? extends
Query<SymbolicMethodSymbol, SymbolicQueryOutput>> clctn) {
for (Query<SymbolicMethodSymbol, SymbolicQueryOutput> query : clctn) {
processQuery(query);
}
}