mCRL2
Loading...
Searching...
No Matches
with_prover.h
Go to the documentation of this file.
1// Author(s): Muck van Weerdenburg
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
11
12#ifndef MCRL2_DATA_DETAIL_REWR_PROVER_H
13#define MCRL2_DATA_DETAIL_REWR_PROVER_H
14
16
17namespace mcrl2
18{
19namespace data
20{
21namespace detail
22{
23
25{
26 public:
28
30
31 public:
33 const used_data_equation_selector& equations_selector)
34 : Rewriter(data_spec, equations_selector),
35 prover_obj(data_spec, equations_selector, strat)
36 {
38 }
39
41 {}
42
44 {
46 {
47 case jitty:
48 return jitty_prover;
49#ifdef MCRL2_ENABLE_JITTYC
50 case jitty_compiling:
51 return jitty_compiling_prover;
52#endif
53 default:
54 throw mcrl2::runtime_error("invalid rewrite strategy");
55 }
56 }
57
58 void rewrite(
59 data_expression& result,
60 const data_expression& t,
62 {
63 // The prover rewriter should also work on terms with other types than Bool.
64 // Up till 14/5/2020 this was not the case. The old code is left here, to
65 // restore it easily, in case it turns out that the jittyp rewriter cannot
66 // fruitfully be applied on expressions, other than those of type bool.
67 //
68 // if (mcrl2::data::data_expression(t).sort() == mcrl2::data::sort_bool::bool_())
69 // {
72 result=prover_obj.get_bdd();
73 return;
74 // }
75 // else
76 //{
77 // return prover_obj.get_rewriter()->rewrite(t,sigma);
78 //}
79 }
80
82 const data_expression& t,
84 {
85 data_expression result;
86 rewrite(result,t,sigma);
87 return result;
88 }
89
91 {
94 }
95
96 protected:
97
98 // Protected copy constructor.
99 RewriterProver(const RewriterProver& other) = delete;
100
101 // Copy constructor intended for cloning.
103 BDD_Prover prover_obj_)
104 : Rewriter(rewr),
105 prover_obj(prover_obj_)
106 {
108 }
109
110 std::shared_ptr<Rewriter> clone()
111 {
112 return std::shared_ptr<Rewriter>(new RewriterProver(*this,prover_obj.clone()));
113 }
114};
115
116}
117}
118}
119
120#endif
strategy rewriter_strategy() const
Returns the strategy of the rewriter used inside this proving rewriter.
Definition bdd_prover.h:621
void set_substitution(substitution_type &sigma)
Set the substitution to be used to construct the BDD.
Definition bdd_prover.h:526
void set_formula(const data_expression &formula)
Sets Prover::f_formula to formula. precondition: the argument passed as parameter formula is an expre...
Definition bdd_prover.h:628
data_expression get_bdd()
Returns the BDD BDD_Prover::f_bdd.
Definition bdd_prover.h:552
RewriterProver(const data_specification &data_spec, mcrl2::data::rewriter::strategy strat, const used_data_equation_selector &equations_selector)
Definition with_prover.h:32
Rewriter::substitution_type substitution_type
Definition with_prover.h:29
RewriterProver(const RewriterProver &other)=delete
rewrite_strategy getStrategy()
Get rewriter strategy that is used.
Definition with_prover.h:43
void rewrite(data_expression &result, const data_expression &t, substitution_type &sigma)
Rewrite an mCRL2 data term.
Definition with_prover.h:58
data_expression rewrite(const data_expression &t, substitution_type &sigma)
Rewrite an mCRL2 data term.
Definition with_prover.h:81
std::shared_ptr< Rewriter > clone()
Clone a rewriter.
RewriterProver(const RewriterProver &rewr, BDD_Prover prover_obj_)
Rewriter interface class.
Definition rewrite.h:42
virtual void thread_initialise()
Definition rewrite.h:228
Component for selecting a subset of equations that are actually used in an encompassing specification...
Definition selection.h:37
Standard exception class for reporting runtime errors.
Definition exception.h:27
static RewriterCompilingJitty::substitution_type & sigma(RewriterCompilingJitty *this_rewriter)
rewrite_strategy
The strategy of the rewriter.
@ jitty_prover
JITty.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72