Logic: Else Symbol

3.2k Views Asked by At

Is there a mathematical symbol to represent "else"; the way it's used in computer science and propositional logic? Is it simply "or"?

1

There are 1 best solutions below

0
On

The closest thing to an "else" comes with piecewise defined functions, which is in act the very application of else in programming:

function max(x,y) {
  if (x > y) then
     return x
  else
     return y
  end if
}

would match the piecewise definition $$ \max\{x,y\}:=\begin{cases}x&\text{if }x>y\\y&\text{otherwise}\end{cases}$$ Note that one commonly embeds natural language into such definitions, for the sake of readability.