Skip to content

Make Compose and Join optional in EdgeFunction#736

Open
fabianbs96 wants to merge 7 commits intodevelopmentfrom
f-OptionalEFComposeJoin
Open

Make Compose and Join optional in EdgeFunction#736
fabianbs96 wants to merge 7 commits intodevelopmentfrom
f-OptionalEFComposeJoin

Conversation

@fabianbs96
Copy link
Member

Make the compose and join functions in the EdgeFunction implementations optional, if the IDETabulationProblem impl provides extend and combine.

Can we somehow emit a compile-time error, if neither are implemented?

…ns optional, if the IDETabulkationProblem impl provides extend and combine
@fabianbs96 fabianbs96 self-assigned this Oct 21, 2024
@fabianbs96 fabianbs96 marked this pull request as ready for review February 26, 2026 17:27
Copy link
Collaborator

@vulder vulder left a comment

Choose a reason for hiding this comment

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

About your question reg. the compile error. Am I missing something, or would not just a OR + concept check in a static assert be enough? If you wanna talk about the design just ping me :)

Btw. I added Sebi to check if this conflicts with our internal setup.


template <typename L, typename ConcreteEF>
EdgeFunction<L>
inline EdgeFunction<L>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Inline should not really be needed here

@vulder
Copy link
Collaborator

vulder commented Mar 1, 2026

@boehmseb Can you please double check if this change would work for us.

@fabianbs96
Copy link
Member Author

The problem with concept+static_assert is that the Problem contains a virtual default implementation of extend and combine that forward to the EF-member-functions composeWith and joinWith. We would somehow need to statically detect that extend and combine have been overwritten.

I guess with the current design of IDETabulationProblem, this is not possible.

  virtual EdgeFunction<l_t> extend(const EdgeFunction<l_t> &L,
                                   const EdgeFunction<l_t> &R) {
    return L.composeWith(R); // <-- with the current design, this would emit a runtime error if compose() has
                             //     not been implemented *and* extend has not been overwritten
  }

  virtual EdgeFunction<l_t> combine(const EdgeFunction<l_t> &L,
                                    const EdgeFunction<l_t> &R) {
    return L.joinWith(R); // <-- similar possible runtime error as with compose
  }

Or do you have an idea, how one could detect that at compile time?

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