[HIDE]Provide a definition by recursion of a function F such that for every wff A, F(A) is a wff obtained from A replacing all occurrences of p with q and all occurrences of q with p simultaneously. For example, F((p⇒q)) = (q⇒p).[/HIDE] I have to make a base case, and a recursive step. I got some advice from a friend: [HIDE] ---When its atomic. theres no case to replace the p and q. so it stops calling there ---Look back at the definition for WFFs, when you see (AoB) You "call" recusive definition on each of A and B. for this question, you switch A and B, then call definition on A and B for (BoA). the definition keeps calling until its reduced all the way to the variables. which means Base case(atomic) ---If A is ¬B then theres no p and q so it just continues call on that B ---you have two cases in the recursive steps. Think of a recursive method. BASE: A is atomic. return Recursive step: If A is in the form nB, and B is WFF. call definition on B end if. else If A is in the form BoC, and B and C are both WFF. then... then call definition on each B and C A = CoB end if. return A [/HIDE] I don't understand this.
Build a new replacement base B for the test. there are 4 conditions, cause p,q are subsets of F(A).so test from the smallest to the biggest. subsets are void and non void,so,when its atomic,p,q are void subsets of A, . If it's not, discuss F(A). ---When its atomic. theres no case to replace the p and q. so it stops calling there CONDITION:When its atomic. pUq=0, F(A)=o,stop calling,or nul. ---Look back at the definition for WFFs, when you see (AoB) You "call" recusive definition on each of A and B. for this question, you switch A and B, then call definition on A and B for (BoA). the definition keeps calling until its reduced all the way to the variables. which means Base case(atomic) 1,A contains B's condition,F base=F(A),2,B contains A's all condition,F(B),keep calling,till the condition (A=>B) recurse back to 1. ---If A is ¬B then theres no p and q so it just continues call on that B A,B not related, no A, Just F(B)= SOME CERTAIN NUMBER I AM USED TO CREATE ONE REPLACEMENT BASE, U CAN CREATE TWO, DO ONES LIKE U THINK IS EASIER.