Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions spectec/doc/semantics/il/0-aux.spectec
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ def $equiv_(syntax X, x_1*, x_2*) = false -- otherwise
def $transpose_(syntax X, X**) : X**
def $transpose_(syntax X, eps^n) = eps
def $transpose_(syntax X, (x_1 x*)*) = x_1* $transpose_(X, x**)


def $forall(bool*) : bool
def $forall(eps) = true
def $forall(bool_1 bool*) = bool_1 /\ $forall(bool*)
8 changes: 4 additions & 4 deletions spectec/doc/semantics/il/6-typing.spectec
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ rule Sub_typ/struct:
E |- t_1 <: t_2
-- Expand_typ: E |- t_1 => STRUCT tf_1*
-- Expand_typ: E |- t_2 => STRUCT tf_2*
-- (if (a `: t_2a `- `{q*} pr*) = tf_2)*
-- (if (a `: t_1a `- `{q*} pr*) <- tf_1*)*
-- (if (a `: t_2a `- `{q*} pr_2*) = tf_2)*
-- (if (a `: t_1a `- `{q*} pr_1*) <- tf_1* /\ $forall((pr_2 <- pr_1*)*))*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this not work without the auxiliary forall?

Suggested change
-- (if (a `: t_1a `- `{q*} pr_1*) <- tf_1* /\ $forall((pr_2 <- pr_1*)*))*
-- (if (a `: t_1a `- `{q*} pr_1*) <- tf_1*)*
-- (if pr_2 <- pr_1*)**

-- (Sub_typ: E |- t_1a <: t_2a)*

rule Sub_typ/variant:
E |- t_1 <: t_2
-- Expand_typ: E |- t_1 => VARIANT tc_1*
-- Expand_typ: E |- t_2 => VARIANT tc_2*
-- (if (m `: t_1a `- `{q*} pr*) = tc_1)*
-- (if (m `: t_2a `- `{q*} pr*) <- tc_2*)*
-- (if (m `: t_1a `- `{q*} pr_1*) = tc_1)*
-- (if (m `: t_2a `- `{q*} pr_2*) <- tc_2* /\ $forall((pr_2 <- pr_1*)*))*
-- (Sub_typ: E |- t_1a <: t_2a)*

rule Sub_typ/iter:
Expand Down
Loading