Skip to content

Commit

Permalink
correct specialisation signature
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Oct 3, 2023
1 parent b70fb05 commit dd63c7b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Juvix/Compiler/Core/Data/InfoTable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ data AxiomInfo = AxiomInfo
}

data SpecialisationInfo = SpecialisationInfo
{ _specSignature :: [Node],
{ _specSignature :: ([Node], [Int]),
_specSymbol :: Symbol
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ convertNode = dmapLRM go
filter
( \argNum ->
argNum <= argsNum
&& argNum <= length args'
&& isSpecializable tab (args' !! (argNum - 1))
&& isArgSpecializable tab _identSymbol argNum
)
Expand Down Expand Up @@ -145,9 +144,13 @@ convertNode = dmapLRM go
eassert (length lams == argsNum)
eassert (length args' == argsNum)
eassert (argsNum <= length tyargs)
let specSig = selectSpecargs specargs args'
-- assumption: all type variables are at the front
eassert (not $ any (isTypeConstr tab) (drop tyargsNum tyargs))
-- the specialisation signature: the values we specialise the arguments by
let specSigArgs = selectSpecargs specargs args'
specSig = (specSigArgs, specargs)
if
| all isClosed specSig ->
| all isClosed specSigArgs ->
case find ((== specSig) . (^. specSignature)) (lookupSpecialisationInfo tab _identSymbol) of
Just SpecialisationInfo {..} ->
return $
Expand Down

0 comments on commit dd63c7b

Please sign in to comment.