summaryrefslogtreecommitdiff
path: root/source/Meaning.hs
diff options
context:
space:
mode:
authoradelon <22380201+adelon@users.noreply.github.com>2025-07-16 12:36:32 +0200
committeradelon <22380201+adelon@users.noreply.github.com>2025-07-16 12:36:32 +0200
commit9aac1a22c4ff4b4be16800b86e34a94d358b0deb (patch)
tree4874bcad55c1a40d8776e367b1bba0ad6c80f46e /source/Meaning.hs
parent92efa0fe16152c0f42cb9d05d6ef127955b03a18 (diff)
Add quantified calcs and relax tokenization
Use an `\iff`-calc to speed up `union_as_unions`. Also remove `in_implies_neq` which seems to interact badly with the choice axiom used by superposition-based proofs like Vampire in cut-down problems.
Diffstat (limited to 'source/Meaning.hs')
-rw-r--r--source/Meaning.hs14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/Meaning.hs b/source/Meaning.hs
index 9b4bc45..3822221 100644
--- a/source/Meaning.hs
+++ b/source/Meaning.hs
@@ -605,14 +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
+ Raw.Calc calcQuant calc proof ->
+ Sem.Calc <$> glossCalcQuantifier calcQuant <*> glossCalc calc <*> glossProof proof
+glossCalcQuantifier :: Maybe Raw.CalcQuantifier -> Gloss Sem.CalcQuantifier
+glossCalcQuantifier Nothing = pure Sem.CalcUnquantified
+glossCalcQuantifier (Just (Raw.CalcQuantifier xs bound maySuchThat)) = do
+ bound' <- glossBound bound
+ maySuchThat' <- glossStmt `each` maySuchThat
+ let maySuchThat'' = case (bound', maySuchThat') of
+ _ -> Nothing
+ pure (Sem.CalcForall xs maySuchThat'')
glossLocalFunctionExprDef :: (Raw.Expr, Raw.Formula) -> Gloss (Sem.Term, Sem.Formula)
glossLocalFunctionExprDef (definingExpression, localDomain) = do