Topic: boolean value that's not true or false


Author: Jim Smith <jimsmithellis@gmail.com>
Date: Wed, 10 Jun 2015 14:51:25 -0400
Raw View
--001a11c2b616a2f0fe05182e5cce
Content-Type: text/plain; charset=UTF-8

There was a feature proposal that accounted for a boolean value that's not
true or false. Was it ever accepted or replaced?


--
Regards,
James Smith

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--001a11c2b616a2f0fe05182e5cce
Content-Type: text/html; charset=UTF-8

<div dir="ltr">There was a feature proposal that accounted for a boolean value that&#39;s not true or false. Was it ever accepted or replaced?<br clear="all"><div><div><br><br>-- <br><div class="gmail_signature">Regards,<br>James Smith<br><br></div>
</div></div></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />

--001a11c2b616a2f0fe05182e5cce--

.


Author: Max Truxa <me@maxtruxa.com>
Date: Wed, 10 Jun 2015 12:47:33 -0700 (PDT)
Raw View
------=_Part_871_877624051.1433965653865
Content-Type: multipart/alternative;
 boundary="----=_Part_872_1309737561.1433965653865"

------=_Part_872_1309737561.1433965653865
Content-Type: text/plain; charset=UTF-8

I can't exactly answer your question, but I guess the proposal you are
referring to is N2136 "Bool_set: multi-valued logic"
<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2136.pdf>.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_872_1309737561.1433965653865
Content-Type: text/html; charset=UTF-8

<div dir="ltr">I can't exactly answer your question, but I guess the proposal you are referring to is <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2136.pdf">N2136 "Bool_set: multi-valued logic"</a>.</div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:std-proposals+unsubscribe@isocpp.org">std-proposals+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href="mailto:std-proposals@isocpp.org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href="http://groups.google.com/a/isocpp.org/group/std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/</a>.<br />

------=_Part_872_1309737561.1433965653865--
------=_Part_871_877624051.1433965653865--

.


Author: Michael Price - Dev <michael.b.price.dev@gmail.com>
Date: Fri, 12 Jun 2015 11:52:03 -0700 (PDT)
Raw View
------=_Part_1408_1697508228.1434135123677
Content-Type: multipart/alternative;
 boundary="----=_Part_1409_700537601.1434135123677"

------=_Part_1409_700537601.1434135123677
Content-Type: text/plain; charset=UTF-8

Will std::optional<bool> work instead?

On Wednesday, June 10, 2015 at 1:51:27 PM UTC-5, Jim Smith wrote:
>
> There was a feature proposal that accounted for a boolean value that's not
> true or false. Was it ever accepted or replaced?
>
>
> --
> Regards,
> James Smith
>
>

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

------=_Part_1409_700537601.1434135123677
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Will std::optional&lt;bool&gt; work instead?<br><br>On Wed=
nesday, June 10, 2015 at 1:51:27 PM UTC-5, Jim Smith wrote:<blockquote clas=
s=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #c=
cc solid;padding-left: 1ex;"><div dir=3D"ltr">There was a feature proposal =
that accounted for a boolean value that's not true or false. Was it ever ac=
cepted or replaced?<br clear=3D"all"><div><div><br><br>-- <br><div>Regards,=
<br>James Smith<br><br></div>
</div></div></div>
</blockquote></div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

------=_Part_1409_700537601.1434135123677--
------=_Part_1408_1697508228.1434135123677--

.


Author: Jim Smith <jimsmithellis@gmail.com>
Date: Fri, 12 Jun 2015 19:40:24 -0400
Raw View
--001a11c23452d07a9005185aa1ac
Content-Type: text/plain; charset=UTF-8

I remember this feature being seriously considered for C++11, was it ever
considered again? It appears to be reasonable and I never heard the reason
why it was suddenly rejected.


Jim Smith


On Fri, Jun 12, 2015 at 2:52 PM, Michael Price - Dev <
michael.b.price.dev@gmail.com> wrote:

> Will std::optional<bool> work instead?
>
>
> On Wednesday, June 10, 2015 at 1:51:27 PM UTC-5, Jim Smith wrote:
>>
>> There was a feature proposal that accounted for a boolean value that's
>> not true or false. Was it ever accepted or replaced?
>>
>>
>> --
>> Regards,
>> James Smith
>>
>>   --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> Visit this group at
> http://groups.google.com/a/isocpp.org/group/std-proposals/.
>



--
Regards,
James Smith

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

--001a11c23452d07a9005185aa1ac
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>I remember this feature being seriously considered fo=
r C++11, was it ever considered again? It appears to be reasonable and I ne=
ver heard the reason why it was suddenly rejected.<br><br><br></div>Jim Smi=
th<br><div><br></div></div><div class=3D"gmail_extra"><br><div class=3D"gma=
il_quote">On Fri, Jun 12, 2015 at 2:52 PM, Michael Price - Dev <span dir=3D=
"ltr">&lt;<a href=3D"mailto:michael.b.price.dev@gmail.com" target=3D"_blank=
">michael.b.price.dev@gmail.com</a>&gt;</span> wrote:<br><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div dir=3D"ltr">Will std::optional&lt;bool&gt; work instead?=
<div><div class=3D"h5"><br><br>On Wednesday, June 10, 2015 at 1:51:27 PM UT=
C-5, Jim Smith wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0;ma=
rgin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"lt=
r">There was a feature proposal that accounted for a boolean value that&#39=
;s not true or false. Was it ever accepted or replaced?<br clear=3D"all"><d=
iv><div><br><br>-- <br><div>Regards,<br>James Smith<br><br></div>
</div></div></div>
</blockquote></div></div></div><div class=3D"HOEnZb"><div class=3D"h5">

<p></p>

-- <br>
<br>
--- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/" target=3D"_blank">http://groups.google.com/a/isocpp.org/gro=
up/std-proposals/</a>.<br>
</div></div></blockquote></div><br><br clear=3D"all"><br>-- <br><div class=
=3D"gmail_signature">Regards,<br>James Smith<br><br></div>
</div>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--001a11c23452d07a9005185aa1ac--

.


Author: David Krauss <potswa@gmail.com>
Date: Sat, 13 Jun 2015 10:37:25 +0800
Raw View
--Apple-Mail=_5509E841-60CE-48F5-8583-32456A04C015
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8

Looking at the proposal, some pieces are inconsistent, like the floating-po=
int comparisons which return =E2=80=9Cindeterminate=E2=80=9D even for +0=3D=
+0. Ternary circuits are of no relevance to C++. Frankly, it seems a little=
 half-baked and directionless.

It calls for values, =E2=80=9Ctrue,=E2=80=9D =E2=80=9Cfalse,=E2=80=9D =E2=
=80=9Ceither,=E2=80=9D and =E2=80=9Cneither.=E2=80=9D It=E2=80=99s the powe=
rset of bool. Why?

> Why not just three states as in Boost.Tribool?
>=20
> In addition to indeterminate, usage with interval<T> requires an empty st=
ate. Moreover, there is
> likely no penalty for having a fourth state in current systems, since the=
 possibilities for space savings
> by having three instead of four are almost null. If the empty state is no=
t needed, there is no penalty
> for not using it, and it will not be created by the other boolean operati=
ons. In other words, the algebra
> consisting of true, false, and indeterminate states is stable.

So, the extra value is essentially a NaN. Just because interval<bool> can g=
enerate a NaN, does that really imply that bool_set should propagate it? Do=
es supporting this really add no overhead? The paper says no storage overhe=
ad and leaves it at that, which isn=E2=80=99t a very good analysis. Even co=
nsidering storage alone, it=E2=80=99s a class and there=E2=80=99s no provis=
ion for packed representation, so it always takes a byte. (That=E2=80=99s a=
 terrible shortcoming for many potential users, by the way.)

Some directions that might do better, IMHO:

1. Standardize Boost.tribool.

2. Create a more general library for multi-valued/fuzzy logic. It would be =
nice to support the algebra used by VHDL and Verilog for digital circuit si=
mulation. Such a beast might support arbitrary lookup tables and exceptions=
 on invalid operations (=E2=80=9Csignaling NaNs=E2=80=9D).

3. Create an adapter to map operator & and operator | to min and max, respe=
ctively. (I don=E2=80=99t see the advantage to Boost.tribool's decision to =
use && and ||. Short-circuit operators should be overloaded only as a last =
resort, and the user shouldn=E2=80=99t access the bitwise representation of=
 a fuzzy logic value.)

For #2 and #3, the implementation could explicitly specialize and optimize =
the 3-state logic case. In all cases, there should be std::bitset and std::=
vector<bool> equivalents. (Or, perhaps use enumerations and propose a gener=
al packed-value facility?)

But, what would standardization really gain? Are there fuzzy logic librarie=
s out there with interoperability problems? Are there programs in the wild =
that run too slow because of poor fuzzy logic micro-optimization? A proposa=
l needs more motivation than =E2=80=9Cwe were in the neighborhood and thoug=
ht we would stop by.=E2=80=9D

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

--Apple-Mail=_5509E841-60CE-48F5-8583-32456A04C015
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html charset=
=3Dutf-8"></head><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: s=
pace; -webkit-line-break: after-white-space;" class=3D"">Looking at the pro=
posal, some pieces are inconsistent, like the floating-point comparisons wh=
ich return =E2=80=9Cindeterminate=E2=80=9D even for +0=3D+0. Ternary circui=
ts are of no relevance to C++. Frankly, it seems a little half-baked and di=
rectionless.<div class=3D""><br class=3D""></div><div class=3D"">It calls f=
or values, =E2=80=9Ctrue,=E2=80=9D =E2=80=9Cfalse,=E2=80=9D =E2=80=9Ceither=
,=E2=80=9D and =E2=80=9Cneither.=E2=80=9D It=E2=80=99s the powerset of bool=
.. Why?</div><div class=3D""><br class=3D""></div><div class=3D""></div><blo=
ckquote type=3D"cite" class=3D""><div class=3D"">Why not just three states =
as in Boost.Tribool?</div><div class=3D""><br class=3D"">In addition to ind=
eterminate, usage with&nbsp;<font face=3D"Courier" class=3D"">interval&lt;T=
&gt;</font>&nbsp;requires an empty state.&nbsp;Moreover, there is<br class=
=3D"">likely no penalty for having a fourth state in current systems, since=
 the possibilities for space savings<br class=3D"">by having three instead =
of four are almost null.&nbsp;If the empty state is not needed, there is no=
 penalty<br class=3D"">for not using it, and it will not be created by the =
other boolean operations. In other words, the algebra<br class=3D"">consist=
ing of true, false, and indeterminate states is stable.<br class=3D""></div=
></blockquote><div class=3D""><div class=3D""><br class=3D""></div><div cla=
ss=3D"">So, the extra value is essentially a NaN. Just because&nbsp;<font f=
ace=3D"Courier" class=3D"">interval&lt;bool&gt;</font> can generate a NaN, =
does that really imply that <font face=3D"Courier" class=3D"">bool_set</fon=
t> should propagate it? Does supporting this really add no overhead? The pa=
per says no <i class=3D"">storage</i>&nbsp;overhead and leaves it at that, =
which isn=E2=80=99t a very good analysis. Even considering storage alone, i=
t=E2=80=99s a class and there=E2=80=99s no provision for packed representat=
ion, so it always takes a byte. (That=E2=80=99s a terrible shortcoming for =
many potential users, by the way.)</div><div class=3D""><br class=3D""></di=
v><div class=3D"">Some directions that might do better, IMHO:</div><div cla=
ss=3D""><br class=3D""></div><div class=3D"">1. Standardize Boost.tribool.<=
/div><div class=3D""><br class=3D""></div><div class=3D"">2. Create a more =
general library for multi-valued/fuzzy logic. It would be nice to support t=
he algebra used by VHDL and Verilog for digital circuit simulation. Such a =
beast might support arbitrary lookup tables and exceptions on invalid opera=
tions (=E2=80=9Csignaling NaNs=E2=80=9D).</div><div class=3D""><br class=3D=
""></div><div class=3D"">3. Create an adapter to map&nbsp;<font face=3D"Cou=
rier" class=3D"">operator &amp;</font> and <font face=3D"Courier" class=3D"=
">operator |</font>&nbsp;to <font face=3D"Courier" class=3D"">min</font> an=
d <font face=3D"Courier" class=3D"">max</font>, respectively. (I don=E2=80=
=99t see the advantage to Boost.tribool's decision to use <font face=3D"Cou=
rier" class=3D"">&amp;&amp;</font> and <font face=3D"Courier" class=3D"">||=
</font>. Short-circuit operators should be overloaded only as a last resort=
, and the user shouldn=E2=80=99t access the bitwise representation of a fuz=
zy logic value.)</div><div class=3D""><br class=3D""></div><div class=3D"">=
For #2 and #3, the implementation could explicitly specialize and optimize =
the 3-state logic case. In all cases, there should be <font face=3D"Courier=
" class=3D"">std::bitset</font> and <font face=3D"Courier" class=3D"">std::=
vector&lt;bool&gt;</font> equivalents. (Or, perhaps use enumerations and pr=
opose a general packed-value facility?)</div><div class=3D""><br class=3D""=
></div><div class=3D""><div class=3D""><div class=3D""><div class=3D"">But,=
 what would standardization really gain? Are there fuzzy logic libraries ou=
t there with interoperability problems? Are there programs in the wild that=
 run too slow because of poor fuzzy logic micro-optimization? A proposal ne=
eds more motivation than =E2=80=9Cwe were in the neighborhood and thought w=
e would stop by.=E2=80=9D</div></div></div></div></div></body></html>

<p></p>

-- <br />
<br />
--- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
Visit this group at <a href=3D"http://groups.google.com/a/isocpp.org/group/=
std-proposals/">http://groups.google.com/a/isocpp.org/group/std-proposals/<=
/a>.<br />

--Apple-Mail=_5509E841-60CE-48F5-8583-32456A04C015--

.


Author: Bjorn Reese <breese@mail1.stofanet.dk>
Date: Sat, 13 Jun 2015 11:39:17 +0200
Raw View
On 06/13/2015 04:37 AM, David Krauss wrote:

> 1. Standardize Boost.tribool.

With the addition of having traits to specify the truth tables. This has
been discussed earlier at:

http://permalink.gmane.org/gmane.comp.lang.c%2B%2B.isocpp.proposals/5250
http://permalink.gmane.org/gmane.comp.lang.c%2B%2B.isocpp.proposals/5270

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.

.