Implement identity, binary operator, and skipping operator for associative commutative operators #493
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
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
is_ac_operator
method (or another way to tell if an operator is AC) #494The text was updated successfully, but these errors were encountered: