本文整理汇总了C#中Operator.GetType方法的典型用法代码示例。如果您正苦于以下问题:C# Operator.GetType方法的具体用法?C# Operator.GetType怎么用?C# Operator.GetType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Operator
的用法示例。
在下文中一共展示了Operator.GetType方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Constant
/**
* Constructor by copy.
*
* @param o
*/
public Constant(Operator o)
{
if (o.GetType() == this.GetType())
{
Constant oa = (Constant)o;
m_symbol = oa.m_symbol;
}
}
示例2: Atom
/**
* Constructor by copy.
*
* @param o
*/
public Atom(Operator o)
: base(o)
{
if (o.GetType() == this.GetType())
{
Atom oa = (Atom)o;
m_symbol = oa.m_symbol;
}
}
示例3: ConstantPath
/**
* Constructor by copy.
*
* @param o
*/
public ConstantPath(Operator o)
: base(o)
{
if (o.GetType() == this.GetType())
{
ConstantPath oa = (ConstantPath)o;
m_symbol = oa.m_symbol;
}
}
示例4: BinaryOperator
/**
* Default constructor by copy. The resulting object is a constructor with
* similar fields than the Operator passed in the argument. Note that the
* copy is shallow, i.e. it is not recursive.
*
* @param o
* An Operator
*/
public BinaryOperator(Operator o)
: base(o)
{
if (o.GetType() == this.GetType())
{
BinaryOperator bo = (BinaryOperator)o;
m_left = bo.m_left;
m_right = bo.m_right;
m_commutative = bo.m_commutative;
}
}
示例5: FOQuantifier
/**
* Default constructor by copy. The resulting object is a constructor with
* similar fields than the Operator passed in the argument. Note that the
* copy is shallow, i.e. it is not recursive.
*
* @param o
* An Operator
*/
public FOQuantifier(Operator o)
: base(o)
{
if (o.GetType() == this.GetType())
{
FOQuantifier foq = (FOQuantifier)o;
m_symbolLeft = foq.m_symbolLeft;
m_symbolRight = foq.m_symbolRight;
m_quantifiedVariable = foq.m_quantifiedVariable;
m_operand = foq.m_operand;
}
}
示例6: isSatisfiedInCurrentState
/**
* Determines the value of an LTL-FO+ formula using a 3-valued logic. In
* addition to TRUE and FALSE, we add a third value "?". The following rules
* apply:
* <ul>
* <li>¬ ? = ?</li>
* <li>TRUE ∧ ? = ?</li>
* <li>FALSE ∧ ? = FALSE</li>
* <li>TRUE ∨ ? = TRUE</li>
* <li>FALSE ∨ ? = ?</li>
* <li>X φ = G φ = ? no matter φ</li>
* <li>F φ = φ ∨ ?</li>
* <li>φ U ψ = ψ ∨ ?</li>
* <li>∃<sub>p</sub> x: φ = φ(x<sub>1</sub>) ∨ ... ∨
* φ(x<sub>n</sub>) for x<sub>i</sub> in Dom<sub>s</sub>(p)</li>
* <li>∀<sub>p</sub> x: φ = φ(x<sub>1</sub>) ∧ ... ∧
* φ(x<sub>n</sub>) for x<sub>i</sub> in Dom<sub>s</sub>(p)</li>
*
* @param o
* @param m
* TODO
* @return
*/
protected static Outcome isSatisfiedInCurrentState(Operator o, WatcherMessage m)
{
// This method uses getClass to branch on the type of operator
// used; TODO: redesign with method overriding
Outcome oc1, oc2;
Operator o1, o2, o3;
if (o.GetType() == typeof(OperatorNot))
{
o1 = ((OperatorNot)o).getOperand();
oc1 = isSatisfiedInCurrentState(o1, m);
return threeValuedNot(oc1);
}
else if (o.GetType() == typeof(OperatorX) ||
o.GetType() == typeof(OperatorG))
{
// TODO
// assert(false);
return Outcome.INCONCLUSIVE;
}
else if (o.GetType() == typeof(OperatorEquals))
{
o1 = ((OperatorEquals)o).getLeftOperand();
o2 = ((OperatorEquals)o).getRightOperand();
if (o1.GetType () == typeof(ConstantPath))
{
// Left member is a path; we compare that path
// to the right member
HashSet<Atom> dom = m.getDomain((ConstantPath) o1);
foreach (Atom a in dom)
{
// We return true if at least one value at the end
// of the path equals o2
if (a.Equals(o2))
return Outcome.TRUE;
}
return Outcome.FALSE;
}
else
{
// We compare directly the two members
if (o1.Equals(o2))
return Outcome.TRUE;
}
return Outcome.FALSE;
}
else if (o.GetType() == typeof(OperatorAnd))
{
o1 = ((OperatorAnd)o).getLeftOperand();
oc1 = isSatisfiedInCurrentState(o1, m);
o2 = ((OperatorAnd)o).getRightOperand();
oc2 = isSatisfiedInCurrentState(o2, m);
return threeValuedAnd(oc1, oc2);
}
else if (o.GetType() == typeof(OperatorOr))
{
o1 = ((OperatorOr)o).getLeftOperand();
oc1 = isSatisfiedInCurrentState(o1, m);
o2 = ((OperatorOr)o).getRightOperand();
oc2 = isSatisfiedInCurrentState(o2, m);
return threeValuedOr(oc1, oc2);
}
else if (o.GetType() == typeof(OperatorF))
{
o1 = ((OperatorF)o).getOperand();
oc1 = isSatisfiedInCurrentState(o1, m);
//.........这里部分代码省略.........
示例7: spawn
public HashSet<GeneratorNode> spawn(Operator o)
{
if (o.GetType() == typeof(Constant)) { return spawn((Constant)o); }
else if (o.GetType() == typeof(FOExists)) { return spawn((FOExists)o); }
else if (o.GetType() == typeof(FOForAll)) { return spawn((FOForAll)o); }
else if (o.GetType() == typeof(OperatorAnd)) { return spawn((OperatorAnd)o); }
else if (o.GetType() == typeof(OperatorEquals)) { return spawn((OperatorEquals)o); }
else if (o.GetType() == typeof(OperatorF)) { return spawn((OperatorF)o); }
else if (o.GetType() == typeof(OperatorG)) { return spawn((OperatorG)o); }
else if (o.GetType() == typeof(OperatorImplies)) { return spawn((OperatorImplies)o); }
else if (o.GetType() == typeof(OperatorNot)) { return spawn((OperatorNot)o); }
else if (o.GetType() == typeof(OperatorOr)) { return spawn((OperatorOr)o); }
else if (o.GetType() == typeof(OperatorU)) { return spawn((OperatorU)o); }
else if (o.GetType() == typeof(OperatorV)) { return spawn((OperatorV)o); }
else if (o.GetType() == typeof(OperatorX)) { return spawn((OperatorX)o); }
else { return null; }
}
示例8: addToDelta
public new void addToDelta(Operator o)
{
base.addToDelta(o);
if (o.GetType() == typeof(FOExists))
{
if (((FOExists)o).isPathAssertion() &&
((FOExists)o).getQualifier() == "/confirmed")
{
System.Console.WriteLine("PELLETE");
}
}
}