FO Sequent: Error when using allLeft or exRight
Drodt opened this issue · 8 comments
When using allLeft or exRight in the FO sequent calculus and instantiating with a term that is not a simple constant, e.g., f(a)
, the following error is shown by the UI:
Character at position 1 in 'f(a)' is not allowed in constants
How to reproduce:
- Enter
\all X: P(X) -> P(f(a))
- Use impRight
- Use allLeft with
f(a)
- Get the error
Follow up question while I'm looking at the code:
There's an unimplemented function findFittingVariableName
that would implement some sort of proof-search for fitting instantiations in allLeft and exRight if no instantiation is given. Currently this just throws an exception.
However, the same function is used in allRight and exLeft to get what should be a fresh constant (?) if none is given explicitly. This is incorrect, no? If anything, there should be a second getFreshVariable
function.
Yes, much of the logic there is incorrect. I am currently working on a fix (the backend is fixed) but I am stuck at the frontend. Basically, I had to update some dependencies to newer versions, which are now incompatible with the other dependencies, etc. That will take some time to fix.
I will look into implementing findFittingVariableName
which shouldn't be too hard.
I also want to collect all signatures of functions in the formula. It should not be allowed to write, e.g., f(a, b)
if f
was a unary function before. We check this during parsing, right?
We don't. I think f(a, b)
and f(a)
would be treated as different functions for most purposes? There's some potential for weirdness there because identifier freshness-checks ignore arity. So if you have a function f(a)
you won't be able to instantiate a fresh constant f
.
Should be pretty straightforward though to write a collector that gathers all functions and their signatures / arities so you can check for conflicting instantiations (and initial consistency on the initial parse).
Also feel free to push the backend fixes before the frontend is ready :)
See
Also, if you're already touching the frontend, I think adding an 'automatic' button to the fresh constant assignments in exLeft and allRight (which just sends a null assignment) would be a super cheap quality of life improvement (with an implementation of a freshConstant
function in the backend but that's also cheap)
allLeft and exRight
Do you mean allRight and exLeft or am I misunderstanding?
Do you mean allRight and exLeft or am I misunderstanding?
Yes, sorry - copy pasted from the wrong reply.
Great, then I'll add it to my TODO