Expression Unification
Expression Unification
Expression unification is an experimental feature, part of every CaseTalk edition since version 15.2. It lets a model substitute every expression it already has, fact type expressions (FTE) as well as object type expressions (OTE), and it lets you alter an expression from one kind to the other. It is a switch of the model: you turn it on and off at will, and switching back returns the model to classic FCO-IM without loss.
Background
In classic FCO-IM only an object type expression can be substituted into a role of a fact type expression. Over the years we met models where this forced a modeler to retype a sentence. We start with the fact type Marriage:
[Marriage] F1: "John is married to Mary"
Later a second fact type arrives that speaks about a marriage:
[Marriage Date] F2: "John is married to Mary on 1-1-1990"
To substitute the marriage into F2, the classic method requires an object type expression for Marriage, identical to F1:
[Marriage] O1: "John is married to Mary"
CaseTalk already knows which expressions are substituted where, so the duplicate adds no information. With unification F1 itself is substituted into F2, and Marriage is shown as a nominalised fact for as long as that substitution exists.
What O and F mean
Both kinds of expression stay, and both may be substituted. Their letters now say what happens to a sentence when the model is transformed:
- O, an optional sentence. It exists to be substituted. After transformation (GLR) every O is removed, whether it was substituted or not.
- F, a fixed sentence. It persists through transformation, also when it was substituted into other expressions, and becomes the sentence of the resulting table.
This is exactly what GLR always did with object and fact type expressions, so the transformation itself does not change when unification is on. A model that is valid in both modes transforms to the same result either way. What changes is the input, what may be substituted, and the output, which sentences are shown and kept.
A modeler who wants a type to keep a sentence of its own after transformation alters its O into an F. A type whose only sentence is an O loses it after transformation, and the reduce settings of the transformation profile then decide whether the type stays, the same way they do in classic FCO-IM.
What unification changes
- Substitution Any expression, O or F, can be substituted into a role. When a role is played by a fact type that has no O of its own, CaseTalk substitutes the fact type's F, whether the expression is typed in the expression editor, parsed from text, or added through an agent; in classic FCO-IM an empty O is made for it. The expression editor's pre-find and its drop target offer F expressions as well.
- Agents The MCP tool substitutions reads the model's switch and sets it (operation=unification), reports it with every list, and alters an expression between O and F (operation=alter).
- Alter O and F In the repository window, the context menu of an expression offers Alter to Fact Expression or Alter to Object Expression. The expression keeps its parts and every substitution that uses it. Only its number changes.
- Nominalisation A fact type is shown as a nominalised fact (an object type) only while one of its expressions is substituted somewhere. Remove the last substitution and it is a plain fact type again. In classic FCO-IM this is decided by whether the type has an object type expression.
- Numbering Object and fact type expressions draw their numbers from one sequence, so numbers are unique across both kinds. Switching unification on renumbers the few expressions that clash; switching it off does not renumber.
- Well-formedness The rule that reports an unused object type expression still runs, but under unification it reports a hint instead of a warning: an O that nothing substitutes is a deliberate choice, and the fix dialog offers to alter it to F or to remove it. All other rules apply unchanged.
Switching off
Classic FCO-IM does not allow a fact type expression to be substituted, so switching unification off converts every substituted F into an O, moves its substitutions along, and re-codes each type by the object type expressions it then has. Nothing else is touched. A model that was switched on and off again, without using any of the unified features in between, is identical to one that was never switched, and so is its transformation result.
How to turn it on
Unification is gated three times, so that a model is never switched by accident:
- Edition Every edition that edits models has the feature since 15.2. The Viewer reads a unified model as it was built, but has no commands to alter it.
- Preference In Tools\Preferences, page Feature Toggles, tick Expression Unification under Experimental Features. This is your preference for this installation; it makes the commands visible but switches no model.
- Model With a repository open, choose Repository\Unified Expressions. The first time a model is switched, CaseTalk explains the consequences and asks for confirmation; the same menu item switches the model back. The switch is stored in the model file, so every user of the model sees the same state.
A CaseTalk older than 15.2 reads a unified model as classic FCO-IM, so its substituted fact type expressions then show up as well-formedness violations. Switch the model off before handing it to such an installation.
| Expressions | |
|---|---|
| Dialogs | Expression Input · Expression Viewer · Expression File · Expression Tree · Generate Expressions |
| Reference | Expression Unification · Special Keywords |