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

// Tests the use of functors as arguments in inlined relations.

.decl a(x:number)
.input a()

.decl b(x:number, y:number) inline
b(1, 2).
b(2, 3).
b(1, -1).
b(10, 4).
b(100, 12).
b(32, 32).
b(4, 2).
b(2, 1).

.decl c(x:number)
c(x) :- a(x), b(x + x + x + x, x+1).
c(x) :- a(y), b(x, (y-1)/3).

.output c()
