language derivations: add hypotheses, L example
This commit is contained in:
parent
8a85dcfc8f
commit
aeb441e06d
2 changed files with 15 additions and 1 deletions
|
@ -3,7 +3,8 @@ module Logic.Language.Derivation where
|
|||
import Logic.Language (Language(..))
|
||||
|
||||
data Derivation symbol
|
||||
= Axiom0 Integer
|
||||
= Hypothesis [symbol]
|
||||
| Axiom0 Integer
|
||||
| Axiom1 Integer [symbol]
|
||||
| Axiom2 Integer [symbol] [symbol]
|
||||
| Axiom3 Integer [symbol] [symbol] [symbol]
|
||||
|
@ -44,6 +45,9 @@ data DerivationResultIndexErrorPlace
|
|||
resolveDerivation :: Language s => Derivation s -> Either (DerivationError s) [s]
|
||||
resolveDerivation derivation =
|
||||
case derivation of
|
||||
(Hypothesis wff)
|
||||
| not $ isWellFormed wff -> Left $ NotWellFormed wff
|
||||
| otherwise -> Right wff
|
||||
(Axiom0 index) -> trySelect AxiomSelect axiom0 index []
|
||||
(Axiom1 index wff1)
|
||||
| not $ isWellFormed wff1 -> Left $ NotWellFormed wff1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue