

Function("Substitute",{body,predicate,change})
[
  Substitute(body);
];
HoldArg("Substitute",predicate);
HoldArg("Substitute",change);
UnFence("Substitute",3);
RuleBase("Substitute",{body});
UnFence("Substitute",1);

Rule("Substitute",1,1,Apply("Apply",{predicate,{body}}) = True)
[
  Apply("Apply",{change,{body}});
];
Rule("Substitute",1,2,IsFunction(body))
[
  Apply("MapArgs",{body,"Substitute"});
];
Rule("Substitute",1,3,True) body;





Function("Subst",{from,to,body})
[
  Local(predicate,change,xxx);
  predicate:={{xxx},UnList({=,xxx,from})};
  change   :={{xxx},to};
  Substitute(body);
];


