Skip to content

Commit

Permalink
Add document the rule for the variant operator
Browse files Browse the repository at this point in the history
  • Loading branch information
Shon Feder committed Oct 6, 2023
1 parent 52baae9 commit eed2ee6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions quint/src/types/specialConstraints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,15 @@ export function itemConstraints(
return right([constraint])
}

// The rule for the `variant` operator:
//
// Γ ⊢ e: (t, c) Γ ⊢ 'l' : str v is fresh
// --------------------------------------------------------------------
// Γ ⊢ variant('l', e) : (s, c /\ s ~ < l : t | v > /\ isDefined(s))
//
// Where < ... > is a row-based variant.
//
// This rule is explained in /doc/rfcs/rfc001-sum-types/rfc001-sum-types.org
export function variantConstraints(
id: bigint,
args: [QuintEx, QuintType][],
Expand Down

0 comments on commit eed2ee6

Please sign in to comment.