Skip to content

Commit

Permalink
Simplify iteration in kvar encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
nilehmann committed Feb 5, 2025
1 parent fc342c7 commit cd33967
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/flux-infer/src/fixpoint_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ where
.iter()
.enumerate()
.map(|(i, kvid)| {
let args = all_args.iter().skip(kvids.len() - i - 1).copied().collect();
let args = all_args[i..].to_vec();
fixpoint::Pred::KVar(*kvid, args)
})
.collect_vec();
Expand Down Expand Up @@ -675,7 +675,7 @@ impl KVarEncodingCtxt {
let n = usize::max(decl.self_args, 1);
(0..n)
.map(|i| {
let sorts = all_args.iter().skip(n - i - 1).cloned().collect();
let sorts = all_args[i..].to_vec();
self.kvars.push(FixpointKVar::new(sorts, kvid))
})
.collect_vec()
Expand Down Expand Up @@ -743,7 +743,6 @@ impl LocalVarEnv {
}
}

#[derive(Clone)]
struct ConstInfo {
name: fixpoint::GlobalVar,
sort: fixpoint::Sort,
Expand Down

0 comments on commit cd33967

Please sign in to comment.