-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undesired side effect with modifiers associative and commutative on symbol #991
Comments
Hi Alessio. I am afraid this won't be possible since the way AC symbols are handled in Lambdapi is crucially based on the fact that terms are always in AC-canonical form. By construction, there cannot exists terms not in AC-canonical form. You should really try to reason modulo AC: the order of elements should not be relevant. But we then get problems with unification that could perhaps be solved by a simple change: allowing AC symbols to be declared as constant (and injective?). I will try to implement this today.
|
yes, I have a unification error, and I agree that the order should not be relevant.
That could be very nice if we could have this! Because without the AC feature, we will need to depend on some tool (like Archsat, Zenon-modulo or any prologue-like?) that will tell us how to move the pivot at the correct position and I think it will be heavy for nothing. I also think that being able to declare a
Thank you very much! This problem is a little bit blocking my progress. Thank you 👍 |
There is an unexpected bug in Lambdapi in the handling of AC symbols, perhaps related to Bindlib. It will probably take me more time than expected to fix this. |
No, we shouldn't in unification allow decomposition of AC symbol applications; this is wrong. The problem is that some terms are not put in AC canonical form as expected. Actually, I just realized that Bindlib is unsound when using private data types. This can be fixed by recanonizing terms after each Bindlib substitution, which would be very inefficient. This is another argument to abandon Bindlib and merge #843. |
https://github.com/fblanqui/lambdapi/blob/db/tests/OK/991.lp works with #843. So I invite you to use #843 instead for the moment. |
Yes, it sounds not a very desirable solution, especially in my case where a formula could have tens of literals.
Okay, I will have a look at this today. |
The reconstruction of |
No, that PR should work. It is less efficient but should work. Please add an example where type inference does not work. |
Yes, I said it worked 😄 : "The reconstruction of resolution seems to work..."
Sorry, In the end, the type inference works. I just forgot that my disjunction has the modifier Thanks for your solution! I think we should keep the issue open until #843 is merged. I will report any further problems here in case I am facing other bugs. |
|
In this case, the inference does not work, and the problem does not come from the modifier
|
In the case where ⟇ is not declared associative commutative, the problem is that ⟇ is declared as definable (there is no modifier) and not constant or injective and thus lambdapi does not know how to solve a problem of the form a ⟇ b = c ⟇ d (there may be many different solutions depending on the rules defining ⟇). This is a common mistake... And, of course, if ⟇ is declared associative commutative then it is not constant and not injective. |
But in this case, the symbol ⟇ will not have a definition and just exists at the syntactic level. |
If ⟇ is commutative then ⟇ cannot be constant nor injective: a ⟇ b = c ⟇ d has 2 solutions: (a,b)=(c,d) and (a,b)=(d,c). |
Okay thx for the answer,
So that means being Just to understand, here in my case with
because |
To understand what unification tries to do, add |
Hi!
When I apply the modifiers
associative commutative
on a symbol, and if I have a term with this symbol in the hypothesis of a proof, Lambdapi automatically puts it in its normal form. Where I would prefer that it just keep the term as it is and just apply the normal form for unification when I need it.Let me illustrate to you why I would like this because of Alethe's reconstruction.
Problem with Alethe
I defined a symbol to represent the clauses in a step of the Alethe format
The definition
test
is a formula of 3 litterals that looks like this clause in an Alethe step:Problem for reconstructing CNF resolution step
When Alethe does
resolution
CNF, the pivot can be anywhere in a formula. For example, here, you want to do aresolution
with H1 and H2 withx
as a pivot.The problem is that my
resolution
lemma is not flexible in syntax. It attempted to have the pivot at the left side of the term (of course, I can also have the dual with a lemma that put the pivot on the right side but theassociative
modifier is right associative).So with H2, the
¬ x
is at the right of the expression. To overcome the problem of the undefined position of the pivot in Alethe clauses, I wanted to use the modifiercommutative associative
to have a normal form and reorder the pivot in a sublemma when the pivot is not placed correctly. I expect that the proof is immediate by unification. The problem is the term is reordered automatically in their normal form:when I
assume H2
at (1), I got the hypothesis:and I would prefer that Lambdapi does not change the order.
At (2), I tried to reorder H2 by putting the pivot at the left, but Lambdapi automatically rewrites the
H2_correct
asπ ((d ⟇ (c ⟇ ¬ x)) = (d ⟇ (c ⟇ ¬ x)))
soapply resolution H (subst H2 H2_correct)
failed because the pivot is still at the wrong position.Conclusion
Could we remove this undesired rewrite because it will make the reconstruction of the resolution step easier?
The text was updated successfully, but these errors were encountered: