本文整理汇总了Java中com.fujitsu.vdmj.tc.lex.TCNameList.hasDuplicates方法的典型用法代码示例。如果您正苦于以下问题:Java TCNameList.hasDuplicates方法的具体用法?Java TCNameList.hasDuplicates怎么用?Java TCNameList.hasDuplicates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.fujitsu.vdmj.tc.lex.TCNameList
的用法示例。
在下文中一共展示了TCNameList.hasDuplicates方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isConstrained
import com.fujitsu.vdmj.tc.lex.TCNameList; //导入方法依赖的package包/类
public boolean isConstrained()
{
TCNameList names = new TCNameList();
for (INPattern p: this)
{
if (p.isConstrained()) return true; // NB. OR
names.addAll(p.getAllVariableNames());
}
return names.hasDuplicates(); // No duplicates => not constrained
}
示例2: getProofObligations
import com.fujitsu.vdmj.tc.lex.TCNameList; //导入方法依赖的package包/类
@Override
public ProofObligationList getProofObligations(POContextStack ctxt)
{
ProofObligationList obligations = new ProofObligationList();
TCNameList pids = new TCNameList();
boolean matchNeeded = false;
for (POPatternListTypePair pltp: parameterPatterns)
{
for (POPattern p: pltp.patterns)
{
pids.addAll(p.getVariableNames());
}
if (!pltp.patterns.alwaysMatches())
{
matchNeeded = true;
}
}
if (pids.hasDuplicates() || matchNeeded)
{
obligations.add(new ParameterPatternObligation(this, ctxt));
}
if (precondition != null)
{
obligations.addAll(precondition.getProofObligations(ctxt));
}
if (postcondition != null)
{
if (body != null) // else satisfiability, below
{
ctxt.push(new POFunctionDefinitionContext(this, false));
obligations.add(new FuncPostConditionObligation(this, ctxt));
ctxt.pop();
}
ctxt.push(new POFunctionResultContext(this));
obligations.addAll(postcondition.getProofObligations(ctxt));
ctxt.pop();
}
if (body == null)
{
if (postcondition != null)
{
ctxt.push(new POFunctionDefinitionContext(this, false));
obligations.add(new SatisfiabilityObligation(this, ctxt));
ctxt.pop();
}
}
else
{
ctxt.push(new POFunctionDefinitionContext(this, true));
obligations.addAll(body.getProofObligations(ctxt));
if (isUndefined ||
!TypeComparator.isSubType(actualResult, type.result))
{
obligations.add(new SubTypeObligation(
this, type.result, actualResult, ctxt));
}
ctxt.pop();
}
return obligations;
}
示例3: getProofObligations
import com.fujitsu.vdmj.tc.lex.TCNameList; //导入方法依赖的package包/类
@Override
public ProofObligationList getProofObligations(POContextStack ctxt)
{
ProofObligationList obligations = new ProofObligationList();
TCNameList pids = new TCNameList();
boolean matchNeeded = false;
for (POPatternList pl: paramPatternList)
{
for (POPattern p: pl)
{
pids.addAll(p.getVariableNames());
}
if (!pl.alwaysMatches())
{
matchNeeded = true;
}
}
if (pids.hasDuplicates() || matchNeeded)
{
obligations.add(new ParameterPatternObligation(this, ctxt));
}
if (precondition != null)
{
ctxt.push(new POFunctionDefinitionContext(this, false));
obligations.addAll(precondition.getProofObligations(ctxt));
ctxt.pop();
}
if (postcondition != null)
{
ctxt.push(new POFunctionDefinitionContext(this, false));
obligations.add(new FuncPostConditionObligation(this, ctxt));
ctxt.push(new POFunctionResultContext(this));
obligations.addAll(postcondition.getProofObligations(ctxt));
ctxt.pop();
ctxt.pop();
}
ctxt.push(new POFunctionDefinitionContext(this, true));
obligations.addAll(body.getProofObligations(ctxt));
if (isUndefined ||
!TypeComparator.isSubType(actualResult, expectedResult))
{
obligations.add(
new SubTypeObligation(this, expectedResult, actualResult, ctxt));
}
ctxt.pop();
return obligations;
}
示例4: getProofObligations
import com.fujitsu.vdmj.tc.lex.TCNameList; //导入方法依赖的package包/类
@Override
public ProofObligationList getProofObligations(POContextStack ctxt)
{
ProofObligationList obligations = new ProofObligationList();
TCNameList pids = new TCNameList();
for (POPattern p: parameterPatterns)
{
pids.addAll(p.getVariableNames());
}
if (pids.hasDuplicates() || !parameterPatterns.alwaysMatches())
{
obligations.add(new ParameterPatternObligation(this, ctxt));
}
if (precondition != null)
{
obligations.addAll(precondition.getProofObligations(ctxt));
}
if (postcondition != null)
{
obligations.addAll(postcondition.getProofObligations(ctxt));
obligations.add(new OperationPostConditionObligation(this, ctxt));
}
obligations.addAll(body.getProofObligations(ctxt));
if (isConstructor &&
classDefinition != null &&
classDefinition.invariant != null)
{
obligations.add(new StateInvariantObligation(this, ctxt));
}
if (!isConstructor &&
!TypeComparator.isSubType(actualResult, type.result))
{
obligations.add(new SubTypeObligation(this, actualResult, ctxt));
}
return obligations;
}
示例5: getProofObligations
import com.fujitsu.vdmj.tc.lex.TCNameList; //导入方法依赖的package包/类
@Override
public ProofObligationList getProofObligations(POContextStack ctxt)
{
ProofObligationList obligations = new ProofObligationList();
TCNameList pids = new TCNameList();
boolean matchNeeded = false;
for (POPatternListTypePair pltp: parameterPatterns)
{
for (POPattern p: pltp.patterns)
{
pids.addAll(p.getVariableNames());
}
if (!pltp.patterns.alwaysMatches())
{
matchNeeded = true;
}
}
if (pids.hasDuplicates() || matchNeeded)
{
obligations.add(new ParameterPatternObligation(this, ctxt));
}
if (precondition != null)
{
obligations.addAll(precondition.getProofObligations(ctxt));
}
if (postcondition != null)
{
if (precondition != null)
{
ctxt.push(new POImpliesContext(precondition));
obligations.addAll(postcondition.getProofObligations(ctxt));
ctxt.pop();
}
else
{
obligations.addAll(postcondition.getProofObligations(ctxt));
}
obligations.add(new OperationPostConditionObligation(this, ctxt));
}
if (body != null)
{
obligations.addAll(body.getProofObligations(ctxt));
if (isConstructor &&
classDefinition != null &&
classDefinition.invariant != null)
{
obligations.add(new StateInvariantObligation(this, ctxt));
}
if (!isConstructor &&
!TypeComparator.isSubType(actualResult, type.result))
{
obligations.add(
new SubTypeObligation(this, actualResult, ctxt));
}
}
else
{
if (postcondition != null)
{
ctxt.push(new POOperationDefinitionContext(this, false, stateDefinition));
obligations.add(
new SatisfiabilityObligation(this, stateDefinition, ctxt));
ctxt.pop();
}
}
return obligations;
}