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

.comp A {
    .decl edge(x:number, y:number)
.output edge()
    edge(1,2).
    edge(2,3).
}

.comp B {
    .init a = A
}

.comp C:B {
    .decl path(x:number, y:number)
.output path()
    path(x,y) :- a.edge(x,y).
    path(x,y) :- a.edge(x,z), path(z,y).
}

.init c = C
