2017-03-08 01:21:03 +01:00
|
|
|
#ifndef __ANTHEM__AST_FORWARD_H
|
|
|
|
#define __ANTHEM__AST_FORWARD_H
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
#include <experimental/optional>
|
|
|
|
#include <vector>
|
|
|
|
|
2017-03-23 00:44:10 +01:00
|
|
|
#include <clingo.hh>
|
|
|
|
|
2017-03-08 01:21:03 +01:00
|
|
|
namespace anthem
|
|
|
|
{
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// AST Forward Declarations
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
namespace ast
|
|
|
|
{
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
struct And;
|
|
|
|
struct BinaryOperation;
|
|
|
|
struct Biconditional;
|
|
|
|
struct Boolean;
|
2017-03-15 16:00:00 +01:00
|
|
|
struct Comparison;
|
2017-03-08 01:21:03 +01:00
|
|
|
struct Constant;
|
|
|
|
struct Exists;
|
|
|
|
struct ForAll;
|
|
|
|
struct Function;
|
|
|
|
struct Implies;
|
2017-03-15 16:00:00 +01:00
|
|
|
struct In;
|
2017-03-08 01:21:03 +01:00
|
|
|
struct Integer;
|
2017-03-15 16:00:00 +01:00
|
|
|
struct Interval;
|
2017-03-08 01:21:03 +01:00
|
|
|
struct Not;
|
|
|
|
struct Or;
|
|
|
|
struct Predicate;
|
2017-03-15 16:00:00 +01:00
|
|
|
struct SpecialInteger;
|
|
|
|
struct String;
|
2017-03-08 01:21:03 +01:00
|
|
|
struct Variable;
|
|
|
|
|
|
|
|
using AndPointer = std::unique_ptr<And>;
|
|
|
|
using BinaryOperationPointer = std::unique_ptr<BinaryOperation>;
|
|
|
|
using BiconditionalPointer = std::unique_ptr<Biconditional>;
|
|
|
|
using BooleanPointer = std::unique_ptr<Boolean>;
|
2017-03-15 16:00:00 +01:00
|
|
|
using ComparisonPointer = std::unique_ptr<Comparison>;
|
2017-03-08 01:21:03 +01:00
|
|
|
using ConstantPointer = std::unique_ptr<Constant>;
|
|
|
|
using ExistsPointer = std::unique_ptr<Exists>;
|
|
|
|
using ForAllPointer = std::unique_ptr<ForAll>;
|
|
|
|
using FunctionPointer = std::unique_ptr<Function>;
|
|
|
|
using ImpliesPointer = std::unique_ptr<Implies>;
|
2017-03-15 16:00:00 +01:00
|
|
|
using InPointer = std::unique_ptr<In>;
|
2017-03-08 01:21:03 +01:00
|
|
|
using IntegerPointer = std::unique_ptr<Integer>;
|
2017-03-15 16:00:00 +01:00
|
|
|
using IntervalPointer = std::unique_ptr<Interval>;
|
2017-03-08 01:21:03 +01:00
|
|
|
using NotPointer = std::unique_ptr<Not>;
|
|
|
|
using OrPointer = std::unique_ptr<Or>;
|
|
|
|
using PredicatePointer = std::unique_ptr<Predicate>;
|
2017-03-15 16:00:00 +01:00
|
|
|
using SpecialIntegerPointer = std::unique_ptr<SpecialInteger>;
|
|
|
|
using StringPointer = std::unique_ptr<String>;
|
2017-03-08 01:21:03 +01:00
|
|
|
using VariablePointer = std::unique_ptr<Variable>;
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Variants
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2017-03-23 00:44:10 +01:00
|
|
|
using FormulaT = Clingo::Variant<
|
|
|
|
And,
|
|
|
|
Biconditional,
|
|
|
|
Boolean,
|
|
|
|
Comparison,
|
|
|
|
Exists,
|
|
|
|
ForAll,
|
|
|
|
Implies,
|
|
|
|
In,
|
|
|
|
Not,
|
|
|
|
Or,
|
|
|
|
Predicate>;
|
2017-03-08 01:21:03 +01:00
|
|
|
|
|
|
|
class Formula : public FormulaT
|
|
|
|
{
|
|
|
|
using FormulaT::FormulaT;
|
|
|
|
};
|
|
|
|
|
2017-03-23 00:44:10 +01:00
|
|
|
using TermT = Clingo::Variant<
|
|
|
|
BinaryOperation,
|
|
|
|
Boolean,
|
|
|
|
Constant,
|
|
|
|
Function,
|
|
|
|
Integer,
|
|
|
|
Interval,
|
|
|
|
SpecialInteger,
|
|
|
|
String,
|
|
|
|
Variable>;
|
2017-03-15 16:00:00 +01:00
|
|
|
|
|
|
|
class Term : public TermT
|
|
|
|
{
|
|
|
|
using TermT::TermT;
|
|
|
|
};
|
2017-03-08 01:21:03 +01:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|