How to give a recursive definition of a a function t, which takes ad its argument a propositional formula and returns the set of propositional variables that occur in the given formula?
Define a function t, which takes ad its argument a propositional formula and returns the set of propositional variables in that formula
0
$\begingroup$
logic
propositional-calculus
1 Answers
1
We have to follow te recursive def of formula.
Basis : If $\varphi := p_i$, then $\text {Prop_Vars}(\varphi) = \{ p_i \}$.
Induction step :
(i) If $\varphi := \lnot \psi$, then $\text {Prop_Vars}(\varphi) = \text {Prop_Vars}(\psi)$.
(ii) If $\varphi := \psi \lor \tau$, then $\text {Prop_Vars}(\varphi) = \text {Prop_Vars}(\psi) \cup \text {Prop_Vars}(\tau)$;
and so on for the other binary connectives.
Let $\text {Wff}$ the set of formulae and $\text {Vars}$ the set of propositional variables $p_i$.
Then :
$\text {Prop_Vars} : \text {Wff} \to \mathcal P(\text {Vars})$.