...
Run Format

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

Documentation: simd/archsimd/_gen/unify/testdata

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

View as plain text