z3 0.0.20181229 → 0.0.20211213

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +0 -2
  3. data/Rakefile +8 -1
  4. data/examples/abc_path +187 -0
  5. data/examples/abc_path-1.txt +7 -0
  6. data/examples/algebra_problems +12 -12
  7. data/examples/aquarium +133 -0
  8. data/examples/aquarium-1.txt +11 -0
  9. data/examples/bridges +2 -2
  10. data/examples/cats_organized_neatly +133 -0
  11. data/examples/cats_organized_neatly-10.txt +15 -0
  12. data/examples/cats_organized_neatly-3.txt +8 -0
  13. data/examples/cats_organized_neatly-48.txt +32 -0
  14. data/examples/circuit_problems +4 -4
  15. data/examples/clogic_puzzle +2 -2
  16. data/examples/color_nonogram +150 -0
  17. data/examples/color_nonogram-1.txt +23 -0
  18. data/examples/crossflip +2 -4
  19. data/examples/dominion +153 -0
  20. data/examples/dominion-1.txt +8 -0
  21. data/examples/dominosa +133 -0
  22. data/examples/dominosa-1.txt +8 -0
  23. data/examples/eulero +99 -0
  24. data/examples/eulero-1.txt +5 -0
  25. data/examples/four_hackers_puzzle +2 -2
  26. data/examples/futoshiki +128 -0
  27. data/examples/futoshiki-1.txt +17 -0
  28. data/examples/kakurasu +73 -0
  29. data/examples/kakurasu-1.txt +2 -0
  30. data/examples/kakuro +2 -2
  31. data/examples/killer_sudoku +88 -0
  32. data/examples/killer_sudoku-1.txt +17 -0
  33. data/examples/killer_sudoku-2.txt +53 -0
  34. data/examples/kinematics_problems +20 -20
  35. data/examples/knights_puzzle +2 -2
  36. data/examples/kropki +100 -0
  37. data/examples/kropki-1.txt +13 -0
  38. data/examples/letter_connections +2 -2
  39. data/examples/light_up +2 -2
  40. data/examples/minisudoku +2 -2
  41. data/examples/miracle_sudoku +135 -0
  42. data/examples/miracle_sudoku-1.txt +9 -0
  43. data/examples/mortal_coil_puzzle +2 -2
  44. data/examples/nanro +245 -0
  45. data/examples/nanro-1.txt +8 -0
  46. data/examples/nine_clocks +106 -0
  47. data/examples/nonogram +2 -2
  48. data/examples/pyramid_nonogram +2 -2
  49. data/examples/regexp_crossword_solver +2 -2
  50. data/examples/regexp_solver +2 -2
  51. data/examples/renzoku +124 -0
  52. data/examples/renzoku-1.txt +17 -0
  53. data/examples/sandwich_sudoku +101 -0
  54. data/examples/sandwich_sudoku-1.txt +10 -0
  55. data/examples/selfref +2 -2
  56. data/examples/skyscrapers +118 -0
  57. data/examples/skyscrapers-1.txt +6 -0
  58. data/examples/skyscrapers-2.txt +11 -0
  59. data/examples/star_battle +134 -0
  60. data/examples/star_battle-1.txt +10 -0
  61. data/examples/stitches +180 -0
  62. data/examples/stitches-1.txt +11 -0
  63. data/examples/sudoku +2 -2
  64. data/examples/suguru +199 -0
  65. data/examples/suguru-1.txt +17 -0
  66. data/examples/verbal_arithmetic +2 -2
  67. data/examples/yajilin +268 -0
  68. data/examples/yajilin-1.txt +10 -0
  69. data/lib/z3/expr/expr.rb +3 -3
  70. data/lib/z3/low_level_auto.rb +138 -10
  71. data/lib/z3/optimize.rb +1 -0
  72. data/lib/z3/very_low_level.rb +5 -1
  73. data/lib/z3/very_low_level_auto.rb +35 -3
  74. data/spec/integration/abc_path_spec.rb +21 -0
  75. data/spec/integration/aquarium_spec.rb +27 -0
  76. data/spec/integration/cats_organized_neatly_spec.rb +14 -0
  77. data/spec/integration/color_nonogram_spec.rb +28 -0
  78. data/spec/integration/dominion_spec.rb +14 -0
  79. data/spec/integration/dominosa_spec.rb +21 -0
  80. data/spec/integration/eulero_spec.rb +11 -0
  81. data/spec/integration/futoshiki_spec.rb +23 -0
  82. data/spec/integration/kakurasu_spec.rb +18 -0
  83. data/spec/integration/killer_sudoku_spec.rb +10 -0
  84. data/spec/integration/knights_puzzle_spec.rb +11 -11
  85. data/spec/integration/kropki_spec.rb +19 -0
  86. data/spec/integration/miracle_sudoku_spec.rb +15 -0
  87. data/spec/integration/mortal_coil_puzzle_spec.rb +8 -6
  88. data/spec/integration/nanro_spec.rb +39 -0
  89. data/spec/integration/nine_clocks_spec.rb +30 -0
  90. data/spec/integration/regexp_crossword_solver_spec.rb +1 -1
  91. data/spec/integration/renzoku_spec.rb +23 -0
  92. data/spec/integration/sandwich_sudoku_spec.rb +15 -0
  93. data/spec/integration/skyscraper_spec.rb +10 -0
  94. data/spec/integration/star_battle_spec.rb +27 -0
  95. data/spec/integration/stitches_spec.rb +25 -0
  96. data/spec/integration/suguru_spec.rb +23 -0
  97. data/spec/integration/yajilin_spec.rb +25 -0
  98. data/spec/optimize_spec.rb +3 -1
  99. data/spec/set_expr_spec.rb +15 -9
  100. data/spec/solver_spec.rb +1 -2
  101. data/spec/spec_helper.rb +15 -0
  102. metadata +86 -7
@@ -25,6 +25,14 @@ module Z3
25
25
  VeryLowLevel.Z3_algebraic_ge(_ctx_pointer, ast1._ast, ast2._ast)
26
26
  end
27
27
 
28
+ def algebraic_get_i(ast) #=> :uint
29
+ VeryLowLevel.Z3_algebraic_get_i(_ctx_pointer, ast._ast)
30
+ end
31
+
32
+ def algebraic_get_poly(ast) #=> :ast_vector_pointer
33
+ VeryLowLevel.Z3_algebraic_get_poly(_ctx_pointer, ast._ast)
34
+ end
35
+
28
36
  def algebraic_gt(ast1, ast2) #=> :bool
29
37
  VeryLowLevel.Z3_algebraic_gt(_ctx_pointer, ast1._ast, ast2._ast)
30
38
  end
@@ -301,14 +309,6 @@ module Z3
301
309
  VeryLowLevel.Z3_fixedpoint_inc_ref(_ctx_pointer, fixedpoint._fixedpoint)
302
310
  end
303
311
 
304
- def fixedpoint_pop(fixedpoint) #=> :void
305
- VeryLowLevel.Z3_fixedpoint_pop(_ctx_pointer, fixedpoint._fixedpoint)
306
- end
307
-
308
- def fixedpoint_push(fixedpoint) #=> :void
309
- VeryLowLevel.Z3_fixedpoint_push(_ctx_pointer, fixedpoint._fixedpoint)
310
- end
311
-
312
312
  def fixedpoint_query(fixedpoint, ast) #=> :int
313
313
  VeryLowLevel.Z3_fixedpoint_query(_ctx_pointer, fixedpoint._fixedpoint, ast._ast)
314
314
  end
@@ -589,10 +589,18 @@ module Z3
589
589
  VeryLowLevel.Z3_get_num_tactics(_ctx_pointer)
590
590
  end
591
591
 
592
+ def get_numeral_binary_string(ast) #=> :string
593
+ VeryLowLevel.Z3_get_numeral_binary_string(_ctx_pointer, ast._ast)
594
+ end
595
+
592
596
  def get_numeral_decimal_string(ast, num) #=> :string
593
597
  VeryLowLevel.Z3_get_numeral_decimal_string(_ctx_pointer, ast._ast, num)
594
598
  end
595
599
 
600
+ def get_numeral_double(ast) #=> :double
601
+ VeryLowLevel.Z3_get_numeral_double(_ctx_pointer, ast._ast)
602
+ end
603
+
596
604
  def get_numeral_string(ast) #=> :string
597
605
  VeryLowLevel.Z3_get_numeral_string(_ctx_pointer, ast._ast)
598
606
  end
@@ -653,6 +661,10 @@ module Z3
653
661
  VeryLowLevel.Z3_get_range(_ctx_pointer, func_decl._ast)
654
662
  end
655
663
 
664
+ def get_re_sort_basis(sort) #=> :sort_pointer
665
+ VeryLowLevel.Z3_get_re_sort_basis(_ctx_pointer, sort._ast)
666
+ end
667
+
656
668
  def get_relation_arity(sort) #=> :uint
657
669
  VeryLowLevel.Z3_get_relation_arity(_ctx_pointer, sort._ast)
658
670
  end
@@ -661,6 +673,10 @@ module Z3
661
673
  VeryLowLevel.Z3_get_relation_column(_ctx_pointer, sort._ast, num)
662
674
  end
663
675
 
676
+ def get_seq_sort_basis(sort) #=> :sort_pointer
677
+ VeryLowLevel.Z3_get_seq_sort_basis(_ctx_pointer, sort._ast)
678
+ end
679
+
664
680
  def get_sort(ast) #=> :sort_pointer
665
681
  VeryLowLevel.Z3_get_sort(_ctx_pointer, ast._ast)
666
682
  end
@@ -677,6 +693,10 @@ module Z3
677
693
  VeryLowLevel.Z3_get_sort_name(_ctx_pointer, sort._ast)
678
694
  end
679
695
 
696
+ def get_string_length(ast) #=> :uint
697
+ VeryLowLevel.Z3_get_string_length(_ctx_pointer, ast._ast)
698
+ end
699
+
680
700
  def get_symbol_int(sym) #=> :int
681
701
  VeryLowLevel.Z3_get_symbol_int(_ctx_pointer, sym)
682
702
  end
@@ -765,8 +785,8 @@ module Z3
765
785
  VeryLowLevel.Z3_goal_size(_ctx_pointer, goal._goal)
766
786
  end
767
787
 
768
- def goal_to_dimacs_string(goal) #=> :string
769
- VeryLowLevel.Z3_goal_to_dimacs_string(_ctx_pointer, goal._goal)
788
+ def goal_to_dimacs_string(goal, bool) #=> :string
789
+ VeryLowLevel.Z3_goal_to_dimacs_string(_ctx_pointer, goal._goal, bool)
770
790
  end
771
791
 
772
792
  def goal_to_string(goal) #=> :string
@@ -797,6 +817,10 @@ module Z3
797
817
  VeryLowLevel.Z3_is_as_array(_ctx_pointer, ast._ast)
798
818
  end
799
819
 
820
+ def is_char_sort(sort) #=> :bool
821
+ VeryLowLevel.Z3_is_char_sort(_ctx_pointer, sort._ast)
822
+ end
823
+
800
824
  def is_eq_ast(ast1, ast2) #=> :bool
801
825
  VeryLowLevel.Z3_is_eq_ast(_ctx_pointer, ast1._ast, ast2._ast)
802
826
  end
@@ -1013,6 +1037,30 @@ module Z3
1013
1037
  VeryLowLevel.Z3_mk_bvxor(_ctx_pointer, ast1._ast, ast2._ast)
1014
1038
  end
1015
1039
 
1040
+ def mk_char_from_bv(ast) #=> :ast_pointer
1041
+ VeryLowLevel.Z3_mk_char_from_bv(_ctx_pointer, ast._ast)
1042
+ end
1043
+
1044
+ def mk_char_is_digit(ast) #=> :ast_pointer
1045
+ VeryLowLevel.Z3_mk_char_is_digit(_ctx_pointer, ast._ast)
1046
+ end
1047
+
1048
+ def mk_char_le(ast1, ast2) #=> :ast_pointer
1049
+ VeryLowLevel.Z3_mk_char_le(_ctx_pointer, ast1._ast, ast2._ast)
1050
+ end
1051
+
1052
+ def mk_char_sort #=> :sort_pointer
1053
+ VeryLowLevel.Z3_mk_char_sort(_ctx_pointer)
1054
+ end
1055
+
1056
+ def mk_char_to_bv(ast) #=> :ast_pointer
1057
+ VeryLowLevel.Z3_mk_char_to_bv(_ctx_pointer, ast._ast)
1058
+ end
1059
+
1060
+ def mk_char_to_int(ast) #=> :ast_pointer
1061
+ VeryLowLevel.Z3_mk_char_to_int(_ctx_pointer, ast._ast)
1062
+ end
1063
+
1016
1064
  def mk_concat(ast1, ast2) #=> :ast_pointer
1017
1065
  VeryLowLevel.Z3_mk_concat(_ctx_pointer, ast1._ast, ast2._ast)
1018
1066
  end
@@ -1037,6 +1085,10 @@ module Z3
1037
1085
  VeryLowLevel.Z3_mk_div(_ctx_pointer, ast1._ast, ast2._ast)
1038
1086
  end
1039
1087
 
1088
+ def mk_divides(ast1, ast2) #=> :ast_pointer
1089
+ VeryLowLevel.Z3_mk_divides(_ctx_pointer, ast1._ast, ast2._ast)
1090
+ end
1091
+
1040
1092
  def mk_empty_set(sort) #=> :ast_pointer
1041
1093
  VeryLowLevel.Z3_mk_empty_set(_ctx_pointer, sort._ast)
1042
1094
  end
@@ -1365,6 +1417,14 @@ module Z3
1365
1417
  VeryLowLevel.Z3_mk_le(_ctx_pointer, ast1._ast, ast2._ast)
1366
1418
  end
1367
1419
 
1420
+ def mk_linear_order(sort, num) #=> :func_decl_pointer
1421
+ VeryLowLevel.Z3_mk_linear_order(_ctx_pointer, sort._ast, num)
1422
+ end
1423
+
1424
+ def mk_lstring(num, str) #=> :ast_pointer
1425
+ VeryLowLevel.Z3_mk_lstring(_ctx_pointer, num, str)
1426
+ end
1427
+
1368
1428
  def mk_lt(ast1, ast2) #=> :ast_pointer
1369
1429
  VeryLowLevel.Z3_mk_lt(_ctx_pointer, ast1._ast, ast2._ast)
1370
1430
  end
@@ -1393,6 +1453,14 @@ module Z3
1393
1453
  VeryLowLevel.Z3_mk_params(_ctx_pointer)
1394
1454
  end
1395
1455
 
1456
+ def mk_partial_order(sort, num) #=> :func_decl_pointer
1457
+ VeryLowLevel.Z3_mk_partial_order(_ctx_pointer, sort._ast, num)
1458
+ end
1459
+
1460
+ def mk_piecewise_linear_order(sort, num) #=> :func_decl_pointer
1461
+ VeryLowLevel.Z3_mk_piecewise_linear_order(_ctx_pointer, sort._ast, num)
1462
+ end
1463
+
1396
1464
  def mk_power(ast1, ast2) #=> :ast_pointer
1397
1465
  VeryLowLevel.Z3_mk_power(_ctx_pointer, ast1._ast, ast2._ast)
1398
1466
  end
@@ -1401,6 +1469,10 @@ module Z3
1401
1469
  VeryLowLevel.Z3_mk_probe(_ctx_pointer, str)
1402
1470
  end
1403
1471
 
1472
+ def mk_re_allchar(sort) #=> :ast_pointer
1473
+ VeryLowLevel.Z3_mk_re_allchar(_ctx_pointer, sort._ast)
1474
+ end
1475
+
1404
1476
  def mk_re_complement(ast) #=> :ast_pointer
1405
1477
  VeryLowLevel.Z3_mk_re_complement(_ctx_pointer, ast._ast)
1406
1478
  end
@@ -1449,10 +1521,22 @@ module Z3
1449
1521
  VeryLowLevel.Z3_mk_rotate_right(_ctx_pointer, num, ast._ast)
1450
1522
  end
1451
1523
 
1524
+ def mk_sbv_to_str(ast) #=> :ast_pointer
1525
+ VeryLowLevel.Z3_mk_sbv_to_str(_ctx_pointer, ast._ast)
1526
+ end
1527
+
1452
1528
  def mk_select(ast1, ast2) #=> :ast_pointer
1453
1529
  VeryLowLevel.Z3_mk_select(_ctx_pointer, ast1._ast, ast2._ast)
1454
1530
  end
1455
1531
 
1532
+ def mk_seq_last_index(ast1, ast2) #=> :ast_pointer
1533
+ VeryLowLevel.Z3_mk_seq_last_index(_ctx_pointer, ast1._ast, ast2._ast)
1534
+ end
1535
+
1536
+ def mk_seq_nth(ast1, ast2) #=> :ast_pointer
1537
+ VeryLowLevel.Z3_mk_seq_nth(_ctx_pointer, ast1._ast, ast2._ast)
1538
+ end
1539
+
1456
1540
  def mk_set_add(ast1, ast2) #=> :ast_pointer
1457
1541
  VeryLowLevel.Z3_mk_set_add(_ctx_pointer, ast1._ast, ast2._ast)
1458
1542
  end
@@ -1469,6 +1553,10 @@ module Z3
1469
1553
  VeryLowLevel.Z3_mk_set_difference(_ctx_pointer, ast1._ast, ast2._ast)
1470
1554
  end
1471
1555
 
1556
+ def mk_set_has_size(ast1, ast2) #=> :ast_pointer
1557
+ VeryLowLevel.Z3_mk_set_has_size(_ctx_pointer, ast1._ast, ast2._ast)
1558
+ end
1559
+
1472
1560
  def mk_set_member(ast1, ast2) #=> :ast_pointer
1473
1561
  VeryLowLevel.Z3_mk_set_member(_ctx_pointer, ast1._ast, ast2._ast)
1474
1562
  end
@@ -1505,6 +1593,14 @@ module Z3
1505
1593
  VeryLowLevel.Z3_mk_store(_ctx_pointer, ast1._ast, ast2._ast, ast3._ast)
1506
1594
  end
1507
1595
 
1596
+ def mk_str_le(ast1, ast2) #=> :ast_pointer
1597
+ VeryLowLevel.Z3_mk_str_le(_ctx_pointer, ast1._ast, ast2._ast)
1598
+ end
1599
+
1600
+ def mk_str_lt(ast1, ast2) #=> :ast_pointer
1601
+ VeryLowLevel.Z3_mk_str_lt(_ctx_pointer, ast1._ast, ast2._ast)
1602
+ end
1603
+
1508
1604
  def mk_str_to_int(ast) #=> :ast_pointer
1509
1605
  VeryLowLevel.Z3_mk_str_to_int(_ctx_pointer, ast._ast)
1510
1606
  end
@@ -1517,10 +1613,22 @@ module Z3
1517
1613
  VeryLowLevel.Z3_mk_tactic(_ctx_pointer, str)
1518
1614
  end
1519
1615
 
1616
+ def mk_transitive_closure(func_decl) #=> :func_decl_pointer
1617
+ VeryLowLevel.Z3_mk_transitive_closure(_ctx_pointer, func_decl._ast)
1618
+ end
1619
+
1620
+ def mk_tree_order(sort, num) #=> :func_decl_pointer
1621
+ VeryLowLevel.Z3_mk_tree_order(_ctx_pointer, sort._ast, num)
1622
+ end
1623
+
1520
1624
  def mk_true #=> :ast_pointer
1521
1625
  VeryLowLevel.Z3_mk_true(_ctx_pointer)
1522
1626
  end
1523
1627
 
1628
+ def mk_ubv_to_str(ast) #=> :ast_pointer
1629
+ VeryLowLevel.Z3_mk_ubv_to_str(_ctx_pointer, ast._ast)
1630
+ end
1631
+
1524
1632
  def mk_unary_minus(ast) #=> :ast_pointer
1525
1633
  VeryLowLevel.Z3_mk_unary_minus(_ctx_pointer, ast._ast)
1526
1634
  end
@@ -1609,6 +1717,10 @@ module Z3
1609
1717
  VeryLowLevel.Z3_optimize_assert(_ctx_pointer, optimize._optimize, ast._ast)
1610
1718
  end
1611
1719
 
1720
+ def optimize_assert_and_track(optimize, ast1, ast2) #=> :void
1721
+ VeryLowLevel.Z3_optimize_assert_and_track(_ctx_pointer, optimize._optimize, ast1._ast, ast2._ast)
1722
+ end
1723
+
1612
1724
  def optimize_assert_soft(optimize, ast, str, sym) #=> :uint
1613
1725
  VeryLowLevel.Z3_optimize_assert_soft(_ctx_pointer, optimize._optimize, ast._ast, str, sym)
1614
1726
  end
@@ -1997,6 +2109,10 @@ module Z3
1997
2109
  VeryLowLevel.Z3_solver_get_statistics(_ctx_pointer, solver._solver)
1998
2110
  end
1999
2111
 
2112
+ def solver_get_trail(solver) #=> :ast_vector_pointer
2113
+ VeryLowLevel.Z3_solver_get_trail(_ctx_pointer, solver._solver)
2114
+ end
2115
+
2000
2116
  def solver_get_units(solver) #=> :ast_vector_pointer
2001
2117
  VeryLowLevel.Z3_solver_get_units(_ctx_pointer, solver._solver)
2002
2118
  end
@@ -2013,10 +2129,18 @@ module Z3
2013
2129
  VeryLowLevel.Z3_solver_inc_ref(_ctx_pointer, solver._solver)
2014
2130
  end
2015
2131
 
2132
+ def solver_interrupt(solver) #=> :void
2133
+ VeryLowLevel.Z3_solver_interrupt(_ctx_pointer, solver._solver)
2134
+ end
2135
+
2016
2136
  def solver_pop(solver, num) #=> :void
2017
2137
  VeryLowLevel.Z3_solver_pop(_ctx_pointer, solver._solver, num)
2018
2138
  end
2019
2139
 
2140
+ def solver_propagate_register(solver, ast) #=> :uint
2141
+ VeryLowLevel.Z3_solver_propagate_register(_ctx_pointer, solver._solver, ast._ast)
2142
+ end
2143
+
2020
2144
  def solver_push(solver) #=> :void
2021
2145
  VeryLowLevel.Z3_solver_push(_ctx_pointer, solver._solver)
2022
2146
  end
@@ -2029,6 +2153,10 @@ module Z3
2029
2153
  VeryLowLevel.Z3_solver_set_params(_ctx_pointer, solver._solver, params._params)
2030
2154
  end
2031
2155
 
2156
+ def solver_to_dimacs_string(solver, bool) #=> :string
2157
+ VeryLowLevel.Z3_solver_to_dimacs_string(_ctx_pointer, solver._solver, bool)
2158
+ end
2159
+
2032
2160
  def solver_to_string(solver) #=> :string
2033
2161
  VeryLowLevel.Z3_solver_to_string(_ctx_pointer, solver._solver)
2034
2162
  end
data/lib/z3/optimize.rb CHANGED
@@ -3,6 +3,7 @@ module Z3
3
3
  attr_reader :_optimize
4
4
 
5
5
  def initialize
6
+ raise Z3::Exception, "This is known to crash in Z3 4.8.13"
6
7
  @_optimize = LowLevel.mk_optimize
7
8
  LowLevel.optimize_inc_ref(self)
8
9
  reset_model!
@@ -4,7 +4,7 @@ require "ffi"
4
4
  module Z3
5
5
  module VeryLowLevel
6
6
  extend FFI::Library
7
- ffi_lib "z3"
7
+ ffi_lib ["libz3.so.4.8", "libz3.so", "z3"]
8
8
 
9
9
  class << self
10
10
  # Aliases defined just to make APIs below look nicer
@@ -12,6 +12,10 @@ module Z3
12
12
  arg_types = arg_types.map { |t| map_type(t) }
13
13
  return_type = map_type(return_type)
14
14
  super(name, arg_types, return_type)
15
+ rescue FFI::NotFoundError
16
+ define_singleton_method(name) do |*args|
17
+ raise Z3::Exception, "Could not find #{name} in the Z3 library. It is likely that the Z3 library has wrong version."
18
+ end
15
19
  end
16
20
 
17
21
  def map_type(t)
@@ -6,6 +6,8 @@ module Z3
6
6
  attach_function :Z3_algebraic_div, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
7
7
  attach_function :Z3_algebraic_eq, [:ctx_pointer, :ast_pointer, :ast_pointer], :bool
8
8
  attach_function :Z3_algebraic_ge, [:ctx_pointer, :ast_pointer, :ast_pointer], :bool
9
+ attach_function :Z3_algebraic_get_i, [:ctx_pointer, :ast_pointer], :uint
10
+ attach_function :Z3_algebraic_get_poly, [:ctx_pointer, :ast_pointer], :ast_vector_pointer
9
11
  attach_function :Z3_algebraic_gt, [:ctx_pointer, :ast_pointer, :ast_pointer], :bool
10
12
  attach_function :Z3_algebraic_is_neg, [:ctx_pointer, :ast_pointer], :bool
11
13
  attach_function :Z3_algebraic_is_pos, [:ctx_pointer, :ast_pointer], :bool
@@ -75,8 +77,6 @@ module Z3
75
77
  attach_function :Z3_fixedpoint_get_rules_along_trace, [:ctx_pointer, :fixedpoint_pointer], :ast_vector_pointer
76
78
  attach_function :Z3_fixedpoint_get_statistics, [:ctx_pointer, :fixedpoint_pointer], :stats_pointer
77
79
  attach_function :Z3_fixedpoint_inc_ref, [:ctx_pointer, :fixedpoint_pointer], :void
78
- attach_function :Z3_fixedpoint_pop, [:ctx_pointer, :fixedpoint_pointer], :void
79
- attach_function :Z3_fixedpoint_push, [:ctx_pointer, :fixedpoint_pointer], :void
80
80
  attach_function :Z3_fixedpoint_query, [:ctx_pointer, :fixedpoint_pointer, :ast_pointer], :int
81
81
  attach_function :Z3_fixedpoint_query_from_lvl, [:ctx_pointer, :fixedpoint_pointer, :ast_pointer, :uint], :int
82
82
  attach_function :Z3_fixedpoint_register_relation, [:ctx_pointer, :fixedpoint_pointer, :func_decl_pointer], :void
@@ -147,7 +147,9 @@ module Z3
147
147
  attach_function :Z3_get_index_value, [:ctx_pointer, :ast_pointer], :uint
148
148
  attach_function :Z3_get_num_probes, [:ctx_pointer], :uint
149
149
  attach_function :Z3_get_num_tactics, [:ctx_pointer], :uint
150
+ attach_function :Z3_get_numeral_binary_string, [:ctx_pointer, :ast_pointer], :string
150
151
  attach_function :Z3_get_numeral_decimal_string, [:ctx_pointer, :ast_pointer, :uint], :string
152
+ attach_function :Z3_get_numeral_double, [:ctx_pointer, :ast_pointer], :double
151
153
  attach_function :Z3_get_numeral_string, [:ctx_pointer, :ast_pointer], :string
152
154
  attach_function :Z3_get_numerator, [:ctx_pointer, :ast_pointer], :ast_pointer
153
155
  attach_function :Z3_get_pattern, [:ctx_pointer, :pattern_pointer, :uint], :ast_pointer
@@ -163,12 +165,15 @@ module Z3
163
165
  attach_function :Z3_get_quantifier_pattern_ast, [:ctx_pointer, :ast_pointer, :uint], :pattern_pointer
164
166
  attach_function :Z3_get_quantifier_weight, [:ctx_pointer, :ast_pointer], :uint
165
167
  attach_function :Z3_get_range, [:ctx_pointer, :func_decl_pointer], :sort_pointer
168
+ attach_function :Z3_get_re_sort_basis, [:ctx_pointer, :sort_pointer], :sort_pointer
166
169
  attach_function :Z3_get_relation_arity, [:ctx_pointer, :sort_pointer], :uint
167
170
  attach_function :Z3_get_relation_column, [:ctx_pointer, :sort_pointer, :uint], :sort_pointer
171
+ attach_function :Z3_get_seq_sort_basis, [:ctx_pointer, :sort_pointer], :sort_pointer
168
172
  attach_function :Z3_get_sort, [:ctx_pointer, :ast_pointer], :sort_pointer
169
173
  attach_function :Z3_get_sort_id, [:ctx_pointer, :sort_pointer], :uint
170
174
  attach_function :Z3_get_sort_kind, [:ctx_pointer, :sort_pointer], :uint
171
175
  attach_function :Z3_get_sort_name, [:ctx_pointer, :sort_pointer], :symbol_pointer
176
+ attach_function :Z3_get_string_length, [:ctx_pointer, :ast_pointer], :uint
172
177
  attach_function :Z3_get_symbol_int, [:ctx_pointer, :symbol_pointer], :int
173
178
  attach_function :Z3_get_symbol_kind, [:ctx_pointer, :symbol_pointer], :uint
174
179
  attach_function :Z3_get_symbol_string, [:ctx_pointer, :symbol_pointer], :string
@@ -191,7 +196,7 @@ module Z3
191
196
  attach_function :Z3_goal_precision, [:ctx_pointer, :goal_pointer], :uint
192
197
  attach_function :Z3_goal_reset, [:ctx_pointer, :goal_pointer], :void
193
198
  attach_function :Z3_goal_size, [:ctx_pointer, :goal_pointer], :uint
194
- attach_function :Z3_goal_to_dimacs_string, [:ctx_pointer, :goal_pointer], :string
199
+ attach_function :Z3_goal_to_dimacs_string, [:ctx_pointer, :goal_pointer, :bool], :string
195
200
  attach_function :Z3_goal_to_string, [:ctx_pointer, :goal_pointer], :string
196
201
  attach_function :Z3_goal_translate, [:ctx_pointer, :goal_pointer, :ctx_pointer], :goal_pointer
197
202
  attach_function :Z3_inc_ref, [:ctx_pointer, :ast_pointer], :void
@@ -199,6 +204,7 @@ module Z3
199
204
  attach_function :Z3_is_algebraic_number, [:ctx_pointer, :ast_pointer], :bool
200
205
  attach_function :Z3_is_app, [:ctx_pointer, :ast_pointer], :bool
201
206
  attach_function :Z3_is_as_array, [:ctx_pointer, :ast_pointer], :bool
207
+ attach_function :Z3_is_char_sort, [:ctx_pointer, :sort_pointer], :bool
202
208
  attach_function :Z3_is_eq_ast, [:ctx_pointer, :ast_pointer, :ast_pointer], :bool
203
209
  attach_function :Z3_is_eq_func_decl, [:ctx_pointer, :func_decl_pointer, :func_decl_pointer], :bool
204
210
  attach_function :Z3_is_eq_sort, [:ctx_pointer, :sort_pointer, :sort_pointer], :bool
@@ -253,12 +259,19 @@ module Z3
253
259
  attach_function :Z3_mk_bvurem, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
254
260
  attach_function :Z3_mk_bvxnor, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
255
261
  attach_function :Z3_mk_bvxor, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
262
+ attach_function :Z3_mk_char_from_bv, [:ctx_pointer, :ast_pointer], :ast_pointer
263
+ attach_function :Z3_mk_char_is_digit, [:ctx_pointer, :ast_pointer], :ast_pointer
264
+ attach_function :Z3_mk_char_le, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
265
+ attach_function :Z3_mk_char_sort, [:ctx_pointer], :sort_pointer
266
+ attach_function :Z3_mk_char_to_bv, [:ctx_pointer, :ast_pointer], :ast_pointer
267
+ attach_function :Z3_mk_char_to_int, [:ctx_pointer, :ast_pointer], :ast_pointer
256
268
  attach_function :Z3_mk_concat, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
257
269
  attach_function :Z3_mk_config, [], :config_pointer
258
270
  attach_function :Z3_mk_const, [:ctx_pointer, :symbol_pointer, :sort_pointer], :ast_pointer
259
271
  attach_function :Z3_mk_const_array, [:ctx_pointer, :sort_pointer, :ast_pointer], :ast_pointer
260
272
  attach_function :Z3_mk_context_rc, [:config_pointer], :ctx_pointer
261
273
  attach_function :Z3_mk_div, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
274
+ attach_function :Z3_mk_divides, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
262
275
  attach_function :Z3_mk_empty_set, [:ctx_pointer, :sort_pointer], :ast_pointer
263
276
  attach_function :Z3_mk_eq, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
264
277
  attach_function :Z3_mk_ext_rotate_left, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
@@ -341,6 +354,8 @@ module Z3
341
354
  attach_function :Z3_mk_is_int, [:ctx_pointer, :ast_pointer], :ast_pointer
342
355
  attach_function :Z3_mk_ite, [:ctx_pointer, :ast_pointer, :ast_pointer, :ast_pointer], :ast_pointer
343
356
  attach_function :Z3_mk_le, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
357
+ attach_function :Z3_mk_linear_order, [:ctx_pointer, :sort_pointer, :uint], :func_decl_pointer
358
+ attach_function :Z3_mk_lstring, [:ctx_pointer, :uint, :string], :ast_pointer
344
359
  attach_function :Z3_mk_lt, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
345
360
  attach_function :Z3_mk_mod, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
346
361
  attach_function :Z3_mk_model, [:ctx_pointer], :model_pointer
@@ -348,8 +363,11 @@ module Z3
348
363
  attach_function :Z3_mk_numeral, [:ctx_pointer, :string, :sort_pointer], :ast_pointer
349
364
  attach_function :Z3_mk_optimize, [:ctx_pointer], :optimize_pointer
350
365
  attach_function :Z3_mk_params, [:ctx_pointer], :params_pointer
366
+ attach_function :Z3_mk_partial_order, [:ctx_pointer, :sort_pointer, :uint], :func_decl_pointer
367
+ attach_function :Z3_mk_piecewise_linear_order, [:ctx_pointer, :sort_pointer, :uint], :func_decl_pointer
351
368
  attach_function :Z3_mk_power, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
352
369
  attach_function :Z3_mk_probe, [:ctx_pointer, :string], :probe_pointer
370
+ attach_function :Z3_mk_re_allchar, [:ctx_pointer, :sort_pointer], :ast_pointer
353
371
  attach_function :Z3_mk_re_complement, [:ctx_pointer, :ast_pointer], :ast_pointer
354
372
  attach_function :Z3_mk_re_empty, [:ctx_pointer, :sort_pointer], :ast_pointer
355
373
  attach_function :Z3_mk_re_full, [:ctx_pointer, :sort_pointer], :ast_pointer
@@ -362,11 +380,15 @@ module Z3
362
380
  attach_function :Z3_mk_repeat, [:ctx_pointer, :uint, :ast_pointer], :ast_pointer
363
381
  attach_function :Z3_mk_rotate_left, [:ctx_pointer, :uint, :ast_pointer], :ast_pointer
364
382
  attach_function :Z3_mk_rotate_right, [:ctx_pointer, :uint, :ast_pointer], :ast_pointer
383
+ attach_function :Z3_mk_sbv_to_str, [:ctx_pointer, :ast_pointer], :ast_pointer
365
384
  attach_function :Z3_mk_select, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
385
+ attach_function :Z3_mk_seq_last_index, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
386
+ attach_function :Z3_mk_seq_nth, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
366
387
  attach_function :Z3_mk_set_add, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
367
388
  attach_function :Z3_mk_set_complement, [:ctx_pointer, :ast_pointer], :ast_pointer
368
389
  attach_function :Z3_mk_set_del, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
369
390
  attach_function :Z3_mk_set_difference, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
391
+ attach_function :Z3_mk_set_has_size, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
370
392
  attach_function :Z3_mk_set_member, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
371
393
  attach_function :Z3_mk_set_sort, [:ctx_pointer, :sort_pointer], :sort_pointer
372
394
  attach_function :Z3_mk_set_subset, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
@@ -376,10 +398,15 @@ module Z3
376
398
  attach_function :Z3_mk_solver_for_logic, [:ctx_pointer, :symbol_pointer], :solver_pointer
377
399
  attach_function :Z3_mk_solver_from_tactic, [:ctx_pointer, :tactic_pointer], :solver_pointer
378
400
  attach_function :Z3_mk_store, [:ctx_pointer, :ast_pointer, :ast_pointer, :ast_pointer], :ast_pointer
401
+ attach_function :Z3_mk_str_le, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
402
+ attach_function :Z3_mk_str_lt, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
379
403
  attach_function :Z3_mk_str_to_int, [:ctx_pointer, :ast_pointer], :ast_pointer
380
404
  attach_function :Z3_mk_string_symbol, [:ctx_pointer, :string], :symbol_pointer
381
405
  attach_function :Z3_mk_tactic, [:ctx_pointer, :string], :tactic_pointer
406
+ attach_function :Z3_mk_transitive_closure, [:ctx_pointer, :func_decl_pointer], :func_decl_pointer
407
+ attach_function :Z3_mk_tree_order, [:ctx_pointer, :sort_pointer, :uint], :func_decl_pointer
382
408
  attach_function :Z3_mk_true, [:ctx_pointer], :ast_pointer
409
+ attach_function :Z3_mk_ubv_to_str, [:ctx_pointer, :ast_pointer], :ast_pointer
383
410
  attach_function :Z3_mk_unary_minus, [:ctx_pointer, :ast_pointer], :ast_pointer
384
411
  attach_function :Z3_mk_uninterpreted_sort, [:ctx_pointer, :symbol_pointer], :sort_pointer
385
412
  attach_function :Z3_mk_unsigned_int, [:ctx_pointer, :uint, :sort_pointer], :ast_pointer
@@ -402,6 +429,7 @@ module Z3
402
429
  attach_function :Z3_model_to_string, [:ctx_pointer, :model_pointer], :string
403
430
  attach_function :Z3_model_translate, [:ctx_pointer, :model_pointer, :ctx_pointer], :model_pointer
404
431
  attach_function :Z3_optimize_assert, [:ctx_pointer, :optimize_pointer, :ast_pointer], :void
432
+ attach_function :Z3_optimize_assert_and_track, [:ctx_pointer, :optimize_pointer, :ast_pointer, :ast_pointer], :void
405
433
  attach_function :Z3_optimize_assert_soft, [:ctx_pointer, :optimize_pointer, :ast_pointer, :string, :symbol_pointer], :uint
406
434
  attach_function :Z3_optimize_dec_ref, [:ctx_pointer, :optimize_pointer], :void
407
435
  attach_function :Z3_optimize_from_file, [:ctx_pointer, :optimize_pointer, :string], :void
@@ -499,14 +527,18 @@ module Z3
499
527
  attach_function :Z3_solver_get_proof, [:ctx_pointer, :solver_pointer], :ast_pointer
500
528
  attach_function :Z3_solver_get_reason_unknown, [:ctx_pointer, :solver_pointer], :string
501
529
  attach_function :Z3_solver_get_statistics, [:ctx_pointer, :solver_pointer], :stats_pointer
530
+ attach_function :Z3_solver_get_trail, [:ctx_pointer, :solver_pointer], :ast_vector_pointer
502
531
  attach_function :Z3_solver_get_units, [:ctx_pointer, :solver_pointer], :ast_vector_pointer
503
532
  attach_function :Z3_solver_get_unsat_core, [:ctx_pointer, :solver_pointer], :ast_vector_pointer
504
533
  attach_function :Z3_solver_import_model_converter, [:ctx_pointer, :solver_pointer, :solver_pointer], :void
505
534
  attach_function :Z3_solver_inc_ref, [:ctx_pointer, :solver_pointer], :void
535
+ attach_function :Z3_solver_interrupt, [:ctx_pointer, :solver_pointer], :void
506
536
  attach_function :Z3_solver_pop, [:ctx_pointer, :solver_pointer, :uint], :void
537
+ attach_function :Z3_solver_propagate_register, [:ctx_pointer, :solver_pointer, :ast_pointer], :uint
507
538
  attach_function :Z3_solver_push, [:ctx_pointer, :solver_pointer], :void
508
539
  attach_function :Z3_solver_reset, [:ctx_pointer, :solver_pointer], :void
509
540
  attach_function :Z3_solver_set_params, [:ctx_pointer, :solver_pointer, :params_pointer], :void
541
+ attach_function :Z3_solver_to_dimacs_string, [:ctx_pointer, :solver_pointer, :bool], :string
510
542
  attach_function :Z3_solver_to_string, [:ctx_pointer, :solver_pointer], :string
511
543
  attach_function :Z3_stats_dec_ref, [:ctx_pointer, :stats_pointer], :void
512
544
  attach_function :Z3_stats_get_double_value, [:ctx_pointer, :stats_pointer, :uint], :double
@@ -0,0 +1,21 @@
1
+ # There are multiple solutions, so this test is nondeterministic
2
+ # This is what Z3 4.8.13 returns
3
+ describe "ABC Path" do
4
+ it do
5
+ expect("abc_path").to have_output <<'EOF'
6
+ C O R D F B U
7
+
8
+ N o-n l-k-j L
9
+ | |/ |
10
+ G p m g-f i I
11
+ | x /
12
+ Q q-r e h a H
13
+ / | |
14
+ V s v d-c-b S
15
+ x \
16
+ T u-t w-x-y X
17
+
18
+ J P M W K Y E
19
+ EOF
20
+ end
21
+ end
@@ -0,0 +1,27 @@
1
+ describe "Aquarium" do
2
+ it do
3
+ expect("aquarium").to have_output <<EOF
4
+ +-+-+-+-+-+-+-+-+-+-+
5
+ |# #|# # # # #|# #| |
6
+ + +-+-+-+-+-+ +-+ + +
7
+ |#|#| |# #|#|#|
8
+ + + + +-+-+-+-+-+-+-+
9
+ |#|#| |# #|# #| |#|
10
+ + + + +-+-+-+-+ + +
11
+ |#|#|#| | | |#|
12
+ + +-+-+ + +-+-+-+
13
+ |#| | | |
14
+ + + +-+ +-+ + +-+-+
15
+ |#| | | | |#|#|# #|
16
+ + + + +-+-+ + +-+ +
17
+ |#| | | |#| |# #|
18
+ + + +-+ + +-+ +-+ +
19
+ |#|# #| | |# # #|#|
20
+ +-+-+-+ + + +-+-+-+
21
+ | | |#|#|#| |
22
+ + +-+-+ + +-+ + +
23
+ |# # #| |# #|#|# #|
24
+ +-+-+-+-+-+-+-+-+-+-+
25
+ EOF
26
+ end
27
+ end
@@ -0,0 +1,14 @@
1
+ describe "Cats Organized Neatly" do
2
+ it do
3
+ expect("cats_organized_neatly").to have_output <<EOF
4
+ .ffffbbb
5
+ .fdddbbb
6
+ aadddbbb
7
+ aadddbbe
8
+ aagggcee
9
+ aagggcce
10
+ aagggcc.
11
+ ..gggcc.
12
+ EOF
13
+ end
14
+ end
@@ -0,0 +1,28 @@
1
+ describe "Color Nonogram" do
2
+ let(:ascii_board) do <<EOF
3
+ 3 3 3 3 3 3 3 3 3 3
4
+ 3 0 2 2 0 0 0 0 0 3
5
+ 3 0 0 0 0 0 0 0 0 3
6
+ 3 2 1 0 0 0 2 1 0 3
7
+ 3 3 3 0 0 0 1 1 0 0
8
+ 3 0 0 0 0 0 0 0 0 0
9
+ 0 2 2 1 2 2 2 2 0 3
10
+ 0 0 2 2 2 2 2 0 0 3
11
+ 3 0 0 0 0 0 0 0 0 3
12
+ 3 0 0 3 3 3 3 0 0 3
13
+ EOF
14
+ end
15
+
16
+ it do
17
+ color_board = ascii_board.gsub(/\d/) do |i|
18
+ {
19
+ "0" => "\e[38;2;255;0;0m0\e[0m",
20
+ "1" => "\e[38;2;0;0;0m1\e[0m",
21
+ "2" => "\e[38;2;255;255;255m2\e[0m",
22
+ "3" => "\e[38;2;165;42;42m3\e[0m",
23
+ }[i]
24
+ end
25
+
26
+ expect("color_nonogram").to have_output color_board
27
+ end
28
+ end
@@ -0,0 +1,14 @@
1
+ describe "Dominion" do
2
+ it do
3
+ expect("dominion").to have_output <<EOF
4
+ **AAAA*B
5
+ FF*AAA*B
6
+ FF*A**BB
7
+ F*E*GG**
8
+ F*E*G*DD
9
+ *G*GG*DD
10
+ *G*G*C**
11
+ GGGG*CCC
12
+ EOF
13
+ end
14
+ end
@@ -0,0 +1,21 @@
1
+ describe "Dominosa" do
2
+ it do
3
+ expect("dominosa").to have_output <<EOF
4
+ 5*5 7 4*1 1 4 2 3
5
+ * * * * *
6
+ 2*0 2 4*7 5 4 2 0
7
+
8
+ 4*0 0 3 2 0 3 4*5
9
+ * * * * *
10
+ 1*1 6 4 6 5 2 5 6
11
+ * *
12
+ 6 1 1 7*7 5 6 3 6
13
+ * * * * *
14
+ 7 3 0 2*4 2 1 6*3
15
+
16
+ 6 5*6 0 1 3*3 0*0
17
+ * * *
18
+ 4 5*7 7 7 2*1 7*3
19
+ EOF
20
+ end
21
+ end
@@ -0,0 +1,11 @@
1
+ describe "Eulero" do
2
+ it do
3
+ expect("eulero").to have_output <<EOF
4
+ C2 B4 D5 A1 E3
5
+ D1 A2 B3 E5 C4
6
+ E4 D3 C1 B2 A5
7
+ B5 E1 A4 C3 D2
8
+ A3 C5 E2 D4 B1
9
+ EOF
10
+ end
11
+ end
@@ -0,0 +1,23 @@
1
+ describe "Futoshiki" do
2
+ it do
3
+ expect("futoshiki").to have_output <<EOF
4
+ 2 5 3 4 1 7 6<9 8
5
+
6
+ 1 9 7 2 8 5 3<4<6
7
+ _
8
+ 7<8 2 5>3>1 4<6 9
9
+ ^
10
+ 8 1<5<9 7 6 2 3 4
11
+ ^
12
+ 4 7>6>1 9 2 5 8 3
13
+ ^ ^ ^
14
+ 6 4 1 8 2 3 9 5 7
15
+ _ _ ^ _ _
16
+ 9 3 4 6>5 8 7 1 2
17
+ _
18
+ 5 2 9>3 6>4 8>7 1
19
+ _
20
+ 3 6 8>7>4 9 1<2 5
21
+ EOF
22
+ end
23
+ end
@@ -0,0 +1,18 @@
1
+ describe "Kakurasu" do
2
+ it do
3
+ expect("kakurasu").to have_output <<EOF
4
+ [ ][ ][X][ ][ ][ ][X][ ][ ][ ][ ][ ]
5
+ [ ][X][ ][X][ ][ ][ ][ ][ ][X][X][X]
6
+ [ ][X][X][X][ ][ ][X][ ][ ][ ][ ][ ]
7
+ [ ][X][X][ ][ ][X][X][X][X][ ][X][X]
8
+ [ ][X][ ][ ][ ][ ][ ][ ][ ][ ][ ][ ]
9
+ [ ][ ][X][ ][ ][ ][ ][X][ ][ ][X][ ]
10
+ [X][ ][ ][ ][ ][X][X][ ][ ][ ][X][X]
11
+ [ ][ ][ ][ ][ ][ ][X][ ][ ][ ][X][X]
12
+ [ ][ ][X][ ][ ][ ][ ][ ][ ][ ][X][ ]
13
+ [ ][ ][ ][ ][X][ ][X][ ][X][ ][X][ ]
14
+ [ ][ ][ ][ ][ ][X][X][ ][X][ ][X][ ]
15
+ [ ][ ][X][ ][X][ ][X][ ][X][ ][X][ ]
16
+ EOF
17
+ end
18
+ end