Scala implementation of Drescher's Schema Mechanism