// 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 inlining with records.

.type Thing <: symbol

.type Conn = [
    first : Thing,
    second : Thing
]

.decl a(x:Conn, y:Conn) inline
a(["Hello", "Goodbye"], ["temporary", "value"]).
a(["temporary", "value"], ["NO", "NO"]).
a(["can", "do"], ["my", "value"]).

.decl b(x:Conn, y:Conn) inline
b(["good job", "bad job"], ["can", "do"]).
b(x, y) :- a(x, y), x != ["temporary", "value"].

.decl c(x:Conn) inline
c(x) :- a(z, y), b(x, z), x != y.

.decl d(x:Thing)
d(x) :- c([x, _]).
.output d()
