Question: OCaml Write the function formatSubstitution : subst -> string which returns a string representation of substitution subst. For example, with 0, 1, 2 defined as
OCaml
Write the function formatSubstitution : subst -> string which returns a string representation of substitution subst. For example, with 0, 1, 2 defined as above, the call (formatSubstitution sigma0) should return the string "{}" , (formatSubstitution sigma1) should return the string "{(v0 -> (C -> C))/v1, (C -> v1)/v0}"and finally, the function call (formatSubstitution sigma2) should return the string "{v0/v1}". Obviously you should feel free to use the formatTree function defined in problem 6. Also, feel free to use the Lib.fmt function too.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
