Boost logo

Boost :

From: Dan'l Miller (optikos_at_[hidden])
Date: 2002-08-11 15:27:36


  In reply to the various "what terms should we use for 3-valued and n-valued logic?" postings, a few of which are briefly quoted here:

Petr Kocmid wrote:
> Subject: RE: [boost] 3-state boolean type
> Date: Fri, 2 Aug 2002 05:37:22 +0200
> From: "Petr Kocmid" <pkocmid_at_[hidden]>
> To: <boost_at_[hidden]>
>
> Hi Douglas,
>
> > I've just placed a 3-state boolean type in the sandbox,
>
> Your tribool is very cute, however I have a few comments to it:
>
> As it is, it would be probably suitable for checkbox widget with
> on/off/maybe semantics on certain GUIs for example.
[...snip...]
> I'd prefer the name change to tristate_bool or multistate_bool respectively
> with namespace logic (I mean boost::logic), which certainly will please the
> purists. Perhaps, if tristate_bool implementation will remain with
> non-customizable indeterminate, multistate_bool could be written more
> generic way later on?

Matthew Hurd wrote:
> Douglas Gregor wrote:
> > I see that the naming of 'indeterminate' might be an issue, then. I need
> the
> > tribool in the domain of static analysis, where the third value means "I
> > can't statically determine if this boolean value is true or false, so the
> > value is indeterminate at compile-time". I'm not overly attached to the
> name
> > 'indeterminate', and 'maybe' is a lot shorter...
> >
> <snip>
>
> I've seen "unknown" used in a couple of languages. I like it. 'Maybe'
> presents a true bias in my mind, but I'm an optimist ;-)

  Boost should use existing terms for 3-valued and n-valued logic.

  bool and boolean derive from the person who first published an algebra for 2-valued logic: George Boole whose seminal publications on this topic were dated 1844 through 1847. Boole explored only 2-valued logic. Only two-valued logic bears the honor of his name. "bool" is not synonymous with "logic" but rather only with formalizing Aristotlean "two-valued logic".

  The waters are a tad more muddy for the "inventor/discoverer" of 3-valued logic. Three men appear to be recognized by us moderns as having introduced & advanced 3-valued logic: Charles S Pierce (USA, 1885, introduction) and Jan Lukasiewicz (Poland, pre1920, formal treatment) and to a lesser degree Emil Post (USA, 1920, formal treatment) as part of his n-valued logic. Pierce published his introduction in 1885 as "On the algebra of logic: a contribution to the philosophy of notation" in _American journal of mathematics_ volume 7 pages 180 to 202. Lukasiewicz's presented his unfolding advancements in 1910's "O zasadzie sprzecznosci u Arystotelesa" ["On the principle of contradiction in Aristotle"] (not published), in the Farewell Lecture of 7 March 1918 (not published), and in 1920's "O logice trojwartosciowej" ["On three-valued logic"] in _Ruch filozoficzny_ volume 5 pages 170 to 171. One thing is quite certain though: George Boole had nothing to do with the invention/discovery of 3-valued logic nor n-v
alued logic and thus "bool" is inappropriate to be used outside of the context of 2-valued logic.

  It should be noted that there is not exactly one 3-valued logic. Lukasiewicz logic is defined for the following 3 values: 0=false, 1/2=indeterminacy/possibility, 1=true. Other 3-valued logics are possible though (especially when considering the world of discrete n-valued logics as separate from Zadeh's fuzzy logic). For example,
  0=false, 1=indeterminacy/possibility, 2=true [logic in number systems of radix larger than 2, such as might be useful in optical computing with residue number systems]
  0=false, 1/2=deduction not yet reached due to not yet making the deductions (which could very well be made already given existing facts), 1=true [a discrete fractional logic (of procrastination?)]
  0=false, 1/2=indeterminacy due to future possibility (i.e., not deemed false *yet* and not deemed true *yet* because now's facts and history's facts do not support future events) [a discrete fractional temporal logic]
  (where things get really different than the colloquial 3-valued logic which is being discussed on this thread)
  0=falsity, 1=real truth, i=imaginary truth [complex logic]

  The waters are a tad clearer for n-valued logic. Emil Post was the first to publish an algebra for a finite n-valued logic in 1920 in "Introduction to a general theory of elementary propositions" in _Bulletin of the American Mathematics Society_ volume 26 (page 437) with a reprise in 1921 in "Introduction to a general theory of elementary propositions" in _American journal of mathematics_ volume 43, pages 163 to 185.

  3-valued logic and n-valued logic should not be confused with L. A. Zadeh's fuzzy logic (or any other probabilistic or continuous logic) which is a generalization of some discrete n-valued logics to operate over the [0,1] interval of real numbers.

  So in short:
  The terms chosen by Boost as the name of n-valued or 3-valued logic should be neither "bool" nor "boolean", lest Boost erode what "*Boolean* logic" means (and has meant for the past 150 years).
  The terms chosen by Boost as the name of n-valued or 3-valued logic could be focused on honoring one of the inventors/discovers of 3-valued or n-valued logic, of which Post is easiest for English-speakers to spell, but "post" already has other uses throughout computer science.
  The terms chosen by Boost as the name of n-valued or 3-valued logic could be focused on existing practice in formal mathematics: "n-valued logic", "3-valued logic", "many-valued logics", such as logic_nvalued, logic_3valued, and manyvalued_logic respectively.
  The terms & values chosen by Boost for the 3-values of 3-valued logic should be focused precisely on what the chosen 3-valued logic itself focuses on. If the values {0,1,2} are chosen, then this would not be canonical Lukasiewicz logic (nor similar to Zadeh's fuzzy logic over the inverval [0,1]), but rather would resemble more Post's n-valued logic. If the values {0, 1/2, 1} are chosen, then that could be Lukasiewicz logic, but would present some awkward/inefficent representation problems. If real values are chosen, then complex logic is excluded. If canonical 3-valued logic is what is desired, then that would be the values {0, 1/2, 1} and the terms {false, possibility, true}. If the values {0,1,2} are chosen for 3-valued logic, then {false, ..., true} cannot be the set of values, because true which already is a keyword which has the value 1 in ISO/IEC 14882 (Standard C++) cannot take on the value 2 in a different context.

  As a reference to the topic of many-valued logics (which is the accepted term for referring to both 3-valued logics as well as n-valued logics together), I would suggest _Many-valued logics_ by Grzegorz Malinowski, Oxford University Press, New York, 1993, QA9.45.M35, ISBN 0-19-853787-5.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk