本文整理匯總了Java中de.learnlib.api.Query.answer方法的典型用法代碼示例。如果您正苦於以下問題:Java Query.answer方法的具體用法?Java Query.answer怎麽用?Java Query.answer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類de.learnlib.api.Query
的用法示例。
在下文中一共展示了Query.answer方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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) {
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());
}
}
示例6: 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));
}
示例7: 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);
}
示例8: 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());
}
示例9: processQuery
import de.learnlib.api.Query; //導入方法依賴的package包/類
private void processQuery(
Query<SymbolicMethodSymbol, SymbolicQueryOutput> query) {
Word<SymbolicQueryOutput> out = getPotentialOutput(query.getInput());
//FIXME: this has to be adapted to include dont knows!!
for (SymbolicQueryOutput o : out) {
if (o.isUniform() && !o.equals(SymbolicQueryOutput.OK)) {
query.answer(o);
return;
}
}
this.oracle.processQueries(Collections.singleton(query));
}
示例10: processQueries
import de.learnlib.api.Query; //導入方法依賴的package包/類
@Override
public void processQueries(Collection<? extends Query<SymbolicMethodSymbol, SymbolicQueryOutput>> clctn) {
ArrayList<Query<SymbolicMethodSymbol, SymbolicQueryOutput>> queries
= new ArrayList<>();
for (Query<SymbolicMethodSymbol, SymbolicQueryOutput> q : clctn) {
if (isValid(q.getInput())) {
queries.add(q);
}
else {
q.answer(SymbolicQueryOutput.ERROR);
}
}
this.oracle.processQueries(queries);
}