Skip to content

Commit

Permalink
Merge pull request #14 from leanprover-community/duper2
Browse files Browse the repository at this point in the history
TPTP Parser Bug Fix
  • Loading branch information
PratherConid authored Feb 15, 2024
2 parents 17787c7 + b535939 commit 2c3e8c8
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions Auto/Parser/TPTP.lean
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,25 @@ partial def addOpAndRhs (lhs : Term) (minbp : Nat) : ParserM Term := do
return ← addOpAndRhs (Term.mk op [lhs, rhs]) minbp

partial def parseTypeDecl : ParserM Term := do
let ident ← parseIdent
if (← peek?) == some (.op ":") then
parseToken (.op ":")
let ty ← parseTerm
return Term.mk (.ident ident) [ty]
if (← peek?) == some (.op "(") then
parseToken (.op "(")
let ident ← parseIdent
if (← peek?) == some (.op ":") then
parseToken (.op ":")
let ty ← parseTerm
parseToken (.op ")")
return Term.mk (.ident ident) [ty]
else
parseToken (.op ")")
return Term.mk (.ident ident) []
else
return Term.mk (.ident ident) []
let ident ← parseIdent
if (← peek?) == some (.op ":") then
parseToken (.op ":")
let ty ← parseTerm
return Term.mk (.ident ident) [ty]
else
return Term.mk (.ident ident) []
end

structure Command where
Expand Down

0 comments on commit 2c3e8c8

Please sign in to comment.