Algorithms for computing restricted root systems and Weyl groups