Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
81c8c1d
Add missing statistics prints for `. A` and PM Dumps on execution b…
kunalsheth Dec 25, 2025
92d82df
Fix segfault on certain SAR-ADC problems: when Integral constraint's …
kunalsheth Dec 27, 2025
64c5cae
Expand concept of "dummy" Variables in dreal/drake ASTs with negative…
kunalsheth Dec 27, 2025
e37594d
Make std::vector<Variable> order-able for use as key in std::set.
kunalsheth Dec 27, 2025
5f3bf4b
Include variable sort/type (but not name) in alpha-hashing.
kunalsheth Dec 27, 2025
74513c0
Fix bugs in alpha-hashing for commutative AST nodes (`alpha_hash_map(…
kunalsheth Dec 27, 2025
8b6c14e
Reorganize pattern matching folder.
kunalsheth Dec 27, 2025
ddc6a45
Implement DeBruijn/Hashing-based pattern matcher.
kunalsheth Dec 27, 2025
d01dec5
Add temporary implementation for quantifiers in DeBruijnCanonicalizer…
kunalsheth Dec 27, 2025
49d5738
FIX descending ordering of explanation literals before pattern matching.
kunalsheth Dec 27, 2025
0af74c6
Remove unnecessary 'indices' indirection layer in DeBruijnCanonicaliz…
kunalsheth Dec 27, 2025
ca64aec
Set DRPM max size and max time via CLI instead of compile-time.
kunalsheth Dec 27, 2025
da6734f
Remove 'DREAL_EXPERIMENTAL_PATTERN_MATCH_' macros.
kunalsheth Dec 27, 2025
4ce0ebe
Improve --version printout clarity.
kunalsheth Dec 27, 2025
3c1de59
Cleanup macros in version.h.
kunalsheth Dec 27, 2025
4828a92
Fix compile error on CentOS— bad call to std::find, since `==` does n…
kunalsheth Dec 27, 2025
ad6cdb1
Add pattern matching implementation to version string.
kunalsheth Dec 27, 2025
ee096be
Implement substitution_tree.cc data structure for more efficient alph…
kunalsheth Dec 28, 2025
7aa02bd
Switch `substitutions_map` bijection data structure from std::unorder…
kunalsheth Dec 28, 2025
fd6a3e5
Re-enable the `ComplicatedMultiplicationExpression` pattern matching …
kunalsheth Dec 28, 2025
21b7955
Make returning of substitution_maps alongside alpha-equivalent Formul…
kunalsheth Dec 29, 2025
1ec5b67
Add missing includes for Linux build.
kunalsheth Dec 29, 2025
b8c41f3
Check for cache hits during DeBruijnCanonicalizer.cc insertion.
kunalsheth Dec 29, 2025
47d046e
Change "Failed to configure desired stack size limit." message from f…
kunalsheth Dec 29, 2025
98dda94
Update docker build to ubuntu 24.04 LTS.
kunalsheth Dec 29, 2025
3efcebe
Tweak matching_stats_t misses to be array instead of hardcoded fields.
kunalsheth Jan 1, 2026
ffab058
Add CAV26 symmetry filtering and remove `GENERATE_HEURISTICS_CSV` fun…
kunalsheth Jan 1, 2026
f141d89
Remove now-defunct pattern_matching_heuristic.cc/h.
kunalsheth Jan 1, 2026
aa8803b
Fix using matching_stats_t = struct / typedef struct compile error on…
kunalsheth Jan 1, 2026
38c534e
Remove now-defunct predicate_heuristic.cc/h.
kunalsheth Jan 1, 2026
8323d38
Remove now-defunct predicate_heuristic.cc/h.
kunalsheth Jan 1, 2026
7e01f9b
Remove CAV26 symmetry filtering from substitutions_map.cc.
kunalsheth Jan 3, 2026
7f2be6b
Add `metadata_tags` and `was_not_added` fields to `pm_dump_all(..)` j…
kunalsheth Jan 3, 2026
61efc21
Switch CAV26 parser's `t` field from double to optional<int>.
kunalsheth Jan 3, 2026
d81814d
Add caching to CAV26 variable name parser.
kunalsheth Jan 3, 2026
ebe09de
Add concept of `CAV26_NOT_PURE_ANY` to identify mixed symmetries.
kunalsheth Jan 3, 2026
837688e
Implement symetry filtering at the lemma-level and add deeper telemetry.
kunalsheth Jan 3, 2026
3537c06
Fix CAV26 sym. version string printout.
kunalsheth Jan 5, 2026
d12b74a
Implement randomization in substitution_tree.cc iteration for pattern…
kunalsheth Jan 5, 2026
9e37ebb
Slightly increase PM timeout for very-long-running lemmas.
kunalsheth Jan 6, 2026
4b44670
Make threshold value for fixed-point a macro.
kunalsheth Jan 7, 2026
bacf835
chore: add Apache-2.0 LICENSE and NOTICE for FMCAD26 artifact release
kunalsheth Jul 4, 2026
9cf8cca
build: DREAL_EXE_LINKER_FLAGS build-arg for a fully-static Linux binary
kunalsheth Jul 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions Dockerfile.dreal_ubuntu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:20.04
FROM ubuntu:24.04

RUN DEBIAN_FRONTEND="noninteractive" apt-get update && apt-get -y install tzdata

Expand All @@ -17,6 +17,7 @@ RUN apt-get update \
ENV CC="/usr/bin/clang-18"
ENV CXX="/usr/bin/clang++-18"

RUN apt-get install -y xz-utils
RUN cd / && \
wget https://gmplib.org/download/gmp/gmp-6.3.0.tar.xz && \
tar -xf gmp-6.3.0.tar.xz
Expand Down Expand Up @@ -71,23 +72,28 @@ RUN rm /usr/local/lib/libgmpxx.so*
# for ODEs... all installs from dReal3
RUN apt-get update \
&& apt-get install -y \
build-essential \
autoconf \
automake \
build-essential \
git-svn \
libtool \
pkg-config \
python3 python3-dev \
software-properties-common \
texinfo \
python python3 python-dev python3-dev


texinfo

# BEGIN DREAL BUILD
RUN mkdir /dreal/
COPY src/ /dreal/src
COPY test/ /dreal/test
COPY CMakeLists.txt /dreal/CMakeLists.txt
COPY FULL_BUILD.sh /dreal/FULL_BUILD.sh
RUN /dreal/FULL_BUILD.sh
# Linker flags applied to the top-level dreal4 executable ONLY (not the FILIB/CAPD
# autotools sub-builds, which break under a global LDFLAGS=-static). Build with
# --build-arg DREAL_EXE_LINKER_FLAGS=-static
# to produce a fully static dreal4 (portable binary for the FMCAD26 release).
# Empty default preserves the normal (dynamic) image build.
ARG DREAL_EXE_LINKER_FLAGS=""
RUN /dreal/FULL_BUILD.sh -DCMAKE_EXE_LINKER_FLAGS="${DREAL_EXE_LINKER_FLAGS}"

WORKDIR /dreal/gcc_build/
2 changes: 1 addition & 1 deletion FULL_BUILD.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cd "$(dirname "$0")"
mkdir gcc_build

cd gcc_build &&
cmake -DCMAKE_BUILD_TYPE=Release .. &&
cmake -DCMAKE_BUILD_TYPE=Release "$@" .. &&
cmake --build . --target dreal4 -j8 &&
cd ../ &&
echo -e "\a DONE! \a"
Expand Down
201 changes: 201 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

1. Definitions.

"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.

"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.

"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.

"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.

"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.

"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).

"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.

"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."

"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.

2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.

3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.

4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:

(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and

(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and

(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and

(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.

You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.

5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.

9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
16 changes: 16 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
dReal
Copyright 2017 Toyota Research Institute

This product includes software developed at Toyota Research Institute
(https://github.com/dreal/dreal4), licensed under the Apache License,
Version 2.0.

This distribution is a research fork maintained by the ncsys-lab group at
Stanford University (https://github.com/ncsys-lab/dReal-CMake), packaged as
the FMCAD26 artifact. Modifications are covered by the same Apache License,
Version 2.0 (see the LICENSE file), and are noted in the source history.

Third-party components are redistributed under their own licenses, including
IBEX (LGPL-3.0), CAPD, Drake symbolic (BSD-3-Clause), fmt (MIT), spdlog (MIT),
nlopt, libcds, and a vendored ThreadPool. See the respective source trees for
their full license texts.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ In this directory, run:
docker build --platform linux/amd64 -t dreal/my_dreal_image:1.0 -f Dockerfile.dreal_ubuntu .
```

This will probably take 20+ minutes.
This takes 30–40 minutes on my M4 MacBook Pro (cold start).

### Execute
```
Expand Down
50 changes: 44 additions & 6 deletions src/dreal/contractor/odes/contractor_odes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,16 @@ namespace dreal

// Special Case: Time = [0, 0]
// Intersect X_0 and X_t and return
if (cs->mutable_box()[get_variable(icc->get_time_t())].ub() == 0.0) {

// dReal3:
// if (cs->mutable_box()[get_variable(icc->get_time_t())].ub() == 0.0) {
// Kunal Fix:
const auto &icct = icc->get_time_t();
if (
(is_variable(icct) && cs->mutable_box()[get_variable(icct)].ub() == 0.0) ||
is_constant(icct, 0.0)
) {

for (unsigned i = 0; i < m_vars_0.size(); ++i) {
auto& iv_0_i = cs->mutable_box()[m_vars_0[i]];
auto& iv_t_i = cs->mutable_box()[m_vars_t[i]];
Expand Down Expand Up @@ -324,8 +333,23 @@ namespace dreal
}
capd::IVector X_0 = extract_ivector(cs->mutable_box(), m_vars_0);
capd::IVector X_t = extract_ivector(cs->mutable_box(), m_vars_t);
ibex::Interval const& ibex_T = cs->mutable_box()[get_variable(icc->get_time_t())];
capd::interval T(ibex_T.lb(), ibex_T.ub());

// dReal3 code:
// ibex::Interval const& ibex_T =
// is_constant(icc->get_time_t())
// cs->mutable_box()[get_variable(icc->get_time_t())];
// capd::interval T(ibex_T.lb(), ibex_T.ub());
// Kunal's Fix:
capd::interval T;
const auto& icct = icc->get_time_t();
if (is_variable(icct)) {
const auto& iv = cs->box()[get_variable(icct)];
T = capd::interval(iv.lb(), iv.ub());
}
else if (is_real_constant(icct)) T = capd::interval(get_lb_of_real_constant(icct), get_ub_of_real_constant(icct));
else if (is_constant(icct)) T = capd::interval(get_constant_value(icct));
else DREAL_UNREACHABLE();

// DREAL_LOG_INFO("X_0 : ", X_0);
// DREAL_LOG_INFO("X_t : ", X_t);
// DREAL_LOG_INFO("T : ", T);
Expand Down Expand Up @@ -408,7 +432,8 @@ namespace dreal
// SAT
update_box_with_ivector(cs->mutable_box(), m_vars_t, X_t);
// TODO(soonhok): Here we still assume that time_0 = zero.
cs->mutable_box()[get_variable(icc->get_time_t())] = ibex::Interval(T.leftBound(), T.rightBound());
if (is_variable(icct))
cs->mutable_box()[get_variable(icc->get_time_t())] = ibex::Interval(T.leftBound(), T.rightBound());
DREAL_LOG_DEBUG("contractor_capd_full::prune: get non-empty set after filtering");
}
else {
Expand Down Expand Up @@ -539,8 +564,21 @@ namespace dreal
(m_dir == ode_direction::FWD) ? icc->get_pars_0() : icc->get_pars_t();
capd::IVector X_0 = extract_ivector(b, vars_0);
capd::IVector X_t = extract_ivector(b, vars_t);
ibex::Interval const& ibex_T = b[get_variable(icc->get_time_t())];
capd::interval T(ibex_T.lb(), ibex_T.ub());

// dReal3 code:
// ibex::Interval const& ibex_T = b[get_variable(icc->get_time_t())];
// capd::interval T(ibex_T.lb(), ibex_T.ub());
// Kunal's Fix:
capd::interval T;
const auto& icct = icc->get_time_t();
if (is_variable(icct)) {
const auto& iv = b[get_variable(icct)];
T = capd::interval(iv.lb(), iv.ub());
}
else if (is_real_constant(icct)) T = capd::interval(get_lb_of_real_constant(icct), get_ub_of_real_constant(icct));
else if (is_constant(icct)) T = capd::interval(get_constant_value(icct));
else DREAL_UNREACHABLE();

Rect2Set rs(X_0);
(*m_timeMap)(0.0, rs); // Rewind to 0.0
m_timeMap->stopAfterStep(true);
Expand Down
Loading