When updating the documentation, Peter N Lewis and I came to the problem how to describe the Boolean values `True' and `False'.
Peter suggested "true (conforming to reality) and false (different from reality", but I think "reality" is not a good term here (what do computer programs have to do with reality, anyway ;-).
Perhaps the only thing that can be said is that there are two values, true and false, and that one is the opposite of the other.
But they have some certain meanings as conditions in `if' and loops, and in expressions like `x = 2'.
Does anyone have a useful description without being selfreferential and without referring to "reality"?
BTW, ISO 10206 contains things like these:
: The Booleantype shall be an ordinaltype. The values : shall be the enumeration of truth values denoted by the required : constantidentifiers false and true, such that false is the predecessor : of true. The ordinal numbers of the truth values denoted by false and : true shall be the integer values 0 and 1 respectively.
: The operator in shall yield the value true if : the value of the operand of ordinaltype is a member of the value of the : settype; otherwise, it shall yield the value false.
: If the Booleanexpression of the ifstatement yields the value true, the : statement of the ifstatement shall be executed. If the Booleanexpression : yields the value false, the statement of the ifstatement shall not be : executed, and the statement of the elsepart, if any, shall be executed.
Frank
Frank Heckenbach wrote:
When updating the documentation, Peter N Lewis and I came to the problem how to describe the Boolean values `True' and `False'.
Peter suggested "true (conforming to reality) and false (different from reality", but I think "reality" is not a good term here (what do computer programs have to do with reality, anyway ;-).
What about this?
"True" stands for a condition which is always fullfilled - such as "2 = 2" - and "False" stands for a condition which is never fullfilled - such as "1 = 0".
Formally spoken, "condition" ties it "too much" to the usage in "if" statements etc. - but this is what Boolean values are used for in reality. ;-)
In order to illustrate that other uses are possible at all, an example with a Boolean variable should follow.
Just my 2 CentiEuro,
Peter
Peter Gerwinski wrote:
Frank Heckenbach wrote:
When updating the documentation, Peter N Lewis and I came to the problem how to describe the Boolean values `True' and `False'.
Peter suggested "true (conforming to reality) and false (different from reality", but I think "reality" is not a good term here (what do computer programs have to do with reality, anyway ;-).
What about this?
"True" stands for a condition which is always fullfilled - such as "2 = 2" - and "False" stands for a condition which is never fullfilled - such as "1 = 0".
There might be a danger of confusion WRT "always":
if (i >= 0) = True then Foo
Someone might think that `Foo' is only executed only if i is *always* >= 0 (e.g., declared as an unsigned type). It's silly, I know ...
In order to illustrate that other uses are possible at all, an example with a Boolean variable should follow.
Actually, the current example reads:
program TrueDemo;
var a: Boolean; begin a := 1 = 1; { True } WriteLn (Ord (a)); { 1 } WriteLn (a); { True } end.
So perhaps it would be better to add the more common usage in conditionals and loops. ;-)
Or, actually, add `True' in the first place. It might be useful for a demo program to contain the thing that is demonstrated at all (not only in comments). ;-)
Frank
I'd back this, after all they refer to logical states which are "black and white", either always correct or never correct. No half-way "maybe correct, etc." Replace 'correct' with fulfilled depending on the context.
(Just CentiAEuro-pinching: I'm think its spelt fulfilled, one 'l' the first time, two 'l's the second time.)
Maybe someone who plays with logical algebra will have a better answer?
Grant
At 4:46 PM +0200 31/3/03, Peter Gerwinski wrote:
Frank Heckenbach wrote:
When updating the documentation, Peter N Lewis and I came to the problem how to describe the Boolean values `True' and `False'.
Peter suggested "true (conforming to reality) and false (different from reality", but I think "reality" is not a good term here (what do computer programs have to do with reality, anyway ;-).
What about this?
"True" stands for a condition which is always fullfilled - such as "2 = 2" - and "False" stands for a condition which is never fullfilled - such as "1 = 0".
Formally spoken, "condition" ties it "too much" to the usage in "if" statements etc. - but this is what Boolean values are used for in reality. ;-)
In order to illustrate that other uses are possible at all, an example with a Boolean variable should follow.
Just my 2 CentiEuro,
Peter
-- WARNING: Do not execute! This software is patented! See: http://swpat.ffii.org/patents/txt/ep/0394/160/
echo -ne PROGRESS\r;for i in `seq 8`;do sleep 1;echo -n %;done;echo