Skip to content

Remove T_abs with (Path = T_sub) and add T_abs & T_sub syntax...#19

Open
polytypic wants to merge 2 commits into
1ml-primefrom
intersection-sub-to-replace-with
Open

Remove T_abs with (Path = T_sub) and add T_abs & T_sub syntax...#19
polytypic wants to merge 2 commits into
1ml-primefrom
intersection-sub-to-replace-with

Conversation

@polytypic
Copy link
Copy Markdown
Member

@polytypic polytypic commented Feb 18, 2020

Remove T_abs with (Path = T_sub) and add T_abs & T_sub syntax for type refinement.

The new

T_abs & T_sub

mechanism is similar to the old

T_abs with (Path = T_sub)

mechanism and also to the include mechanism

{...T_abs; ...T_sub}

The main difference is that, instead of using a path to target a specific substructure or requiring that no declarations overlap, an intersection, T_int, of the nested declarations of T_abs and T_sub, is computed.

Then it is checked whether T_abs :> T_int and if so a substitution, 𝛿, is obtained. Finally the nested declarations of 𝛿(T_abs) and T_sub are merged.

Also, in T1 & T2 both T1 and T2 are elaborated in the same environment whereas in {...T1; ...T2} the environment for T2 includes declarations from T1 and in T1 with (P = T2) the path P is specific to T1.

When defined, T1 & T2 is always a subtype of both T1 and T2

T1 & T2  :>  T1
T1 & T2  :>  T2

@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch 5 times, most recently from 4a4c30a to 229896c Compare February 19, 2020 18:24
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch 3 times, most recently from aff9b3e to 7845dd3 Compare February 22, 2020 13:29
@polytypic polytypic force-pushed the 1ml-prime branch 4 times, most recently from 1d77593 to b248d00 Compare February 22, 2020 18:46
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch from 7845dd3 to 604881f Compare February 22, 2020 18:48
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch from 604881f to 5fc4f42 Compare February 22, 2020 18:57
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch from 5fc4f42 to ea353d3 Compare February 23, 2020 10:47
@polytypic polytypic force-pushed the 1ml-prime branch 2 times, most recently from 6167f5b to 88b09cf Compare February 28, 2020 06:01
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch from ea353d3 to 2268faa Compare February 28, 2020 06:45
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch 2 times, most recently from e909120 to afd4d23 Compare February 29, 2020 08:49
@polytypic polytypic force-pushed the 1ml-prime branch 6 times, most recently from 0fb0880 to 5c75b59 Compare March 1, 2020 13:20
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch from 79a1bc8 to 4fbd995 Compare March 15, 2020 17:24
@polytypic polytypic force-pushed the 1ml-prime branch 2 times, most recently from 43f4894 to c3c1c90 Compare March 16, 2020 07:46
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch from 4fbd995 to dcfa560 Compare March 16, 2020 17:39
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch 4 times, most recently from 15e8112 to 8782d47 Compare March 24, 2020 23:59
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch from 8782d47 to 25ee61f Compare April 10, 2020 11:54
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch from 25ee61f to 9dba1f2 Compare April 10, 2020 23:51
@polytypic polytypic force-pushed the 1ml-prime branch 2 times, most recently from 6118930 to 08bacfc Compare April 12, 2020 10:37
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch from 9dba1f2 to 11ef5ea Compare April 12, 2020 11:51
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch 2 times, most recently from 1d9fde6 to a3670c2 Compare April 12, 2020 19:42
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch from a3670c2 to 4c52f17 Compare April 12, 2020 21:30
@polytypic polytypic force-pushed the 1ml-prime branch 2 times, most recently from 2cd76cf to 06a9f97 Compare April 14, 2020 05:15
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch from 4c52f17 to e0b0e3b Compare April 14, 2020 05:18
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch from e0b0e3b to fd0fcca Compare May 27, 2020 21:19
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch from fd0fcca to cd5b854 Compare May 27, 2020 22:42
@polytypic polytypic force-pushed the intersection-sub-to-replace-with branch from cd5b854 to 1345d70 Compare May 27, 2020 22:46
...for type refinement.

The new

    T_abs & T_sub

mechanism is similar to the old

    T_abs with (Path = T_sub)

mechanism and also to the include mechanism

    {...T_abs; ...T_sub}

The main difference is that, instead of using a path to target a specific
substructure or requiring that no declarations overlap, an intersection,
`T_int`, of the nested declarations of `T_abs` and `T_sub`, is computed.

Then it is checked whether `T_abs :> T_int` and if so a substitution, `𝛿`, is
obtained.  Finally the nested declarations of `𝛿(T_abs)` and `T_sub` are merged.

Also, in `T1 & T2` both `T1` and `T2` are elaborated in the same environment
whereas in `{...T1; ...T2}` the environment for `T2` includes declarations from
`T1` and in `T1 with (P = T2)` the path `P` is specific to `T1`.

When defined, `T1 & T2` is always a subtype of both `T1` and `T2`

    T1 & T2  :>  T1
    T1 & T2  :>  T2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant