3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-12 20:18:18 +00:00
Commit graph

175 commits

Author SHA1 Message Date
Nikolaj Bjorner 0f29fff836 remove bit-vector dependencies in seq theory 2021-02-08 10:57:50 -08:00
Nikolaj Bjorner 4455f6caf8 move to get_sort as method, add opt_lns pass, disable xor simplification unless configured, fix perf bug in model converter update trail 2021-02-02 03:58:19 -08:00
Nikolaj Bjorner 520b24aab4 string escaping
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-01-30 04:58:58 -08:00
Nikolaj Bjorner 909257f856 remove family id externals
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-01-27 06:48:24 -08:00
Nikolaj Bjorner d3564f5b50 move unicode toggle to char-plugin
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-01-27 06:42:19 -08:00
Nikolaj Bjorner e969bd1c97 fully remove seq-based characters
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-01-27 06:26:44 -08:00
Nikolaj Bjorner 696b3c79b9 fixes to self-contained character unicode 2021-01-27 06:13:37 -08:00
Nikolaj Bjorner d0f1d8f59e move to unicode as stand-alone theory
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-01-27 05:46:45 -08:00
Nikolaj Bjorner 20332c6d3e adding char decl plugin for separate theory treatment
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-01-26 16:28:44 -08:00
Nikolaj Bjorner 33714ceb40 use _ 2021-01-26 14:56:48 -08:00
Nikolaj Bjorner 7dd7d83a36 make it easier to use string literals 2021-01-26 11:01:03 -08:00
Nikolaj Bjorner 47cb1d1207 remove bit-vector dependencies in theory_str_mc. See discussion #4939
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-01-23 13:03:06 -08:00
Nikolaj Bjorner 03fd251ccb streamline unicode/ascii toggling. Fix bit-width for unicode to 18 2021-01-23 11:11:44 -08:00
Nikolaj Bjorner 4e8ba8b160 regression fix, fix unicode mode 2021-01-21 22:06:15 -08:00
Nikolaj Bjorner dafee71500 reshuffle unicode support to use global parameter, and use bit-vectors on demand 2021-01-21 14:24:26 -08:00
Nikolaj Bjorner 5d10cb7af4 fix #4791 - diff is left associative
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-11-11 18:07:05 -08:00
Nikolaj Bjorner d64bc795f0 wrong assert, compiler warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-10-30 10:10:59 -07:00
Margus Veanes af54a79acc
fixing issue #4651 (#4666)
* fixing issue #4651

* regression fix

* fix #4662

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* reenabled lift_ites_throttled with an additional filter, without the filter finding the model in report #4651 goes from .02s to 20s, also updated pretty printing of regexes to be more accurate

* removing temp testing variable

* Allow to skip System.loadLibrary() calls from Java Native class (#4667)

* using intended utility methods for sort detection

* adding ack/model

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* add smt params dependency

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* missing file

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* deps

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* order

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* persist fields

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* dbg build

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* reset caches

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* sr

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* fix cmake build

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* shuffle dependencies

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* warnings /errors

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* update include

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* missing cmakelists

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* update cmake

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* add depend

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* add depend

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* virtual method

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* path

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* move parameters from ast/rewriter to params

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* move fpa

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* fix warnings

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* remove pragma

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* dbg

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* updated sat_smt

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* fix #4651

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* encoding options #4665

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* expose name inclusion as optional

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* fix misc issues around #4661 introduced when adding lazy push/pop to selected theories

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* remove lazy push from theory_lra

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* fix dotnet build

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* release nodes

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* free memory in egraph

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* avoid duplicate class names frame in sat_scc and sat_smt

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* adding euf

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* elaborate on smt/drat format outline, expose euf mode as config

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* mk-var during copy

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* move theory_var_list into id_var_list and utilities from smt-enode into it, prepare for theory variables in egraph

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* with bounded

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* Remove duplicate binary condition. Fixes #4668.

* butterfly effect on fp?

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* prepare for theory plugins

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* file

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* build fix

* remove SMTFD

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* na

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* SMTFD is back (#4676)

* fixing issue #4651

* regression fix

* reenabled lift_ites_throttled with an additional filter, without the filter finding the model in report #4651 goes from .02s to 20s, also updated pretty printing of regexes to be more accurate

* removing temp testing variable

* using intended utility methods for sort detection

* misc edits related to nonground regexes

* bug fix of state id off by 1 calculation error and improved pretty printing with regex tooltip generated in dgml state graph

* removed unused method declaration

* improved id to regex value map info in generated dgml

* reorgd callback function for state pretty printer

* updated some comments

Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
Co-authored-by: Sergey Vladimirov <vlsergey@gmail.com>
Co-authored-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
Co-authored-by: Arie Gurfinkel <arie.gurfinkel@gmail.com>
2020-09-08 04:13:18 -07:00
Nikolaj Bjorner 6beec7b642 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-08-24 02:04:44 -07:00
Margus Veanes 5e5ef50dbc
re info extension (#4659)
* made loop info calculation more accurate

* made loop info calculation more accurate

* updated formattig and added const declarations
2020-08-22 15:59:53 -07:00
Margus Veanes 1e29ba76d0 renamed compl method (compl is a reserved c++ keyword) to complement 2020-08-21 17:34:15 -07:00
Margus Veanes 7b478c8406 fixed loop lower bound bug in loop info and default nullable value in invalid_info 2020-08-21 15:59:56 -07:00
Margus Veanes 3fb226dcd6 added missing return statements, reordered def of compl to match declaration order of methods 2020-08-21 13:20:05 -07:00
Margus Veanes 1099c519ab took care of PR comments and fixed some info calculation bugs 2020-08-21 13:00:36 -07:00
Margus Veanes 93bc1bc983 extended calculation of info for regexes, updated tracing of state_graph with regex info 2020-08-21 13:00:36 -07:00
Margus Veanes de65c61ebc
renamed re to rex and added custom pretty printing for info (#4650) 2020-08-19 19:20:14 -07:00
Nikolaj Bjorner ed258ca019 approximate min-length for complements
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-08-18 22:04:09 -07:00
Margus Veanes c50e869e5a
computing and memoizing info for regexes (#4647)
* computing and memoizing info for regex expressions

* computing and memoizing info for regex expressions

* took care of comments of the related pull request

* removed +1 from min_length of ite

* added to_str method for re and fixed STRACE bug in get_info_rec
2020-08-18 20:01:59 -07:00
Nikolaj Bjorner c0a07f9229 tidy
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-08-14 04:26:59 -07:00
Margus Veanes 1233cb4621 added missing const declarations that caused build failure on some platforms 2020-08-13 20:04:35 -07:00
Margus Veanes 1567587b97 fixed bug in seq_unit 2020-08-13 18:14:21 -07:00
Margus Veanes e80b143e71 updated detection of when parenthesis can be omitted to cover empty and epsilon 2020-08-13 18:14:21 -07:00
Margus Veanes ae413365e9 further PR comment fixes 2020-08-13 18:14:21 -07:00
Margus Veanes 5f9a326910 took care of comments for related PR 2020-08-13 18:14:21 -07:00
Margus Veanes 2c33bd6faf pp support for regex expressions is more-or-less standard syntax 2020-08-13 18:13:51 -07:00
Caleb Stanford 2c02264a94
Regex solver updates (#4636)
* 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

* oops, missed merge change to fix compilation

* disabled change to lift unions to the top level and treat them seperately in seq_regex solver

* added get_overapprox_regex to over-approximate regex membership constraints

* replace calls to is_epsilon with a centrally available method in seq_decl_plugin

* simplifications and modifications in get_overapprox_regex and related

* added approximation support for sequence expressions that use ite

* removed is_app check that was redundant

* tweak differences with upstream

* rewrite derivative leaves

* enable Antimorov-style derivatives via lifting unions in the solver

* TODO placeholders for outputting state graph

* change order in seq_regex propagate_in_re

* implement a more restricted form of Antimorov derivatives via a special op code to indicate lifting unions

* minor

* new Antimorov optimizations based on BDD compatibility checking

* seq regex tracing for # of derivatives

* fix get_cofactors (currently this fix is buggy)

* partially revert get_cofactors buggy change

* re-implement get_cofactors to more efficiently explore nodes in the derivative expression

* dgml generation for state graph

* fix release build

* improved dgml output

* bug fixes in dgml generation

* dot output support for state_graph and moved dgml and dot output under CASSERT

* updated tracing of what regex corresponds to what state id with /tr:state_graph

* clean up & document Antimorov derivative support

* remove op cache tracing

* remove re_rank experimental idea

* small fix

* fix Antimorov derivative (important change for the good performance)

* remove unused and unnecessary code

* implemented simpler efficient get_cofactors alternative mk_deriv_accept

* simplifications in propagate_accept, and trace unusual cases

* document the various seq_regex tracing & debugging command-line options

* fix debug build (broken tracing)

* guard eager Antimorov lifting for possible disabling

* fix bug in propagate_accept Rule 1

* disable eager version of Antimorov lifting for performance reasons

* remove some remaining obsolete comments

Co-authored-by: calebstanford-msr <t-casta@microsoft.com>
Co-authored-by: Margus Veanes <margus@microsoft.com>
2020-08-13 12:47:36 -07:00
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