I'm having this issue with a basic logic problem.
X is the statement: If you have an apple, I will give you a hat, unless you already have one.
This can be broken into 3 statements.
P: You have an apple
Q: I give you a hat
R: You already have a hat
Then X can be written as:
$$ P \land \lnot R \implies Q $$
Simplified:
$$ \lnot P \lor R \lor Q $$
However, when all three are true, I.E. You have a hat, you have an apple, and I give you hat. The expression evaluates to true.
However, this cannot be because I promised I would not give you a hat if you already had one. I.E. the following contradiction occurs with Q and R, where Q is True and ~R is False.
$$ T \implies F = T $$
What is my mistake?
Edit:
Maybe what I want is actually:
$$ ( P \implies Q ) \iff \lnot R $$
The implication in first order logic is not the same as the implication we use in language, for example $5>3 \Longrightarrow \text{The earth orbits around the sun}$ is true even though the first has nothing to do with the second one. In the same way $3>5 \Longrightarrow A$ where $A$ is any predicate is true. This isn't directly the same as what you posted but it illustrates that you have to be carefull when translating an implication to a logic implication.
$A\Longrightarrow B$ can be best translated as: "If $A$ is true, then $B$ is also true." Note that this doesn't say anything about what happens if $A$ is false and doesn't say anything about causation.
Edit: Aditionally your sentence doesn't have to mean that he wouldn't get an apple when one of the conditions isn't true. You could interpret the sentence in multiple ways and that's one of the reasons the logical implication is different: it is defined in a way that there can't be multiple ways something can be interpreted.