implemented reachability query in rascal