The util/ordering module and ordered subsignatures

前端 未结 2 1172
[愿得一人]
[愿得一人] 2021-01-25 12:24

Consider the following Alloy model:

open util/ordering[C]

abstract sig A {}
sig B extends A {}
sig C extends A {}

pred show {}
run show for 7

2条回答
  •  天命终不由人
    2021-01-25 13:09

    I understand that the ordered signature will always have as many atoms as the scope allows, because util/ordering tells me so. But that's not quite the same as why.

    The reason is that when forcing an ordered sig to contain as many atoms as the scope allows it is possible for the translator to generate an efficient symmetry breaking predicate, which, in most examples with ordered sigs, results in much better solving time. So it is simply a trade-off, and the design decision was to enforce this extra constraint in order to gain performance.

提交回复
热议问题