3 ms·
Related, with emphasis in original: > Determining whether a given predicate has a set of valuations for its variables which make it true is an NP-complete prob
by gbacon 9y ago
Related, with emphasis in original:
> Determining whether a given predicate has a set of valuations for its variables which make it true is an NP-complete problem; actually finding the set of valuations is an NP-hard problem. Therefore, overload resolution in C# 3.0 is at the very least NP-hard. There is no known polynomial-time algorithm for any NP-complete or NP-hard problem and it is widely believed that there is none to be found, though that conjecture has yet to be proven. So our dream of fast lambda type analysis in C# 3.0 is almost certainly doomed, at least as long as we have the current rules for overload resolution.
See Lambda Expressions vs. Anonymous Methods, Part Five[0] by Eric Lippert.
[0]: https://blogs.msdn.microsoft.com/ericlippert/2007/03/28/lambda-expressions-vs-anonymous-methods-part-five/ https://blogs.msdn.microsoft.com/ericlippert/2007/03/28/lamb...
- cwzwarich 9y agoIf the concern is regarding real-world performance and not DoS attacks, then why can't they just adopt the conflict-driven clause learning techniques of practical SAT solvers? The corresponding SAT instances are quite small, so the problems should be handled quickly by even a relatively naive CDCL implementation.
- matthewwarren 9y agoThanks for the link. I thought I'd read all the Eric Lippert articles related to my post, but I missed this one