Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network encodings and heuristics for planning #97

Closed
wants to merge 30 commits into from

Conversation

danbryce
Copy link
Member

@danbryce danbryce commented May 4, 2015

Tested the build and unit tests. Cherry picked only mine and Alex's commits.

@soonhokong
Copy link
Member

Hi Dan,

First of all, thanks for the contributions and all the hard works (esp, I understand that rebasing is non-trivial).

  1. I'm using clang++-3.5 and I had to fix a problem to compile the new code. I created a new branch on my repository and added a commit to fix the problem. After fixing it, I was able to compile it but it generated a few warnings. Could you take a look at the followings and fix them?

    /Users/soonhok/work/dreal3/src/opensmt/smtsolvers/Debug.C:154:65: warning: unused parameter 'withLiterals' [-Wunused-parameter]
    void CoreSMTSolver::printCurrentAssignment( ostream & out, bool withLiterals )
                                                                ^
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:42:41: warning: unused parameter 'c' [-Wunused-parameter]
    void heuristic::initialize(SMTConfig &c, Egraph &e, THandler* thandler,
                                          ^
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:42:52: warning: unused parameter 'e' [-Wunused-parameter]
    void heuristic::initialize(SMTConfig &c, Egraph &e, THandler* thandler,
                                                     ^
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:42:65: warning: unused parameter 'thandler' [-Wunused-parameter]
    void heuristic::initialize(SMTConfig &c, Egraph &e, THandler* thandler,
                                                                  ^
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:43:19: warning: unused parameter 'trail' [-Wunused-parameter]
        vec<Lit> *trail, vec<int> *trail_lim) {
                  ^
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:43:36: warning: unused parameter 'trail_lim' [-Wunused-parameter]
        vec<Lit> *trail, vec<int> *trail_lim) {
                                   ^
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:46:34: warning: unused parameter 'e' [-Wunused-parameter]
    void heuristic::inform(Enode * e){
                                   ^
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:118:30: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int level = 0; level <= m_stack_lim.size(); level++){
                       ~~~~~ ^  ~~~~~~~~~~~~~~~~~~
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:122:39: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
      indx_high = (m_stack_lim.size() == level ? m_stack.size() : m_stack_lim[level]);
                   ~~~~~~~~~~~~~~~~~~ ^  ~~~~~
    
    In file included from /Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.cpp:27:
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.h:122:50: warning: field 'autom' will be initialized after field 'myHeuristic' [-Wreorder]
    SubgoalCompare(int a, hybrid_heuristic& c) : autom(a), myHeuristic(c) {}
                                                 ^
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.cpp:121:24: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
      for(int j = 0; j < hinfo[2].size(); j++){
                     ~ ^ ~~~~~~~~~~~~~~~
    
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.cpp:277:70: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
    int bt_point = (trail_lim->size() == 0 ? 0 : (m_stack_lim.size() == trail_lim->size() ? m_stack.size() : m_stack_lim[trail_lim->size()]-1));
                                                  ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.cpp:280:30: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
    while(m_stack_lim.size() != trail_lim->size()) m_stack_lim.pop_back();
          ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.cpp:490:22: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    for(int i = 0; i < parallel_transitions.size(); i++){
                   ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.cpp:742:23: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    for (int i = 0; i < m_decision_stack.size(); i++){
                    ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.cpp:755:26: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    if(trail_lim->size() > m_stack_lim.size() )
       ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
    
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/plan_heuristic.cpp:124:36: warning: unused variable 'consts' [-Wunused-variable]
    unordered_set<Enode *> const & consts = e->get_constants();
                                   ^
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/plan_heuristic.cpp:306:31: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
      0 : (m_stack_lim.size() <= trail_lim->size() ?
           ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/plan_heuristic.cpp:311:30: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
    while(m_stack_lim.size() > trail_lim->size() && !m_stack_lim.empty())
          ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/plan_heuristic.cpp:348:26: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    if(trail_lim->size() > m_stack_lim.size() )
       ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/plan_heuristic.cpp:381:22: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
    for(int i = 0; i < m_decision_stack.size(); i++) {
                   ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
    /Users/soonhok/work/dreal3/src/opensmt/heuristics/plan_heuristic.cpp:492:6: warning: expression result unused [-Wunused-value]
     found_existing_value;
     ^~~~~~~~~~~~~~~~~~~~
    6 warnings generated.
    
  2. Please understand that it takes some time to process this pull-requests. This time, I really want to understand the changes. Since some techniques in the SAT-layer are beyond my knowledge, it takes some time for me to digest the changes. I will ask you or Nina when I have questions while reading the changes.

  3. So far, I mainly have worked on the theory solver of dReal while you've worked on the SAT solver part and other parts of dReal/dReach. We rarely modified the same file so far, and we were able to avoid a conflict without much efforts. Now, Nina (@nnarodytska) joins the dReal team and she is working on SAT part of dReal and other parts as well. For example, she implemented --short_sat option in dReal3 before we got this pull-request. She also implemented --multiple_soln option in the SAT layer. To avoid any potential conflicts/duplications, I think we need to discuss what to change before we start something. For me, the best way of doing it is to work via Github issue tracker (i.e. open an issue, discuss, and implement). Of course, I'm open to any alternatives and happy to hear other's opinion.

@danbryce
Copy link
Member Author

danbryce commented May 6, 2015

Hi Soonho,

I’ve fixed the warnings. I am using g++-4.9 (started after GLOG stopped working on g++-4.8). How do you want me to give you the changes? I can add to the pull request or push to your branch (mentioned below), but need access.

I’m happy to discuss what I’ve done to the SAT solver. Let me know when you have time.

Thanks,

Dan

On May 6, 2015, at 12:33 AM, Soonho Kong notifications@github.com wrote:

Hi Dan,

First of all, thanks for the contributions and all the hard works (esp, I understand that rebasing is non-trivial).

• I'm using clang++-3.5 and I had to fix a problem to compile the new code. I created a new branch on my repository and added a commit to fix the problem. After fixing it, I was able to compile it but it generated a few warnings. Could you take a look at the followings and fix them?

/Users/soonhok/work/dreal3/src/opensmt/smtsolvers/Debug.C:154:65: warning: unused parameter 'withLiterals' [-Wunused-parameter]
void CoreSMTSolver::printCurrentAssignment( ostream & out, bool withLiterals )
^
/Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:42:41: warning: unused parameter 'c' [-Wunused-parameter]
void heuristic::initialize(SMTConfig &c, Egraph &e, THandler* thandler,
^
/Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:42:52: warning: unused parameter 'e' [-Wunused-parameter]
void heuristic::initialize(SMTConfig &c, Egraph &e, THandler* thandler,
^
/Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:42:65: warning: unused parameter 'thandler' [-Wunused-parameter]
void heuristic::initialize(SMTConfig &c, Egraph &e, THandler* thandler,
^
/Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:43:19: warning: unused parameter 'trail' [-Wunused-parameter]
vec *trail, vec *trail_lim) {
^
/Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:43:36: warning: unused parameter 'trail_lim' [-Wunused-parameter]
vec *trail, vec *trail_lim) {
^
/Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:46:34: warning: unused parameter 'e' [-Wunused-parameter]
void heuristic::inform(Enode * e){
^
/Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:118:30: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
for (int level = 0; level <= m_stack_lim.size(); level++){
~~~~~ ^ ~~~~~~~~~~~~~~~~~~
/Users/soonhok/work/dreal3/src/opensmt/heuristics/heuristic.cpp:122:39: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
indx_high = (m_stack_lim.size() == level ? m_stack.size() : m_stack_lim[level]);
~~~~~~~~~~~~~~~~~~ ^ ~~~~~

In file included from /Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.cpp:27:
/Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.h:122:50: warning: field 'autom' will be initialized after field 'myHeuristic' [-Wreorder]
SubgoalCompare(int a, hybrid_heuristic& c) : autom(a), myHeuristic(c) {}
^
/Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.cpp:121:24: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
for(int j = 0; j < hinfo[2].size(); j++){
~ ^ ~~~~~~~~~~~~~~~

/Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.cpp:277:70: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
int bt_point = (trail_lim->size() == 0 ? 0 : (m_stack_lim.size() == trail_lim->size() ? m_stack.size() : m_stack_lim[trail_lim->size()]-1));
~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
/Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.cpp:280:30: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
while(m_stack_lim.size() != trail_lim->size()) m_stack_lim.pop_back();
~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
/Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.cpp:490:22: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
for(int i = 0; i < parallel_transitions.size(); i++){
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.cpp:742:23: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
for (int i = 0; i < m_decision_stack.size(); i++){
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
/Users/soonhok/work/dreal3/src/opensmt/heuristics/hybrid_heuristic.cpp:755:26: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
if(trail_lim->size() > m_stack_lim.size() )


/Users/soonhok/work/dreal3/src/opensmt/heuristics/plan_heuristic.cpp:124:36: warning: unused variable 'consts' [-Wunused-variable]
unordered_set<Enode *> const & consts = e->get_constants();
                            ^
/Users/soonhok/work/dreal3/src/opensmt/heuristics/plan_heuristic.cpp:306:31: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
0 : (m_stack_lim.size() <= trail_lim->size() ?
    ~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~
/Users/soonhok/work/dreal3/src/opensmt/heuristics/plan_heuristic.cpp:311:30: warning: comparison of integers of different signs: 'size_type' (aka 'unsigned long') and 'int' [-Wsign-compare]
while(m_stack_lim.size() > trail_lim->size() && !m_stack_lim.empty())
   ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
/Users/soonhok/work/dreal3/src/opensmt/heuristics/plan_heuristic.cpp:348:26: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
if(trail_lim->size() > m_stack_lim.size() )
~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
/Users/soonhok/work/dreal3/src/opensmt/heuristics/plan_heuristic.cpp:381:22: warning: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long') [-Wsign-compare]
for(int i = 0; i < m_decision_stack.size(); i++) {
            ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~
/Users/soonhok/work/dreal3/src/opensmt/heuristics/plan_heuristic.cpp:492:6: warning: expression result unused [-Wunused-value]
found_existing_value;
^~~~~~~~~~~~~~~~~~~~
6 warnings generated.

• Please understand that it takes some time to process this pull-requests. This time, I really want to understand the changes. Since some techniques in the SAT-layer are beyond my knowledge, it takes some time for me to digest the changes. I will ask you or Nina when I have questions while reading the changes.

• So far, I mainly have worked on the theory solver of dReal while you've worked on the SAT solver part and other parts of dReal/dReach. We rarely modified the same file so far, and we were able to avoid a conflict without much efforts. Now, Nina (@nnarodytska) joins the dReal team and she is working on SAT part of dReal and other parts as well. For example, she implemented --short_sat option in dReal3 before we got this pull-request. She also implemented --multiple_soln option in the SAT layer. To avoid any potential conflicts/duplications, I think we need to discuss what to change before we start something. For me, the best way of doing it is to work via Github issue tracker (i.e. open an issue, discuss, and implement). Of course, I'm open to any alternatives and happy to hear other's opinion.

—
Reply to this email directly or view it on GitHub.

@soonhokong
Copy link
Member

Hi @danbryce,

I’ve fixed the warnings.

Thank you!

I am using g++-4.9 (started after GLOG stopped working on g++-4.8).

I'm not sure about GLOG, but we do have some issues between the JSON library and g++-4.8. I opened an issue in upstream. In the meantime, using g++-4.9 is a workaround.

How do you want me to give you the changes?

I can easily cherry-pick the commit from your repository. Just let me know the commit (git SHASUM).

I’m happy to discuss what I’ve done to the SAT solver. Let me know when you have time.

Thanks. I'll do that.

@danbryce
Copy link
Member Author

danbryce commented May 6, 2015

How do you want me to give you the changes?

I can easily cherry-pick the commit from your repository. Just let me know the commit (git SHASUM).

https://github.com/danbryce/dreal3/feat-dan-pull-request

08775a9

@soonhokong
Copy link
Member

@danbryce, thank you!

danbryce and others added 24 commits May 7, 2015 04:31
fix(style)

fix(heuristic): avoid backtracking in heuristic unless required

fix(style)

fix(heuristic): avoid backtracking in heuristic unless required

fix(heuristic): avoid backtracking in heuristic unless required

fix(style)

feat(heuristics): checkpoint on implementing ode simulation

feat(heuristics): checkpoint on implementing ode simulation

feat(heuristics): checkpoint on implementing ode simulation

feat(heuristics): checkpoint on implementing ode simulation

feat(heuristics): checkpoint on implementing ode simulation

feat(heuristics): checkpoint on implementing ode simulation

feat(heuristics): checkpoint on implementing ode simulation

feat(heuristic): ode sim heuristic

cleanup
feat(heuristics): generalized time splitting heuristic

feat(heuristics): generalized time splitting heuristic

feat(dsolver): style
fix(CoreSMTSolver): print boolean part of model
fix(style)

fix(debugging): removed unnecessary debugging
… file

fix(heuristics): refactored variable selection heuristics to use common parent class and live in SMTSolver

feat(.gitignore)
…red heuristic interface

Forgot some new files.

Fixed compiling errors caused by updated code base.
Automata instanciation
Extended ile format syntax to accommodate for instanciation, network scope initialization
Internal mode name encoding
Initial SMT work

Discrete encoding (Hopefully). Sync really took a while...
Encoded benchmark (train) for k=0..2 in benchmarks/train-k*.txt

Rewrote discrete mode encoding to use synchronization variables. Jump precompostion will remain an experimental feature.
"Active" encoding.

Added continuous encoding
Renamed enforcing variable
Updated train benchmark encoding in benchmarks/networked_train_testing_grounds/

Forgot to add a "maintain" for the last iteration.

Changed invariant implication order
Added "active" formula to the last iteration since "maintain" requires the setting of gamma variables for the flow in the final mode-space
Added noop-transitions
Added unused variables in transitions for value propagation (x_1_0 = x_0_t)
Added dummy flows of gamma variables (gamma' = 0) to the flowmap since it's required for constructions such as x' = t * gamma
Added dummy flows for variables without flows to account for the satisfaction of the goal formula (Otherwise x_final_t might be dangling)
Added dumbed down generator model for testing of continuous behavior (dreach-networks/benchmarks/networked_train_testing_grounds/generator.drh
Added simple model for testing discrete behavior (dreach-networks/benchmarks/networked_train_testing_grounds/discrete_test.drh)
Updated benchmark outputs (dreach-networks/benchmarks/networked_train_testing_grounds/*.smt2)

Changed composition parser according to mail/documentation
Updated benchmarks accordingly

dan's train tweaks
…de mutex constraint to encoding

Added basic backwards compatability. Creation of singleton network.

Fixes to the backward compatability

Add option to parse the old file format to dReach runscript.

Removed old, uncommented code.
General clean up.

Removed pathgen and possibly related stuff by mistake. Put it back in.
…ncoding mutex for goal modes.

fix(cherry-pick)
The current approach is to always include the encodings of the whole network.
We introduce an options to change the behavior to filter out encodings of modes and related contraints, that are unreachable within k steps.
Execute either the dReach runscript with the -f option, or the bmc executable with the --length_filter options.

fix(style)
@soonhokong
Copy link
Member

@danbryce, --pathgen option in bmc is not working now. It outputs an SMT2 formula instead. Could you check?

@soonhokong
Copy link
Member

Yesterday, @nnarodytska and I reviewed the changes under opensmt directory. @nnarodytska also cleaned up the implementation of --short_sat in soonhokong@b24c394 to avoid duplication. I also made two additional commits which are pretty minor:

I think it's great and ready to be merged. At the same time, we have some questions about them:

  1. What is substitution in opensmt/egraph/Egraph.h?
  2. Could you explain the change at line 98 of opensmt/tsolvers/THandler.C? It always freezes all variables regardless of whether a variable is TAtom or not.
  3. What's the relationship between the heuristic-based suggestion and an existing theory-solver’s suggestion mechanism? Are they compatible or one overrides the other?
  4. We were wondering whether it's possible to implement a heuristics class inside of a theory solver when we saw that it follows theory solver's interface (inform, backtrack, etc). Then we also observed that it's using some information in the SAT-layer (i.e. trail). Is it why it's not possible to embed a heuristic class in a theory solver? In general, it would be great if you can elaborate what a heuristic class is doing.

FYI, I rebase the changes on the blessed/master and add them at https://github.com/soonhokong/dreal3/commits/feat-dan-pull-request.

@danbryce
Copy link
Member Author

danbryce commented May 7, 2015

@4lex4nder removed this and I’ve asked him to put it back. I’ll put it in the pull request once done.

On May 7, 2015, at 3:41 AM, Soonho Kong notifications@github.com wrote:

@danbryce, --pathgen option in bmc is not working now. It outputs an SMT2 formula instead. Could you check?


Reply to this email directly or view it on GitHub.

@soonhokong
Copy link
Member

@4lex4nder removed this and I’ve asked him to put it back. I’ll put it in the pull request once done.

@danbryce, I see. Thank you!

@danbryce
Copy link
Member Author

danbryce commented May 7, 2015

On May 7, 2015, at 4:02 AM, Soonho Kong notifications@github.com wrote:

Yesterday, @nnarodytska and I reviewed the changes under opensmt directory. @nnarodytska also cleaned up the implementation of --short_sat in soonhokong/dreal3@b24c394 to avoid duplication. I also made two additional commits which are pretty minor:

soonhokong/dreal3@854c4fb: refactoring
soonhokong/dreal3@c06eab2: cleaning up whitespace
I think it's great and ready to be merged. At the same time, we have some questions about them:

• What is substitution in opensmt/egraph/Egraph.h?

These are Booleans that were inferred or resolved out of the initial CNF. I need their inferred values in the output model. They are not mentioned in the “model" array or current assignment managed by the SAT solver.

• Could you explain the change at line 98 of opensmt/tsolvers/THandler.C? It always freezes all variables regardless of whether a variable is TAtom or not.

This resolved an issue where the MiniSAT preprocessor was incorrectly removing Boolean variables. See issue dreal/dreal2#66. The preprocessor attempts to eliminate unfrozen variables (see SimpSMTSolver::eliminate()). There was a case where it was eliminating some pure literals and it was causing me problems. I probably need to revisit this. Freezing all booleans is safe, but might be inefficient.

• What's the relationship between the heuristic-based suggestion and an existing theory-solver’s suggestion mechanism? Are they compatible or one overrides the other?

If you look at CoreSMTSolver::pickBranchLit(), then you’ll see where this works. Currently, the heuristic overrides the theory suggestion.

Previously, for hybrid system problems, I had the theory solver suggesting the mode paths via this interface. In my current work on planning, I needed suggestions for Booleans and thought it cleaner to remove this from the theory solver (which is unaware of Booleans).

There is no reason that the theory solver cannot again make suggestions. This might be a way to implement theory propagation.

• We were wondering whether it's possible to implement a heuristics class inside of a theory solver when we saw that it follows theory solver's interface (inform, backtrack, etc). Then we also observed that it's using some information in the SAT-layer (i.e. trail). Is it why it's not possible to embed a heuristic class in a theory solver? In general, it would be great if you can elaborate what a heuristic class is doing.

At the level of its interface, the heuristic class gets the literals (inform()), is asked for a suggestion (getSuggestion(), where it reads the trail) and backtracks (backtrack(), where it again reads the trail). It could probably remove the backtrack() method and do the necessary maintenance when asked for a suggestion next.

FYI, I rebase the changes on the blessed/master and add them at https://github.com/soonhokong/dreal3/commits/feat-dan-pull-request.


Reply to this email directly or view it on GitHub.

@soonhokong soonhokong force-pushed the master branch 2 times, most recently from b3bad86 to 5707f19 Compare August 21, 2015 02:08
@soonhokong soonhokong closed this May 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants