我为合金使用No instance found
报告该模型的seq
感到困惑:
one sig Const { T: seq (seq Int) } fact const_facts { Const.T = { 0 -> {0->1 + 1->9} + 1 -> {0->3 + 1->15} } } run {} for 20 but 6 Int, 8 seq
虽然下面的模型,其中我仅用
seq
替换了每个Int ->
,但有一个实例,正如人们所期望的那样:
one sig Const { T: Int -> (Int -> Int) } fact const_facts { Const.T = { 0 -> {0->1 + 1->9} + 1 -> {0->3 + 1->15} } } run {} for 20 but 6 Int
[这让我特别困惑,因为https://alloytools.org/quickguide/seq.html似乎暗示
seq X
和Int -> X
在类型方面是同一件事。
有什么想法吗?
[我对合金报告使用seq找不到该模型的实例感到困惑:一个sig Const {T:seq(seq Int)} fact const_facts {Const.T = {0-> {0-> 1 + 1-> 9} +1-&...
您创建的Const.T
具有3的稀有度,而seq
必须是2的稀有度。