summaryrefslogtreecommitdiff
path: root/source/Meaning.hs
diff options
context:
space:
mode:
authoradelon <22380201+adelon@users.noreply.github.com>2025-07-02 20:28:22 +0200
committerGitHub <noreply@github.com>2025-07-02 20:28:22 +0200
commit793849dd0b20bc70ea0e0ecfd5008a3806eca0d9 (patch)
tree280949f358a695c5471212cc5b22950399d8cd57 /source/Meaning.hs
parent3caadfbe0fdb417b8edebc17002ddafe795a4bcc (diff)
parent8fd49ae84e8cc4524c19b20fa0aabb4e77a46cd5 (diff)
Merge pull request #2 from Simon-Kor/main
Merge (finally)
Diffstat (limited to 'source/Meaning.hs')
-rw-r--r--source/Meaning.hs13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/Meaning.hs b/source/Meaning.hs
index 3017c1f..9b4bc45 100644
--- a/source/Meaning.hs
+++ b/source/Meaning.hs
@@ -605,9 +605,22 @@ glossProof = \case
if domVar == argVar
then Sem.DefineFunction funVar argVar <$> glossExpr valueExpr <*> glossExpr domExpr <*> glossProof proof
else error "mismatched variables in function definition."
+
+ Raw.DefineFunctionLocal funVar domVar ranExpr funVar2 argVar definitions proof -> do
+ if funVar == funVar2
+ then Sem.DefineFunctionLocal funVar argVar domVar <$> glossExpr ranExpr <*> (glossLocalFunctionExprDef `each` definitions) <*> glossProof proof
+ else error "missmatched function names"
Raw.Calc calc proof ->
Sem.Calc <$> glossCalc calc <*> glossProof proof
+
+glossLocalFunctionExprDef :: (Raw.Expr, Raw.Formula) -> Gloss (Sem.Term, Sem.Formula)
+glossLocalFunctionExprDef (definingExpression, localDomain) = do
+ e <- glossExpr definingExpression
+ d <- glossFormula localDomain
+ pure (e,d)
+
+
glossCase :: Raw.Case -> Gloss Sem.Case
glossCase (Raw.Case caseOf proof) = Sem.Case <$> glossStmt caseOf <*> glossProof proof