binop.hh 1.08 KB
Newer Older
1
2
3
#ifndef SPOT_LTLAST_BINOP_HH
# define SPOT_LTLAST_BINOP_HH

4
#include "formula.hh"
5
6
7
8
9

namespace spot
{
  namespace ltl
  {
10
11

    /// Binary operator.
12
    class binop : public formula
13
14
    {
    public:
15
16
17
18
      /// Different kinds of binary opertaors
      ///
      /// And and Or are not here.  Because they
      /// are often nested we represent them as multops.
19
20
      enum type { Xor, Implies, Equiv, U, R };

21
      binop(type op, formula* first, formula* second);
22
23
24
25
26
      virtual ~binop();

      virtual void accept(visitor& v);
      virtual void accept(const_visitor& v) const;

27
      /// Get the first operand.
28
      const formula* first() const;
29
      /// Get the first operand.
30
      formula* first();
31
      /// Get the second operand.
32
      const formula* second() const;
33
      /// Get the second operand.
34
      formula* second();
35

36
      /// Get the type of this operator.
37
      type op() const;
38
      /// Get the type of this operator, as a string.
39
40
41
42
      const char* op_name() const;

    private:
      type op_;
43
44
      formula* first_;
      formula* second_;
45
46
47
48
49
50
    };

  }
}

#endif // SPOT_LTLAST_BINOP_HH