本文整理汇总了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