language derivations: add hypotheses, L example

This commit is contained in:
hi 2025-08-10 16:09:10 +00:00
parent 8a85dcfc8f
commit aeb441e06d
2 changed files with 15 additions and 1 deletions

View file

@ -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