InPlace Version v0.13.0 delivers the following milestones in the project Practical Tools to Build the Context Web as supported by NLnet:
This release is being done while working on another milestone, the Context Name System (Mileston T9). Working towards that goal has turned out to be an important way of uncovering deficiencies and other issues. By far most of the work done since the previous release was spent on these issues. We outline some of the most important.
Computed Properties. These properties must not be confused with Calculated Properties (properties defined as a query). Here we mean property values computed by some (Purescript) function external to the core system.
New execution model. The Perspectives Language is partly declarative. It lets the modeller describe contexts, roles, properties, perspectives and more, on the type level. But it also contains assignment statements to update instances of those types, to track a changing world. The modeller can specify that such statements must be carried out automatically on behalf of some user when the state of a context or role changes. This raises questions about the order in which such statements are executed. Because state changes are pattern-invoked, the modeller has no full control of this order (similar to rule-based languages).
A new (and better) execution model has been devised and implemented to make the impact of changes as understandable as is possible. Put simply, it boils down to postponing actually removing a resource to the very last moment. This makes it possible to understand all expressions in statements in terms of the situation as it exists prior to modification.
Improved composition of roles and contexts. On the type level, roles and contexts can be used as building blocks for other roles and contexts. Specifically, the roles of one context can be used as is inside another context. For example, a generic Driver
role could be added to both an AmbulanceRide
and a TaxiRide
.
However, Perspectives also allows so-called calculated roles. These are expressed as a query: a path through the (type level) network of contexts and roles. These queries are used, among others, to trigger state transitions and to synchronize changes with peers. Up to version v0.13.0, roles were treated as units in such queries. However, it turns out that, in the light of using a role as an aspect (building block) we should consider the combination of a role and a context as a unit. Intuitively, 'Driver in a TaxiRide' is not the same as 'Driver in an AmbulanceRide'.
Suppose we act automatically on a state change depending on who is the Driver in an AmbulanceRide. If we don't recognize the difference between a generic Driver and the ones in an AmbulanceRide, we're bound to act in situations where it is not appropriate.
Version v0.14.0 fixes that problem. As roles and queries are very fundamental to the language, however, this required extensive refactoring.
As a consequence, multiple facets of the language have been adapted. It is, for example, now possible to specify a context of origin in a filledBy
step.
Standard variables. New and better treatment of standard variables. The variables have new names; their scope has been systematically explored; they are added compile time when necessary and have been documented clearly.
Recompiling models automatically When the shape of the compiled model files (so called DomeinFile's) changes, an installation can no longer access its locally saved models. This is because the PDR expects the new shape. In general, a Repository may be expected to update its published models, and this mechanism complements that for local copies of compiled model files. In the future, when we have version management for InPlace as a WebApp, this mechanism will be part of the update cycle. Currently the mechanism can be activated by a query fragment in the url: ?recompilebasicmodels=true
.
Calling Actions. A modeller can specify an Action for a particular user perspective. It is now possible to call such actions from the user interface of InPlace. We have context actions that can be called by a control from the top menu bar, and role actions that can be called by a control in the toolbar under a form or a table.
Synchronization checking. Changes made by the user must be communicated to relevant peers. But in order to be able to send such a change to a peer, the user's installation must know she exists. That is, the user must have a perspective on that peer. This is not by default the case. Think of reviewing a scientific article. The author is in contact with an editor and the editor employs a reviewer. However, author and reviewer do not know each other (in those roles, at least). So comments by the reviewer will not automatically be sent to the author.
Synchronization checking is a new module that is activated on compiling a model. It warns the modeller of situations like this. This is work in progress.
A system of warnings. We now have a mechanism in place to show warnings to the programmers of the PDR (and, in some cases, to modellers as well). Warnings are not errors and do not break the execution machine.
Regular expressions. We can now match a string to a regular expression in the Perspectives Query Language.
Comparing (role) types. If we want to fill a role with another, the latter should comply with the restrictions put by the first. The filler needs not be the exact required type, however; it may be a specialisation of it. This underlines the need to be able to compare types; to say whether one type is a specialisation of another.
We have two ways of comparing role types, depending on what we think a role is. It can be considered to be a set of properties; but it can also be seen as a tag put on an instance. In the first case we let the semantics of 'role' depend on its structure; in the second case we put it outside the model entirely. Up till version v0.13.0 we used the role-as-property-collection definition. However, since we recognize the fact that the meaning of a(n Aspect) role instance is partly given by the context it is part of, we have switched to the other semantics. We have defined a sound definition of a role type as an Abstract Data Type composed of Sums and Products of simple roles and were able to derive a simple algorithm for comparing them (by reasoning about the normal forms of such ADTs).
The list below is a curated extract of the commit history, from which repairs to functionality that was introduced as new in this release, were stripped.
getMyType
now works for unlinked roles.A collection of short documents describing Aspect Patterns has been added here: Aspect Patterns.
Other new documents have been added: