Documentation
  • Introduction
  • Why Ampersand?
    • The Business Rules Manifesto and Ampersand
  • Tutorial
    • Example system: Enrollment
    • Conceptual Model: Enrollment
    • Your tool: RAP4
    • Making your first Ampersand script
  • Reactive programming
  • The language Ampersand
    • How to read syntax statements
    • Truth
    • Atoms
    • The CONCEPT statement
    • The RELATION statement
    • The MEANING statement
    • The PURPOSE statement
    • The CLASSIFY statement
    • The RULE statement
    • Terms
      • Semantics
      • Semantics in logic
        • Primitive terms
        • Boolean operators
        • Relational operators
        • Residual operators
      • Semantics in natural language
        • Primitive terms in natural language
        • Boolean operators in natural language
        • Relational operators in natural language
        • Residual operators in natural language
      • Semantics in sets
        • Primitive terms in set theory
        • Boolean operators in set theory
        • Relational operators in set theory
      • Semantics of terms, defined algebraically
        • Boolean operators in algebra
        • Relational operators in algebra
      • Semantics visualized
        • Semantics of boolean operators visualized
        • Semantics of relational operators visualized
        • Semantics of residuals visualized
    • Context
    • Module
    • Best Practices
    • Syntactical Conventions
      • The CONCEPT statement
      • The RELATION statement
      • The RULE statement
      • The CONTEXT statement
      • The INCLUDE statement
      • Explanation
      • Patterns
      • Population
        • Population in spreadsheets
      • The PURPOSE statement
      • The IDENT statement
      • The TABLE statement
      • Language support
    • The INCLUDE statement
    • Patterns
    • Services
      • Example: Client
      • Example: Login
      • Syntax and meaning
      • Explanation
      • Layout of user interfaces
        • Your own widgets (HTML and CSS)
      • CRUD
    • Population
      • Population in spreadsheets
    • The ENFORCE statement
    • The IDENT statement
    • The TABLE statement
    • Language support
    • Current date
    • The Preprocessor
    • Design considerations
  • Running the Ampersand compiler
    • Configuration
    • Commands (vs. 4.0.0 and later)
    • Options (up to vs. 3.17.4)
  • Architecture of an Ampersand Application
    • Backend framework
    • Hooks
    • Extensions
      • The ExecEngine
  • Deploying your Ampersand script
    • Compiler
    • Deploy your own web application on your laptop
    • Prototype multi-stage build
    • Prototype database
  • Reusing Available Modules
    • Modules
    • Security
    • SIAM (Sessions, Identity and Access Management) Module
  • Exercises
    • Delivery
    • VOG (in Dutch)
  • Installing Ampersand
    • Deploying your Prototype
    • Installing the tools manually
  • Modeling
    • Domain Driven Design
    • Data modeling
    • Legal modeling
    • Architecture modeling
    • Metamodeling
    • Limitations of Ampersand
  • Configuring your application
  • The Excel Importer
  • Plans
    • Current State
    • NoSQL storage
    • API documentation
    • OWL and RDFS input
    • Refactor the front-end
  • Research
Powered by GitBook
On this page
  • How to type boolean operators in your script
  • Other explanation
Export as PDF
  1. The language Ampersand
  2. Terms
  3. Semantics in logic

Boolean operators

PreviousPrimitive termsNextRelational operators

Last updated 2 years ago

The notation a r ba\ r\ ba r b means that the pair (a,b) is in relation rrr. This page defines when pair (a,b) is in relation r∩sr ∩ sr∩s (the intersection of rrr and sss), r∪sr ∪ sr∪s (the union of rrr and sss), r−sr-sr−s (the difference of rrr and sss).

  • intersection : a (r∩s) b ⇔ a r b ∧ a s ba\ (r ∩ s)\ b\ \Leftrightarrow\ a\ r\ b\ ∧\ a\ s\ ba (r∩s) b ⇔ a r b ∧ a s b . In other words: if the pair (a,b)(a,b)(a,b) is both in relation rrr and sss, then it is in the intersection of rrr and sss.

  • union : a (r∪s) b ⇔ a r b ∨ a s ba\ (r ∪ s)\ b\ \Leftrightarrow\ a\ r\ b\ \vee\ a\ s\ ba (r∪s) b ⇔ a r b ∨ a s b . In words: if the pair (a,b)(a,b)(a,b) is in the relation rrr or in sss, then it is in the union of rrr and sss.

  • difference : a (r−s) b ⇔ a r b ∧ ¬(a s b)a\ (r-s)\ b\ \Leftrightarrow\ a\ r\ b\ ∧\ \neg(a\ s\ b)a (r−s) b ⇔ a r b ∧ ¬(a s b). In other words, the term r−sr-sr−s contains all pairs from rrr that are not in sss.

The complement (or negation) of a relation r[AxB]r_{[A x B]}r[AxB]​ is defined by means of the difference operator:

  • complement : If rrr is defined as rA×Br_{A\times B}rA×B​, then r‾\overline{r}r is the set of all tuples in A×BA\times BA×B (the Cartesian product) that are not contained in rrr. So r‾=V[A×B]−r\overline{r} = V_{[A\times B]} - rr=V[A×B]​−r

Note that the complement is defined in terms of AAA and BBB. So, two relations with an identical population yet a different type may have different complements.

How to type boolean operators in your script

shows how you can type boolean (and other) operators in your Ampersand script.

Other explanation

Would you like a different explanation of the boolean operators? explains the boolean operators in terms of set theory.

This page
This page