grisette-0.3.0.0: Symbolic evaluation as a library
Copyright(c) Sirui Lu 2021-2023
LicenseBSD-3-Clause (see the LICENSE file)
Maintainersiruilu@cs.washington.edu
StabilityExperimental
PortabilityGHC only
Safe HaskellSafe-Inferred
LanguageHaskell2010

Grisette.IR.SymPrim.Data.Prim.PartialEval.PartialEval

Description

 

Documentation

type PartialFun a b = a -> Maybe b Source #

type TotalRuleUnary a b = Term a -> Term b Source #

type PartialRuleBinary a b c = Term a -> PartialFun (Term b) (Term c) Source #

type TotalRuleBinary a b c = Term a -> Term b -> Term c Source #

totalize :: PartialFun a b -> (a -> b) -> a -> b Source #

totalize2 :: (a -> PartialFun b c) -> (a -> b -> c) -> a -> b -> c Source #

class UnaryPartialStrategy tag a b | tag a -> b where Source #

Methods

extractor :: tag -> Term a -> Maybe a Source #

constantHandler :: tag -> a -> Maybe (Term b) Source #

nonConstantHandler :: tag -> Term a -> Maybe (Term b) Source #

unaryPartial :: forall tag a b. UnaryPartialStrategy tag a b => tag -> PartialRuleUnary a b Source #

class BinaryCommPartialStrategy tag a c | tag a -> c where Source #

Methods

singleConstantHandler :: tag -> a -> Term a -> Maybe (Term c) Source #

class BinaryPartialStrategy tag a b c | tag a b -> c where Source #

Methods

extractora :: tag -> Term a -> Maybe a Source #

extractorb :: tag -> Term b -> Maybe b Source #

allConstantHandler :: tag -> a -> b -> Maybe (Term c) Source #

leftConstantHandler :: tag -> a -> Term b -> Maybe (Term c) Source #

default leftConstantHandler :: (a ~ b, BinaryCommPartialStrategy tag a c) => tag -> a -> Term b -> Maybe (Term c) Source #

rightConstantHandler :: tag -> Term a -> b -> Maybe (Term c) Source #

default rightConstantHandler :: (a ~ b, BinaryCommPartialStrategy tag a c) => tag -> Term a -> b -> Maybe (Term c) Source #

nonBinaryConstantHandler :: tag -> Term a -> Term b -> Maybe (Term c) Source #

binaryPartial :: forall tag a b c. BinaryPartialStrategy tag a b c => tag -> PartialRuleBinary a b c Source #