From 76ea8e11d943b123d28dfbe2f354838f80fb8dba Mon Sep 17 00:00:00 2001 From: Simon-Kor <52245124+Simon-Kor@users.noreply.github.com> Date: Mon, 26 Aug 2024 20:14:18 +0200 Subject: Implemented the checking for local functions. --- source/Syntax/Abstract.hs | 2 +- source/Syntax/Adapt.hs | 2 +- source/Syntax/Concrete.hs | 2 +- source/Syntax/Internal.hs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source/Syntax') diff --git a/source/Syntax/Abstract.hs b/source/Syntax/Abstract.hs index 6457d42..6372c87 100644 --- a/source/Syntax/Abstract.hs +++ b/source/Syntax/Abstract.hs @@ -373,7 +373,7 @@ data Proof - | DefineFunctionMathy VarSymbol VarSymbol VarSymbol VarSymbol VarSymbol (NonEmpty [(Expr, Formula)]) Proof + | DefineFunctionMathy VarSymbol VarSymbol VarSymbol VarSymbol VarSymbol (NonEmpty (Expr, Formula)) Proof -- ^ Local function definition, but in this case we give the domain and target an the rules for $xs$ in some sub domains. -- deriving (Show, Eq, Ord) diff --git a/source/Syntax/Adapt.hs b/source/Syntax/Adapt.hs index 96fd76d..3cff497 100644 --- a/source/Syntax/Adapt.hs +++ b/source/Syntax/Adapt.hs @@ -35,7 +35,7 @@ scanChunk ltoks = Located{startPos = pos, unLocated = (BeginEnv "inductive")} :_ -> matchOrErr inductive "inductive definition" pos Located{startPos = pos, unLocated = (BeginEnv "signature")} :_ -> - matchOrErr signature "signature" pos + matchOrErr signatureIntro "signature" pos _ -> [] adaptChunks :: [[Located Token]] -> Lexicon -> Lexicon diff --git a/source/Syntax/Concrete.hs b/source/Syntax/Concrete.hs index f414ea6..69280c1 100644 --- a/source/Syntax/Concrete.hs +++ b/source/Syntax/Concrete.hs @@ -373,7 +373,7 @@ grammar lexicon@Lexicon{..} = mdo -- 3 & \text{else} -- \end{cases} - functionDefineCase <- rule $ (:[]) <$> ((,) <$> expr <*> (_ampersand *> formula)) + functionDefineCase <- rule $ (,) <$> expr <*> (_ampersand *> formula) defineFunctionMathy <- rule $ DefineFunctionMathy <$> (_define *> beginMath *> varSymbol) -- Define $ f <*> (_colon *> varSymbol) -- : 'var' \to 'var' diff --git a/source/Syntax/Internal.hs b/source/Syntax/Internal.hs index 872ae06..0e3361d 100644 --- a/source/Syntax/Internal.hs +++ b/source/Syntax/Internal.hs @@ -436,7 +436,7 @@ data Proof | Define VarSymbol Term Proof | DefineFunction VarSymbol VarSymbol Term Term Proof - | DefineFunctionMathy VarSymbol VarSymbol VarSymbol VarSymbol [(Term, Formula)] Proof + | DefineFunctionMathy VarSymbol VarSymbol VarSymbol VarSymbol (NonEmpty (Term, Formula)) Proof deriving instance Show Proof deriving instance Eq Proof -- cgit v1.2.3