/
NormaliseConstraints.h
45 lines (36 loc) · 1.17 KB
/
NormaliseConstraints.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Souffle - A Datalog Compiler
* Copyright (c) 2018, The Souffle Developers. All rights reserved
* Licensed under the Universal Permissive License v 1.0 as shown at:
* - https://opensource.org/licenses/UPL
* - <souffle root>/licenses/SOUFFLE-UPL.txt
*/
/************************************************************************
*
* @file NormaliseConstraints.h
*
* Transformation pass to normalise constraints.
* E.g.: a(x) :- b(x, 1). -> a(x) :- b(x, tmp0), tmp0=1.
*
***********************************************************************/
#pragma once
#include "ast/transform/Transformer.h"
#include <string>
namespace souffle {
class AstTranslationUnit;
/**
* Transformation pass to normalise constraints.
* E.g.: a(x) :- b(x, 1). -> a(x) :- b(x, tmp0), tmp0=1.
*/
class NormaliseConstraintsTransformer : public AstTransformer {
public:
std::string getName() const override {
return "NormaliseConstraintsTransformer";
}
NormaliseConstraintsTransformer* clone() const override {
return new NormaliseConstraintsTransformer();
}
private:
bool transform(AstTranslationUnit& translationUnit) override;
};
} // end of namespace souffle