Skip to content
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

feat: Add Eq op to logic extension #1398

Merged
merged 6 commits into from
Aug 8, 2024
Merged

feat: Add Eq op to logic extension #1398

merged 6 commits into from
Aug 8, 2024

Conversation

croyzor
Copy link
Contributor

@croyzor croyzor commented Aug 7, 2024

No description provided.

@croyzor croyzor requested a review from a team as a code owner August 7, 2024 16:02
@croyzor croyzor requested a review from acl-cqc August 7, 2024 16:02
Copy link

codecov bot commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 87.63%. Comparing base (b7f0765) to head (4d969d6).

Files Patch % Lines
hugr-core/src/std_extensions/logic.rs 71.42% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1398      +/-   ##
==========================================
- Coverage   87.64%   87.63%   -0.01%     
==========================================
  Files         118      118              
  Lines       20347    20352       +5     
  Branches    18035    18040       +5     
==========================================
+ Hits        17833    17836       +3     
  Misses       1725     1725              
- Partials      789      791       +2     
Flag Coverage Δ
python 91.65% <ø> (ø)
rust 87.12% <71.42%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@acl-cqc acl-cqc left a comment

Choose a reason for hiding this comment

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

Thanks Craig! That is a neat observation about partial folding. Test please :)

@@ -331,6 +340,8 @@ pub(crate) mod test {
#[case(NaryLogic::Or, [], false)]
#[case(NaryLogic::Or, [false, false, true], true)]
#[case(NaryLogic::Or, [false, false, false], false)]
#[case(NaryLogic::Eq, [true, true, false, true], false)]
#[case(NaryLogic::Eq, [false, false], true)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Add some couple of cases to nary_partial_const_fold too?

@croyzor croyzor requested a review from acl-cqc August 8, 2024 09:48
Copy link
Contributor

@acl-cqc acl-cqc left a comment

Choose a reason for hiding this comment

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

Thanks @croyzor, looks good to me :)

@@ -355,6 +366,9 @@ pub(crate) mod test {
#[case(NaryLogic::And, [Some(false), None], Some(false))]
#[case(NaryLogic::Or, [None, Some(false)], None)]
#[case(NaryLogic::Or, [None, Some(true)], Some(true))]
#[case(NaryLogic::Eq, [None, Some(true), Some(true)], None)]
#[case(NaryLogic::Eq, [None, Some(false), Some(true)], Some(false))]
#[case(NaryLogic::Eq, [Some(true), Some(true), Some(true)], Some(true))]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: the last doesn't need to be expressed in the more-complex nary_partial_const_fold format, right? Doing so is a test of the test framework, rather than the code-under-test! You could move it to nary_const_fold or remove it.

@croyzor croyzor added this pull request to the merge queue Aug 8, 2024
Merged via the queue into main with commit cd0c906 Aug 8, 2024
21 of 22 checks passed
@croyzor croyzor deleted the feat/logic-eq branch August 8, 2024 13:42
@hugrbot hugrbot mentioned this pull request Aug 8, 2024
github-merge-queue bot pushed a commit that referenced this pull request Aug 12, 2024
## 🤖 New release
* `hugr`: 0.10.0 -> 0.11.0
* `hugr-core`: 0.7.0 -> 0.8.0
* `hugr-passes`: 0.6.2 -> 0.7.0
* `hugr-cli`: 0.3.0 -> 0.4.0

<details><summary><i><b>Changelog</b></i></summary><p>

## `hugr`
<blockquote>

## 0.11.0 (2024-08-12)

### Bug Fixes

- [**breaking**] BasicBlockExits should not be `OpTag::DataflowParent`
([#1409](#1409))

### Documentation

- Clarify CustomConst::equal_consts
([#1396](#1396))

### Features

- [**breaking**] Serialised extensions
([#1371](#1371))
- Serialised standard extensions
([#1377](#1377))
- [**breaking**] Update remaining builder methods to "infer by default"
([#1386](#1386))
- Add Eq op to logic extension
([#1398](#1398))
- Improve error message on failed custom op validation
([#1416](#1416))
- [**breaking**] `Extension` requires a version
([#1367](#1367))
</blockquote>

## `hugr-core`
<blockquote>

## 0.8.0 (2024-08-12)

### Bug Fixes

- [**breaking**] BasicBlockExits should not be `OpTag::DataflowParent`
([#1409](#1409))

### Documentation

- Clarify CustomConst::equal_consts
([#1396](#1396))

### Features

- [**breaking**] `Extension` requires a version
([#1367](#1367))
- [**breaking**] Serialised extensions
([#1371](#1371))
- Serialised standard extensions
([#1377](#1377))
- [**breaking**] Update remaining builder methods to "infer by default"
([#1386](#1386))
- Add Eq op to logic extension
([#1398](#1398))
- Improve error message on failed custom op validation
([#1416](#1416))
</blockquote>

## `hugr-passes`
<blockquote>

## 0.7.0 (2024-08-12)

### Features

- [**breaking**] `Extension` requires a version
([#1367](#1367))
</blockquote>

## `hugr-cli`
<blockquote>

## 0.4.0 (2024-08-12)

### Features

- Serialised standard extensions
([#1377](#1377))
- Validate with extra extensions and packages
([#1389](#1389))
- [**breaking**] Move mermaid to own sub-command
([#1390](#1390))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).

---------

Co-authored-by: Craig Roy <[email protected]>
@hugrbot hugrbot mentioned this pull request Aug 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants