Text file src/simd/_gen/unify/testdata/vars.yaml

     1  #
     2  # Basic tests
     3  #
     4  
     5  name: "basic string"
     6  unify:
     7  - $x
     8  - test
     9  all:
    10  - test
    11  ---
    12  name: "basic tuple"
    13  unify:
    14  - [$x, $x]
    15  - [test, test]
    16  all:
    17  - [test, test]
    18  ---
    19  name: "three tuples"
    20  unify:
    21  - [$x, $x]
    22  - [test, _]
    23  - [_, test]
    24  all:
    25  - [test, test]
    26  ---
    27  name: "basic def"
    28  unify:
    29  - {a: $x, b: $x}
    30  - {a: test, b: test}
    31  all:
    32  - {a: test, b: test}
    33  ---
    34  name: "three defs"
    35  unify:
    36  - {a: $x, b: $x}
    37  - {a: test}
    38  - {b: test}
    39  all:
    40  - {a: test, b: test}
    41  
    42  #
    43  # Bottom tests
    44  #
    45  
    46  ---
    47  name: "basic bottom"
    48  unify:
    49  - [$x, $x]
    50  - [test, foo]
    51  all: []
    52  ---
    53  name: "three-way bottom"
    54  unify:
    55  - [$x, $x]
    56  - [test, _]
    57  - [_, foo]
    58  all: []
    59  
    60  #
    61  # Basic sum tests
    62  #
    63  
    64  ---
    65  name: "basic sum"
    66  unify:
    67  - $x
    68  - !sum [a, b]
    69  all:
    70  - a
    71  - b
    72  ---
    73  name: "sum of tuples"
    74  unify:
    75  - [$x]
    76  - !sum [[a], [b]]
    77  all:
    78  - [a]
    79  - [b]
    80  ---
    81  name: "acausal sum"
    82  unify:
    83  - [_, !sum [a, b]]
    84  - [$x, $x]
    85  all:
    86  - [a, a]
    87  - [b, b]
    88  
    89  #
    90  # Transitivity tests
    91  #
    92  
    93  ---
    94  name: "transitivity"
    95  unify:
    96  - [_, _, _, test]
    97  - [$x, $x,   _,  _]
    98  - [ _, $x,  $x,  _]
    99  - [ _,  _,  $x, $x]
   100  all:
   101  - [test, test, test, test]
   102  
   103  #
   104  # Multiple vars
   105  #
   106  
   107  ---
   108  name: "basic uncorrelated vars"
   109  unify:
   110  - - !sum [1, 2]
   111    - !sum [3, 4]
   112  - - $a
   113    - $b
   114  all:
   115  - [1, 3]
   116  - [1, 4]
   117  - [2, 3]
   118  - [2, 4]
   119  ---
   120  name: "uncorrelated vars"
   121  unify:
   122  - - !sum [1, 2]
   123    - !sum [3, 4]
   124    - !sum [1, 2]
   125  - - $a
   126    - $b
   127    - $a
   128  all:
   129  - [1, 3, 1]
   130  - [1, 4, 1]
   131  - [2, 3, 2]
   132  - [2, 4, 2]
   133  ---
   134  name: "entangled vars"
   135  unify:
   136  - - !sum [[1,2],[3,4]]
   137    - !sum [[2,1],[3,4],[4,3]]
   138  - - [$a, $b]
   139    - [$b, $a]
   140  all:
   141  - - [1, 2]
   142    - [2, 1]
   143  - - [3, 4]
   144    - [4, 3]
   145  
   146  #
   147  # End-to-end examples
   148  #
   149  
   150  ---
   151  name: "end-to-end"
   152  unify:
   153  - go: Add
   154    in:
   155    - go: $t
   156    - go: $t
   157  - in: !repeat
   158    - !sum
   159      - go: Int32x4
   160        base: int
   161      - go: Uint32x4
   162        base: uint
   163  all:
   164  - go: Add
   165    in:
   166    - base: int
   167      go: Int32x4
   168    - base: int
   169      go: Int32x4
   170  - go: Add
   171    in:
   172    - base: uint
   173      go: Uint32x4
   174    - base: uint
   175      go: Uint32x4
   176  

View as plain text