mirror of
https://github.com/Z3Prover/z3
synced 2025-10-20 22:30:32 +00:00
scaffoldin
This commit is contained in:
parent
4be2fc416f
commit
3c9c7105d3
5 changed files with 293 additions and 74 deletions
|
@ -1,78 +1,6 @@
|
|||
// Context for property propagation (e.g., which case of rule 4.2 applies)
|
||||
enum class property_mapping_case : unsigned {
|
||||
case1 = 0,
|
||||
case2 = 1,
|
||||
case3 = 3,
|
||||
};
|
||||
|
||||
/*++
|
||||
Copyright (c) 2025
|
||||
|
||||
Module Name:
|
||||
levelwise.h
|
||||
|
||||
Abstract:
|
||||
Levelwise algorithm property and mapping definitions (see levelwise paper).
|
||||
|
||||
--*/
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include "nlsat_types.h"
|
||||
|
||||
namespace nlsat {
|
||||
|
||||
/**
|
||||
* Properties for indexed roots, in the order specified by the levelwise paper.
|
||||
* The order is important for the algorithm and must match the paper exactly.
|
||||
*/
|
||||
enum class polynom_property : unsigned {
|
||||
ir_ord, // ir_ord(≼, s) for all ≼ for roots of level i and s ∈ Ri−1
|
||||
an_del, // an_del(p) for all p of level i
|
||||
non_null, // non_null(p) for all p of level i
|
||||
ord_inv_reducible, // ord_inv(p) for all reducible p of level i
|
||||
ord_inv_irreducible, // ord_inv(p) for all irreducible p of level i
|
||||
sgn_inv_reducible, // sgn_inv(p) for all reducible p of level i
|
||||
sgn_inv_irreducible, // sgn_inv(p) for all irreducible p of level i
|
||||
connected, // connected(i)
|
||||
an_sub, // an_sub(i)
|
||||
sample, // sample(s) for all s ∈ Ri of level i
|
||||
repr, // repr(I, s) for all I of level i and s ∈ ...
|
||||
holds,
|
||||
_count // always last: number of properties
|
||||
};
|
||||
|
||||
// Utility: property to string (for debugging, logging, etc.)
|
||||
inline const char* to_string(polynom_property prop) {
|
||||
switch (prop) {
|
||||
case polynom_property::ir_ord: return "ir_ord";
|
||||
case polynom_property::an_del: return "an_del";
|
||||
case polynom_property::non_null: return "non_null";
|
||||
case polynom_property::ord_inv_reducible: return "ord_inv_reducible";
|
||||
case polynom_property::ord_inv_irreducible: return "ord_inv_irreducible";
|
||||
case polynom_property::sgn_inv_reducible: return "sgn_inv_reducible";
|
||||
case polynom_property::sgn_inv_irreducible: return "sgn_inv_irreducible";
|
||||
case polynom_property::connected: return "connected";
|
||||
case polynom_property::an_sub: return "an_sub";
|
||||
case polynom_property::sample: return "sample";
|
||||
case polynom_property::repr: return "repr";
|
||||
case polynom_property::holds: return "holds";
|
||||
default: throw "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Property propagation mapping: for each property, the set of properties it implies (see levelwise paper, e.g., rule 4.2)
|
||||
// Example: property_dependencies[root_property::sgn_inv] = {root_property::ord_inv, ...}
|
||||
// Overload: property_dependencies with context (for rules like 4.2 with multiple cases)
|
||||
inline const std::vector<polynom_property> get_property_dependencies(polynom_property prop, property_mapping_case p_case) {
|
||||
// Each property has a table of vectors, one per context case
|
||||
static const std::vector<polynom_property> table[][10] = {
|
||||
|
||||
};
|
||||
return table[(unsigned)prop][(unsigned)p_case];
|
||||
}
|
||||
|
||||
|
||||
void lewelwise_project(polynomial_ref_vector & ps, var max_x);
|
||||
|
||||
} // namespace nlsat
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue