mirror of
https://github.com/Z3Prover/z3
synced 2026-03-04 12:40:23 +00:00
Adopt std::optional for try_get_value and try_get_size functions (#8268)
* Initial plan * Convert try_get_value and try_get_size to use std::optional Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Add unit tests for std::optional conversions and fix compilation error Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Address code review comments - improve readability and reduce code duplication Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
2e7b700769
commit
1bb471447e
14 changed files with 92 additions and 44 deletions
|
|
@ -18,6 +18,7 @@ Revision History:
|
|||
--*/
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include "ast/ast.h"
|
||||
#include "ast/arith_decl_plugin.h"
|
||||
#include "ast/bv_decl_plugin.h"
|
||||
|
|
@ -172,7 +173,7 @@ namespace datalog {
|
|||
|
||||
sort* mk_sort(const symbol& name, uint64_t domain_size);
|
||||
|
||||
bool try_get_size(const sort *, uint64_t& size) const;
|
||||
std::optional<uint64_t> try_get_size(const sort *) const;
|
||||
|
||||
bool is_finite_sort(sort* s) const {
|
||||
return is_sort_of(s, get_family_id(), DL_FINITE_SORT);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue