Tuesday 1 May 2018

Causal Notation.

Purpose.

This is a Causal Notation's initial draft, it's intended to have uses in Causal Proofs, Causal Analysis,
Causal Modelling, Causal Design, Causal Programming & Causal Automated Tests.


Additional practical notes.

This model is not detached from Reality, it applies to concurrent, non-realtime systems. Hence, we consider unknown delays in model & notation.

Are realtime systems detached from Reality?

Generally they are not - but for many solutions they are too expensive and slow to make. Hence, in many niches and solutions they are too unreal to be worthwhile.

Proving that programs or program parts will complete in a given maximum amount of time, is not possible using these tools. Using statistical-allowance of errors, including completion-time-related errors and forming contracts that way might be possible, but there's always a risk.

While time is counted very precisely by computer clocks, there are delays caused by code execution - every instruction takes a time to perform. Exact amount of delay depends on instruction(s), on processor(s) and on operating system and other software layers, if there are any.

Therefore, clock-events, objects creation and interaction are associated with delays, and response to clock-events usually is associated with delays.

Profilers, either built-in a programming language, or added manually or provided by thrid-party tools - are a good way of measuring average, worst and best delays statistically on a given hardware-software infrastructure unit.

See also, if You wish: Correctness.


Types.

Ca: a cause,
R: a result, an abstract object type that can evaluate to a boolean value,
De: discrete event, either a cause or result,
Co: a condition,
Te: a timeframe.
Cns: a conditions set,
B: a boolean expression,
Cto: a clock-events bound condition; it's state contains exact time of appearance and time of disappearance,
t: a time measured in milliseconds since beginning of year 1 A.D.
O: observer object - observes clock events, causes & conditions appearance, existence and disappearance, as well as origination, hold time, and cessation, then reacts with events that can result in cause(s) and/or condition(s) appearance and disappearance, as well as origination and cessation.


Definitions.

Cto := (t1, t2) - - Condition that appears at time t1 or a little later, and disappears at t2 or a little later,
Cto := (t, ...) - Condition that appears at a time t or a little later, and disappears when program stops,
Cto := (..., t) - Condition that appears during program's initialization, and disappears at time t or a little later,
Ten := Com - a timeframe Ten is defined as in-between of a condition Com appearance and disappearance.
Cnsn := Con1, Con2, ... - a conditions set Con is defined as a collection of conditions Con1, Con2, ...
Cnsn := Cnsm1, Cnsm2, ..., Cop1, Cop2, ... - a conditions set Cnsn,
  is defined as a collection of:
  * conditions Cop1, Cop2, ...,
  * conditions from conditions sets Cnsm1, Cnsm2, ...

Origination - an objects starts to affect Reality.
Hold - an object keeps affecting Reality.
Cessation - an object ceases to affect Reality.

Appearance - an object appears in Reality.
Existence - an object exists in Reaiity.
Disappearance - an object disappears from Reality.

In different sources - Buddhist or other - these ideas might be defined differently.

In many cases, but not all:
* appearance means origination,
* existence means hold,
* disappearance means cessation.

Can object exist and not affect Reality?
* depends on how we define a Reality,
* a part of Reality is also a Reality,
* we can play with ideas of objects with or without meaning,
* we can play with ideas of physical and nonmaterial objects,
* we can play with ideas of redefining what 'affecting' means, and with 'affecting threshold',
* does observation affect Reality?,
* ...

This has uses in modelling, for example, as models are simplified representation of interresting Reality's parts.


Appearance, Existence, Disappearance, Origination, Hold & Cessation.

Can := App Dem - a discrete event Dem makes a cause Can to appear.
Can := App Com - a condition Com makes a cause Can to appear.
Can := App Cnsm - a conditions set Cnsm makes a cause Can to appear.

when Bn : Com - condition Com appears and exists for as long as Bn is true.

Rn := Ap Dem in Tep - a result Rn evaluates to true if a discrete event Dem appears in a timeframe Tep.
Rn := Ap Com in Tep - a result Rn evaluates to true if a condition Com appears in a timeframe Tep.
Rn := Ap Cnsm in Tep - a result Rn evaluates to true if a conditions set Cnsm appears in a timeframe Tep.
Rn := Dis Cam in Tep - a result Rn evaluates to true if a cause Cam disappears in a timeframe Tep.
Rn := Dis Com in Tep - a result Rn evaluates to true if a condition Com disappears in a timeframe Tep.
Rn := Dis Cnsm in Tep - a result Rn evaluates to true if a condition set Cnsm disappears in a timeframe Tep.
Rn := Ex Cam in Tep - a result Rn evaluates to true if a cause Cam exists in a timeframe Tep.
Rn := Ex Com in Tep - a result Rn evaluates to true if a condition Com exists in a timeframe Tep.
Rn := Ex Cnsm in Tep - a result Rn evaluates to true if a condition set Cnsm exists in a timeframe Tep.

Rn := Ori Dem in Tep - a result Rn evaluates to true if a cause Dem originates in a timeframe Tep.
Rn := Ori Com in Tep - a result Rn evaluates to true if a condition Com originates in a timeframe Tep.
Rn := Ori Cnsm in Tep - a result Rn evaluates to true if a conditions set Cnsm originates in a timeframe Tep.
Rn := Ces Cam in Tep - a result Rn evaluates to true if a cause Cam ceases in a timeframe Tep.
Rn := Ces Com in Tep - a result Rn evaluates to true if a condition Com ceases in a timeframe Tep.
Rn := Ces Cnsm in Tep - a result Rn evaluates to true if a condition set Cnsm ceases in a timeframe Tep.
Rn := H Cam in Tep - a result Rn evaluates to true if a cause Cam holds in a timeframe Tep.
Rn := H Com in Tep - a result Rn evaluates to true if a condition Com holds in a timeframe Tep.
Rn := H Cnsm in Tep - a result Rn evaluates to true if a condition set Cnsm holds in a timeframe Tep.



Links.

See also, if You wish:
* The 'Causal Programming Paradigm'.
* Causal Automated Tests.