本文整理匯總了Java中com.sri.ai.expresso.helper.Expressions.freeVariables方法的典型用法代碼示例。如果您正苦於以下問題:Java Expressions.freeVariables方法的具體用法?Java Expressions.freeVariables怎麽用?Java Expressions.freeVariables使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.sri.ai.expresso.helper.Expressions
的用法示例。
在下文中一共展示了Expressions.freeVariables方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: Model
import com.sri.ai.expresso.helper.Expressions; //導入方法依賴的package包/類
public Model(Set<Expression> Factors,Theory theory, Context context, boolean isExtensional, VariableNode query) {
this(theory, context, isExtensional, query);
for (Expression factor : Factors) {
FactorNode f = new FactorNode(factor,isExtensional,theory,context);
if (factor != null) {
for (Expression variable : Expressions.freeVariables(factor, context)) {
VariableNode v = new VariableNode(variable, isExtensional,theory,context);
graphicalModel.add(v,f);
}
}
}
}
示例2: ExpandModel
import com.sri.ai.expresso.helper.Expressions; //導入方法依賴的package包/類
/**
* This method receives as input an {@code Iterator<FactorNode>} object and expands the
* {@code exploredGraphicalModel} by adding ONE FACTOR to it.
*
* There are various ways of doing such expansion, and it is then given to the User the
* choice on which way to go.
*
* @param it
*/
public void ExpandModel(Iterator<FactorNode> it) {
// BFS, DFS,...
if (it.hasNext()) {
FactorNode newFactorNode = it.next();
for (Expression variable : Expressions.freeVariables(newFactorNode.getValue(), context)) {
VariableNode v = new VariableNode(variable, isExtensional,theory,context);
exploredGraphicalModel.add(v,newFactorNode);
}
}
}
示例3: LVECalculation
import com.sri.ai.expresso.helper.Expressions; //導入方法依賴的package包/類
public static Expression LVECalculation(Collection<FactorNode> factorNodes, Expression query, Context context, Theory theory) {
Set<Expression> factorExpressions = new HashSet<>();
for (FactorNode f : factorNodes) {
factorExpressions.add(f.getValue());
}
Expression product = apply(TIMES, factorExpressions);
Set<Expression> freevariables = Expressions.freeVariables(product, context);
freevariables.remove(query);
ArrayList<Expression> varToSumOut = new ArrayList<>();
varToSumOut.addAll(freevariables);
Expression variablesToBeSummedOut = new DefaultExtensionalMultiSet(varToSumOut);
IndexExpressionsSet indices = getIndexExpressionsOfFreeVariablesIn(variablesToBeSummedOut, context);
Expression setOfFactorInstantiations = IntensionalSet.makeMultiSet(
indices,
product,// head
makeSymbol(true)// No Condition
);
Expression sumOnPhi = apply(SUM, setOfFactorInstantiations);
Expression evaluation = theory.evaluate(sumOnPhi, context);
Expression result = Bounds.normalizeSingleExpression(evaluation, theory, context);
return result;
}
示例4: getIndexExpressionsOfFreeVariablesIn
import com.sri.ai.expresso.helper.Expressions; //導入方法依賴的package包/類
/**
* Returns a list of index expressions corresponding to the free variables in an expressions and their types per the registry, if any.
*/
public static IndexExpressionsSet getIndexExpressionsOfFreeVariablesIn(Expression expression, Registry registry) {
Set<Expression> freeVariables = Expressions.freeVariables(expression, registry);
IndexExpressionsSet result = makeIndexExpressionsForIndicesInListAndTypesInRegistry(freeVariables, registry);
return result;
}
示例5: getParameters
import com.sri.ai.expresso.helper.Expressions; //導入方法依賴的package包/類
private List<Expression> getParameters(MultiQuantifierEliminationProblem problem, Context context) {
Set<Expression> freeVariables = Expressions.freeVariables(problem.getConditionedBody(), context);
freeVariables.removeAll(problem.getIndices());
List<Expression> proceduralAttachmentParameters = new ArrayList<>(freeVariables);
return proceduralAttachmentParameters;
}
開發者ID:aic-sri-international,項目名稱:aic-expresso,代碼行數:7,代碼來源:SamplingProceduralAttachmentSingleQuantifierEliminator.java