z3 0.0.20230311 → 0.0.20251017

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bba953278a11ef2e902d7f7103195a57c2d94b1a515de357e23c4cce3a8ced81
4
- data.tar.gz: c4dc956299e225582b8913d135adcd67595fcfb28c20565a1121b5d5ed73f983
3
+ metadata.gz: eba319d56d6c1d848c4d50a904b5ce6f324589fd10606f8e8233d2118b22ab5b
4
+ data.tar.gz: 5a38dc72afd6e48f57e712b4db42c78587e532c5605f6c0a3290c255c8f682bf
5
5
  SHA512:
6
- metadata.gz: ca74743545f86daa86cb85a3f33ce0db5e3d159dcbe133e85a389b795d5ca6ad5b15842e275ef18a21e0a3317d010d1906143fc8bd6cbc27513777d0186a88df
7
- data.tar.gz: a6ef5bb470556ad7d1bb39c54537ca9516aa64cc0bfb53fc8984352033ced94443e0272de9fa078a451f680af3a08d4c2c706e43f134a564bb2aef9fd677a8be
6
+ metadata.gz: 8f40bbe4cb4c034313d76071d97c857648da9317bb53eecdae07114981d90576e45a4832fc3df7f508641b70e3b8b8fc03f787c7424b680574f0d6ed57785c13
7
+ data.tar.gz: 902d5ef0940cda61a31e99899756eaab0d1eb6fc051a3a162aebf1752ca1c00eff685f18931b68849af42920fe08d8eeda4994251d9b7bd8defce256f3d2b59d
@@ -185,6 +185,10 @@ module Z3
185
185
  VeryLowLevel.Z3_ast_vector_translate(_ctx_pointer, ast_vector, context._context)
186
186
  end
187
187
 
188
+ def constructor_num_fields(constructor) #=> :uint
189
+ VeryLowLevel.Z3_constructor_num_fields(_ctx_pointer, constructor._constructor)
190
+ end
191
+
188
192
  def datatype_update_field(func_decl, ast1, ast2) #=> :ast_pointer
189
193
  VeryLowLevel.Z3_datatype_update_field(_ctx_pointer, func_decl._ast, ast1._ast, ast2._ast)
190
194
  end
@@ -213,6 +217,10 @@ module Z3
213
217
  VeryLowLevel.Z3_disable_trace(str)
214
218
  end
215
219
 
220
+ def enable_concurrent_dec_ref #=> :void
221
+ VeryLowLevel.Z3_enable_concurrent_dec_ref(_ctx_pointer)
222
+ end
223
+
216
224
  def enable_trace(str) #=> :void
217
225
  VeryLowLevel.Z3_enable_trace(str)
218
226
  end
@@ -461,10 +469,18 @@ module Z3
461
469
  VeryLowLevel.Z3_get_arity(_ctx_pointer, func_decl._ast)
462
470
  end
463
471
 
472
+ def get_array_arity(sort) #=> :uint
473
+ VeryLowLevel.Z3_get_array_arity(_ctx_pointer, sort._ast)
474
+ end
475
+
464
476
  def get_array_sort_domain(sort) #=> :sort_pointer
465
477
  VeryLowLevel.Z3_get_array_sort_domain(_ctx_pointer, sort._ast)
466
478
  end
467
479
 
480
+ def get_array_sort_domain_n(sort, num) #=> :sort_pointer
481
+ VeryLowLevel.Z3_get_array_sort_domain_n(_ctx_pointer, sort._ast, num)
482
+ end
483
+
468
484
  def get_array_sort_range(sort) #=> :sort_pointer
469
485
  VeryLowLevel.Z3_get_array_sort_range(_ctx_pointer, sort._ast)
470
486
  end
@@ -557,6 +573,10 @@ module Z3
557
573
  VeryLowLevel.Z3_get_denominator(_ctx_pointer, ast._ast)
558
574
  end
559
575
 
576
+ def get_depth(ast) #=> :uint
577
+ VeryLowLevel.Z3_get_depth(_ctx_pointer, ast._ast)
578
+ end
579
+
560
580
  def get_domain(func_decl, num) #=> :sort_pointer
561
581
  VeryLowLevel.Z3_get_domain(_ctx_pointer, func_decl._ast, num)
562
582
  end
@@ -577,6 +597,10 @@ module Z3
577
597
  VeryLowLevel.Z3_get_func_decl_id(_ctx_pointer, func_decl._ast)
578
598
  end
579
599
 
600
+ def get_global_param_descrs #=> :param_descrs_pointer
601
+ VeryLowLevel.Z3_get_global_param_descrs(_ctx_pointer)
602
+ end
603
+
580
604
  def get_index_value(ast) #=> :uint
581
605
  VeryLowLevel.Z3_get_index_value(_ctx_pointer, ast._ast)
582
606
  end
@@ -585,6 +609,10 @@ module Z3
585
609
  VeryLowLevel.Z3_get_num_probes(_ctx_pointer)
586
610
  end
587
611
 
612
+ def get_num_simplifiers #=> :uint
613
+ VeryLowLevel.Z3_get_num_simplifiers(_ctx_pointer)
614
+ end
615
+
588
616
  def get_num_tactics #=> :uint
589
617
  VeryLowLevel.Z3_get_num_tactics(_ctx_pointer)
590
618
  end
@@ -633,6 +661,10 @@ module Z3
633
661
  VeryLowLevel.Z3_get_quantifier_bound_sort(_ctx_pointer, ast._ast, num)
634
662
  end
635
663
 
664
+ def get_quantifier_id(ast) #=> :symbol_pointer
665
+ VeryLowLevel.Z3_get_quantifier_id(_ctx_pointer, ast._ast)
666
+ end
667
+
636
668
  def get_quantifier_no_pattern_ast(ast, num) #=> :ast_pointer
637
669
  VeryLowLevel.Z3_get_quantifier_no_pattern_ast(_ctx_pointer, ast._ast, num)
638
670
  end
@@ -653,6 +685,10 @@ module Z3
653
685
  VeryLowLevel.Z3_get_quantifier_pattern_ast(_ctx_pointer, ast._ast, num)
654
686
  end
655
687
 
688
+ def get_quantifier_skolem_id(ast) #=> :symbol_pointer
689
+ VeryLowLevel.Z3_get_quantifier_skolem_id(_ctx_pointer, ast._ast)
690
+ end
691
+
656
692
  def get_quantifier_weight(ast) #=> :uint
657
693
  VeryLowLevel.Z3_get_quantifier_weight(_ctx_pointer, ast._ast)
658
694
  end
@@ -677,6 +713,10 @@ module Z3
677
713
  VeryLowLevel.Z3_get_seq_sort_basis(_ctx_pointer, sort._ast)
678
714
  end
679
715
 
716
+ def get_simplifier_name(num) #=> :string
717
+ VeryLowLevel.Z3_get_simplifier_name(_ctx_pointer, num)
718
+ end
719
+
680
720
  def get_sort(ast) #=> :sort_pointer
681
721
  VeryLowLevel.Z3_get_sort(_ctx_pointer, ast._ast)
682
722
  end
@@ -833,6 +873,10 @@ module Z3
833
873
  VeryLowLevel.Z3_is_eq_sort(_ctx_pointer, sort1._ast, sort2._ast)
834
874
  end
835
875
 
876
+ def is_ground(ast) #=> :bool
877
+ VeryLowLevel.Z3_is_ground(_ctx_pointer, ast._ast)
878
+ end
879
+
836
880
  def is_lambda(ast) #=> :bool
837
881
  VeryLowLevel.Z3_is_lambda(_ctx_pointer, ast._ast)
838
882
  end
@@ -849,10 +893,18 @@ module Z3
849
893
  VeryLowLevel.Z3_is_quantifier_forall(_ctx_pointer, ast._ast)
850
894
  end
851
895
 
896
+ def is_recursive_datatype_sort(sort) #=> :bool
897
+ VeryLowLevel.Z3_is_recursive_datatype_sort(_ctx_pointer, sort._ast)
898
+ end
899
+
852
900
  def is_well_sorted(ast) #=> :bool
