souffle  2.0.2-371-g6315b36
Namespaces | Macros | Functions
ast_program_test.cpp File Reference
#include "tests/test.h"
#include "AggregateOp.h"
#include "ast/Aggregator.h"
#include "ast/Argument.h"
#include "ast/Atom.h"
#include "ast/Attribute.h"
#include "ast/Clause.h"
#include "ast/Literal.h"
#include "ast/Node.h"
#include "ast/Program.h"
#include "ast/Relation.h"
#include "ast/TranslationUnit.h"
#include "ast/Variable.h"
#include "ast/utility/Utils.h"
#include "parser/ParserDriver.h"
#include "reports/DebugReport.h"
#include "reports/ErrorReport.h"
#include <algorithm>
#include <iostream>
#include <memory>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for ast_program_test.cpp:

Go to the source code of this file.

Namespaces

 souffle
 
 souffle::ast
 
 souffle::ast::test
 

Macros

#define TESTASTCLONEANDEQUAL(SUBTYPE, DL)
 

Functions

Own< TranslationUnit > souffle::ast::test::makeATU (std::string program=".decl A,B,C(x:number)")
 
Own< Clause > souffle::ast::test::makeClause (std::string name, Own< Argument > headArgument)
 
 souffle::ast::test::TEST (Program, AppendRelation)
 
 souffle::ast::test::TEST (Program, Parse)
 
 souffle::ast::test::TEST (Program, RemoveClause)
 test removeClause, addRelation and removeRelation More...
 
 souffle::ast::test::TEST (Program, RemoveRelation)
 
 souffle::ast::test::TESTASTCLONEANDEQUAL (ChainedTypes, R"( .type D <: symbol .type C = D .type B = C .type A = B .decl R1(x:A,y:B) .decl R2(x:C,y:D) .decl R4(x:A) output R4(x) :- R2(x,x),R1(x,x). )")
 
 souffle::ast::test::TESTASTCLONEANDEQUAL (ComplexTypes, R"( .type A <: symbol .type B <: number .type U = B .decl a ( x : A ) .decl b ( x : B ) .decl u ( x : U ) a(X) :- X < 10. b(X) :- X < 10. u(X) :- X < 10. )")
 
 souffle::ast::test::TESTASTCLONEANDEQUAL (NestedAggregates, R"( .type D <: symbol .decl r(x:D) r(x) :- r(y), x=cat(cat(x,x),x). )")
 
 souffle::ast::test::TESTASTCLONEANDEQUAL (Program, R"( .decl r(a:number,b:number,c:number,d:number) .decl s(x:symbol) .decl a(x:number) s("xxx"). r(X,Y,Z,W) :- a(X), 10 = Y, Y = Z, 8 + W = 12 + 14. r(z + 2, x, y, a) :- s(b), b = to_string(a), z = x, a = y, x = 2, a = 2 + x. )")
 
 souffle::ast::test::TESTASTCLONEANDEQUAL (Record, R"( .type N <: symbol .type R = [ a : N, B : N ] .decl r ( r : R ) .decl s ( r : N ) s(x) :- r([x,y]). )")
 
 souffle::ast::test::TESTASTCLONEANDEQUAL (RelationCopies, R"( .type D = number .decl a(a:D,b:D) .decl b(a:D,b:D) .decl c(a:D,b:D) .decl d(a:D,b:D) a(1,2). b(x,y) :- a(x,y). c(x,y) :- b(x,y). d(x,y) :- b(x,y), c(y,x). )")
 
 souffle::ast::test::TESTASTCLONEANDEQUAL (SimpleTypes, R"( .type A <: symbol .type B <: symbol .type U = A | B .decl a ( x : A ) .decl b ( x : B ) .decl u ( x : U ) a(X) :- u(X). b(X) :- u(X). u(X) :- u(X). a(X) :- b(X). a(X) :- b(Y). )")
 

Macro Definition Documentation

◆ TESTASTCLONEANDEQUAL

#define TESTASTCLONEANDEQUAL (   SUBTYPE,
  DL 
)
Value:
TEST(Ast, CloneAndEqual##SUBTYPE) { \
ErrorReport e; \
DebugReport d; \
Own<TranslationUnit> tu = ParserDriver::parseTranslationUnit(DL, e, d); \
Program& program = tu->getProgram(); \
EXPECT_EQ(program, program); \
Own<Program> clone(program.clone()); \
EXPECT_NE(clone.get(), &program); \
EXPECT_EQ(*clone, program); \
}

Definition at line 89 of file ast_program_test.cpp.

souffle::ast::test::TEST
TEST(Program, RemoveRelation)
Definition: ast_program_test.cpp:150
e
l j a showGridBackground &&c b raw series this eventEmitter e
Definition: htmlJsChartistMin.h:15
souffle::clone
auto clone(const std::vector< A * > &xs)
Definition: ContainerUtil.h:172
d
else d
Definition: htmlJsChartistMin.h:15