package aspectjhw.lambda;
/** Exercise beta reduction */
public class ExerciseBeta {
    /** Run the exercise */
    public static void main(String[] args) {
        Term t =
            new Application(
                new Lambda("x", new Variable("x")),
                new Variable("y"));
        Term s = t.reduce1Step();
        System.out.println(s.toString());
        t = new Application(
                new Application(
                    new Lambda(
                        "x",
                        new Application(new Variable("x"), new Variable("x"))),
                    new Lambda("z", new Variable("z"))),
                new Variable("q"));
        s = t.reduce1Step();
        s = s.reduce1Step();
        s = s.reduce1Step();
        System.out.println(s.toString());
    }
}
