Copyright | (c) Sirui Lu 2021-2023 |
---|---|
License | BSD-3-Clause (see the LICENSE file) |
Maintainer | siruilu@cs.washington.edu |
Stability | Experimental |
Portability | GHC only |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
Synopsis
- class ExtractSymbolics a where
- extractSymbolics :: a -> SymbolSet
Extracting symbolic constant set from a value
class ExtractSymbolics a where Source #
Extracts all the symbolic variables that are transitively contained in the given value.
>>>
extractSymbolics ("a" :: SymBool) :: SymbolSet
SymbolSet {a :: Bool}
>>>
extractSymbolics (mrgIf "a" (mrgReturn ["b"]) (mrgReturn ["c", "d"]) :: UnionM [SymBool]) :: SymbolSet
SymbolSet {a :: Bool, b :: Bool, c :: Bool, d :: Bool}
Note 1: This type class can be derived for algebraic data types.
You may need the DerivingVia
and DerivingStrategies
extensions.
data X = ... deriving Generic deriving ExtractSymbolics via (Default X)
extractSymbolics :: a -> SymbolSet Source #