Single variable true or false statements

90 Views Asked by At

If I have a true or false statement S, depending on a varible x, is there some standard function or opperation in formal logic, that takes the statement S and the variable x, and outputs $1$ if statement S is true for x, and $0$ if the statement S is false for x.

1

There are 1 best solutions below

0
On

One name for this is the Iverson bracket:

In mathematics, the Iverson bracket, named after Kenneth E. Iverson, is a notation that denotes a number that is $1$ if the condition in square brackets is satisfied, and $0$ otherwise. More exactly, $$[P] = \begin{cases} 1 & \text{if $P$ is true;} \\ 0 & \text{otherwise} \end{cases} $$ where $P$ is a statement that can be true or false.