// 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

// This code tests the provenance explain interface for a simple example containing constraints.

.pragma "provenance" "explain"

.decl Rule(n: number)
Rule(0).

.decl neg(x:number)
neg(121).

.decl Patient(SSN: number, ID: number)
.input Patient

.decl Violation(SSN: number, ID1: number, ID2: number)
.output Violation

Violation(ssn, p1, p2) :- Patient(ssn, p1), !neg(ssn), Patient(ssn, p2), p1 != p2, Rule(0).
