Simple functional language implemented in Prolog