3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-05 23:06:12 +00:00
z3/src/sat/sat_solver_core.h
davedets 6ac3075022
Remove unnecessary semicolons (Attempt 2) (#10020)
This is another PR towards the goal of getting Z3 to compile cleanly
when included via FetchContents into clang-tidy, which uses a pretty
strict set of warnings.

This is a second version of https://github.com/Z3Prover/z3/pull/9957. I
address @NikolajBjorner 's comments about not changing the semicolons
after macro invocations, because some editors work better with them
present. It now, to the best of my ability, only deletes semis:

* after the closing brace of namespace decl.
* after the closing brace of an extern "C" decl.
* after a function definition.

This PR is very large, but it consists entirely of deletions of
semicolons in these situations.

(If there was a way to update the previous PR, which had been closed,
and that is preferable, please let me know. I couldn't figure it out.)
2026-07-02 12:47:29 -07:00

62 lines
1.7 KiB
C++

/*++
Copyright (c) 2011 Microsoft Corporation
Module Name:
sat_solver_core.h
Abstract:
SAT solver API class.
Author:
Nikolaj Bjorner (nbjorner) 2019-02-06
Revision History:
--*/
#pragma once
#include "sat/sat_model_converter.h"
#include "sat/sat_types.h"
namespace sat {
class extension;
class solver_core {
protected:
reslimit& m_rlimit;
public:
solver_core(reslimit& l) : m_rlimit(l) {}
virtual ~solver_core() = default;
// add clauses
virtual void add_clause(unsigned n, literal* lits, status st) = 0;
void add_clause(literal l1, literal l2, literal l3, status st) {
literal lits[3] = {l1, l2, l3};
add_clause(3, lits, st);
}
// create boolean variable, tagged as external (= true) or internal (can be eliminated).
virtual bool_var add_var(bool ext) = 0;
virtual void set_external(bool_var v) {}
virtual void set_eliminated(bool_var v, bool f) {}
virtual void set_phase(literal l) { }
// optional support for user-scopes. Not relevant for sat_tactic integration.
// it is only relevant for incremental mode SAT, which isn't wrapped (yet)
virtual void user_push() { throw default_exception("optional API not supported"); }
virtual void user_pop(unsigned num_scopes) {}
virtual unsigned num_user_scopes() const { return 0;}
virtual unsigned num_scopes() const { return 0; }
// hooks for extension solver. really just ba_solver atm.
virtual extension* get_extension() const { return nullptr; }
virtual void set_extension(extension* e) { if (e) throw default_exception("optional API not supported"); }
};
}