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


C# Operator.GetType方法代码示例

本文整理汇总了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;
     }
 }
开发者ID:sylvainhalle,项目名称:BeepBeepCSharp,代码行数:13,代码来源:Constant.cs

示例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;
     }
 }
开发者ID:sylvainhalle,项目名称:BeepBeepCSharp,代码行数:14,代码来源:Atom.cs

示例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;
        }
    }
开发者ID:sylvainhalle,项目名称:BeepBeepCSharp,代码行数:15,代码来源:ConstantPath.cs

示例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;
        }
    }
开发者ID:sylvainhalle,项目名称:BeepBeepCSharp,代码行数:20,代码来源:BinaryOperator.cs

示例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;
        }
    }
开发者ID:sylvainhalle,项目名称:BeepBeepCSharp,代码行数:21,代码来源:FOQuantifier.cs

示例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>&not; ? = ?</li>
     * <li>TRUE &and; ? = ?</li>
     * <li>FALSE &and; ? = FALSE</li>
     * <li>TRUE &or; ? = TRUE</li>
     * <li>FALSE &or; ? = ?</li>
     * <li>X &phi; = G &phi; = ? no matter &phi;</li>
     * <li>F &phi; = &phi; &or; ?</li>
     * <li>&phi; U &psi; = &psi; &or; ?</li>
     * <li>&exist;<sub>p</sub> x: &phi; = &phi;(x<sub>1</sub>) &or; ... &or;
     * &phi;(x<sub>n</sub>) for x<sub>i</sub> in Dom<sub>s</sub>(p)</li>
     * <li>&forall;<sub>p</sub> x: &phi; = &phi;(x<sub>1</sub>) &and; ... &and;
     * &phi;(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);
//.........这里部分代码省略.........
开发者ID:sylvainhalle,项目名称:BeepBeepCSharp,代码行数:101,代码来源:SequentNode.cs

示例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; }
 }
开发者ID:sylvainhalle,项目名称:BeepBeepCSharp,代码行数:17,代码来源:GeneratorNode.cs

示例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");
            }
        }
    }
开发者ID:sylvainhalle,项目名称:BeepBeepCSharp,代码行数:13,代码来源:GeneratorNode.cs


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