Scala Implementation of FOIL