3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-11 19:53:34 +00:00
Commit graph

58 commits

Author SHA1 Message Date
Nikolaj Bjorner 823830181b butterfly effect with relevancy marking
bail out of infinite instantiation loop
2021-02-15 16:37:23 -08:00
Nikolaj Bjorner a152bb1e80 remove template Context dependency in every trail object 2021-02-08 15:41:57 -08:00
Nikolaj Bjorner 8f577d3943 remove ast_manager get_sort method entirely 2021-02-02 13:57:01 -08:00
Nikolaj Bjorner 12198d13ac fix #4794 2020-12-02 12:24:35 -08:00
Nikolaj Bjorner 98db260a93 relax unhandled condition 2020-11-14 14:58:43 -08:00
Nikolaj Bjorner 9fa17a432a bug fixes in nullability check
@veanes @cdstanford
2020-11-13 17:05:10 -08: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 86310a1a27 updated sat_smt
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-08-29 19:21:51 -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
Margus Veanes ae413365e9 further PR comment fixes 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 7fa5b31fe1
adding back dropped return statement (#4611) 2020-08-01 18:59:47 -07:00
Nikolaj Bjorner 06f34bd42b tidy
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-08-01 16:54:05 -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
Nikolaj Bjorner 97ed1cd07d don't rewrite empty/non-empty checking predicates
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-31 11:47:52 -07:00
Nikolaj Bjorner 615e2cf37c don't rewrite empty/non-empty checking predicates
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-31 11:47:52 -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 71a32f5bb2 remove unused
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-22 11:38:27 -07:00
Nikolaj Bjorner c0fbb31379 use nonse based seed for transition characters
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-24 12:07:37 -07:00
Nikolaj Bjorner 02f34ea4b1 address some crashes reported by Caleb
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-20 18:35:35 -07:00
Nikolaj Bjorner 1204671595 fix #4534
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-19 14:10:49 -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 865dfe0590 own refs
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-12 17:07:06 -07:00
Nikolaj Bjorner 41430cd128 register unhandled expressions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-12 16:12:24 -07:00
Nikolaj Bjorner b0da5409c1 substitute into non-ground regexes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-09 14:58:25 -07:00
Nikolaj Bjorner 08cc5bc2e5 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-09 11:39:26 -07:00
calebstanford-msr 1fd567d1e9
fix bug in seq rewriter op_cache::find (#4509)
* remove unneeded reverse case in derivative; placeholder for generalized lifted derivative

* experimental tweaks to RE rewriter to improve performance

* if-then-else lifting
(broken code -- preserving this commit in case this idea is useful later)

* if-then-else derivative optimizations: new approach templates

* implement if-then-else BDD normal form for derivatives
(code compiles but is still buggy)

* remove std::cout debugging for PR

* Revert "remove std::cout debugging for PR"

This reverts commit c7bdc44d31.

* debugging

* fix derivative interaction with reverse; add flags for left/right derivative and lifting over union/intersection

* remove debugging statements for PR

* Revert "remove debugging statements for PR"

This reverts commit 38e85a7288.

* revert some purely cosmetic changes from upstream; fix a bug

* revert unnecessary changes

* remove some redundant rewrites and add a new one for str.in_re(s, comp(r))

* add disabled rewrite for complement

* fix bug in op cache find (result was not saved)

* remove debugging std::cout for PR
2020-06-09 11:36:31 -07:00
Nikolaj Bjorner d2a12f6db5 tuning
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-07 12:52:13 -07:00
Nikolaj Bjorner ba1ca33637 normalization of union/intersection
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-06 12:54:44 -07:00
Nikolaj Bjorner ccea27de35 add nullable propagation instead of waiting for length assignment
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-06 12:11:04 -07:00
Nikolaj Bjorner 65b6ccd651 add nullable propagation instead of waiting for length assignment
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-06 11:32:43 -07:00
Nikolaj Bjorner 1b9fcc7098 integrate ite-normalized derivatives
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-05 17:28:48 -07:00
Nikolaj Bjorner 3a7df2c6ef fix various nullability checks in seq_regex
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-03 12:28:32 -07:00
Nikolaj Bjorner d372af4782 add stub for cheap equality propagation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-30 15:36:27 -07:00
Nikolaj Bjorner ce4e1d3cbb fresh index
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-29 19:54:50 -07:00
Nikolaj Bjorner d41ecda03e skip non-overlap simplification in rewriter
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-29 17:27:54 -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 3d9d52f742 add detection of string equalities
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-29 10:40:47 -07:00
Nikolaj Bjorner 6a90072a98 bug in non-member disjunction
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-28 12:03:40 -07:00
Nikolaj Bjorner 87f8da022e fix non-empty -> empty typo
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-27 12:13:25 -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 9dd8ebb474 fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-27 10:10:25 -07:00
Nikolaj Bjorner 94ffd63b51 change to iterative unfolding left build broken for some time
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-26 21:25:53 -07:00
Nikolaj Bjorner 9764007c97 lorem ipsum
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-26 20:55:02 -07:00
Nikolaj Bjorner 0c2c1861f1 add general purpose emptiness/non-emptiness check
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-26 20:50:18 -07:00
Nikolaj Bjorner 88e36c6bf3 add general purpose emptiness/non-emptiness check
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-26 20:42:21 -07:00
Nikolaj Bjorner 33cdc06eb4 merge
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-26 13:37:49 -07:00