Skip to content

Collection attributes not statically scheduled correctly (aps2scala) #7

Description

@boyland

Using aps2scala collection attributes (as opposed to collection globals) are not scheduled correctly:

with "tiny";

module TINY_COLL[T :: var TINY[]] extends T
begin
  type Integers := SET[Integer];

  collection attribute Wood.sum : Integer :> 0, (+);

  pragma synthesized(sum);

  match ?l=leaf(?x) begin
    l.sum :> x;
  end;
  match ?b=branch(?x,?y) begin
    b.sum :> x.sum;
    b.sum :> y.sum;
  end;

  match ?p=root(?b) begin
  end;

end;

Not only is only one of the collection assignments activated (as can be seen below), but the generated code uses "set/assign" rather than something that collects multiple values.

Furthermore, even collection globals are not statically scheduled correctly if there are multiple collection assignments (e.g. from test-coll.aps):

   match ?l=leaf(?x) begin
     sum :> x;
     leaves :> {x};
+    sum :> 10; 
   end;

NB: dynamic scheduling works correctly in both cases.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions