// 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 rules containing body literals that are independent of the
// head arguments (i.e. they are 'constant' wrt. head arguments).

.decl worried(x:symbol)
.output worried()

// The `PartitionBodyLiteralsTransformer` optimising transformer
// should change this rule to:
//  - worried(x) :- person(x), !jailed(x), newrel().
//  - newrel() :- thief(y), !jailed(y).
worried(x) :- person(x), !jailed(x), thief(y), !jailed(y).

.decl person(x:symbol)
.input person()

.decl thief(x:symbol)
.input thief()

.decl jailed(x:symbol)
.input jailed()
