manyvalued
Safe HaskellNone
LanguageGHC2024

Circuit.Logics.Prop

Description

Classical propositional formulas and evaluation.

The formula AST is the "syntax"; Bool (and other Boolean carriers) are compile targets for evalProp.

Synopsis

Documentation

data Prop v Source #

Propositional formula over variable names v.

Constructors

Var v

Atomic variable.

Bot

Falsehood.

Top

Truth.

Not (Prop v)

Negation.

And (Prop v) (Prop v)

Conjunction.

Or (Prop v) (Prop v)

Disjunction.

Imp (Prop v) (Prop v)

Implication.

Instances

Instances details
Functor Prop Source # 
Instance details

Defined in Circuit.Logics.Prop

Methods

fmap :: (a -> b) -> Prop a -> Prop b #

(<$) :: a -> Prop b -> Prop a #

Eq v => Eq (Prop v) Source # 
Instance details

Defined in Circuit.Logics.Prop

Methods

(==) :: Prop v -> Prop v -> Bool #

(/=) :: Prop v -> Prop v -> Bool #

Ord v => Ord (Prop v) Source # 
Instance details

Defined in Circuit.Logics.Prop

Methods

compare :: Prop v -> Prop v -> Ordering #

(<) :: Prop v -> Prop v -> Bool #

(<=) :: Prop v -> Prop v -> Bool #

(>) :: Prop v -> Prop v -> Bool #

(>=) :: Prop v -> Prop v -> Bool #

max :: Prop v -> Prop v -> Prop v #

min :: Prop v -> Prop v -> Prop v #

Read v => Read (Prop v) Source # 
Instance details

Defined in Circuit.Logics.Prop

Show v => Show (Prop v) Source # 
Instance details

Defined in Circuit.Logics.Prop

Methods

showsPrec :: Int -> Prop v -> ShowS #

show :: Prop v -> String #

showList :: [Prop v] -> ShowS #

evalProp :: (Heyting b, Complemented b) => (v -> b) -> Prop v -> b Source #

Evaluate a formula given a valuation into a complemented Heyting algebra.

evalPropH3 :: (v -> H3) -> Prop v -> H3 Source #

Three-valued eval: atoms may be unknown; connectives use H3 tables.

Not on H3 uses the Heyting-style pseudo-complement a ==> HFalse.

simplify :: Prop v -> Prop v Source #

Cheap structural simplify (constants only).