Attic/sier.prs
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 25 Oct 2024 18:54:08 +0100
changeset 971 51e00f223792
parent 710 183663740fb7
permissions -rw-r--r--
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
710
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
val sier = List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
  ArrayDef("mem", 30000),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
  Assign("ptr", Num(15000)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
  AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(8))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
  While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
    Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
    List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
      Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
      AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    10
      Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
      AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(4))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
      Assign("ptr", Aop("-", Var("ptr"), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
      AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
      Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
    )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
  ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
  Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
  AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
  Assign("ptr", Aop("+", Var("ptr"), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
  AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
  Assign("ptr", Aop("-", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
  While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
    Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
    List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
      AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
      While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
        Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    28
        List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
          Assign("ptr", Aop("+", Var("ptr"), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
          AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
          Assign("ptr", Aop("-", Var("ptr"), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
          AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
          Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
        )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    35
      ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
      AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
      Assign("ptr", Aop("+", Var("ptr"), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    38
      Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    39
    )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    40
  ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    41
  Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    42
  AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    43
  While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
    Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
    List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
      AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    47
      Assign("ptr", Aop("-", Var("ptr"), Num(3))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    48
      While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    49
        Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    50
        List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    51
          AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    52
          Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    53
          While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    54
            Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    55
            List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    56
              AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    57
              AssignA("mem", Var("ptr"), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    58
              AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    59
              Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
              AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
              Assign("ptr", Aop("+", Var("ptr"), Num(3))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    62
              AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    63
              Assign("ptr", Aop("-", Var("ptr"), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    64
              Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    65
            )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
          ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    67
          Assign("ptr", Aop("-", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
          While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    69
            Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
            List(Assign("ptr", Aop("-", Var("ptr"), Num(1))), Skip)
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
          ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
          Assign("ptr", Aop("+", Var("ptr"), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
          AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(6))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
          While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    75
            Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
            List(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
              Assign("ptr", Aop("-", Var("ptr"), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    78
              AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(5))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
              Assign("ptr", Aop("+", Var("ptr"), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    80
              AssignA("mem", Var("ptr"), Aop("-", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
              Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    82
            )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
          ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
          AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
          Assign("ptr", Aop("-", Var("ptr"), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
          AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
          Assign("x", Ref("mem", Var("ptr"))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    88
          Write("x"),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
          AssignA("mem", Var("ptr"), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    90
          Assign("ptr", Aop("-", Var("ptr"), Num(2))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    91
          Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
        )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    93
      ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
      Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
      Assign("x", Ref("mem", Var("ptr"))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
      Write("x"),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
      Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
      AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
      While(
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
        Bop("!=", Ref("mem", Var("ptr")), Num(0)),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
        List(Assign("ptr", Aop("+", Var("ptr"), Num(2))), Skip)
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
      ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
      Assign("ptr", Aop("+", Var("ptr"), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
      AssignA("mem", Var("ptr"), Aop("+", Ref("mem", Var("ptr")), Num(1))),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
      Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   106
    )
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
  ),
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   108
  Skip
183663740fb7 updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   109
)