Are two functions equal?

前端 未结 5 1153
轮回少年
轮回少年 2020-12-06 11:08

[Edit]

The general question seems incredibly hard to solve. Here is a significantly restricted version of this question.


How do I dete

5条回答
  •  情书的邮戳
    2020-12-06 11:33

    This is impossible according to Rice's theorem:

    In computability theory, Rice's theorem states that, for any non-trivial property of partial functions, there is no general and effective method to decide whether an algorithm computes a partial function with that property.

    If you restrict the domain of the functions to be finite, then you can trivially verify if ∀x: f(x) = g(x) using brute force, but this is not possible with an infinite domain.

提交回复
热议问题