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
  • Purpose
  • Description
  • Examples
  • Syntax and meaning
  • Language
  • Markup
  • Context elements
Export as PDF
  1. The language Ampersand

Context

PreviousSemantics of residuals visualizedNextModule

Last updated 6 years ago

Purpose

Contexts exist in Ampersand for the purpose of dealing with . Within one context there may be no contradictions.

Description

Any statement can be true in context only. Within one context, there are no contradictions. As facts are true statements, we say that facts must exist inside a context.

Examples

Examples of contexts:

  • a single lawsuit in which all case data is contained;

  • the financial administration of a repair shop;

  • the life insurance department of a bank.

The world is full of contradictions. Examples:

  • Bob's personal income over March 2013 according to Bob's employer differs from Bob's personal income over March 2013 according to the National Tax Authority. (To resolve this, we must distinguish between the context of Bob's employer and the context of the National Tax Authority.)

  • The police can be convinced that Peter X commited the crime, yet his attorney is convinced he is innocent. (To make sense of the situation, a judge distinguishes the reasoning of the defense from the reasoning of the prosecution as different contexts. In fact, the judge will construct her own context to create the verdict )

  • A computer system can tell that the person with social security number 721-07-4426 was born on April 27th, 1943, while the same computer system tells in another screen that this person was born on May 3rd, 1952. This is inconsistent, because every person has only one birth date. (This situation should be reported as a software mistake.)

and meaning

CONTEXT <name> <language>? <markup>? <context element>* ENDCONTEXT

A context is specified by the context elements between the keywords CONTEXT and ENDCONTEXT. A context has a name. You can optionally specify the language and markup (see below).

Language

To tell Ampersand what language your context is in, you can append a language directive to your context. Currently English and Dutch are supported. To do so, directly following the name of your context, you can specify

IN <language>

Where <language> can be ENGLISH or DUTCH.

Markup

Directly following the optional language definition, you can optionally specify the format of texts in your PURPOSE statements and MEANING blocks. This allows you to use your favourite markup language within Ampersand, as long as it is one of REST (Restructured Text), HTML, LATEX or MARKDOWN. If you specify one of these words in your CONTEXT definition, that value will be the default markup of all purposes and meanings in your context.

Context elements

A context may contain different types of statements. The order of statements in a context is irrelevant for the software that Ampersand generates. However, the order is maintained when documentation is generated.

<meta>

a statement to provide metadata to a script, such as author, company, etc.

<pattern>

a block of code that represents rules on a single and specific topic, at the user's discretion

<rule>

<gen>

<relation>

<conceptDef>

<representation>

<roleRule>

a statement that makes a role responsible for satisfying a rule

<viewDef>

a statement for presenting facts in a readable sentence

<service>

a unit of code that can be run independently and specifies interaction with a user or a computer

<purpose>

a statement to describe the purpose of a context or a context element

<population>

a statement that sums up the initial population of a relation

<include>

a statement to include another file in the context

A context represents a set of , which is the meaning of that context.

(For details on these formats, see ).

a statement that declares a

a statement that specifies generalization/specialization of

a declaration of a relation, stating the existence of a within the context

a description of a , to document its meaning

a statement that defines the atomic type of a

truth
Syntax
true statements in a given language
pandoc.org
rule
concepts
relation
concept
concept