-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting all outcomes of a Trace #46
Comments
Hmmm... In the TRS above, the rule for |
Gah, you're right, thanks. That solves the term that was not commented-out ( |
I don't see anything obvious. 0.7.0 is fairly old code - I've pushed the library much further and fixed many bugs on the |
Hrm, still no luck. With extern crate term_rewriting;
use term_rewriting::{Signature, Strategy, NumberRepresentation, trace::*, parse_trs, parse_term};
fn main() {
let mut sig = Signature::default();
let t = parse_trs(&mut sig,
"And(a_ Or(a_ b_)) = a_;").unwrap();
let patterns = t.patterns(&sig);
let term = parse_term(&mut sig, "And(a Or(a b))").unwrap();
let trace = Trace::new(&t, &sig, &term, 0.5, 10, None, &patterns, Strategy::All, NumberRepresentation::default());
for idx in trace.iter() {
println!("{}", trace[idx].term().pretty(&sig));
}
}
Since that term is a perfect match for the rule, I'm guessing I don't have the rule specified properly. |
Ack - sorry to be slow here. I don't have the ability to easily test this on my work machine, but I will try to take a closer look this weekend. |
No problem and no rush, really appreciate your help if/when you get to it. |
Aha - there was a bug in term unification. I just pushed some changes to |
Hey,
I think I'm missing something basic here. I'm trying to get the fully simplified form of a term:
This prints a single outcome:
Not(Not(a))
. If I just callrewrite()
once, I geta
as expected, but that strategy doesn't work for terms that need more than one rewriting step. Could you help me figure out what I'm doing wrong here please?Thanks!
The text was updated successfully, but these errors were encountered: