Question about logic syntax

I am trying to symbolize the sentence

"If Alma paints a square, then Alma paints a rectangle" using the dictionary:

S1 : is a square R1 : is a rectangle a : alma P2 : Paints

My question is is it correct to nest a relational phrase (S1x) inside another relational phrase (P2)?

∀x(P2aS1x -> P2aR1x)

I can't see how to write this sentence if this is not the case.

• No, it is not correct. ∀x [(Sx ∧ Pax) → (Rx ∧ Pax)] Feb 6, 2018 at 18:24

Other than the fact that you cannot use predicates as arguments of other predicates, you are also interpreting the sentence by saying that the rectangle that Anna is painting when she is painting a square is that the very square ... which is of course a very reasonable interpretation of that sentence, but if we go for a more literal interpretation, then we need say that if there is some square that she is painting, then she is painting some rectangle (which may or may not be that square ... indeed, when in English we use 'rectangle' we may be trying to emphasize that it is not a square, otherwise we would have said square). So, using that interpretation, we get:

Ex (Sx&Pax) -> Ex (Rx&Pax)

(E being the existential quantifier)

My question is is it correct to nest a relational phrase (S1x) inside another relational phrase (P2)?

To begin, I'm not sure what you mean by "a" in your logic.

If a is referring to some object, be it "anna" then no, AFAIK you can't have two extensions with one or two variables in a form like yours - P2aS1x. Syntactically it doesn't make sense, it's like saying "for all x, x is an SI anna paints" which is really bad syntax. You can have two variables following one predicate as in the case with General Predicate Logic which Bram28 shows in his logic which translates as - "if (x is a square and Anna painted x) then (x is a rectangle and Anna painted x)" you just need a few glossary intensions like "Pxy means x painted y" etc.

However I think a universal quantifier Ax would be better than Bram's suggestion of an existential quantifier for OPs solution.