Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,9 @@ jobs:
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ${{ runner.temp }}\vcpkg-binary-cache
key: vcpkg-${{ runner.os }}-x64-windows-d015e31e90838a4c9dfa3eed45979bc70d9357fc-${{ hashFiles('vcpkg.json') }}
key: vcpkg-${{ runner.os }}-x64-windows-45f9f39362a4c52e2b1fbe57b7e649db7f3d96d4-${{ hashFiles('vcpkg.json') }}
restore-keys: |
vcpkg-${{ runner.os }}-x64-windows-d015e31e90838a4c9dfa3eed45979bc70d9357fc-
vcpkg-${{ runner.os }}-x64-windows-45f9f39362a4c52e2b1fbe57b7e649db7f3d96d4-

- name: Setup vcpkg
shell: pwsh
Expand All @@ -439,7 +439,7 @@ jobs:
$vcpkgBinaryCache = Join-Path $env:RUNNER_TEMP "vcpkg-binary-cache"
New-Item -ItemType Directory -Force -Path $vcpkgBinaryCache | Out-Null
git clone https://github.com/microsoft/vcpkg $vcpkgRoot
git -C $vcpkgRoot checkout d015e31e90838a4c9dfa3eed45979bc70d9357fc
git -C $vcpkgRoot checkout 45f9f39362a4c52e2b1fbe57b7e649db7f3d96d4
& (Join-Path $vcpkgRoot "bootstrap-vcpkg.bat") -disableMetrics
"VCPKG_ROOT=$vcpkgRoot" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"VCPKG_DEFAULT_BINARY_CACHE=$vcpkgBinaryCache" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Expand Down
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,8 @@ if(BUILD_TESTING)
Int::Arithmetic::Max::Nary
Int::Cumulative::Man::Fix::0::4
Int::Distinct::Random
Int::Extensional::Reg::Sparse::NFAPrefix
Int::Extensional::Reg::Sparse::RandomNFADifferential
Int::Extensional::TupleSet::Sparse::IncrementalDelta
Int::Extensional::TupleSet::Auto::DefaultDispatch
Int::Linear::Bool::Int::Lq
Expand Down
2 changes: 2 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,8 @@ CHECKTESTS = Branch::Int::Dense::3 \
Int::Arithmetic::Max::Nary \
Int::Cumulative::Man::Fix::0::4 \
Int::Distinct::Random \
Int::Extensional::Reg::Sparse::NFAPrefix \
Int::Extensional::Reg::Sparse::RandomNFADifferential \
Int::Extensional::TupleSet::Sparse::IncrementalDelta \
Int::Extensional::TupleSet::Auto::DefaultDispatch \
Int::Linear::Bool::Int::Lq \
Expand Down
26 changes: 26 additions & 0 deletions changelog.in
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,32 @@
# optional section in the html page.
#

[RELEASE]
Version: 6.5.0
Date: unreleased
[DESCRIPTION]
This is the development changelog for the next Gecode release.

[ENTRY]
Module: int
What: performance
Rank: major
[DESCRIPTION]
Reduce construction memory for regular constraints by building the layered
graph from sparse forward frontiers and retaining only backward co-reachable
states. This avoids allocating one temporary state for every automaton state
at every sequence position while preserving the persistent graph.

[ENTRY]
Module: int
What: new
Rank: major
[DESCRIPTION]
Add DFA::nfa factories for finite automata with nondeterministic transitions.
The factories retain nondeterminism without determinization or minimization;
epsilon transitions are not supported. Regular propagation now preserves
branching assigned prefixes when cloning such automata.

[RELEASE]
Version: 6.4.0
Date: 2026-07-15
Expand Down
33 changes: 30 additions & 3 deletions gecode/int.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2192,7 +2192,12 @@ namespace Gecode {
*/

/**
* \brief Deterministic finite automaton (%DFA)
* \brief Finite automaton with deterministic construction by default
*
* The constructors and init() require deterministic transitions.
* Use nfa() to retain nondeterministic transitions without determinization
* or minimization. Every transition consumes one symbol; epsilon
* transitions are not supported.
*
* After initialization, the start state is always zero.
* The final states are contiguous ranging from the first to the
Expand Down Expand Up @@ -2301,6 +2306,28 @@ namespace Gecode {
GECODE_INT_EXPORT
DFA(int s, std::initializer_list<Transition> t,
std::initializer_list<int> f, bool minimize=true);
/**
* \brief Construct a nondeterministic finite automaton
*
* Start state is \a s. The last transition in \a t must have -1 as
* its input state, and the last final state in \a f must be -1.
* Multiple transitions may share an input state and symbol.
* Every transition consumes one symbol; epsilon transitions are not
* supported. Unreachable states are removed, but the automaton is
* neither determinized nor minimized.
*/
GECODE_INT_EXPORT
static DFA nfa(int s, Transition t[], int f[]);
/**
* \brief Construct a nondeterministic finite automaton from lists
*
* Start state is \a s, transitions are \a t, and final states are
* \a f. No sentinel elements are needed. As for the array overload,
* nondeterminism is retained and epsilon transitions are not supported.
*/
GECODE_INT_EXPORT
static DFA nfa(int s, std::initializer_list<Transition> t,
std::initializer_list<int> f);
/// Initialize by DFA \a d (DFA is shared)
DFA(const DFA& d);
/// Test whether DFA is equal to \a d
Expand Down Expand Up @@ -2717,7 +2744,7 @@ namespace Gecode {
* \brief Post domain consistent propagator for extensional constraint described by a DFA
*
* The elements of \a x must be a word of the language described by
* the DFA \a d.
* the automaton \a d, which may be constructed with DFA::nfa().
*
* Throws an exception of type Int::ArgumentSame, if \a x contains
* the same unassigned variable multiply. If shared occurrences of variables
Expand All @@ -2733,7 +2760,7 @@ namespace Gecode {
* \brief Post domain consistent propagator for extensional constraint described by a DFA
*
* The elements of \a x must be a word of the language described by
* the DFA \a d.
* the automaton \a d, which may be constructed with DFA::nfa().
*
* Throws an exception of type Int::ArgumentSame, if \a x contains
* the same unassigned variable multiply. If shared occurrences of variables
Expand Down
11 changes: 11 additions & 0 deletions gecode/int/extensional/dfa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,17 @@ namespace Gecode {
init(start,ts,fs,minimize);
}

DFA
DFA::nfa(int start, Transition t[], int f[]) {
return DFA(start,t,f,false);
}

DFA
DFA::nfa(int start, std::initializer_list<Transition> t,
std::initializer_list<int> f) {
return DFA(start,t,f,false);
}

bool
DFA::equal(const DFA& d) const {
assert(n_states() == d.n_states());
Expand Down
Loading
Loading