Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Exporting get_requires utils function #1056

Merged
merged 9 commits into from
Apr 4, 2024
Merged

Conversation

Robertorosmaninho
Copy link
Contributor

This PR introduces a new file, utils.py, which should contain auxiliary functions that need to be converted from and to llvm but don't set any field on an object.

In this context we're using a function from llvm backend's pattern_matching.cpp to avoid reimplement it in Python. This function is exported as Pyhton binding in this PR, and therefore, the current PR can only be merged after we merge the LLVM Backend one.

@Robertorosmaninho Robertorosmaninho self-assigned this Apr 2, 2024
rv-jenkins pushed a commit to runtimeverification/llvm-backend that referenced this pull request Apr 2, 2024
This is a requirement from the Math Proof Generation Team of $Piˆ2$ to
get easy access to the Pattern of a requires clause.

This PR must be merged before this [PyK
PR](runtimeverification/pyk#1056) that will
properly expose this binding to the Pi2 project.
Copy link
Collaborator

@tothtamas28 tothtamas28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a unit test for this feature. That will also block merging this PR until the binding becomes available.

@tothtamas28
Copy link
Collaborator

In this context we're using a function from llvm backend's pattern_matching.cpp to avoid reimplement it in Python

Hasn't there been a plan to eventually implement it in pyk though?

@Robertorosmaninho
Copy link
Contributor Author

In this context we're using a function from llvm backend's pattern_matching.cpp to avoid reimplement it in Python

Hasn't there been a plan to eventually implement it in pyk though?

That was revisited, and we decided to move in another direction to avoid having the exact implementation in two different places when we could just export them.

@Robertorosmaninho
Copy link
Contributor Author

Please add a unit test for this feature. That will also block merging this PR until the binding becomes available.

I've just added a unit test, and I'm waiting for this PR to be approved

src/pyk/kcfg/kcfg.py Outdated Show resolved Hide resolved
@rv-jenkins rv-jenkins merged commit 798f63f into master Apr 4, 2024
12 checks passed
@rv-jenkins rv-jenkins deleted the get-requires-utils branch April 4, 2024 13:25
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 9, 2024
This PR introduces a new file, `utils.py`, which should contain
auxiliary functions that need to be converted from and to llvm but don't
set any field on an object.

In this context we're using a function from llvm backend's
[pattern_matching.cpp](https://github.com/runtimeverification/llvm-backend/blob/e2f583a05b9bf362deabd58f8acc1ce534aaf4c4/lib/ast/pattern_matching.cpp#L174)
to avoid reimplement it in Python. This function is exported as Pyhton
binding in this
[PR](runtimeverification/llvm-backend#1019), and
therefore, the current PR can only be merged after we merge the LLVM
Backend one.

---------

Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 9, 2024
This PR introduces a new file, `utils.py`, which should contain
auxiliary functions that need to be converted from and to llvm but don't
set any field on an object.

In this context we're using a function from llvm backend's
[pattern_matching.cpp](https://github.com/runtimeverification/llvm-backend/blob/e2f583a05b9bf362deabd58f8acc1ce534aaf4c4/lib/ast/pattern_matching.cpp#L174)
to avoid reimplement it in Python. This function is exported as Pyhton
binding in this
[PR](runtimeverification/llvm-backend#1019), and
therefore, the current PR can only be merged after we merge the LLVM
Backend one.

---------

Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 10, 2024
This PR introduces a new file, `utils.py`, which should contain
auxiliary functions that need to be converted from and to llvm but don't
set any field on an object.

In this context we're using a function from llvm backend's
[pattern_matching.cpp](https://github.com/runtimeverification/llvm-backend/blob/e2f583a05b9bf362deabd58f8acc1ce534aaf4c4/lib/ast/pattern_matching.cpp#L174)
to avoid reimplement it in Python. This function is exported as Pyhton
binding in this
[PR](runtimeverification/llvm-backend#1019), and
therefore, the current PR can only be merged after we merge the LLVM
Backend one.

---------

Co-authored-by: devops <[email protected]>
Baltoli pushed a commit to runtimeverification/k that referenced this pull request Apr 10, 2024
This PR introduces a new file, `utils.py`, which should contain
auxiliary functions that need to be converted from and to llvm but don't
set any field on an object.

In this context we're using a function from llvm backend's
[pattern_matching.cpp](https://github.com/runtimeverification/llvm-backend/blob/e2f583a05b9bf362deabd58f8acc1ce534aaf4c4/lib/ast/pattern_matching.cpp#L174)
to avoid reimplement it in Python. This function is exported as Pyhton
binding in this
[PR](runtimeverification/llvm-backend#1019), and
therefore, the current PR can only be merged after we merge the LLVM
Backend one.

---------

Co-authored-by: devops <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants