3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-14 21:08:46 +00:00
Commit graph

139 commits

Author SHA1 Message Date
Margus Veanes 8137143ada
string to regex approximation used to strengthen membership constraints (#4610)
* string to regex approximation used to strengthen membership constraints

* fixed pull request comments
2020-08-01 16:45:00 -07:00
Caleb Stanford 976e4c91b0
Integrate new regex solver (#4602)
* std::cout debugging statements

* comment out std::cout debugging as this is now a shared fork

* convert std::cout to TRACE statements for seq_rewriter and seq_regex

* add cases to min_length and max_length for regexes

* bug fix

* update min_length and max_length functions for REs

* initial pass on simplifying derivative normal forms by eliminating redundant predicates locally

* add seq_regex_brief trace statements

* working on debugging ref count issue

* fix ref count bug and convert trace statements to seq_regex_brief

* add compact tracing for cache hits/misses

* seq_regex fix cache hit/miss tracing and wrapper around is_nullable

* minor

* label and disable more experimental changes for testing

* minor documentation / tracing

* a few more @EXP annotations

* dead state elimination skeleton code

* progress on dead state elimination

* more progress on dead state elimination

* refactor dead state class to separate self-contained state_graph class

* finish factoring state_graph to only work with unsigned values, and implement separate functionality for expr* logic

* implement get_all_derivatives, add debug tracing

* trace statements for debugging is_nullable loop bug

* fix is_nullable loop bug

* comment out local nullable change and mark experimental

* pretty printing for state_graph

* rewrite state graph to remove the fragile assumption that all edges from a state are added at a time

* start of general cycle detection check + fix some comments

* implement full cycle detection procedure

* normalize derivative conditions to form 'ele <= a'

* order derivative conditions by character code

* fix confusing names m_to and m_from

* assign increasing state IDs from 1 instead of using get_id on AST node

* remove elim_condition call in get_dall_derivatives

* use u_map instead of uint_map to avoid memory leak

* remove unnecessary call to is_ground

* debugging

* small improvements to seq_regex_brief tracing

* fix bug on evil2 example

* save work

* new propagate code

* work in progress on using same seq sort for deriv calls

* avoid re-computing derivatives: use same head var for every derivative call

* use min_length on regexes to prune search

* simple implementation of can_be_in_cycle using rank function idea

* add a disabled experimental change

* minor cleanup comments, etc.

* seq_rewriter cleanup for PR

* typo noticed by Nikolaj

* move state graph to util/state_graph

* re-add accidentally removed line

* clean up seq_regex code removing obsolete functions and comments

* a few more cleanup items

* remove experimental functionality for integration

* fix compilation

* remove some tracing and TODOs

* remove old comment

* update copyright dates to 2020

* feedback from Nikolaj

* use [] for map access

* make state_graph methods constant

* avoid recursion in mark_dead_recursive and mark_live_recursive

* a possible bug fix in propagate_nonempty

* write down list of invariants in state_graph

* implement partial invariant check and insert CASSERT statements

* expand on invariant check and tracing

* finish state graph invariant check

* minor tweaks

* regex propagation: convert first two axioms to propagations

* remove obsolete regex solver functionality

Co-authored-by: calebstanford-msr <t-casta@microsoft.com>
2020-07-30 13:54:49 -07:00
Nikolaj Bjorner b71a64365d sketch fixed-length heuristic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-27 19:34:32 -07:00
Nikolaj Bjorner e63992c8bd fix #4589
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-24 15:46:54 -07:00
Nikolaj Bjorner 780346c7ca address model generation bugs raised in #4518 and #4324
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-24 13:22:19 -07:00
Nuno Lopes 23e6adcad3 fix a couple hundred deref-after-free bugs due to .c_str() on a temporary string 2020-07-11 20:24:45 +01:00
Nikolaj Bjorner 5987d9ae20 cache computing strings and regexes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-02 11:14:29 -07:00
Nikolaj Bjorner 3b1149330d enable theory propagation of regex accept condition
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-17 13:42:40 -07:00
Nikolaj Bjorner 5a2b6d9c92 bounds on loop expressions 2020-06-11 00:04:41 -07:00
Nikolaj Bjorner e3d45b9850 refcount leaks
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-09 14:19:26 -07:00
Nikolaj Bjorner 4fdfc65b37 tune seq rewriting
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-09 13:30:39 -07:00
Nikolaj Bjorner 084cd335eb add (disabled) stubs for decomposing re-membership on regex
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-31 12:25:21 -07:00
Nikolaj Bjorner c92a63690d enable parsing (_ char ..)
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-29 17:47:24 -07:00
Nikolaj Bjorner f381d51c83 update badge
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-29 14:04:12 -07:00
calebstanford-msr c939195c10
add regex support for reverse and left/right derivative rewriting (#4477)
* partial work on adding 'reverse' (broken code)

* new op codes for derivative and reverse + associated rewrite rules

* incorporate reverses and derivatives in rewriter + some fixes

* enable rewriting str.in_re constraints with right derivative
2020-05-29 13:00:37 -07:00
Nikolaj Bjorner dbd90e5f86 dbg proagate_eq
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-27 10:33:45 -07:00
Nikolaj Bjorner a97bc65af4 hoist co-factors eagerly without adding axioms
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-25 15:10:45 -07:00
Nikolaj Bjorner d1d14111cb turn on Unicode parsing when they fit in 8 bits
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-22 10:41:19 -07:00
Nikolaj Bjorner 5844964d95 rename temporary macro
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-18 17:17:51 -07:00
Nikolaj Bjorner c8c02060ee another module level ifdef for #4382
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-18 15:01:27 -07:00
Murphy Berzish 152d6338f8
fix hex digit radix in unicode escape (#4356) 2020-05-17 19:07:51 -07:00
Nikolaj Bjorner 1def58bc9f optional unicode mode
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-17 19:06:34 -07:00
Nikolaj Bjorner 30f17b1509 fix #4355
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-17 12:28:30 -07:00
Nikolaj Bjorner fc8dfe3e40 seq
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-17 05:35:32 -07:00
Nikolaj Bjorner 34cc60410f additional str/re operators, remove encoding option from zstring
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-17 05:08:36 -07:00
Nikolaj Bjorner bfb38451d1 add unicode encoding back 2020-05-16 17:11:47 -07:00
Murphy Berzish 6f0a367357
add SMTLIB2.6 names for QF_SLIA and string-int conversion operators (#4341) 2020-05-16 14:31:47 -07:00
Nikolaj Bjorner 21c4d451d8 parse RegLan
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-16 14:26:53 -07:00
Nikolaj Bjorner 4753d93bb7 add some of the SMTLIB2.6 conventions and features to strings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-16 14:00:02 -07:00
Nikolaj Bjorner 1ab2ad07be outline of unicode parsing #4333
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-16 13:36:43 -07:00
Murphy Berzish 1f15033ca2
z3str3: remove legacy code (#4215)
* z3str3: remove legacy fixed-length overlap testing

parameter smt.str.fixed_length_overlap_models has been deprecated

* z3str3: remove legacy length/value testing algorithm and binary search heuristic

the following parameters are deprecated:
smt.str.use_binary_search
smt.str.binary_search_start
smt.str.fixed_length_models (the fixed-length model construction is now always used)

* z3str3: remove legacy regex unroll methods

* z3str3: remove unused methods and member variables
2020-05-06 13:07:04 -07:00
Nikolaj Bjorner 9c3f0190f4 fix #4069
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-23 20:53:13 -07:00
Nikolaj Bjorner 501aa7927d split into seq_axioms and seq_skolem
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-17 06:14:52 -07:00
Nikolaj Bjorner 835b57b775 fix #3961 fix #3940
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-14 17:33:44 -07:00
Nikolaj Bjorner a7aff1bcf0 fix regression on string ops
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-02 10:03:35 -07:00
Nikolaj Bjorner 57d430b3fd fix #3700
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-02 06:38:14 -07:00
Nikolaj Bjorner ab5905cf7f some adjustments for stack use on large strings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-01-12 22:08:24 -08:00
Nikolaj Bjorner 541658fe02 move to abstract symbols
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-01-10 12:14:13 -08:00
Nikolaj Bjorner 489448b869 fix #2762, fix #2750, add iterative unrolling to help on termination on sat instances (to address non-termination in #2759 and #2762)
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-11-30 18:05:24 -08:00
Nikolaj Bjorner a257ec0cc1 build warnings #2748
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-11-28 15:36:54 -08:00
Nikolaj Bjorner 64dd4e1c83 fix #2659
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-10-25 10:42:21 -07:00
Nikolaj Bjorner 4ce6b53d95 fix #2640
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-10-16 20:40:03 -07:00
Nikolaj Bjorner 4101652747 handle case where lower bound is above upper
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-09-20 09:54:18 -07:00
Nikolaj Bjorner cd0cd82eb7 add rewrites for #2575
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-09-20 08:55:53 -07:00
Nikolaj Bjorner 12034df11a add rewrites for #2575
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-09-20 02:16:30 -07:00
Nikolaj Bjorner 584eee2cf4 fixing #2448 and #2445 and #2443
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-08-02 15:06:34 -07:00
Nikolaj Bjorner 335543b374 adding comparison #2360
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-06-28 21:14:58 -07:00
Nikolaj Bjorner b2845d888e add get_lstring per #2286
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-05-22 18:32:57 +04:00
Nikolaj Bjorner 3e059a3a3b one must answer the call of the master of compilers #2258
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-05-07 05:49:16 +02:00
Nikolaj Bjorner 3c8fd83c97 implementing last-index-of #2089
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-03-22 12:29:50 -07:00