How do you say "if ... else" in logic notation?

91 Views Asked by At

I know that "if a then b" is represented as $a \implies b$, but how is "if a then b else c" represented?

I know in most programming languages there's a way to write this, but is there a way to write it in logic notation? Thanks in advance :]

1

There are 1 best solutions below

2
On BEST ANSWER

The expression you want is $(a \implies b) \wedge ((\neg a) \implies c)$.

(This was previously a comment; posting it as an answer as requested)