autoproof-0.0.0.0: Propositional logic library
Copyright(c) Artem Mavrin 2021
LicenseBSD3
Maintainerartemvmavrin@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe
LanguageHaskell2010

AutoProof.Internal.Judgement

Description

Defines the Judgement type and related functions.

Synopsis

Types and constructors

type Context a = Set (Formula a) Source #

A set of propositional formulas, used as antecedents of a judgement.

data Judgement a Source #

(Judgement c a) represents the judgement or sequent \(c \vdash a\).

>>> Judgement Set.empty (Imp (And (Var 'a') (Var 'b')) (Var 'a'))
[] |- Imp (And (Var 'a') (Var 'b')) (Var 'a')

Constructors

Judgement 

Fields

Instances

Instances details
Eq a => Eq (Judgement a) Source # 
Instance details

Defined in AutoProof.Internal.Judgement

Methods

(==) :: Judgement a -> Judgement a -> Bool #

(/=) :: Judgement a -> Judgement a -> Bool #

Ord a => Ord (Judgement a) Source # 
Instance details

Defined in AutoProof.Internal.Judgement

(Ord a, Read a) => Read (Judgement a) Source # 
Instance details

Defined in AutoProof.Internal.Judgement

Show a => Show (Judgement a) Source # 
Instance details

Defined in AutoProof.Internal.Judgement

PrettyPrintable a => PrettyPrintable (Judgement a) Source # 
Instance details

Defined in AutoProof.Internal.Judgement

(|-) :: (Ord a, Foldable f) => f (Formula a) -> Formula a -> Judgement a infix 5 Source #

Infix judgement constructor. (c |- a) represents the judgement \(c \vdash a\).

>>> [Var 'a', Imp (Var 'a') (Var 'b')] |- Var 'b'
[Var 'a',Imp (Var 'a') (Var 'b')] |- Var 'b'

Note: If c is already a Set, then it is recommended to use (Judgement c a) in favor of (c |- a), since the latter will create a new set and fill it with the values in c.

Pretty-printing

prettyJudgement :: PrettyPrintable a => Judgement a -> String Source #

Get a pretty-printed representation of a judgement.

Examples

Expand
>>> prettyJudgement $ [Var "a", Imp (Var "a") (Var "b")] |- Var "b"
"a, a → b ⊢ b"

Operations on judgements

weakenJudgement :: Ord a => Judgement a -> Formula a -> Judgement a Source #

Weaken a judgement by inserting a formula into its hypotheses.

>>> weakenJudgement ([Var 'a', Imp (Var 'a') (Var 'b')] |- Var 'b') (Var 'c')
[Var 'a',Var 'c',Imp (Var 'a') (Var 'b')] |- Var 'b'