SUBST_OCCS_TAC : ((int list # thm) list -> tactic)
A ?- t ============================= SUBST_OCCS_TAC [(l1,A1|-t1=u1);...; A ?- t[u1,...,un/t1,...,tn] (ln,An|-tn=un)]The assumptions of the theorems used to substitute with are not added to the assumptions A of the goal, but they are recorded in the proof. If any Ai is not a subset of A (up to alpha-conversion), SUBST_OCCS_TAC [(l1,A1|-t1=u1);...;(ln,An|-tn=un)] results in an invalid tactic.
SUBST_OCCS_TAC automatically renames bound variables to prevent free variables in ui becoming bound after substitution.
?- (m + n) + (n + m) = (m + n) + (m + n)applying the commutative law for addition on the third occurrence of the subterm m + n
SUBST_OCCS_TAC [([3],SPECL ["m:num"; "n:num"] ADD_SYM)]results in the goal
?- (m + n) + (n + m) = (m + n) + (n + m)