overloading - Hiding a field for a subtype in Alloy -
suppose have following signature declarations, in alloy 4.2:
sig target {} abstract sig { parent: lone a, r: target } sig b extends {} sig c extends {} when running, resulting instances have arrows every b target, , c target.
how able hide arrows b?
tried following, @ first:
abstract sig { parent: lone } sig b extends { r: target } sig c extends { r: target } this give me control on r in b, introduces lot of ambiguity when writing properties. keep these simple possible. example:
all a: | a.r = parent.a.r the above says a's targets set of a's children's targets.
latter declarations, have rewrite to
all b: b | b.r = parent.b.((b <: r) + (c <: r)) c: c | c.r = parent.c.((b <: r) + (c <: r)) which undesirable.
is there workaround able have general field, still have control on arrows displayed?
you can define function corresponds (c <: r):
fun c_r : -> target { (c <: r) } in alloy visualizer, wil have access relation $c_r. then, can turn off "show arcs" relation r, still have $c_r visible. should hide set of edges belong (b <: r).
Comments
Post a Comment