I am trying to imagine formulas with the variables above, for example, either formulas or variables and constants:
R(a,b) -> Q [Q takes formulae as substitutions] R(x,b) v P(b) [x takes constants or variables as substitutions]
Functions over formulas have class restrictions that determine what type of variable is considered. For example, classes of terms, variables, and permutations can have the following structure:
class Var b where ... class (Var b) => Term ba | b -> a where ... class (Term ba) => Subst sba | ba -> s where ...
There are many algorithms associated with syntactic terms for which it would be useful to use types of parameter types for variable types. For example, consider a general unification algorithm over formulas of a certain type of terms having different types of variables:
unify :: (Subst sba) => a -> a -> sba unify (P -> F(a,b)) ((Q v R) -> F(a,b)) = {P\(Q v R)} -- formulae unify (P(x,f(a,b))) (P(g(c),f(y,b))) = {x\g(c),y\a} -- variables and constants
What is the best way to represent such variable variables? I experimented with various methods, but did not find a satisfactory solution.
source share