I wrote a program that is able to evaluate arithmetical expressions, like
1 + 3.0 * 4 / (1 - 1 * 3.2)
What I want is to use the same program to evaluate logical expressions. For that, suppose $1$ means true and $0$ means false. For example, let's consider the logical operation AND
0 ^ 0 = 0
0 ^ 1 = 0
1 ^ 0 = 0
1 ^ 1 = 1
We could easily represent the AND operator using multiplication
0 * 0 = 0
0 * 1 = 0
1 * 0 = 0
1 * 1 = 1
My question is: given a logical expression (e.g.: $1 \lor \lnot1\land(0\rightarrow 1)$), is there a mapping to turn it into an arithmetical expression such that its evaluation would give the same value than the logical?
Yes, this is possible: