New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support subset of instances of nested abstract clafers #29

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

Comments

Projects
None yet
2 participants
@mantkiew
Member

mantkiew commented Sep 5, 2016

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 added a commit that referenced this issue Sep 5, 2016

@mantkiew

This comment has been minimized.

Show comment
Hide comment
@mantkiew

mantkiew Sep 5, 2016

Member

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
Member

mantkiew commented Sep 5, 2016

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

This comment has been minimized.

Show comment
Hide comment
@JLiangWaterloo

JLiangWaterloo Sep 7, 2016

Member

Fixed.

Member

JLiangWaterloo commented Sep 7, 2016

Fixed.

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