Skip to content

Commit 0b9ed21

Browse files
committed
Handeling literal found in a not constraint
1 parent e562744 commit 0b9ed21

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

src/antimirov/subs.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,10 +711,9 @@ fn merge(substitutions: AnySub) -> Option<SimpleSub> {
711711
if modified_not.contains(&new_c) {
712712
return None;
713713
}
714-
// Note: We insert c instead of new_c here which means that not all keys are fully resolved. Can be revisted later.
715714
match &*new_c {
716715
CharExpression::CharVar(new_var) => combined_not.insert(new_var.clone(), modified_not),
717-
CharExpression::Literal(_) => todo!(),
716+
CharExpression::Literal(_) => None,
718717
};
719718
}
720719

src/solver/antimirov.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl Solver for AntimirovSolver {
6868
});
6969
//TODO: Modify visited to compare not substitutions, not just the USR
7070
let mut visited: HashSet<Rc<GenRegex>> = HashSet::new();
71-
let mut count = 0;
71+
//let mut count = 0;
7272
while let Some(layer) = sat_stack.pop() {
7373
println!("Looking at: {}", layer.gre);
7474
// if count>=2{
@@ -95,8 +95,7 @@ impl Solver for AntimirovSolver {
9595
let deriv = derivative(&layer.gre, &self.get_fresh_var(layer.depth));
9696
//println!("deriv: {:?}", deriv);
9797
'deriv_loop: for ele in deriv {
98-
println!("Pushing expr: {}", ele.get_expr());
99-
println!("Subs: {:?}", ele.get_subs());
98+
//println!("\tPushing expr: {}", ele.get_expr());
10099
// Check range
101100
let range = ele.get_ranges();
102101

@@ -115,11 +114,11 @@ impl Solver for AntimirovSolver {
115114
}
116115
}
117116
// TODO Caleb
118-
eprintln!("TODO: handle range constraint {} on {}", range, var);
117+
//eprintln!("TODO: handle range constraint {} on {}", range, var);
119118
// For now, ignore and continue
120119
}
121-
println!("Subs: {:?}", ele.get_subs());
122-
println!("Not subs: {:?}", layer.not_sub);
120+
// println!("\tSubs: {:?}", ele.get_subs());
121+
// println!("\tNot subs: {:?}", layer.not_sub);
123122
let Some(mut f) = merge_binary(ele.get_subs(), &layer.not_sub) else {
124123
// println!("death2");
125124
continue;
@@ -140,11 +139,11 @@ impl Solver for AntimirovSolver {
140139
}
141140
//println!("Updated Range: {:?}",updated_range);
142141
let Some(r) = merge_range_constraints(ele.get_ranges(), &updated_range) else {
143-
print!("Pruned");
142+
//println!("Pruned");
144143
continue;
145144
};
146145
//println!("After range merge: {:?}",r);
147-
println! {"Not constraint pushed: {:?}",f};
146+
//println! {"\tNot constraint pushed: {:?}",f};
148147
sat_stack.push(DerivativeDepth {
149148
gre: new_re.clone(),
150149
not_sub: SimpleSub::new(

0 commit comments

Comments
 (0)