本文整理汇总了C#中Term.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Term.Clone方法的具体用法?C# Term.Clone怎么用?C# Term.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Term
的用法示例。
在下文中一共展示了Term.Clone方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddMapping
public override void AddMapping(TermVariable from, Term to)
{
if (to is TermObject == false)
throw new Exception("TermObjectSubstitution is optimised for TermObjects");
int delta = from.GetHashCode() ^ to.GetHashCode();
_hashcode += delta;
Substitutions[from] = to.Clone();
}
示例2: TermFunction
public TermFunction(bool cloneCols, int funcName, Term[] args)
{
FunctionName = funcName;
if (args == null)
{
Arguments = EmptyArgs;
_hasVariables = false;
}
else
{
// Check if any of the term arguments are variables
_hasVariables = args.Any(t => t.HasVariables);
if (cloneCols)
Arguments = (Term[])args.Clone();
else
Arguments = args;
}
// Compute the total columns needed
TotalColumns = 1 + Arguments.Sum(t => t.TotalColumns); // 1 for the name
}
示例3: DerivedArguments
public override void DerivedArguments(int frameId, Method method, Term[] arguments)
{
this.derivedArguments[frameId] = (Term[]) arguments.Clone();
if (trackedFrameId == frameId)
{
TypeEx declaringType;
if (method.TryGetDeclaringType(out declaringType) &&
declaringType.IsReferenceType &&
!method.IsStatic)
{
var receiver = arguments[0];
var instanceFields = declaringType.InstanceFields;
Term[] initialFieldValues = new Term[instanceFields.Length];
Term[] initialFieldArrayValues = new Term[instanceFields.Length];
for (int i = 0; i < instanceFields.Length; i++)
{
initialFieldValues[i] = _thread.State.ReadObjectField(receiver, instanceFields[i]);
if (instanceFields[i].Type.Spec == TypeSpec.SzArray)
initialFieldArrayValues[i] = _thread.State.ReadSzArrayElement(instanceFields[i].Type.ElementType.Layout, initialFieldValues[i], this.TermManager.Symbol(SzArrayIndexId.Instance));
}
this.initialFieldValues[frameId] = initialFieldValues;
this.initialFieldArrayValues[frameId] = initialFieldArrayValues;
}
}
}
示例4: AddMapping
public virtual void AddMapping(TermVariable from, Term to)
{
//TODO: is there a reason to clone?
Substitutions[from] = to.Clone();
}