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

.decl A (n:number)
.decl B (a:number, b:number)
.decl C (a:number, b:number)
.output C ()

// create a list from 0 to 1000
A(0).
A(i+1) :- A(i), i<100.			// this is sequential

// use list to fill another in parallel
B(autoinc(),i) :- A(i).			// this may be parallel

// make sure the autoinc() produced the right range of numbers
C(i,j) :- B(c,i), B(c,j), i!=j.