853
901
  VeryLowLevel.Z3_is_well_sorted(_ctx_pointer, ast._ast)
854
902
  end
855
903
 
904
+ def mk_abs(ast) #=> :ast_pointer
905
+ VeryLowLevel.Z3_mk_abs(_ctx_pointer, ast._ast)
906
+ end
907
+
856
908
  def mk_array_default(ast) #=> :ast_pointer
857
909
  VeryLowLevel.Z3_mk_array_default(_ctx_pointer, ast._ast)
858
910
  end
@@ -873,6 +925,10 @@ module Z3
873
925
  VeryLowLevel.Z3_mk_ast_vector(_ctx_pointer)
874
926
  end
875
927
 
928
+ def mk_bit2bool(num, ast) #=> :ast_pointer
929
+ VeryLowLevel.Z3_mk_bit2bool(_ctx_pointer, num, ast._ast)
930
+ end
931
+
876
932
  def mk_bool_sort #=> :sort_pointer
877
933
  VeryLowLevel.Z3_mk_bool_sort(_ctx_pointer)
878
934
  end
@@ -1037,6 +1093,10 @@ module Z3
1037
1093
  VeryLowLevel.Z3_mk_bvxor(_ctx_pointer, ast1._ast, ast2._ast)
1038
1094
  end
1039
1095
 
1096
+ def mk_char(num) #=> :ast_pointer
1097
+ VeryLowLevel.Z3_mk_char(_ctx_pointer, num)
1098
+ end
1099
+
1040
1100
  def mk_char_from_bv(ast) #=> :ast_pointer
1041
1101
  VeryLowLevel.Z3_mk_char_from_bv(_ctx_pointer, ast._ast)
1042
1102
  end
@@ -1081,6 +1141,10 @@ module Z3
1081
1141
  VeryLowLevel.Z3_mk_context_rc(config._config)
1082
1142
  end
1083
1143
 
1144
+ def mk_datatype_sort(sym) #=> :sort_pointer
1145
+ VeryLowLevel.Z3_mk_datatype_sort(_ctx_pointer, sym)
1146
+ end
1147
+
1084
1148
  def mk_div(ast1, ast2) #=> :ast_pointer
1085
1149
  VeryLowLevel.Z3_mk_div(_ctx_pointer, ast1._ast, ast2._ast)
1086
1150
  end
@@ -1477,6 +1541,10 @@ module Z3
1477
1541
  VeryLowLevel.Z3_mk_re_complement(_ctx_pointer, ast._ast)
1478
1542
  end
1479
1543
 
1544
+ def mk_re_diff(ast1, ast2) #=> :ast_pointer
1545
+ VeryLowLevel.Z3_mk_re_diff(_ctx_pointer, ast1._ast, ast2._ast)
1546
+ end
1547
+
1480
1548
  def mk_re_empty(sort) #=> :ast_pointer
1481
1549
  VeryLowLevel.Z3_mk_re_empty(_ctx_pointer, sort._ast)
1482
1550
  end
@@ -1489,6 +1557,10 @@ module Z3
1489
1557
  VeryLowLevel.Z3_mk_re_loop(_ctx_pointer, ast._ast, num1, num2)
1490
1558
  end
1491
1559
 
1560
+ def mk_re_power(ast, num) #=> :ast_pointer
1561
+ VeryLowLevel.Z3_mk_re_power(_ctx_pointer, ast._ast, num)
1562
+ end
1563
+
1492
1564
  def mk_re_range(ast1, ast2) #=> :ast_pointer
1493
1565
  VeryLowLevel.Z3_mk_re_range(_ctx_pointer, ast1._ast, ast2._ast)
1494
1566
  end
@@ -1501,6 +1573,10 @@ module Z3
1501
1573
  VeryLowLevel.Z3_mk_real2int(_ctx_pointer, ast._ast)
1502
1574
  end
1503
1575
 
1576
+ def mk_real_int64(num1, num2) #=> :ast_pointer
1577
+ VeryLowLevel.Z3_mk_real_int64(_ctx_pointer, num1, num2)
1578
+ end
1579
+
1504
1580
  def mk_real_sort #=> :sort_pointer
1505
1581
  VeryLowLevel.Z3_mk_real_sort(_ctx_pointer)
1506
1582
  end
@@ -1529,10 +1605,26 @@ module Z3
1529
1605
  VeryLowLevel.Z3_mk_select(_ctx_pointer, ast1._ast, ast2._ast)
1530
1606
  end
1531
1607
 
1608
+ def mk_seq_foldl(ast1, ast2, ast3) #=> :ast_pointer
1609
+ VeryLowLevel.Z3_mk_seq_foldl(_ctx_pointer, ast1._ast, ast2._ast, ast3._ast)
1610
+ end
1611
+
1612
+ def mk_seq_foldli(ast1, ast2, ast3, ast4) #=> :ast_pointer
1613
+ VeryLowLevel.Z3_mk_seq_foldli(_ctx_pointer, ast1._ast, ast2._ast, ast3._ast, ast4._ast)
1614
+ end
1615
+
1532
1616
  def mk_seq_last_index(ast1, ast2) #=> :ast_pointer
1533
1617
  VeryLowLevel.Z3_mk_seq_last_index(_ctx_pointer, ast1._ast, ast2._ast)
1534
1618
  end
1535
1619
 
1620
+ def mk_seq_map(ast1, ast2) #=> :ast_pointer
1621
+ VeryLowLevel.Z3_mk_seq_map(_ctx_pointer, ast1._ast, ast2._ast)
1622
+ end
1623
+
1624
+ def mk_seq_mapi(ast1, ast2, ast3) #=> :ast_pointer
1625
+ VeryLowLevel.Z3_mk_seq_mapi(_ctx_pointer, ast1._ast, ast2._ast, ast3._ast)
1626
+ end
1627
+
1536
1628
  def mk_seq_nth(ast1, ast2) #=> :ast_pointer
1537
1629
  VeryLowLevel.Z3_mk_seq_nth(_ctx_pointer, ast1._ast, ast2._ast)
1538
1630
  end
@@ -1605,10 +1697,18 @@ module Z3
1605
1697
  VeryLowLevel.Z3_mk_str_to_int(_ctx_pointer, ast._ast)
1606
1698
  end
1607
1699
 
1700
+ def mk_string_from_code(ast) #=> :ast_pointer
1701
+ VeryLowLevel.Z3_mk_string_from_code(_ctx_pointer, ast._ast)
1702
+ end
1703
+
1608
1704
  def mk_string_symbol(str) #=> :symbol_pointer
1609
1705
  VeryLowLevel.Z3_mk_string_symbol(_ctx_pointer, str)
1610
1706
  end
1611
1707
 
1708
+ def mk_string_to_code(ast) #=> :ast_pointer
1709
+ VeryLowLevel.Z3_mk_string_to_code(_ctx_pointer, ast._ast)
1710
+ end
1711
+
1612
1712
  def mk_tactic(str) #=> :tactic_pointer
1613
1713
  VeryLowLevel.Z3_mk_tactic(_ctx_pointer, str)
1614
1714
  end
@@ -1625,6 +1725,10 @@ module Z3
1625
1725
  VeryLowLevel.Z3_mk_true(_ctx_pointer)
1626
1726
  end
1627
1727
 
1728
+ def mk_type_variable(sym) #=> :sort_pointer
1729
+ VeryLowLevel.Z3_mk_type_variable(_ctx_pointer, sym)
1730
+ end
1731
+
1628
1732
  def mk_ubv_to_str(ast) #=> :ast_pointer
1629
1733
  VeryLowLevel.Z3_mk_ubv_to_str(_ctx_pointer, ast._ast)
1630
1734
  end
@@ -1805,6 +1909,10 @@ module Z3
1805
1909
  VeryLowLevel.Z3_optimize_push(_ctx_pointer, optimize._optimize)
1806
1910
  end
1807
1911
 
1912
+ def optimize_set_initial_value(optimize, ast1, ast2) #=> :void
1913
+ VeryLowLevel.Z3_optimize_set_initial_value(_ctx_pointer, optimize._optimize, ast1._ast, ast2._ast)
1914
+ end
1915
+
1808
1916
  def optimize_set_params(optimize, params) #=> :void
1809
1917
  VeryLowLevel.Z3_optimize_set_params(_ctx_pointer, optimize._optimize, params._params)
1810
1918
  end
@@ -1937,6 +2045,10 @@ module Z3
1937
2045
  VeryLowLevel.Z3_rcf_add(_ctx_pointer, num1._rcf_num, num2._rcf_num)
1938
2046
  end
1939
2047
 
2048
+ def rcf_coefficient(num1, num2) #=> :rcf_num_pointer
2049
+ VeryLowLevel.Z3_rcf_coefficient(_ctx_pointer, num1._rcf_num, num2)
2050
+ end
2051
+
1940
2052
  def rcf_del(num) #=> :void
1941
2053
  VeryLowLevel.Z3_rcf_del(_ctx_pointer, num._rcf_num)
1942
2054
  end
@@ -1949,6 +2061,10 @@ module Z3
1949
2061
  VeryLowLevel.Z3_rcf_eq(_ctx_pointer, num1._rcf_num, num2._rcf_num)
1950
2062
  end
1951
2063
 
2064
+ def rcf_extension_index(num) #=> :uint
2065
+ VeryLowLevel.Z3_rcf_extension_index(_ctx_pointer, num._rcf_num)
2066
+ end
2067
+
1952
2068
  def rcf_ge(num1, num2) #=> :bool
1953
2069
  VeryLowLevel.Z3_rcf_ge(_ctx_pointer, num1._rcf_num, num2._rcf_num)
1954
2070
  end
@@ -1957,10 +2073,30 @@ module Z3
1957
2073
  VeryLowLevel.Z3_rcf_gt(_ctx_pointer, num1._rcf_num, num2._rcf_num)
1958
2074
  end
1959
2075
 
2076
+ def rcf_infinitesimal_name(num) #=> :symbol_pointer
2077
+ VeryLowLevel.Z3_rcf_infinitesimal_name(_ctx_pointer, num._rcf_num)
2078
+ end
2079
+
1960
2080
  def rcf_inv(num) #=> :rcf_num_pointer
1961
2081
  VeryLowLevel.Z3_rcf_inv(_ctx_pointer, num._rcf_num)
1962
2082
  end
1963
2083
 
2084
+ def rcf_is_algebraic(num) #=> :bool
2085
+ VeryLowLevel.Z3_rcf_is_algebraic(_ctx_pointer, num._rcf_num)
2086
+ end
2087
+
2088
+ def rcf_is_infinitesimal(num) #=> :bool
2089
+ VeryLowLevel.Z3_rcf_is_infinitesimal(_ctx_pointer, num._rcf_num)
2090
+ end
2091
+
2092
+ def rcf_is_rational(num) #=> :bool
2093
+ VeryLowLevel.Z3_rcf_is_rational(_ctx_pointer, num._rcf_num)
2094
+ end
2095
+
2096
+ def rcf_is_transcendental(num) #=> :bool
2097
+ VeryLowLevel.Z3_rcf_is_transcendental(_ctx_pointer, num._rcf_num)
2098
+ end
2099
+
1964
2100
  def rcf_le(num1, num2) #=> :bool
1965
2101
  VeryLowLevel.Z3_rcf_le(_ctx_pointer, num1._rcf_num, num2._rcf_num)
1966
2102
  end
@@ -2001,6 +2137,18 @@ module Z3
2001
2137
  VeryLowLevel.Z3_rcf_neq(_ctx_pointer, num1._rcf_num, num2._rcf_num)
2002
2138
  end
2003
2139
 
2140
+ def rcf_num_coefficients(num) #=> :uint
2141
+ VeryLowLevel.Z3_rcf_num_coefficients(_ctx_pointer, num._rcf_num)
2142
+ end
2143
+
2144
+ def rcf_num_sign_condition_coefficients(num1, num2) #=> :uint
2145
+ VeryLowLevel.Z3_rcf_num_sign_condition_coefficients(_ctx_pointer, num1._rcf_num, num2)
2146
+ end
2147
+
2148
+ def rcf_num_sign_conditions(num) #=> :uint
2149
+ VeryLowLevel.Z3_rcf_num_sign_conditions(_ctx_pointer, num._rcf_num)
2150
+ end
2151
+
2004
2152
  def rcf_num_to_decimal_string(num1, num2) #=> :string
2005
2153
  VeryLowLevel.Z3_rcf_num_to_decimal_string(_ctx_pointer, num1._rcf_num, num2)
2006
2154
  end
@@ -2013,10 +2161,22 @@ module Z3
2013
2161
  VeryLowLevel.Z3_rcf_power(_ctx_pointer, num1._rcf_num, num2)
2014
2162
  end
2015
2163
 
2164
+ def rcf_sign_condition_coefficient(num1, num2, num3) #=> :rcf_num_pointer
2165
+ VeryLowLevel.Z3_rcf_sign_condition_coefficient(_ctx_pointer, num1._rcf_num, num2, num3)
2166
+ end
2167
+
2168
+ def rcf_sign_condition_sign(num1, num2) #=> :int
2169
+ VeryLowLevel.Z3_rcf_sign_condition_sign(_ctx_pointer, num1._rcf_num, num2)
2170
+ end
2171
+
2016
2172
  def rcf_sub(num1, num2) #=> :rcf_num_pointer
2017
2173
  VeryLowLevel.Z3_rcf_sub(_ctx_pointer, num1._rcf_num, num2._rcf_num)
2018
2174
  end
2019
2175
 
2176
+ def rcf_transcendental_name(num) #=> :symbol_pointer
2177
+ VeryLowLevel.Z3_rcf_transcendental_name(_ctx_pointer, num._rcf_num)
2178
+ end
2179
+
2020
2180
  def reset_memory #=> :void
2021
2181
  VeryLowLevel.Z3_reset_memory()
2022
2182
  end
@@ -2025,6 +2185,10 @@ module Z3
2025
2185
  VeryLowLevel.Z3_set_param_value(config._config, str1, str2)
2026
2186
  end
2027
2187
 
2188
+ def simplifier_get_descr(str) #=> :string
2189
+ VeryLowLevel.Z3_simplifier_get_descr(_ctx_pointer, str)
2190
+ end
2191
+
2028
2192
  def simplify(ast) #=> :ast_pointer
2029
2193
  VeryLowLevel.Z3_simplify(_ctx_pointer, ast._ast)
2030
2194
  end
@@ -2053,6 +2217,18 @@ module Z3
2053
2217
  VeryLowLevel.Z3_solver_check(_ctx_pointer, solver._solver)
2054
2218
  end
2055
2219
 
2220
+ def solver_congruence_explain(solver, ast1, ast2) #=> :ast_pointer
2221
+ VeryLowLevel.Z3_solver_congruence_explain(_ctx_pointer, solver._solver, ast1._ast, ast2._ast)
2222
+ end
2223
+
2224
+ def solver_congruence_next(solver, ast) #=> :ast_pointer
2225
+ VeryLowLevel.Z3_solver_congruence_next(_ctx_pointer, solver._solver, ast._ast)
2226
+ end
2227
+
2228
+ def solver_congruence_root(solver, ast) #=> :ast_pointer
2229
+ VeryLowLevel.Z3_solver_congruence_root(_ctx_pointer, solver._solver, ast._ast)
2230
+ end
2231
+
2056
2232
  def solver_cube(solver, ast_vector, num) #=> :ast_vector_pointer
2057
2233
  VeryLowLevel.Z3_solver_cube(_ctx_pointer, solver._solver, ast_vector, num)
2058
2234
  end
@@ -2137,7 +2313,7 @@ module Z3
2137
2313
  VeryLowLevel.Z3_solver_pop(_ctx_pointer, solver._solver, num)
2138
2314
  end
2139
2315
 
2140
- def solver_propagate_register(solver, ast) #=> :uint
2316
+ def solver_propagate_register(solver, ast) #=> :void
2141
2317
  VeryLowLevel.Z3_solver_propagate_register(_ctx_pointer, solver._solver, ast._ast)
2142
2318
  end
2143
2319
 
@@ -2145,14 +2321,26 @@ module Z3
2145
2321
  VeryLowLevel.Z3_solver_push(_ctx_pointer, solver._solver)
2146
2322
  end
2147
2323
 
2324
+ def solver_push(solver) #=> :void
2325
+ VeryLowLevel.Z3_solver_push(_ctx_pointer, solver._solver)
2326
+ end
2327
+
2148
2328
  def solver_reset(solver) #=> :void
2149
2329
  VeryLowLevel.Z3_solver_reset(_ctx_pointer, solver._solver)
2150
2330
  end
2151
2331
 
2332
+ def solver_set_initial_value(solver, ast1, ast2) #=> :void
2333
+ VeryLowLevel.Z3_solver_set_initial_value(_ctx_pointer, solver._solver, ast1._ast, ast2._ast)
2334
+ end
2335
+
2152
2336
  def solver_set_params(solver, params) #=> :void
2153
2337
  VeryLowLevel.Z3_solver_set_params(_ctx_pointer, solver._solver, params._params)
2154
2338
  end
2155
2339
 
2340
+ def solver_solve_for(solver, ast_vector1, ast_vector2, ast_vector3) #=> :void
2341
+ VeryLowLevel.Z3_solver_solve_for(_ctx_pointer, solver._solver, ast_vector1, ast_vector2, ast_vector3)
2342
+ end
2343
+
2156
2344
  def solver_to_dimacs_string(solver, bool) #=> :string
2157
2345
  VeryLowLevel.Z3_solver_to_dimacs_string(_ctx_pointer, solver._solver, bool)
2158
2346
  end
@@ -46,6 +46,7 @@ module Z3
46
46
  attach_function :Z3_ast_vector_size, [:ctx_pointer, :ast_vector_pointer], :uint
47
47
  attach_function :Z3_ast_vector_to_string, [:ctx_pointer, :ast_vector_pointer], :string
48
48
  attach_function :Z3_ast_vector_translate, [:ctx_pointer, :ast_vector_pointer, :ctx_pointer], :ast_vector_pointer
49
+ attach_function :Z3_constructor_num_fields, [:ctx_pointer, :constructor_pointer], :uint
49
50
  attach_function :Z3_datatype_update_field, [:ctx_pointer, :func_decl_pointer, :ast_pointer, :ast_pointer], :ast_pointer
50
51
  attach_function :Z3_dec_ref, [:ctx_pointer, :ast_pointer], :void
51
52
  attach_function :Z3_del_config, [:config_pointer], :void
@@ -53,6 +54,7 @@ module Z3
53
54
  attach_function :Z3_del_constructor_list, [:ctx_pointer, :constructor_list_pointer], :void
54
55
  attach_function :Z3_del_context, [:ctx_pointer], :void
55
56
  attach_function :Z3_disable_trace, [:string], :void
57
+ attach_function :Z3_enable_concurrent_dec_ref, [:ctx_pointer], :void
56
58
  attach_function :Z3_enable_trace, [:string], :void
57
59
  attach_function :Z3_eval_smtlib2_string, [:ctx_pointer, :string], :string
58
60
  attach_function :Z3_finalize_memory, [], :void
@@ -115,7 +117,9 @@ module Z3
115
117
  attach_function :Z3_get_app_decl, [:ctx_pointer, :app_pointer], :func_decl_pointer
116
118
  attach_function :Z3_get_app_num_args, [:ctx_pointer, :app_pointer], :uint
117
119
  attach_function :Z3_get_arity, [:ctx_pointer, :func_decl_pointer], :uint
120
+ attach_function :Z3_get_array_arity, [:ctx_pointer, :sort_pointer], :uint
118
121
  attach_function :Z3_get_array_sort_domain, [:ctx_pointer, :sort_pointer], :sort_pointer
122
+ attach_function :Z3_get_array_sort_domain_n, [:ctx_pointer, :sort_pointer, :uint], :sort_pointer
119
123
  attach_function :Z3_get_array_sort_range, [:ctx_pointer, :sort_pointer], :sort_pointer
120
124
  attach_function :Z3_get_as_array_func_decl, [:ctx_pointer, :ast_pointer], :func_decl_pointer
121
125
  attach_function :Z3_get_ast_hash, [:ctx_pointer, :ast_pointer], :uint
@@ -139,13 +143,16 @@ module Z3
139
143
  attach_function :Z3_get_decl_sort_parameter, [:ctx_pointer, :func_decl_pointer, :uint], :sort_pointer
140
144
  attach_function :Z3_get_decl_symbol_parameter, [:ctx_pointer, :func_decl_pointer, :uint], :symbol_pointer
141
145
  attach_function :Z3_get_denominator, [:ctx_pointer, :ast_pointer], :ast_pointer
146
+ attach_function :Z3_get_depth, [:ctx_pointer, :ast_pointer], :uint
142
147
  attach_function :Z3_get_domain, [:ctx_pointer, :func_decl_pointer, :uint], :sort_pointer
143
148
  attach_function :Z3_get_domain_size, [:ctx_pointer, :func_decl_pointer], :uint
144
149
  attach_function :Z3_get_error_code, [:ctx_pointer], :uint
145
150
  attach_function :Z3_get_full_version, [], :string
146
151
  attach_function :Z3_get_func_decl_id, [:ctx_pointer, :func_decl_pointer], :uint
152
+ attach_function :Z3_get_global_param_descrs, [:ctx_pointer], :param_descrs_pointer
147
153
  attach_function :Z3_get_index_value, [:ctx_pointer, :ast_pointer], :uint
148
154
  attach_function :Z3_get_num_probes, [:ctx_pointer], :uint
155
+ attach_function :Z3_get_num_simplifiers, [:ctx_pointer], :uint
149
156
  attach_function :Z3_get_num_tactics, [:ctx_pointer], :uint
150
157
  attach_function :Z3_get_numeral_binary_string, [:ctx_pointer, :ast_pointer], :string
151
158
  attach_function :Z3_get_numeral_decimal_string, [:ctx_pointer, :ast_pointer, :uint], :string
@@ -158,17 +165,20 @@ module Z3
158
165
  attach_function :Z3_get_quantifier_body, [:ctx_pointer, :ast_pointer], :ast_pointer
159
166
  attach_function :Z3_get_quantifier_bound_name, [:ctx_pointer, :ast_pointer, :uint], :symbol_pointer
160
167
  attach_function :Z3_get_quantifier_bound_sort, [:ctx_pointer, :ast_pointer, :uint], :sort_pointer
168
+ attach_function :Z3_get_quantifier_id, [:ctx_pointer, :ast_pointer], :symbol_pointer
161
169
  attach_function :Z3_get_quantifier_no_pattern_ast, [:ctx_pointer, :ast_pointer, :uint], :ast_pointer
162
170
  attach_function :Z3_get_quantifier_num_bound, [:ctx_pointer, :ast_pointer], :uint
163
171
  attach_function :Z3_get_quantifier_num_no_patterns, [:ctx_pointer, :ast_pointer], :uint
164
172
  attach_function :Z3_get_quantifier_num_patterns, [:ctx_pointer, :ast_pointer], :uint
165
173
  attach_function :Z3_get_quantifier_pattern_ast, [:ctx_pointer, :ast_pointer, :uint], :pattern_pointer
174
+ attach_function :Z3_get_quantifier_skolem_id, [:ctx_pointer, :ast_pointer], :symbol_pointer
166
175
  attach_function :Z3_get_quantifier_weight, [:ctx_pointer, :ast_pointer], :uint
167
176
  attach_function :Z3_get_range, [:ctx_pointer, :func_decl_pointer], :sort_pointer
168
177
  attach_function :Z3_get_re_sort_basis, [:ctx_pointer, :sort_pointer], :sort_pointer
169
178
  attach_function :Z3_get_relation_arity, [:ctx_pointer, :sort_pointer], :uint
170
179
  attach_function :Z3_get_relation_column, [:ctx_pointer, :sort_pointer, :uint], :sort_pointer
171
180
  attach_function :Z3_get_seq_sort_basis, [:ctx_pointer, :sort_pointer], :sort_pointer
181
+ attach_function :Z3_get_simplifier_name, [:ctx_pointer, :uint], :string
172
182
  attach_function :Z3_get_sort, [:ctx_pointer, :ast_pointer], :sort_pointer
173
183
  attach_function :Z3_get_sort_id, [:ctx_pointer, :sort_pointer], :uint
174
184
  attach_function :Z3_get_sort_kind, [:ctx_pointer, :sort_pointer], :uint
@@ -208,16 +218,20 @@ module Z3
208
218
  attach_function :Z3_is_eq_ast, [:ctx_pointer, :ast_pointer, :ast_pointer], :bool
209
219
  attach_function :Z3_is_eq_func_decl, [:ctx_pointer, :func_decl_pointer, :func_decl_pointer], :bool
210
220
  attach_function :Z3_is_eq_sort, [:ctx_pointer, :sort_pointer, :sort_pointer], :bool
221
+ attach_function :Z3_is_ground, [:ctx_pointer, :ast_pointer], :bool
211
222
  attach_function :Z3_is_lambda, [:ctx_pointer, :ast_pointer], :bool
212
223
  attach_function :Z3_is_numeral_ast, [:ctx_pointer, :ast_pointer], :bool
213
224
  attach_function :Z3_is_quantifier_exists, [:ctx_pointer, :ast_pointer], :bool
214
225
  attach_function :Z3_is_quantifier_forall, [:ctx_pointer, :ast_pointer], :bool
226
+ attach_function :Z3_is_recursive_datatype_sort, [:ctx_pointer, :sort_pointer], :bool
215
227
  attach_function :Z3_is_well_sorted, [:ctx_pointer, :ast_pointer], :bool
228
+ attach_function :Z3_mk_abs, [:ctx_pointer, :ast_pointer], :ast_pointer
216
229
  attach_function :Z3_mk_array_default, [:ctx_pointer, :ast_pointer], :ast_pointer
217
230
  attach_function :Z3_mk_array_sort, [:ctx_pointer, :sort_pointer, :sort_pointer], :sort_pointer
218
231
  attach_function :Z3_mk_as_array, [:ctx_pointer, :func_decl_pointer], :ast_pointer
219
232
  attach_function :Z3_mk_ast_map, [:ctx_pointer], :ast_map_pointer
220
233
  attach_function :Z3_mk_ast_vector, [:ctx_pointer], :ast_vector_pointer
234
+ attach_function :Z3_mk_bit2bool, [:ctx_pointer, :uint, :ast_pointer], :ast_pointer
221
235
  attach_function :Z3_mk_bool_sort, [:ctx_pointer], :sort_pointer
222
236
  attach_function :Z3_mk_bound, [:ctx_pointer, :uint, :sort_pointer], :ast_pointer
223
237
  attach_function :Z3_mk_bv2int, [:ctx_pointer, :ast_pointer, :bool], :ast_pointer
@@ -259,6 +273,7 @@ module Z3
259
273
  attach_function :Z3_mk_bvurem, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
260
274
  attach_function :Z3_mk_bvxnor, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
261
275
  attach_function :Z3_mk_bvxor, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
276
+ attach_function :Z3_mk_char, [:ctx_pointer, :uint], :ast_pointer
262
277
  attach_function :Z3_mk_char_from_bv, [:ctx_pointer, :ast_pointer], :ast_pointer
263
278
  attach_function :Z3_mk_char_is_digit, [:ctx_pointer, :ast_pointer], :ast_pointer
264
279
  attach_function :Z3_mk_char_le, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
@@ -270,6 +285,7 @@ module Z3
270
285
  attach_function :Z3_mk_const, [:ctx_pointer, :symbol_pointer, :sort_pointer], :ast_pointer
271
286
  attach_function :Z3_mk_const_array, [:ctx_pointer, :sort_pointer, :ast_pointer], :ast_pointer
272
287
  attach_function :Z3_mk_context_rc, [:config_pointer], :ctx_pointer
288
+ attach_function :Z3_mk_datatype_sort, [:ctx_pointer, :symbol_pointer], :sort_pointer
273
289
  attach_function :Z3_mk_div, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
274
290
  attach_function :Z3_mk_divides, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
275
291
  attach_function :Z3_mk_empty_set, [:ctx_pointer, :sort_pointer], :ast_pointer
@@ -369,12 +385,15 @@ module Z3
369
385
  attach_function :Z3_mk_probe, [:ctx_pointer, :string], :probe_pointer
370
386
  attach_function :Z3_mk_re_allchar, [:ctx_pointer, :sort_pointer], :ast_pointer
371
387
  attach_function :Z3_mk_re_complement, [:ctx_pointer, :ast_pointer], :ast_pointer
388
+ attach_function :Z3_mk_re_diff, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
372
389
  attach_function :Z3_mk_re_empty, [:ctx_pointer, :sort_pointer], :ast_pointer
373
390
  attach_function :Z3_mk_re_full, [:ctx_pointer, :sort_pointer], :ast_pointer
374
391
  attach_function :Z3_mk_re_loop, [:ctx_pointer, :ast_pointer, :uint, :uint], :ast_pointer
392
+ attach_function :Z3_mk_re_power, [:ctx_pointer, :ast_pointer, :uint], :ast_pointer
375
393
  attach_function :Z3_mk_re_range, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
376
394
  attach_function :Z3_mk_real, [:ctx_pointer, :int, :int], :ast_pointer
377
395
  attach_function :Z3_mk_real2int, [:ctx_pointer, :ast_pointer], :ast_pointer
396
+ attach_function :Z3_mk_real_int64, [:ctx_pointer, :int64, :int64], :ast_pointer
378
397
  attach_function :Z3_mk_real_sort, [:ctx_pointer], :sort_pointer
379
398
  attach_function :Z3_mk_rem, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
380
399
  attach_function :Z3_mk_repeat, [:ctx_pointer, :uint, :ast_pointer], :ast_pointer
@@ -382,7 +401,11 @@ module Z3
382
401
  attach_function :Z3_mk_rotate_right, [:ctx_pointer, :uint, :ast_pointer], :ast_pointer
383
402
  attach_function :Z3_mk_sbv_to_str, [:ctx_pointer, :ast_pointer], :ast_pointer
384
403
  attach_function :Z3_mk_select, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
404
+ attach_function :Z3_mk_seq_foldl, [:ctx_pointer, :ast_pointer, :ast_pointer, :ast_pointer], :ast_pointer
405
+ attach_function :Z3_mk_seq_foldli, [:ctx_pointer, :ast_pointer, :ast_pointer, :ast_pointer, :ast_pointer], :ast_pointer
385
406
  attach_function :Z3_mk_seq_last_index, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
407
+ attach_function :Z3_mk_seq_map, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
408
+ attach_function :Z3_mk_seq_mapi, [:ctx_pointer, :ast_pointer, :ast_pointer, :ast_pointer], :ast_pointer
386
409
  attach_function :Z3_mk_seq_nth, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
387
410
  attach_function :Z3_mk_set_add, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
388
411
  attach_function :Z3_mk_set_complement, [:ctx_pointer, :ast_pointer], :ast_pointer
@@ -401,11 +424,14 @@ module Z3
401
424
  attach_function :Z3_mk_str_le, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
402
425
  attach_function :Z3_mk_str_lt, [:ctx_pointer, :ast_pointer, :ast_pointer], :ast_pointer
403
426
  attach_function :Z3_mk_str_to_int, [:ctx_pointer, :ast_pointer], :ast_pointer
427
+ attach_function :Z3_mk_string_from_code, [:ctx_pointer, :ast_pointer], :ast_pointer
404
428
  attach_function :Z3_mk_string_symbol, [:ctx_pointer, :string], :symbol_pointer
429
+ attach_function :Z3_mk_string_to_code, [:ctx_pointer, :ast_pointer], :ast_pointer
405
430
  attach_function :Z3_mk_tactic, [:ctx_pointer, :string], :tactic_pointer
406
431
  attach_function :Z3_mk_transitive_closure, [:ctx_pointer, :func_decl_pointer], :func_decl_pointer
407
432
  attach_function :Z3_mk_tree_order, [:ctx_pointer, :sort_pointer, :uint], :func_decl_pointer
408
433
  attach_function :Z3_mk_true, [:ctx_pointer], :ast_pointer
434
+ attach_function :Z3_mk_type_variable, [:ctx_pointer, :symbol_pointer], :sort_pointer
409
435
  attach_function :Z3_mk_ubv_to_str, [:ctx_pointer, :ast_pointer], :ast_pointer
410
436
  attach_function :Z3_mk_unary_minus, [:ctx_pointer, :ast_pointer], :ast_pointer
411
437
  attach_function :Z3_mk_uninterpreted_sort, [:ctx_pointer, :symbol_pointer], :sort_pointer
@@ -451,6 +477,7 @@ module Z3
451
477
  attach_function :Z3_optimize_minimize, [:ctx_pointer, :optimize_pointer, :ast_pointer], :uint
452
478
  attach_function :Z3_optimize_pop, [:ctx_pointer, :optimize_pointer], :void
453
479
  attach_function :Z3_optimize_push, [:ctx_pointer, :optimize_pointer], :void
480
+ attach_function :Z3_optimize_set_initial_value, [:ctx_pointer, :optimize_pointer, :ast_pointer, :ast_pointer], :void
454
481
  attach_function :Z3_optimize_set_params, [:ctx_pointer, :optimize_pointer, :params_pointer], :void
455
482
  attach_function :Z3_optimize_to_string, [:ctx_pointer, :optimize_pointer], :string
456
483
  attach_function :Z3_param_descrs_dec_ref, [:ctx_pointer, :param_descrs_pointer], :void
@@ -484,12 +511,19 @@ module Z3
484
511
  attach_function :Z3_probe_or, [:ctx_pointer, :probe_pointer, :probe_pointer], :probe_pointer
485
512
  attach_function :Z3_qe_lite, [:ctx_pointer, :ast_vector_pointer, :ast_pointer], :ast_pointer
486
513
  attach_function :Z3_rcf_add, [:ctx_pointer, :rcf_num_pointer, :rcf_num_pointer], :rcf_num_pointer
514
+ attach_function :Z3_rcf_coefficient, [:ctx_pointer, :rcf_num_pointer, :uint], :rcf_num_pointer
487
515
  attach_function :Z3_rcf_del, [:ctx_pointer, :rcf_num_pointer], :void
488
516
  attach_function :Z3_rcf_div, [:ctx_pointer, :rcf_num_pointer, :rcf_num_pointer], :rcf_num_pointer
489
517
  attach_function :Z3_rcf_eq, [:ctx_pointer, :rcf_num_pointer, :rcf_num_pointer], :bool
518
+ attach_function :Z3_rcf_extension_index, [:ctx_pointer, :rcf_num_pointer], :uint
490
519
  attach_function :Z3_rcf_ge, [:ctx_pointer, :rcf_num_pointer, :rcf_num_pointer], :bool
491
520
  attach_function :Z3_rcf_gt, [:ctx_pointer, :rcf_num_pointer, :rcf_num_pointer], :bool
521
+ attach_function :Z3_rcf_infinitesimal_name, [:ctx_pointer, :rcf_num_pointer], :symbol_pointer
492
522
  attach_function :Z3_rcf_inv, [:ctx_pointer, :rcf_num_pointer], :rcf_num_pointer
523
+ attach_function :Z3_rcf_is_algebraic, [:ctx_pointer, :rcf_num_pointer], :bool
524
+ attach_function :Z3_rcf_is_infinitesimal, [:ctx_pointer, :rcf_num_pointer], :bool
525
+ attach_function :Z3_rcf_is_rational, [:ctx_pointer, :rcf_num_pointer], :bool
526
+ attach_function :Z3_rcf_is_transcendental, [:ctx_pointer, :rcf_num_pointer], :bool
493
527
  attach_function :Z3_rcf_le, [:ctx_pointer, :rcf_num_pointer, :rcf_num_pointer], :bool
494
528
  attach_function :Z3_rcf_lt, [:ctx_pointer, :rcf_num_pointer, :rcf_num_pointer], :bool
495
529
  attach_function :Z3_rcf_mk_e, [:ctx_pointer], :rcf_num_pointer
@@ -500,12 +534,19 @@ module Z3
500
534
  attach_function :Z3_rcf_mul, [:ctx_pointer, :rcf_num_pointer, :rcf_num_pointer], :rcf_num_pointer
501
535
  attach_function :Z3_rcf_neg, [:ctx_pointer, :rcf_num_pointer], :rcf_num_pointer
502
536
  attach_function :Z3_rcf_neq, [:ctx_pointer, :rcf_num_pointer, :rcf_num_pointer], :bool
537
+ attach_function :Z3_rcf_num_coefficients, [:ctx_pointer, :rcf_num_pointer], :uint
538
+ attach_function :Z3_rcf_num_sign_condition_coefficients, [:ctx_pointer, :rcf_num_pointer, :uint], :uint
539
+ attach_function :Z3_rcf_num_sign_conditions, [:ctx_pointer, :rcf_num_pointer], :uint
503
540
  attach_function :Z3_rcf_num_to_decimal_string, [:ctx_pointer, :rcf_num_pointer, :uint], :string
504
541
  attach_function :Z3_rcf_num_to_string, [:ctx_pointer, :rcf_num_pointer, :bool, :bool], :string
505
542
  attach_function :Z3_rcf_power, [:ctx_pointer, :rcf_num_pointer, :uint], :rcf_num_pointer
543
+ attach_function :Z3_rcf_sign_condition_coefficient, [:ctx_pointer, :rcf_num_pointer, :uint, :uint], :rcf_num_pointer
544
+ attach_function :Z3_rcf_sign_condition_sign, [:ctx_pointer, :rcf_num_pointer, :uint], :int
506
545
  attach_function :Z3_rcf_sub, [:ctx_pointer, :rcf_num_pointer, :rcf_num_pointer], :rcf_num_pointer
546
+ attach_function :Z3_rcf_transcendental_name, [:ctx_pointer, :rcf_num_pointer], :symbol_pointer
507
547
  attach_function :Z3_reset_memory, [], :void
508
548
  attach_function :Z3_set_param_value, [:config_pointer, :string, :string], :void
549
+ attach_function :Z3_simplifier_get_descr, [:ctx_pointer, :string], :string
509
550
  attach_function :Z3_simplify, [:ctx_pointer, :ast_pointer], :ast_pointer
510
551
  attach_function :Z3_simplify_ex, [:ctx_pointer, :ast_pointer, :params_pointer], :ast_pointer
511
552
  attach_function :Z3_simplify_get_help, [:ctx_pointer], :string
@@ -513,6 +554,9 @@ module Z3
513
554
  attach_function :Z3_solver_assert, [:ctx_pointer, :solver_pointer, :ast_pointer], :void
514
555
  attach_function :Z3_solver_assert_and_track, [:ctx_pointer, :solver_pointer, :ast_pointer, :ast_pointer], :void
515
556
  attach_function :Z3_solver_check, [:ctx_pointer, :solver_pointer], :int
557
+ attach_function :Z3_solver_congruence_explain, [:ctx_pointer, :solver_pointer, :ast_pointer, :ast_pointer], :ast_pointer
558
+ attach_function :Z3_solver_congruence_next, [:ctx_pointer, :solver_pointer, :ast_pointer], :ast_pointer
559
+ attach_function :Z3_solver_congruence_root, [:ctx_pointer, :solver_pointer, :ast_pointer], :ast_pointer
516
560
  attach_function :Z3_solver_cube, [:ctx_pointer, :solver_pointer, :ast_vector_pointer, :uint], :ast_vector_pointer
517
561
  attach_function :Z3_solver_dec_ref, [:ctx_pointer, :solver_pointer], :void
518
562
  attach_function :Z3_solver_from_file, [:ctx_pointer, :solver_pointer, :string], :void
@@ -534,10 +578,13 @@ module Z3
534
578
  attach_function :Z3_solver_inc_ref, [:ctx_pointer, :solver_pointer], :void
535
579
  attach_function :Z3_solver_interrupt, [:ctx_pointer, :solver_pointer], :void
536
580
  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
581
+ attach_function :Z3_solver_propagate_register, [:ctx_pointer, :solver_pointer, :ast_pointer], :void
582
+ attach_function :Z3_solver_push, [:ctx_pointer, :solver_pointer], :void
538
583
  attach_function :Z3_solver_push, [:ctx_pointer, :solver_pointer], :void
539
584
  attach_function :Z3_solver_reset, [:ctx_pointer, :solver_pointer], :void
585
+ attach_function :Z3_solver_set_initial_value, [:ctx_pointer, :solver_pointer, :ast_pointer, :ast_pointer], :void
540
586
  attach_function :Z3_solver_set_params, [:ctx_pointer, :solver_pointer, :params_pointer], :void
587
+ attach_function :Z3_solver_solve_for, [:ctx_pointer, :solver_pointer, :ast_vector_pointer, :ast_vector_pointer, :ast_vector_pointer], :void
541
588
  attach_function :Z3_solver_to_dimacs_string, [:ctx_pointer, :solver_pointer, :bool], :string
542
589
  attach_function :Z3_solver_to_string, [:ctx_pointer, :solver_pointer], :string
543
590
  attach_function :Z3_stats_dec_ref, [:ctx_pointer, :stats_pointer], :void
@@ -24,11 +24,22 @@ module Z3
24
24
  expect([a[10] == 20]).to have_solution(
25
25
  a => "const(20)",
26
26
  )
27
- expect([a[x] == 10, a[y] == 20]).to have_solution(
28
- a => "store(const(10), 3, 20)",
29
- x => "2",
30
- y => "3",
31
- )
27
+ # There are many ways to solve this
28
+ if Z3.version_at_least?(4, 12)
29
+ # 4.12.x
30
+ expect([a[x] == 10, a[y] == 20]).to have_solution(
31
+ a => "store(const(10), 3, 20)",
32
+ x => "2",
33
+ y => "3",
34
+ )
35
+ else
36
+ # 4.8.x
37
+ expect([a[x] == 10, a[y] == 20]).to have_solution(
38
+ a => "store(const(10), 1, 20)",
39
+ x => "0",
40
+ y => "1",
41
+ )
42
+ end
32
43
  end
33
44
 
34
45
  it "store" do
@@ -1,14 +1,5 @@
1
1
  describe "Cats Organized Neatly" do
2
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
3
+ expect("cats_organized_neatly").to have_output_matching_saved_example
13
4
  end
14
5
  end
@@ -0,0 +1,8 @@
1
+ .ffffbbb
2
+ .fdddbbb
3
+ aadddbbb
4
+ aadddbbe
5
+ aagggcee
6
+ aagggcce
7
+ aagggcc.
8
+ ..gggcc.
@@ -0,0 +1,8 @@
1
+ .ffffbbb
2
+ .fgggbbb
3
+ aagggbbb
4
+ aagggbbe
5
+ aagggcee
6
+ aadddcce
7
+ aadddcc.
8
+ ..dddcc.
@@ -0,0 +1,90 @@
1
+ Solved
2
+ State 0:
3
+ bbb.
4
+ xbxw
5
+ ..ww
6
+ x.xw
7
+ b: 1,1 -> 3,0
8
+
9
+ State 1:
10
+ bbbb
11
+ x.xw
12
+ ..ww
13
+ x.xw
14
+ w: 3,2 -> 1,1
15
+
16
+ State 2:
17
+ bbbb
18
+ xwxw
19
+ ..w.
20
+ x.xw
21
+ b: 2,0 -> 3,2
22
+
23
+ State 3:
24
+ bb.b
25
+ xwxw
26
+ ..wb
27
+ x.xw
28
+ w: 3,3 -> 1,2
29
+
30
+ State 4:
31
+ bb.b
32
+ xwxw
33
+ .wwb
34
+ x.x.
35
+ w: 1,2 -> 2,0
36
+
37
+ State 5:
38
+ bbwb
39
+ xwxw
40
+ ..wb
41
+ x.x.
42
+ b: 0,0 -> 1,2
43
+
44
+ State 6:
45
+ .bwb
46
+ xwxw
47
+ .bwb
48
+ x.x.
49
+ b: 1,2 -> 3,3
50
+
51
+ State 7:
52
+ .bwb
53
+ xwxw
54
+ ..wb
55
+ x.xb
56
+ w: 3,1 -> 1,2
57
+
58
+ State 8:
59
+ .bwb
60
+ xwx.
61
+ .wwb
62
+ x.xb
63
+ b: 1,0 -> 3,1
64
+
65
+ State 9:
66
+ ..wb
67
+ xwxb
68
+ .wwb
69
+ x.xb
70
+ w: 1,2 -> 0,0
71
+
72
+ State 10:
73
+ w.wb
74
+ xwxb
75
+ ..wb
76
+ x.xb
77
+ w: 2,2 -> 1,0
78
+
79
+ State 11:
80
+ wwwb
81
+ xwxb
82
+ ...b
83
+ x.xb
84
+ b: 3,0 -> 2,2
85
+
86
+ State 12:
87
+ www.
88
+ xwxb
89
+ ..bb
90
+ x.xb
@@ -0,0 +1,90 @@
1
+ Solved
2
+ State 0:
3
+ bbb.
4
+ xbxw
5
+ ..ww
6
+ x.xw
7
+ b: 1,1 -> 3,0
8
+
9
+ State 1:
10
+ bbbb
11
+ x.xw
12
+ ..ww
13
+ x.xw
14
+ w: 3,2 -> 1,1
15
+
16
+ State 2:
17
+ bbbb
18
+ xwxw
19
+ ..w.
20
+ x.xw
21
+ b: 2,0 -> 3,2
22
+
23
+ State 3:
24
+ bb.b
25
+ xwxw
26
+ ..wb
27
+ x.xw
28
+ w: 3,3 -> 1,2
29
+
30
+ State 4:
31
+ bb.b
32
+ xwxw
33
+ .wwb
34
+ x.x.
35
+ w: 1,2 -> 2,0
36
+
37
+ State 5:
38
+ bbwb
39
+ xwxw
40
+ ..wb
41
+ x.x.
42
+ b: 0,0 -> 1,2
43
+
44
+ State 6:
45
+ .bwb
46
+ xwxw
47
+ .bwb
48
+ x.x.
49
+ b: 1,2 -> 3,3
50
+
51
+ State 7:
52
+ .bwb
53
+ xwxw
54
+ ..wb
55
+ x.xb
56
+ w: 3,1 -> 1,2
57
+
58
+ State 8:
59
+ .bwb
60
+ xwx.
61
+ .wwb
62
+ x.xb
63
+ w: 1,2 -> 0,0
64
+
65
+ State 9:
66
+ wbwb
67
+ xwx.
68
+ ..wb
69
+ x.xb
70
+ b: 1,0 -> 3,1
71
+
72
+ State 10:
73
+ w.wb
74
+ xwxb
75
+ ..wb
76
+ x.xb
77
+ w: 2,2 -> 1,0
78
+
79
+ State 11:
80
+ wwwb
81
+ xwxb
82
+ ...b
83
+ x.xb
84
+ b: 3,0 -> 2,2
85
+
86
+ State 12:
87
+ www.
88
+ xwxb
89
+ ..bb
90
+ x.xb
@@ -0,0 +1,90 @@
1
+ Solved
2
+ State 0:
3
+ bbb.
4
+ xbxw
5
+ ..ww
6
+ x.xw
7
+ b: 1,1 -> 3,0
8
+
9
+ State 1:
10
+ bbbb
11
+ x.xw
12
+ ..ww
13
+ x.xw
14
+ w: 3,3 -> 1,2
15
+
16
+ State 2:
17
+ bbbb
18
+ x.xw
19
+ .www
20
+ x.x.
21
+ w: 3,2 -> 1,1
22
+
23
+ State 3:
24
+ bbbb
25
+ xwxw
26
+ .ww.
27
+ x.x.
28
+ b: 2,0 -> 3,2
29
+
30
+ State 4:
31
+ bb.b
32
+ xwxw
33
+ .wwb
34
+ x.x.
35
+ w: 1,2 -> 2,0
36
+
37
+ State 5:
38
+ bbwb
39
+ xwxw
40
+ ..wb
41
+ x.x.
42
+ b: 0,0 -> 1,2
43
+
44
+ State 6:
45
+ .bwb
46
+ xwxw
47
+ .bwb
48
+ x.x.
49
+ b: 1,2 -> 3,3
50
+
51
+ State 7:
52
+ .bwb
53
+ xwxw
54
+ ..wb
55
+ x.xb
56
+ w: 3,1 -> 1,2
57
+
58
+ State 8:
59
+ .bwb
60
+ xwx.
61
+ .wwb
62
+ x.xb
63
+ w: 1,2 -> 0,0
64
+
65
+ State 9:
66
+ wbwb
67
+ xwx.
68
+ ..wb
69
+ x.xb
70
+ b: 1,0 -> 3,1
71
+
72
+ State 10:
73
+ w.wb
74
+ xwxb
75
+ ..wb
76
+ x.xb
77
+ w: 2,2 -> 1,0
78
+
79
+ State 11:
80
+ wwwb
81
+ xwxb
82
+ ...b
83
+ x.xb
84
+ b: 3,0 -> 2,2
85
+
86
+ State 12:
87
+ www.
88
+ xwxb
89
+ ..bb
90
+ x.xb
@@ -0,0 +1,6 @@
1
+ 4 3 2 ### 20 19
2
+ 5 ### 1 ### 21 18
3
+ 6 25 24 23 22 17
4
+ 7 26 27 28 ### 16
5
+ 8 ### 30 29 ### 15
6
+ 9 10 11 12 13 14
@@ -0,0 +1,6 @@
1
+ 5 4 3 ### 21 20
2
+ 6 ### 2 ### 22 19
3
+ 7 30 1 24 23 18
4
+ 8 29 28 25 ### 17
5
+ 9 ### 27 26 ### 16
6
+ 10 11 12 13 14 15
@@ -0,0 +1,6 @@
1
+ 22 21 20 ### 14 13
2
+ 23 ### 19 ### 15 12
3
+ 24 1 18 17 16 11
4
+ 25 2 3 4 ### 10
5
+ 26 ### 30 5 ### 9
6
+ 27 28 29 6 7 8
@@ -2,13 +2,6 @@
2
2
  # This is what Z3 4.8.13 returns
3
3
  describe "Mortal Coil Puzzle" do
4
4
  it do
5
- expect("mortal_coil_puzzle").to have_output <<EOF
6
- 4 3 2 ### 20 19
7
- 5 ### 1 ### 21 18
8
- 6 25 24 23 22 17
9
- 7 26 27 28 ### 16
10
- 8 ### 30 29 ### 15
11
- 9 10 11 12 13 14
12
- EOF
5
+ expect("mortal_coil_puzzle").to have_output_matching_saved_example
13
6
  end
14
7
  end
@@ -15,7 +15,7 @@ describe "Regexp Crossword Solver" do
15
15
  let(:rows) { example.last(row_number) }
16
16
 
17
17
  it "matches output" do
18
- output_rows = `#{binary} #{example_path}`.split("\n").map(&:chomp).map{|x| x.gsub("\\r", "\r")}
18
+ output_rows = `#{binary} #{example_path}`.split("\n").map(&:chomp).map{|x| x.gsub("\\r", "\r").gsub("\\v", "\v")}
19
19
  output_cols = output_rows.map(&:chars).transpose.map(&:join)
20
20
  expect(output_rows.size).to eq(rows.size)
21
21
  expect(output_cols.size).to eq(cols.size)
data/spec/solver_spec.rb CHANGED
@@ -37,7 +37,15 @@ module Z3
37
37
  solver.assert b >= 2
38
38
  solver.assert Z3.Or(a == 2, a == -2)
39
39
  stats = solver.statistics
40
- expect(stats.keys).to match_array(["rlimit count", "max memory", "memory", "num allocs"])
40
+ # This depends on Z3 version so it's not a great test
41
+ # Not sure which version has exactly which set
42
+ if Z3.version_at_least?(4, 12)
43
+ # 4.12.x
44
+ expect(stats.keys).to match_array(["rlimit count", "max memory", "memory", "num allocs"])
45
+ else
46
+ # 4.8.x
47
+ expect(stats.keys).to match_array(["rlimit count", "max memory", "memory", "num allocs", "mk bool var"])
48
+ end
41
49
  end
42
50
 
43
51
  # This is a very simple example of unknown satisfiablity
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: z3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.20230311
4
+ version: 0.0.20251017
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Wegrzanowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-11 00:00:00.000000000 Z
11
+ date: 2025-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -30,84 +30,84 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '12'
33
+ version: '13'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '12'
40
+ version: '13'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.8'
47
+ version: '3.13'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.8'
54
+ version: '3.13'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: simplecov
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.16'
61
+ version: '0.22'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.16'
68
+ version: '0.22'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: regexp_parser
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1.3'
75
+ version: '1.8'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1.3'
82
+ version: '1.8'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: paint
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: 2.1.0
89
+ version: 2.3.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: 2.1.0
96
+ version: 2.3.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: ffi
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '1.9'
103
+ version: '1.17'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '1.9'
110
+ version: '1.17'
111
111
  description: Ruby bindings for Z3 Constraint Solver
112
112
  email: Tomasz.Wegrzanowski@gmail.com
113
113
  executables: []
@@ -282,6 +282,8 @@ files:
282
282
  - spec/integration/eulero_spec.rb
283
283
  - spec/integration/examples/abc_path-1.txt
284
284
  - spec/integration/examples/abc_path-2.txt
285
+ - spec/integration/examples/cats_organized_neatly-1.txt
286
+ - spec/integration/examples/cats_organized_neatly-2.txt
285
287
  - spec/integration/examples/futoshiki-1.txt
286
288
  - spec/integration/examples/futoshiki-2.txt
287
289
  - spec/integration/examples/knights_puzzle-1.txt
@@ -289,6 +291,12 @@ files:
289
291
  - spec/integration/examples/knights_puzzle-3.txt
290
292
  - spec/integration/examples/knights_puzzle-4.txt
291
293
  - spec/integration/examples/knights_puzzle-5.txt
294
+ - spec/integration/examples/knights_puzzle-6.txt
295
+ - spec/integration/examples/knights_puzzle-7.txt
296
+ - spec/integration/examples/knights_puzzle-8.txt
297
+ - spec/integration/examples/mortal_coil_puzzle-1.txt
298
+ - spec/integration/examples/mortal_coil_puzzle-2.txt
299
+ - spec/integration/examples/mortal_coil_puzzle-3.txt
292
300
  - spec/integration/four_hackers_puzzle_spec.rb
293
301
  - spec/integration/futoshiki_spec.rb
294
302
  - spec/integration/geometry_problem_spec.rb
@@ -358,7 +366,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
358
366
  version: '0'
359
367
  requirements:
360
368
  - z3 library (4.8+)
361
- rubygems_version: 3.3.26
369
+ rubygems_version: 3.5.22
362
370
  signing_key:
363
371
  specification_version: 4
364
372
  summary: Z3 Constraint Solver