The following functions that operate on trees should be recursive. Some useful functions that you may need are provided in the file cs378.clj, and you will need some of your functions from the previous assignments.
Write a function (solveqns eqns vals v) that attempts to solve the list of equations eqns for variable v given an association list of values vals.
Use your program to answer the following questions. Input data is provided in the file formulas.clj.
needed is a list of variables whose values are needed by equations that will appear later in the code; initially, needed will be a list of the single var that is the goal of the function.
Go through the (backwards) equation list one equation at a time. If the lhs of the equation is a member of needed, then we need that equation, and it should be kept; in this case, any variables in the rhs of the equation will also be needed and should be added to needed (using union) for the recursive call. If the lhs of an equation is not a member of needed, that equation can be eliminated, and needed is unchanged. The variables in needed are called busy or live variables, and this process is called dead code elimination.
public static double foo(double x, double y, double z) {A useful function is (arglist inputs) that calls a helper function and produces a string of double and input names separated by commas for use as an argument list.
(doseq [item strings] (println item))