microsoft / knossos-ksc

Compiler with automatic differentiation
Other
45 stars 10 forks source link

python rewriter: define "fuse_rules" #819

Open acl33 opened 3 years ago

acl33 commented 3 years ago

From PR comment: consider defining

index_of_map = fuse_rules(index_of_build, build_of_map)

We should think carefully about where the second rule has to apply - it might be just applying the second rule to the replacement pattern of the first rule (not to the replacement subtree formed by substituting in parts of the actual Expression). Not sure if it's more complex than that.