// Souffle - A Datalog Compiler
// Copyright (c) 2016, 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

//
// Equivalent
//
// This test may be used to check whether equivalent relations are eliminated in the RAM program.
//

.decl A(i:number)
.decl B(i:number)
.decl X(i:number)
.decl Y(i:number)

.decl P(j:number, k:number)
.output P()
.decl Q(j:number, k:number)
.output Q()

A(0).
B(1).
X(0).
Y(1).

P(x, y) :- B(y), A(x).
Q(a, b) :- X(a), Y(b), A(a).

