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

.type Integer <: symbol

.decl student (a:Integer, b:Integer, c:Integer)
.decl professor (a:Integer, b:Integer)

.decl actual_adv(s:Integer, p:Integer)
.output actual_adv()
.decl chosen(s:Integer, p:Integer)
.output chosen()
.decl diffchoice(s:Integer, p:Integer)
.output diffchoice()


student("JimBlack", "ee", "Senior").
professor("ohm", "ee").
professor("bell", "ee").

actual_adv(s, p) :- student(s, m, _), professor(p, m), chosen(s, p).
chosen(s, p) :- student(s, m, _), professor(p, m), !diffchoice(s, p).
diffchoice(s, p) :- chosen(s, pp), p != pp, professor(p,_).


