mirror of
https://github.com/Z3Prover/z3
synced 2025-11-02 20:47:52 +00:00
Spacer engine for HORN logic
The algorithms implemented in the engine are described in the following papers Anvesh Komuravelli, Nikolaj Bjørner, Arie Gurfinkel, Kenneth L. McMillan: Compositional Verification of Procedural Programs using Horn Clauses over Integers and Arrays. FMCAD 2015: 89-96 Nikolaj Bjørner, Arie Gurfinkel: Property Directed Polyhedral Abstraction. VMCAI 2015: 263-281 Anvesh Komuravelli, Arie Gurfinkel, Sagar Chaki: SMT-Based Model Checking for Recursive Programs. CAV 2014: 17-34
This commit is contained in:
parent
9f9dc5e19f
commit
5b9bf74787
54 changed files with 18050 additions and 3 deletions
99
src/muz/spacer/spacer_generalizers.h
Normal file
99
src/muz/spacer/spacer_generalizers.h
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
/*++
|
||||
Copyright (c) 2017 Microsoft Corporation and Arie Gurfinkel
|
||||
|
||||
Module Name:
|
||||
|
||||
spacer_generalizers.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Generalizer plugins.
|
||||
|
||||
Author:
|
||||
|
||||
Nikolaj Bjorner (nbjorner) 2011-11-22.
|
||||
Arie Gurfinkel
|
||||
Revision History:
|
||||
|
||||
--*/
|
||||
|
||||
#ifndef _SPACER_GENERALIZERS_H_
|
||||
#define _SPACER_GENERALIZERS_H_
|
||||
|
||||
#include "spacer_context.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
|
||||
namespace spacer {
|
||||
|
||||
// can be used to check whether produced core is really implied by
|
||||
// frame and therefore valid TODO: or negation?
|
||||
class lemma_sanity_checker : public lemma_generalizer {
|
||||
public:
|
||||
lemma_sanity_checker(context& ctx) : lemma_generalizer(ctx) {}
|
||||
virtual ~lemma_sanity_checker() {}
|
||||
virtual void operator()(lemma_ref &lemma);
|
||||
};
|
||||
|
||||
/**
|
||||
* Boolean inductive generalization by dropping literals
|
||||
*/
|
||||
class lemma_bool_inductive_generalizer : public lemma_generalizer {
|
||||
|
||||
struct stats {
|
||||
unsigned count;
|
||||
unsigned num_failures;
|
||||
stopwatch watch;
|
||||
stats() {reset();}
|
||||
void reset() {count = 0; num_failures = 0; watch.reset();}
|
||||
};
|
||||
|
||||
unsigned m_failure_limit;
|
||||
stats m_st;
|
||||
|
||||
public:
|
||||
lemma_bool_inductive_generalizer(context& ctx, unsigned failure_limit) :
|
||||
lemma_generalizer(ctx), m_failure_limit(failure_limit) {}
|
||||
virtual ~lemma_bool_inductive_generalizer() {}
|
||||
virtual void operator()(lemma_ref &lemma);
|
||||
|
||||
virtual void collect_statistics(statistics& st) const;
|
||||
virtual void reset_statistics() {m_st.reset();}
|
||||
};
|
||||
|
||||
class unsat_core_generalizer : public lemma_generalizer {
|
||||
struct stats {
|
||||
unsigned count;
|
||||
unsigned num_failures;
|
||||
stopwatch watch;
|
||||
stats() { reset(); }
|
||||
void reset() {count = 0; num_failures = 0; watch.reset();}
|
||||
};
|
||||
|
||||
stats m_st;
|
||||
public:
|
||||
unsat_core_generalizer(context &ctx) : lemma_generalizer(ctx) {}
|
||||
virtual ~unsat_core_generalizer() {}
|
||||
virtual void operator()(lemma_ref &lemma);
|
||||
|
||||
virtual void collect_statistics(statistics &st) const;
|
||||
virtual void reset_statistics() {m_st.reset();}
|
||||
};
|
||||
|
||||
class lemma_array_eq_generalizer : public lemma_generalizer {
|
||||
public:
|
||||
lemma_array_eq_generalizer(context &ctx) : lemma_generalizer(ctx) {}
|
||||
virtual ~lemma_array_eq_generalizer() {}
|
||||
virtual void operator()(lemma_ref &lemma);
|
||||
|
||||
};
|
||||
|
||||
class lemma_eq_generalizer : public lemma_generalizer {
|
||||
public:
|
||||
lemma_eq_generalizer(context &ctx) : lemma_generalizer(ctx) {}
|
||||
virtual ~lemma_eq_generalizer() {}
|
||||
virtual void operator()(lemma_ref &lemma);
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue