Skip to content

Commit

Permalink
Simplify effect for match
Browse files Browse the repository at this point in the history
  • Loading branch information
Shon Feder committed Nov 3, 2023
1 parent f989027 commit f61ee46
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions quint/src/effects/builtinSignatures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,8 @@ const multipleAritySignatures: [QuintBuiltinOpcode, Signature][] = [
'matchVariant',
(arity: number) => {
const eliminatorIdxs = range((arity - 1) / 2)
const vars = eliminatorIdxs.map(i => `Read[r${i}] & Update[u${i}]`)
const args = vars.map(vs => `Pure, (${vs}) => ${vs}`)
const readVars = ['r', ...eliminatorIdxs.map(i => `r${i}`)].join(', ')
const updateVars = ['u', ...eliminatorIdxs.map(i => `r${i}`)].join(', ')
return parseAndQuantify(`(Read[r] & Update[u], ${args.join(', ')}) => Read[${readVars}] & Update[${updateVars}]`)
const args = eliminatorIdxs.map(_ => `Pure, (a) => b`)
return parseAndQuantify(`(a, ${args.join(', ')}) => b`)
},
],
[
Expand Down

0 comments on commit f61ee46

Please sign in to comment.