Skip to content

Commit 0735236

Browse files
committed
fix: use String for predicate body
1 parent 3a2e20b commit 0735236

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/analyze/local_def.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl<'tcx, 'ctx> Analyzer<'tcx, 'ctx> {
137137
let body_id = hir_map.maybe_body_owned_by(local_def_id).unwrap();
138138
let hir_body = hir_map.body(body_id);
139139

140-
let command = match hir_body.value {
140+
let predicate_body = match hir_body.value {
141141
Expr {
142142
kind: ExprKind::Block(Block { stmts, .. }, _),
143143
..
@@ -166,7 +166,7 @@ impl<'tcx, 'ctx> Analyzer<'tcx, 'ctx> {
166166
self.ctx.system.borrow_mut().push_pred_define(
167167
chc::UserDefinedPred::new(pred_name),
168168
chc::UserDefinedPredSig::from(arg_name_and_sorts),
169-
chc::RawCommand { command },
169+
predicate_body,
170170
);
171171
}
172172

src/chc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,7 +1706,7 @@ pub type UserDefinedPredSig = Vec<(String, Sort)>;
17061706
pub struct UserDefinedPredDef {
17071707
symbol: UserDefinedPred,
17081708
sig: UserDefinedPredSig,
1709-
body: RawCommand,
1709+
body: String,
17101710
}
17111711

17121712
/// A CHC system.
@@ -1732,7 +1732,7 @@ impl System {
17321732
&mut self,
17331733
symbol: UserDefinedPred,
17341734
sig: UserDefinedPredSig,
1735-
body: RawCommand,
1735+
body: String,
17361736
) {
17371737
self.user_defined_pred_defs
17381738
.push(UserDefinedPredDef { symbol, sig, body })

src/chc/smtlib2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ impl<'ctx, 'a> std::fmt::Display for UserDefinedPredDef<'ctx, 'a> {
579579
f,
580580
"(define-fun {name} {params} Bool {body})",
581581
name = self.inner.symbol,
582-
body = RawCommand::new(&self.inner.body),
582+
body = &self.inner.body,
583583
)
584584
}
585585
}

0 commit comments

Comments
 (0)