1
0
This repository has been archived on 2025-03-06. You can view files and clone it, but cannot push or open issues or pull requests.
bytecode-benchmarks/include/minizinc/solvers/incremental_interfaces.hh
Jip J. Dekker b5f0d64642 Squashed 'prototype/' content from commit 91f7db00
git-subtree-dir: prototype
git-subtree-split: 91f7db00d45e7f991b5587ee07f09977ae311ee7
2021-07-29 14:28:24 +10:00

45 lines
1.1 KiB
C++

/* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
* Main authors:
* Jip J. Dekker <jip.dekker@monash.edu>
*/
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#pragma once
#include <minizinc/solver_instance.hh>
#include <string>
#ifdef ERROR // Microsoft.
#undef ERROR
#endif
namespace MiniZinc {
class RestartableSolverInstance {
public:
// Able to return to the solver into a position where no search decisions
// have been made. SolverInstance must allow addDefinition calls after
// restart call.
virtual void restart() = 0;
};
class TrailableSolverInstance : public RestartableSolverInstance {
public:
// Returns the number of stored states
virtual size_t states() = 0;
// Able to store the current solver state to the Trail.
virtual void pushState() = 0;
// Able to restore the last solver state that was saved to the Trail.
virtual void popState() = 0;
};
} // namespace MiniZinc