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

Implement identity, binary operator, and skipping operator for associative commutative operators #493

Open
1 of 4 tasks
niklasdewally opened this issue Nov 26, 2024 · 1 comment
Assignees
Labels
area::conjure-oxide/ast Related to conjure_core and ast representation. area::conjure-oxide Related to conjure_oxide. area::rules Related to rewrite rules kind::feature New feature or request

Comments

@niklasdewally
Copy link
Collaborator

niklasdewally commented Nov 26, 2024

Description

For every AC operator we could have a triplet defined: identity, binary operator, skipping operator. The first two are hopefully clear, the third is a bit weird but useful.

Let's take sum as an example. 0 is the identity, + is the binop, \ (b, x) -> toInt(b) * x is the skipping operator.

Skipping op evaluates to identity if b is false, to the second argument if b is true.

For logical and it is \ (b, x) -> b => x

For logical or it is \ (b, x) -> b /\ x

Originally posted by @ozgurakgun in #491 (comment)

Tasks

@niklasdewally niklasdewally added area::conjure-oxide Related to conjure_oxide. kind::feature New feature or request area::conjure-oxide/ast Related to conjure_core and ast representation. area::rules Related to rewrite rules labels Nov 26, 2024
@niklasdewally
Copy link
Collaborator Author

This will become useful later when I get to quantifiers and comprehensions.

niklasdewally added a commit to niklasdewally/conjure-oxide that referenced this issue Nov 26, 2024
Implement method of Expression to check whether an expression is an
associative-commutative operator. The concept of an AC operator will be
useful down the line for A-CSE, generic normalisation rules, and
quantified expressions.

Related-issues: [conjure-cp#491,conjure-cp#493]
Fixes: conjure-cp#494
niklasdewally added a commit that referenced this issue Nov 26, 2024
Implement method of Expression to check whether an expression is an
associative-commutative operator. The concept of an AC operator will be
useful down the line for A-CSE, generic normalisation rules, and
quantified expressions.

Related-issues: [#491,#493]
Fixes: #494
@niklasdewally niklasdewally self-assigned this Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area::conjure-oxide/ast Related to conjure_core and ast representation. area::conjure-oxide Related to conjure_oxide. area::rules Related to rewrite rules kind::feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant