8 Boolean-valued Attributes

In predicate logic, a 0‑ary predicate is a proposition. Predica deliberately avoids 0‑ary predicates for attributes: every attribute corresponds to a unary predicate, even when the attribute’s type is Boolean. This keeps the semantics uniform and avoids special‑case rules for Boolean attributes.


entity Supplier
{
    Integer id;
    Boolean certified;
}

The query s.supplier.certified is equivalent to:

certified=C:Boolean
where
  ∃S:Supplier
    s.supplier(S)
  ∧ S.certified(C)

When certified is used in a filter in the query s.supplier.[certified], the Boolean-valued variable C appears as a conjunct:

supplier=S:Supplier
where
  ∃C:Boolean
    s.supplier(S)
  ∧ S.certified(C)
  ∧ C

Boolean attribute with relaxed cardinality constraint

In the following example there is no cardinality constraint on respondedThatlikesIcecream. Therefore its extension can be {}, {false}, {true}, or {false,true}. This is an example where a relaxed cardinality constraint allows for recording partial information or conflicting information.


entity Person
{
    String name;
    Boolean respondedThatlikesIcecream*;
}