--- layout: default title: "Booleans" parent: Primitive ancestor: Funcons-beta --- [Funcons-beta] : [Booleans.cbs] ----------------------------- ### Booleans
[
  Datatype booleans      Alias bools
  Funcon   true
  Funcon   false
  Funcon   not
  Funcon   implies
  Funcon   and
  Funcon   or
  Funcon   exclusive-or  Alias xor
]
Datatype
  booleans ::= true | false
Alias
  bools = booleans
Funcon
  not(_:booleans) : =>booleans
not(B) is logical negation.
Rule
  not(false) ~> true
Rule
  not(true) ~> false
Funcon
  implies(_:booleans, _:booleans) : =>booleans
implies(B1, B2) is logical implication.
Rule
  implies(false, false) ~> true
Rule
  implies(false, true) ~> true
Rule
  implies(true, true) ~> true
Rule
  implies(true, false) ~> false
Funcon
  and(_:booleans*) : =>booleans
and(B, ...) is logical conjunction of any number of Boolean values.
Rule
  and( ) ~> true
Rule
  and(false, _*:booleans*) ~> false  
Rule
  and(true, B*:booleans*) ~> and(B*)
Funcon
  or(_:booleans*) : =>booleans
or(B, ...) is logical disjunction of any number of Boolean values.
Rule
  or( ) ~> false
Rule
  or(true, _*:booleans*) ~> true
Rule
  or(false, B*:booleans*) ~> or(B*)
Funcon
  exclusive-or(_:booleans, _:booleans) : =>booleans
Alias
  xor = exclusive-or
exclusive-or(B1, B2) is exclusive disjunction.
Rule
  exclusive-or(false, false) ~> false
Rule
  exclusive-or(false, true)  ~> true
Rule
  exclusive-or(true, false)  ~> true
Rule
  exclusive-or(true, true)   ~> false
____ From the [PLanCompS Project] | [CBS-beta issues...] | [Suggest an improvement...] [Booleans.cbs]: Booleans.cbs "CBS SOURCE FILE" [Funcons-beta]: /CBS-beta/docs/Funcons-beta "FUNCONS-BETA" [Unstable-Funcons-beta]: /CBS-beta/docs/Unstable-Funcons-beta "UNSTABLE-FUNCONS-BETA" [Languages-beta]: /CBS-beta/docs/Languages-beta "LANGUAGES-BETA" [Unstable-Languages-beta]: /CBS-beta/docs/Unstable-Languages-beta "UNSTABLE-LANGUAGES-BETA" [CBS-beta]: /CBS-beta "CBS-BETA" [PLanCompS Project]: https://plancomps.github.io "PROGRAMMING LANGUAGE COMPONENTS AND SPECIFICATIONS PROJECT HOME PAGE" [CBS-beta issues...]: https://github.com/plancomps/CBS-beta/issues "CBS-BETA ISSUE REPORTS ON GITHUB" [Suggest an improvement...]: mailto:plancomps@gmail.com?Subject=CBS-beta%20-%20comment&Body=Re%3A%20CBS-beta%20specification%20at%20Values/Primitive/Booleans/Booleans.cbs%0A%0AComment/Query/Issue/Suggestion%3A%0A%0A%0ASignature%3A%0A "GENERATE AN EMAIL TEMPLATE"