// Souffle - A Datalog Compiler
// Copyright (c) 2016, Oracle and/or its affiliates. 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

//
// Check semantics of binary relations
//

.type n <: number

.decl A (x:n, y:n)
.output A ()
.decl B (x:n, y:n)
.output B ()
.decl C (x:n, y:n)
.output C ()
.decl D (x:n, y:n)
.output D ()
.decl E (x:n, y:n)
.output E ()
.decl F (x:n, y:n)
.output F ()
.decl S (x:n, y:n)
.output S ()
.decl N (x:n)
.output N ()

N(0).
N(1).
N(2).
N(3).
N(4).
N(5).

S(x,y) :- N(x), N(y).

A(a,c) :- S(a,c), a > c.
B(a,c) :- S(a,c), a < c.
C(a,c) :- S(a,c), a = c.
D(a,c) :- S(a,c), a != c.
E(a,c) :- S(a,c), a <= c.
F(a,c) :- S(a,c), a >= c.

