mirror of
https://github.com/GaloisInc/cryptol.git
synced 2024-11-30 23:45:23 +03:00
Fix the solver code for Integral
. It was previously failing too
early if sequence element type is a variable.
This commit is contained in:
parent
9424752b45
commit
97d99072a0
@ -148,15 +148,20 @@ solveIntegralInst ty = case tNoUser ty of
|
||||
TCon (TC TCBit) [] ->
|
||||
Unsolvable $ TCErrorMessage "Arithmetic cannot be done on individual bits."
|
||||
|
||||
-- fin n => Integral [n]
|
||||
TCon (TC TCSeq) [n, TCon (TC TCBit) []] -> SolvedIf [ pFin n ]
|
||||
|
||||
-- Integral Integer
|
||||
TCon (TC TCInteger) [] -> SolvedIf []
|
||||
|
||||
-- Integral (Z n)
|
||||
TCon (TC TCIntMod) [n] -> SolvedIf [ pFin n, n >== tOne ]
|
||||
|
||||
-- fin n => Integral [n]
|
||||
TCon (TC TCSeq) [n, elTy] ->
|
||||
case tNoUser elTy of
|
||||
TCon (TC TCBit) [] -> SolvedIf [ pFin n ]
|
||||
TVar _ -> Unsolved
|
||||
_ -> Unsolvable $ TCErrorMessage $ show
|
||||
$ "Type" <+> quotes (pp ty) <+> "is not an intergral type."
|
||||
|
||||
TVar _ -> Unsolved
|
||||
|
||||
_ -> Unsolvable $ TCErrorMessage $ show
|
||||
|
Loading…
Reference in New Issue
Block a user