This function returns the set of free variables (individual variables) that occur in an unquantified term expression. If there is a sequence variable or quantified term expression, then this function is undefined.
(=> (Variables-In-Term ?Exp ?Vset) (= ?Vset (Cond ((Indvar ?Exp) (Setof ?Exp)) ((Funterm ?Exp) (Apply Union (Map Variables-In-Term (Rest ?Exp)))) ((And (Logterm ?Exp) (= (First ?Exp) (Quote If))) (Union (Variables-In-Sentence (Second-Item ?Exp)) (Apply Union (Map Variables-In-Term (Rest (Rest ?Exp)))))) ((And (Logterm ?Exp) (= (First ?Exp) (Quote Cond))) (Apply Union (Map Variables-In-Cond-Clause (Rest ?Exp)))) ((Quanterm ?Exp) Bottom) ((Term ?Exp) (Setof)))))