Skip to content

Commit

Permalink
enable par_then and par_or even if single threaded - fall back to seq…
Browse files Browse the repository at this point in the history
…uential mode
  • Loading branch information
NikolajBjorner committed Nov 16, 2024
1 parent f64d077 commit 750dd68
Showing 1 changed file with 3 additions and 23 deletions.
26 changes: 3 additions & 23 deletions src/tactic/tactical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,20 +444,10 @@ tactic * or_else(tactic * t1, tactic * t2, tactic * t3, tactic * t4, tactic * t5
return or_else(10, ts);
}

class no_par_tactical : public tactic {
public:
char const* name() const override { return "par"; }
void operator()(goal_ref const & in, goal_ref_buffer& result) override {
throw default_exception("par_tactical is unavailable in single threaded mode");
}
tactic * translate(ast_manager & m) override { return nullptr; }
void cleanup() override {}
};

#ifdef SINGLE_THREAD

tactic * par(unsigned num, tactic * const * ts) {
return alloc(no_par_tactical);
tactic* par(unsigned num, tactic* const* ts) {
return alloc(or_else_tactical, num, ts);
}

#else
Expand Down Expand Up @@ -606,21 +596,11 @@ tactic * par(tactic * t1, tactic * t2, tactic * t3, tactic * t4) {
return par(4, ts);
}

class no_par_and_then_tactical : public tactic {
public:
char const* name() const override { return "par_then"; }
void operator()(goal_ref const & in, goal_ref_buffer& result) override {
throw default_exception("par_and_then is not available in single threaded mode");
}
tactic * translate(ast_manager & m) override { return nullptr; }
void cleanup() override {}
};


#ifdef SINGLE_THREAD

tactic * par_and_then(tactic * t1, tactic * t2) {
return alloc(no_par_and_then_tactical);
return alloc(and_then_tactical, t1, t2);
}

#else
Expand Down

0 comments on commit 750dd68

Please sign in to comment.