当前位置: 首页>>代码示例>>Java>>正文


Java TCNameList.hasDuplicates方法代码示例

本文整理汇总了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
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:13,代码来源:INPatternList.java

示例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;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:71,代码来源:POImplicitFunctionDefinition.java

示例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;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:57,代码来源:POExplicitFunctionDefinition.java

示例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;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:45,代码来源:POExplicitOperationDefinition.java

示例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;
}
 
开发者ID:nickbattle,项目名称:FJ-VDMJ,代码行数:78,代码来源:POImplicitOperationDefinition.java


注:本文中的com.fujitsu.vdmj.tc.lex.TCNameList.hasDuplicates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。