Is there an algorithm for comparing if statements?

前端 未结 1 709
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-25 04:08

Is there an algorithm and/or tool for detecting if two sets of if statements with the same conditions are equivalent? When I say \"equivalent\" - I mean that they e

相关标签:
1条回答
  • 2021-01-25 04:12

    I would use Karnaugh Maps which is standard for non sequential logic synthesis and analysis.

    1. create Karnaugh Map for each set of ifs

    2. compare the maps

      if the map is the same then the if statements are equivalent if not then they are different.

    Sorry for a short answer but I do not have a clue what else to add because this is basic knowledge.

    [edit1] just your case ...

    example

    • set1 == set2
    • set3 is different
    0 讨论(0)
提交回复
热议问题