Copyright | (c) Artem Mavrin 2021 |
---|---|
License | BSD3 |
Maintainer | artemvmavrin@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe |
Language | Haskell2010 |
Defines the TruthAssignment class.
Synopsis
- class TruthAssignment t a where
- evalVar :: t -> a -> Bool
- evalFormula :: t -> Formula a -> Bool
- (|=) :: TruthAssignment t a => t -> Formula a -> Bool
Documentation
class TruthAssignment t a where Source #
Class representing truth assignments for evalutating propositional logic formulas.
evalVar :: t -> a -> Bool Source #
Evaluate the truth value of a variable under a given truth assignment.
evalFormula :: t -> Formula a -> Bool Source #
Evaluate the truth value of a formula under a given truth assignment.
Instances
TruthAssignment () a Source # | Assigns all propositional variables the truth value Examples
|
Ord a => TruthAssignment (Map a Bool) a Source # | Truth assignments where a missing key in the map is interpreted as Examples
|
(|=) :: TruthAssignment t a => t -> Formula a -> Bool infix 5 Source #
Semantic entailment relation. This is an infix alias of evalFormula
.
Examples
>>>
t = Map.fromList $ [("a", True), ("b", False)]
>>>
t |= And (Var "a") (Not (Var "b"))
True