Skip to content

Process assertions/annotations (especially as regards purity) #87

Open

Description

@jrandall

It would be useful to be able to express expectations regarding various properties of processes that implementations could use for workflow planning/optimisation.

For example: functional purity (referential transparency in outputs), safety (no external side effects), idempotency of side effects.

This could be encoded at the level of process or could potentially be represented individually for different sets of inputs/outputs.

For example, a complex process F might generate outputs X and Y on inputs A, B, and C. Let's say that the X output depends only on the inputs A and B while the Y output depends only on the inputs A and C (perhaps that A is a large data file and B and C are filtering parameters describing how to demux records into the B and C outputs). It would be valid in this instance to say that the process F is referentially transparent as a whole (i.e. all outputs depend only on the values of the three inputs). Thus, a workflow author who knows this will always be the case could assert that the process F is pure.

However, the process F could also be represented as a decomposition of two functions F1(A,B) and F2(A,C), each of which in this case is referentially transparent. If it is possible to encode assertions at this level, we could preserve optimisations (such as memoisation) for X = F1(A,B) even if F was not pure in output Y (say, for example, that output Y was output in a random order).

The ability to express workflows in a semantically rich way may be particularly pertinent when a process is itself a workflow and has many outputs and inputs (and perhaps contains that one pesky subprocess that refuses to stop being nondeterministic).

Activity

  1. added this to the unscheduled milestone on Jul 18, 2016
  2. mr-c commented on Jul 18, 2016

    @mr-c
    Member

    @jrandall Thank you for your very interesting proposal. Can you provide one or more concrete user stories?

  3. added a commit that references this issue on Jul 20, 2017
  4. added a commit that references this issue on Mar 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions