-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathNOTES
1212 lines (748 loc) · 41.4 KB
/
NOTES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
======================================================================
This file is part of the Yices SMT Solver.
Copyright (C) 2017 SRI International.
Yices is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Yices is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Yices. If not, see <http://www.gnu.org/licenses/>.
======================================================================
SOURCE CODE OVERVIEW
The source code is organized as follows:
src/utils: Utilities and generic data structures
src/terms: Internal representation of terms and types, including functions and
data structures for building/normalizing/simplifying terms.
src/models: Data structures related to building, querying, and manipulating models.
(A model stores a mapping from terms to concreted values.)
src/solvers: CDCL-based SAT solvers + theory solvers
src/mcsat: MCSAT-based solvers and plugins
src/context: Support for creating and manipulating contexts and for simplification
and preprocessing of assertions.
src/exists_forall: Solver for exists/forall problems
src/api: Functions and data structures needed to implement the Yices API.
src/io: Support for input output, including parsing and pretty printing.
src/parser_utils: Data structures common to all front-end tools, including support
for parsing and stack-based construction of terms and types.
src/frontend: Main binaries. Each front-end supports a different input language.
src/include: Header files that specify the Yices API.
src/solvers contains a subdirectory for each solver:
src/solvers/cdcl: SAT solver
src/solvers/bv: Bit-vector solver
src/solvers/egraph: E-graph/UF solver
src/solvers/simplex: Solver for linear arithmetic (based on Simplex)
src/solvers/funs: Solver for the theory of arrays
src/solvers/floyd_warshall: Specialized solvers for difference logic
front_ends contains a subdirectory for each main binary
src/frontend/yices: Main binary (supports the Yices language and Exists/Forall solving)
src/frontend/smt1: yices-smt (supports SMT-LIB 1.2)
src/frontend/smt2: yices-smt2 (supports SMT-LIB 2.0)
MORE DETAILS
1) UTILITIES
---------
1.1) Memory management
-----------------
arena.h: region-based allocator with push/pop functions
arena.c (pop frees all objects allocated since the previous push)
int_stack.h: stack for allocating integer arrays (freed in reverse order
int_stack.c of allocation).
ptr_stack.h: stack for allocating pointer arrays (same as int_stack
ptr_stack.c but for arrays of (void*) objects).
memalloc.h: wrappers around malloc/realloc/free
memalloc.c NOTE: this imports 'yices_exit_codes.h'
object_stores.h: special allocator for objects of a fixed size
object_stores.c
1.2) Miscellaneous utilities
-----------------------
assert_utils.h: Wrappers around assert to avoid compilation warnings
bit_tricks.h: Low-level bit-mask operations (via GCC's __builtins or replacement
if they're not present).
command_line.h: Support for parsing command-line arguments (passed via argc/argv)
command_line.c
cputime.h: For measuring computing time
cputime.c
dprng.h: Pseudo-random number generator (floating point implementation)
gcd.h: gcd of two integers
gcd.c
hash_functions.h: various hash functions based on Bob Jenkins's public-domain code
hash_functions.c
int_powers.h: exponentiation of 32bit or 64bit unsigned integers
int_powers.c
memsize.h: For measuring memory usage of the current process (approximately)
memsize.c this does not work on mingw but should work on all other platforms
prng.h: simple PRNG generator based on a linear congruence
tagged_pointers.h: macros for tagging/untagging pointers
timeout.h: interface to a timeout function (it's implemented using
timeout.c signal/alarm on Unix or using timer queues on Windows/Mingw)
1.3) Sorting
-------
int_array_sort.h: sort an array of integers in increasing order
int_array_sort.c
int_array_sort2.h: sort an array of integers, ordering supplied by the user
int_array_sort2.c
stable_sort.h: stable sort: array of (void *) pointers, ordering supplied
stable_sort.c by the user
ptr_array_sort.h: sort an array of (void *) pointers in increasing address order
ptr_array_sort.c
ptr_array_sort2.h: sort an array of pointers, ordering supplied by the user
ptr_array_sort2.c
1.4) Generic data structures
-----------------------
bitvectors.h: bit-vectors
dl_lists.h: doubly-linked lists
1.4.a) Vectors and Arrays
------------------
backtrack_arrays.h: arrays of integers with support for update, push/pop
backtrack_arrays.c
dep_tables.h: dependency tables (map integer indices to arrays of
dep_tables.c integer indices. Similar to use_vectors).
int_vectors.h: vectors of signed 32bit integers
int_vectors.c
index_vectors.h: vectors of int32_t integers (similar to int_vectors but
index_vectors.c more efficient in some cases: use a hidden header)
mark_vectors.h: arrays to map 32bit integer indices to unsigned 8bit integers,
mark_vectors.c with a default value
tag_map.h: maps 32bit to unsigned 8bit like mark_vector but is intended
tag_map.c to be more efficient for sparse arrays
ptr_vectors.h: vectors of (void*) pointers
ptr_vectors.c
pointer_vectors.h: vectors of (void *) pointers: similar to ptr_vectors
pointer_vectors.c but use the hidden header trick.
refcount_int_arrays.h: arrays of integers, with reference counters
refcount_int_arrays.c
sparse_arrays.h: arrays of integers (intended to be efficient if many
sparse_arrays.c array elements are never read or written)
use_vectors.h: vectors of tagged pointers (for implementing "use lists")
use_vectors.c
1.4.b) Queues
------
int_queues.h: queue of signed integers (implemented as a circular array)
int_queues.c
ptr_queues.h: queue of (void*) pointers (implemented as a circular array)
ptr_queues.c
1.4.c) Binary Heaps
------------
generic_heap.h: heap of signed 32bit integers, with an ordering function
generic_heap.c defined by the user.
int_heap.h: heap of int32_t integers, sorted in increasing order
int_heap.c (no duplicates, this stores a set)
int_heap2.h: heap of int32_t integers, user-provided ordering
int_heap2.c (duplicates are allowed. this stores a bag).
This is simpler than generic_heap: removal is not supported.
ptr_heap.h: heap of (void*) pointers, user-supplied ordering
ptr_heap.c
1.4.d) Sets/Collections
----------------
csets.h: Sets of integers (all elements are in an interval [0 .. n-1]
csets.c where n is fixed when the set is created)
int_bags.h: bags (multisets) of 32bit non-negative integers
int_bags.c implemented using resizable arrays.
int_bv_sets.h: sets of unsigned integers implemented using resizable bitvectors
int_bv_sets.c
ptr_sets.h: sets of (void*) pointers
ptr_sets.c
ptr_sets2.h: sets/bags of (void*) pointers (another implementation)
ptr_sets2.c
uint_rbtrees.h: Red-black trees to store sets of unsigned, 32bit integers
uint_rbtrees.c
1.4.e) Equivalence Relations/Partitions
--------------------------------
int_partitions.h: data structure to construct partitions of integers
int_partitions.c based on an equivalence relation provided by the user.
each non-singleton class is represented as an array of integer.
ptr_partitions.h: similar to int_partitions but for object represented by pointers
ptr_partitions.c rather than integers.
union_find.h: a union-find data structure for 32bit non-negative integers
union_find.c
1.4.f) Character Strings
-----------------
refcount_strings.h: character strings with reference counter ('\0' terminated)
refcount_strings.c
string_buffers.h: resizable string buffers
string_buffers.c
string_utils.h: utilities for string parsing and binary search in arrays of strings
string_utils.c
1.4.g) Hash tables
-----------
cache.h: a hash table that stores triples <tag, x, y>
cache.c also implements push/pop. It's used by the egraph and other solvers.
int_array_hsets.h: support for storing and hash-consing arrays of 32bit integers
int_array_hsets.c
int_hash_classes.h: hash table for maintaining equivalence classes of integers
int_hash_classes.c the table stores one representative per class
int_hash_map.h: maps int32 to int32, implemented as hash tables.
int_hash_map.c
int_hash_map2.h: maps pairs of int32 to int32, implemented as hash tables.
int_hash_map2,c
int_hash_sets.h: sets of unsigned integers (hash sets)
int_hash_sets.c
int_hash_tables.h: hash map (maps integers to integers). Intended to support hash-consing.
int_hash_tables.c more general than int_hash_map.h
pair_hash_map.h: maps pairs of int32 to (void *) pointers (hash table)
pair_hash_map.c
pair_hash_map2.h: maps pairs of int32 to int32 (more operations are supported than in
pair_hash_map2.c int_hash_map2)
pair_hash_sets.h: sets of pairs of integers (implemented as a hash table)
pair_hash_sets.c
ptr_hash_classes.h: hash table for maintaining equivalence classes of objects (identified
ptr_hash_classes.c by pointers). The table stores one representative per class
ptr_hash_map.h: maps int32 to (void *) pointers (hash table)
ptr_hash_map.c
simple_cache.h: fixed-size caches
simple_cache.c
string_hash_map.h: map strings to 32bit integers
string_hash_map.c
symbol_tables.h: symbol tables: hash map from strings to integers
symbol_tables.c with support for scoping
tuple_hash_map.h: hash map for arrays of int32 to int32 values
tuple_hash_map.c
2) TYPES AND TERMS
---------------
2.1) Rational and bitvector constants
--------------------------------
mpq_aux.h: GMP extensions: operations on multi-precision
mpq_aux.c rational numbers (mpq_t)
rationals.h: Yices rational numbers
rationals.c - a rational is represented as an integer pair num/den
or a GMP rational if required
extended_rationals.h: Extended rationals for dealing with strict inequalities in arithmetic solvers
extended_rationals.c - an extended rational is a pair of rationals <a, b>, interpreted as a + b\delta
where \delta is infinitesimal
bv_constants.h: Bitvector constants (of fixed size)
bv_constants.c
bv64_constants.h: Bitvector constants that can fit in an unsigned 64bit integer
bv64_constants.c
rational_hash_maps.h: Mappings from extended rationals to non-negative 32bit integers
rational_hash_maps.c (implemented using hash tables)
2.2) Arithmetic and polynomials
--------------------------
Arithmetic terms are represented as polynomials in fully-expanded form
(i.e., sums of monomials). Each monomial is a pair (coefficient,
index) and the monomials are sorted in increasing index order. There's
an end-marker monomial whose coefficient is uninitialized and whose
index is INT32_MAX.
There are three types of polynomials, depending on how the
coefficients are represented:
- polynomials: the coefficients are rationals
- bv64 polynomials: the coefficients are bitvector constants of no
more than 64bits
- bv polynomials: the coefficients are bitvector constants of
arbitrary size
The indices occurring in monomials and polynomials are 32bit
(non negative) signed integer:
- the special index const_idx = 0 is used to identify the constant
part of a polynomial
- the special index max_idx = INT32_MAX is used for end marker
- any other index refers to an arithmetic or bitvector term in a
global term table
A term index may be mapped to a power product, which is an array of
pairs <index, exponent>. The exponent is an unsigned 32bit integer
and the index refers to an arithmetic or bitvector term in a global
term table (as above).
There's a hard-coded limit of 2^30-1 on the degree of polynomials we
can represent/manipulate (this is a theoretical limit, most polynomial
construction will blow up well before that).
Many arithmetic operations require an intermediate object (buffer)
that stores a polynomial as a linked list. Arithmetic operations
modify the buffer, and the final result can be extracted/converted to
a polynomial or term.
The relevant source files are:
power_products.h: Power products = arrays of pairs (x_i, d_i)
power_products,c - variable x_i is an integer
- exponent d_i is a non-negative integer
Special representations are used (tagged pointers) for
simple products (e.g, x_i^1).
pprod_table.h: Table for hash-consing of power products.
pprod_table.c
polynomial_common.h: Types and constants common to all three types of polynomials.
polynomials.h: Polynomials with rational coefficients
polynomials.c
arith_buffers.h: Buffers for constructing rational polynomials
arith_buffers.c (Obsolete: the linked list representation was too
inefficient on some benchmarks that have long
sums of terms. Replaced by balanced_arith_buffers).
balanced_arith_buffers.h: Buffers for constructing rational polynomials.
balanced_arith_buffers.c The implementation is based on red-black trees.
poly_buffer.h: Simplified buffer used by the arithmetic solver
poly_buffer.c (more specialized, more efficient than arith_buffer).
bv64_polynomials.h: Polynomials with small bitvector coefficients
bv64_polynomials.c
bvarith64_buffers.h: Buffers for constructing these polynomials
bvarith64_buffers.c
bv_polynomials.h: Polynomials with arbitrary-size bitvector coefficients
bv_polynomials.c
bvarith_buffers.h: Buffers for constructing these polynomials
bvarith_buffers.c
bvpoly_buffers.h: Simplified buffer for polynomials with bitvector coefficients
bvpoly_buffers.c
2.3) Bit array expressions
---------------------
bit_expr.h: Bit expressions (i.e., boolean expressions represented as DAGs
bit_expr.c with nodes for XOR/OR and inverters) (variant of AIG).
bvlogic_buffers.h: Buffers for constructing the bitwise operation on bitvectors
bvlogic_buffers.c (e.g., bit masking, shifts, sign/zero extension). The buffer
stores the result of such operations as an array of n
bit expressions.
2.4) Term and type tables
--------------------
Types and terms are identified by an integer index. The index is
mapped to a descriptor stored in a global type or term table. We use
hash consing: distinct term indices refer to distinct term
descriptors; distinct type indices have distinct type descriptors.
There's support for attaching a name to each term or type, and for
garbage collection of unused types and terms.
types.h: Table of types + type constructors
types.c
terms.h: Table of terms and basic term constructors
terms.c
arith_buffer_terms.h: Operations involving arith_buffers and terms
arith_buffer_terms.c Obsolete: arith_buffers are replaced by
balanced_arith_buffers.
bvarith64_buffer_terms.h: Operations involving bvarith64_buffers and terms
bvarith64_buffer_terms.c
bvarith_buffer_terms.h: Operations involving bvarith_buffers and terms
bvarith_buffer_terms.c
bit_term_conversion.h: Conversion between bit_expr DAGs and term descriptors
bit_term_conversion.c
poly_buffer_terms.h: Operation involving poly_buffers and terms
poly_buffer_terms.c
rba_buffer_terms.h: Operation involving balanced arithmetic buffers
rba_buffer_terms.c (implemented as red-black trees) and terms.
term_utils.h: Utilities to help normalizing/simplifying terms
term_utils.c
conditionals.h: Generalization of if-then-else
conditionals.c
2.5) Auxiliary data structures for substitutions
-------------------------------------------
subst_context.h Store a mapping from int32 to int32 indices
subst_context.c with a scoping mechanism and hash consing
variable_renaming.h To rename bound variables by fresh variables
variable_renaming.c
renaming_context.h Subst context + variable renaming
renaming_context.c
subst_cache.h Store mapping (term, context) --> term
subst_cache.c
free_var_collector.h To compute the free variables of a term
free_var_collector.c
term_sets.h: Sets of terms (represented as hash-sets) to be
term_sets.c used by the elim_subst code.
5.5) Term and type management API
----------------------------
All operations available at the API are declared in yices.h and
implemented in yices_api.c. In particular all type and term
constructors are there.
The constructors check for well-formedness of their arguments
(including type checking) and implement term normalization and
simplification.
Main modules for this purpose:
term_manager.h: Main term-construction module. This is where most term
term_manager.c simplification/normalization functions are implemented.
term_substitution.h Stores a substitution + cache + renaming
term_substitution.c context + free variable collector (also implement
beta-reduction).
full_subst.h: Recursive substitutions: The full substitution
full_subst.c [x --> f(y), y --> a + b] removes both x and y. It's
equivalent to the term_substitution: [x --> f(a+b), y--> a+b].
full_subst includes support for building this type of substitution,
and for detecting/removing substitution cycles.
elim_subst.h: Extends full_subst: it builds a full_subst object from
elim_subst.c a set of literals and a set of variables to eliminates.
term_explorer.h: Make the internal term representation accessible via
term_explorer.c the API.
3) MODELS
------
3.1) Basics
------
abstract_values.h: Intermediate objects used by the function/array solver to
abstract_values.c construct models. The egraph converts these abstract values
to constants (concrete values) of appropriate types.
fun_maps.h: Maps built by the array solver using abstract values. A map
fun_maps.c has a default value + a finite list of pair (element -> val)
fun_trees.h: Tree structure used to force maps with infinite domain
fun_trees.c to be all distinct (cf. fun_solver.c).
concrete_values.h: Hash-consing + tagging of constants used in models.
concrete_values.c - concrete values include booleans, rationals, bitvectors, tuples,
functions and function updates
fresh_value_maker.h: Support for building fresh objects (concrete values) of a given
fresh_value_maker.c type.
small_bvsets.h: Set of bit-vector constants. Used by the bvsolver to create
small_bvsets.c fresh values when requested by the egraph. Compact representation
that works for small bit-vector width.
large_bvsets.h: Variant representation for larger bit width (not used).
large_bvsets.c - sets are stored in an inexact form using Bloom filter ideas
rb_bvsets.h: Another variant representation. Sets of bit-vector constants
rb_bvsets.c are stored in red-black trees. (That's what's currently used
in bv_solver)
models.h: Model representation: map terms to concrete values
models.c - optionally: a model can also include a substitution table
that map uninterpreted terms to other terms.
model_eval.h: Evaluator: compute the (concrete) value of a term in a model
model_eval.c
model_queries.h: Queries: get the values of one or more terms in a model,
model_queries.c also implement more efficient functions to check whether
a formula or set of formulas is true in a model.
val_to_term.h: Convert concrete values to constant terms (in terms.h)
val_to_term.c
term_to_val.h: Convert constant terms to concrete values
term_to_val.c
map_to_model.h: Convert a mapping to a model
map_to_model.c - the mapping assigns constant terms to uninterpreted term
- this module converts it to the model data structure
3.2) Implicants and Quantifier Elimination
-------------------------------------
literal_collector.h: Compute an implicant for a formula based on a model
literal_collector.c that satisfies the formula.
arith_projection.h: Model-based Quantifier Elimination for arithmetic
arith_projection.c (Fourier-Motzkin + a specialized form of Virtual
Term Substitution)
projection.h: Model-based Quantifier Elimination (general)
projection.c
generalization.h: Generalize from a model/counterexample.
generalization.c
4) SOLVERS
-------
4.1) Core/SAT solver
----------------
smt_core.h: CDCL-based SAT solver with support for connection to a theory solver
smt_core.c
smt_core_base_types.h: Type definitions (boolean variables, literals, truth values)
smt_core_printer.h: Print functions for the core
smt_core_printer.c
gates_hash_table.h: Support for hash-consing of boolean gates
gates_hash_table.c
gates_manager.h: Create/assert boolean gates and translate them to clauses
gates_manager.c
gates_printer.h: Print functions for Boolean gates
gates_printer.c
sat_solver.h: A separate SAT solver similar to core but without theory solver
sat_solver.c (it's used to build the yices_sat standalone SAT solver)
sat_parameters.h: Parameters for sat_solver.c
4.2) Egraph
------
egraph_base_types.h: Types used by the egraph.
egraph_types.h: Datatypes shared by all the egraph-related modules:
- egraph_utils.h/egraph_utils.c
- composites.h/composites.c
- egraph_explanations.h/egraph_explanations.c
- egraph.h/egraph.c
egraph_utils.h: Utilities to access the egraph_t structure
egraph_utils.c
composites.h: Support for construction of composite terms (for the egraph)
composites.c and implementation of a congruence table.
egraph_eq_stats.h: Data structure to collect statistics about the egraph
egraph_eq_stats.c (not used).
egraph_explanations.h: Generation of explanations from the egraph
egraph_explanations.c
egraph_assertion_queues.h: Queues to store equalities/disequalities/distinct predicate
egraph_assertion_queues.c that are propagated by the egraph to the satellite solvers.
theory_explanations.h: Data structure to store explanations produced by satellite solvers
theory_explanations.c
diseq_stacks.h: Stack that can be used by satellite solvers to store disequalities
diseq_stacks.c they receive from the egraph.
egraph.h: Main egraph functions
egraph.c
egraph_printer.h: Print functions
egraph_printer.c
4.3) Arithmetic solvers
------------------
4.3.a) Difference Logic Solvers
------------------------
dl_vartable.h: Table that stores variable descriptors for difference logic solvers
dl_vartable.c - each variable is mapped to a triple [x, y, c] (which denotes
the term x - y + c)
idl_floyd_warshall.h: Solver for integer difference logic problems, implemented using an
idl_floyd_warshall.c incremental form of the Floyd-Warshall algorithm (for dense problems)
idl_fw_printer.h: Print functions for the idl_floydwarshall solver
idl_fw_printer.c
rdl_floyd_warshall.h: Solver for real difference logic problems, implemented using an
rdl_floyd_warshall.c incremental form of the Floyd-Warshall algorithm (for dense problems)
rdl_fw_printer.h: Print functions for the rdl_floydwarshall solver
rdl_fw_printer.c
4.3.b) Simplex Solver
--------------
arith_vartable.h: Table of arithmetic variables: maps variables to a definition
arith_vartable.c - uses hash-consing, has support for push/pop/reset, supports
non-linear polynomials as definitions
arith_atomtable.h: Table of arithmetic atoms: supported atoms are (x >= c), (x <= c) or (x == c)
arith_atomtable.c where x is a variable and c is a rational constant
- uses hash-consing, has support for push/pop/reset
diophantine_systems.h: Subsolver (used by Simplex) to deal with linear diophantine equations
diophantine_systems.c
dsolver_printer.h: Print functions for the diophantine system solver.
dsolver_printer.c
matrices.h: Matrix representation used by the Simplex solver
matrices.c
offset_equalities.h: Support for processing equalities of the form x = y + k (where k is a constant)
offset_equalities.c (intended to be propagate equalities to the egraph)
simplex_types.h: Simplex-related type definitions
simplex_propagator0.h: Experimental code to implement theory propagation in the Simplex solver
simplex_propagator1.h
simplex_prop_table.h
simplex_prop_table.c
simplex.h: Simplex solver
simplex.c
simplex_printer.h: Print functions for the simplex solver
simplex_printer.c
4.4) Function/Array solver
---------------------
fun_solver.h: Solver for the function/array theory
fun_solver.c - deals with extensionality and array updates
fun_solver_printer.h: Print functions for the array solver
fun_solver_printer.c
7.5) Bit vector solver
-----------------
merge_table.h: Table for representing equivalence classes of variables
merge_table.c (union-find with support for push/pop)
remap_table.h: Support for building equivalence classes of pseudo literals
remap_table.c and for mapping these to real literals in the SAT solver
bit_blaster.h: Conversion of bit-vector operations to CNF
bit_blaster.c
bv_vartable.h: Table of bit-vector variables
bv_vartable.c
bv_atomtable.h: Table of bit-vector atoms
bv_atomtable.c
bvbound_cache.h: Hash table that stores lower and upper bounds on a variable x
bvbound_cache.c (if known).
bvconst_hmap.h: Mapping from variables to bit-vector constants (used by bvsolver during
bvconst_hmap.c model construction).
bvexp_table.h: Table that stores bitvector polynomials in fully expanded form.
bvexp_table.c (Used for simplification).
bv64_intervals.h: Data structure to store intervals defined by two bit-vector constants
bv64_intervals.c of no more than 64 bits. (Used by bvsolver for simplification)
bv_intervals.h: More general version: intervals defined by two bit-vector constants
bv_intervals.c with more than 64bits. (Used by bvsolver for simplification)
bvpoly_compiler.h: Support for converting bit-vector polynomials to more elementary
bvpoly_compiler.c terms built using binary add, binary product, etc.
bvpoly_dag.h: DAG of elementary bit-vector arithmetic operation (used
bvpoly_dag.c by bvpoly_compiler)
bvsolver_types.h: Data types used by the bitvector solver
bvsolver.h: Bit-vector solver
bvsolver.c
bvsolver_printer.h: Print functions for the bitvector solver
bvsolver_printer.c
dimacs_printer.h: Export a bitvector problem to the DIMACS format.
dimacs_printer.c (also works for pure Boolean problems).
5) CONTEXT
-------
A context stores a set of assertions and one or more solvers to deal
with these assertions. Processing formulas requires converting them
from the term representation used in the term table into the term
representation used by the solvers (we call that internalization).
Also the context performs formula simplification and supports push/pop,
and implements the toplevel solver and model construction procedures.
5.1) Internalization
----------------
internalization_codes.h: Utilities for tagging/untagging internalization codes
each code is 32bit and represents different objects
depending on its sign bit and low-order bits.
internalization_table.h: Table that maps external objects (terms) to
internalization_table.c solver objects (literals/theory variables).
The table can also store a variable substitution
(i.e., mapping form uninterpreted terms to other terms).
It supports push and pop.
internalization_printer.h: Print functions to display the internalization table.
internalization_printer.c
pseudo_subst.h: Store a candidate variable substitution.
pseudo_subst.c This is a mapping from uninterpreted term to other terms.
It can be turned into a real substitution after substitution
cycles are removed.
eq_abstraction.h: Equality abstraction: the abstraction of a formula F is
eq_abstraction.c the set of equalities implied by F (over a fixed set of terms)
- eq_abstraction implements the abstract domain (i.e. a term partition)
and the associated meet/join operations.
eq_learner.h: Computation of equality abstraction for a formula F
eq_learner.c
symmetry_breaking.h: Add constraints to break symmetries in QF_UF problems
symmetry_breaking.c
conditional_definitions.h: Data structures to reconstruct hidden conditional definitions
conditional_definitions.c in QF_LIA encodings.
context_simplifier.c: Simplification and preprocessing procedures used by context.c
- implements simplifications that are independent of the solvers
context.h: Top-level context module, intended to provide assert/push/pop/reset
context.c - implements the translation of yices terms (as provided by yices.h API)
into the egraph and solver(s) data structures
context_printer.h: Print internal context structures
context_printer.c
dump_context.h: Print context details (mostly for debugging).
dump_context.c
5.2) Solving
-------
context_solver.c: Global search algorithm for formulas asserted in a context
context_statistics.h: Print statistics on the search + others
context_statistics.c
6) EXISTS/FORALL SOLVER
--------------------
An exists/forall solver is intended to solve problems of the form (EXISTS x. FORALL y. P(x, y)).
The solution (if any) is an assignment for the variables x such that FORALL y. P(.., y) holds.
We implement this using two contexts: one search for candidate assignments for x, the other
tries to refute such candidates by finding counterexamples (i.e., assignments for y that
make P(..,y) false).
ef_problem.h: Data structure to store a problem of this form..
ef_problem.c
ef_analyze.h: Preprocessing, simplification, and construction of an ef_problem
ef_analyze.c structure from a set of assertions. This takes input of the
form FORALL y. P(x, y) and builds an ef_problem from this.
efsolver.h: Solver for an EF problem.
efsolver.c
7) API
---
yices_types.h: Types visible at the external API
yices_limits.h: Hardcoded limits on term/type representations
yices.h: (public) API
yices_exit_codes.h: Constants passed to the 'exit' system call on unrecoverable errors
yices_api.c: Implements all API functions and more
yices_error.h: Error messages based on an error_report structure
yices_error.c maintained by yices_api.c
yices_extensions.h: Functions defined in yices_api.c that are not part
of the API. These are variants of functions declared
in 'yices.h'.
yices_globals.h: Declare a global structure (maintained in yices.c) that
store pointers to the global tables and other global variables
maintained by yices.c.
yices_iterators.h: Functions to iterate over all contexts, models, etc.
(these functions are defined in yices_api.c)
yices_version_template.txt:
yices_version.c Version number + compilation + architecture.
yices_version.c is generated from yices_version_template.txt
when compiling (cf. src/Makefile).
context_config.h: Data structure to store context configuration info
context_config.c (logic + optional features + solvers)
search_parameters.h: Data structure to store options/settings used by the main
search_parameters.c solver functions.
smt_logic_codes.h: Convert the known SMT-LIB logic names (e.g., "QF_AUFLIA")
smt_logic_codes.c into a numerical code.
yval.h: DAG data structures to examine non-atomic values in a model
yval.c