Support subset of instances of nested abstract clafers #29

Closed
mantkiew opened this Issue Sep 5, 2016 · 2 comments

Projects

None yet

2 participants

@mantkiew
Member
mantkiew commented Sep 5, 2016 edited

The following example gives a NullPointerException:

abstract Component
    abstract Port
    abstract ExceptionPort : Port
    allPorts -> Port *
    [ allPorts.dref = this.Port ]    // the exception is caused by "this.Port"

WinController : Component
    cmd : Port
    powerOut : ExceptionPort

The expected output is (as produced by AlloyIG):

WinController
  allPorts$1 -> powerOut
  allPorts$2 -> cmd
  powerOut
  cmd

This works nicely for concrete clafers:

Component 3
    Port 1..3
    allPorts -> Port *
    [ allPorts.dref = this.Port ]

produces, for example an instance:

Component
  Port
  Port$1
  allPorts -> Port
  allPorts$1 -> Port$1
Component$1
  Port$2
  Port$3
  allPorts$2 -> Port$2
  allPorts$3 -> Port$3
Component$2
  Port$4
  Port$5
  allPorts$4 -> Port$5
  allPorts$5 -> Port$4
@mantkiew mantkiew added this to the 0.4.4 milestone Sep 5, 2016
@mantkiew mantkiew added a commit that referenced this issue Sep 5, 2016
@mantkiew mantkiew test case for issue #29 ad92f0e
@mantkiew
Member
mantkiew commented Sep 5, 2016 edited

It's a peculiar bug because the following works fine

abstract Component
    abstract Port
//    abstract ExceptionPort : Port
    allPorts -> Port *
    [ allPorts.dref = this.Port ]

WinController : Component
    cmd : Port
    powerOut : Port //ExceptionPort
@JLiangWaterloo
Member

Fixed.

@mantkiew mantkiew referenced this issue Sep 19, 2016
Merged

Release 0.4.4 #27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment