-
Notifications
You must be signed in to change notification settings - Fork 8
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
Make P4-Constraints Typechecker Idempotent #140
Comments
Thanks for the suggestion. I agree that on the surface, this seems like much nicer behavior. Would you be able/willing to share some additional context on how/where you're running into this, and what issues it is causing? In terms of implementation, I think the main gap is that the type checker inserts type casts into the AST during type checking, but errors out if the AST already contains type casts. This was mostly done for simplicity, since no one has had a need to support it thus far. I don't expect this would be hard to support. |
This task was assigned to me by @jonathan-dilorenzo. I proposed a solution in which I checked the isTypeChecked boolean. If it was true, I returned the result; otherwise, I continued with the same flow. However, Jonathan pointed out that this approach could lead to redundancy issues. Now, I am considering two solutions:
|
I'd like to encourage you to pursue the second approach, since introducing additional state/caching opens a new can of worms: what is the behavior if the state/cache gets into an in inconsistent state? How to unit test our code well, now that it depends on additional state? Etc. For the second approach, take a look at
|
Thank you for the feedback and suggestions. I'll focus on implementing the second approach, as it aligns better with our current implementation and minimizes the risk of introducing complexities. I'll review the code and work on adding support for type casts within the expression tree traversal and keep you updated on the progress. |
The casts we want to allow are documented here:
A cast to type T is allowed if you can get from the type of the wrapped expression, T', to T via a single upward edge in the diagram. |
Here is my approach please look into this :
Looking forward to your thoughts on this. |
@smolkaj Could you please review my approach so that I can proceed further? It would be very helpful. |
I’m currently at a conference, so please expect some delay on this. I will
get to it next week.
…On Tue, Apr 23, 2024 at 21:50 sumit7754 ***@***.***> wrote:
@smolkaj <https://github.com/smolkaj> Could you please review my approach
so that I can proceed further? It would be very helpful.
—
Reply to this email directly, view it on GitHub
<#140 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSVS4X4GG6LMCS5G2DBYGLY64FXPAVCNFSM6AAAAABGGGT732VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZTHA2DENZQGE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thank you, Steffen, for taking the time to update me. I'll await further
information.
On Thu, 25 Apr 2024 at 06:08, Steffen Smolka ***@***.***>
wrote:
… I’m currently at a conference, so please expect some delay on this. I will
get to it next week.
On Tue, Apr 23, 2024 at 21:50 sumit7754 ***@***.***> wrote:
> @smolkaj <https://github.com/smolkaj> Could you please review my
approach
> so that I can proceed further? It would be very helpful.
>
> —
> Reply to this email directly, view it on GitHub
> <
#140 (comment)>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/ABSVS4X4GG6LMCS5G2DBYGLY64FXPAVCNFSM6AAAAABGGGT732VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZTHA2DENZQGE>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
—
Reply to this email directly, view it on GitHub
<#140 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A7557SWXHYMQKS3DEG5CUZ3Y7BF6RAVCNFSM6AAAAABGGGT732VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZWGEYDINZRHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sorry for the delay. This looks great, please proceed. 👍 |
Current Behavior:
Desired Behavior (Idempotence):
The text was updated successfully, but these errors were encountered: