// Determine the truth of a reduction
assert_eq!(context.execute("a (-> d)"), "true");
assert_eq!(context.execute("d (-> a)"), "false");
// A concept never reduces to itself
assert_eq!(context.execute("a (-> a)"), "false");
// Cannot reduce a reduction expression between unrelated concepts
assert_eq!(context.execute("d (-> f)"), "d (-> f)");
// Can ask whether a reduction is true or false
assert_eq!(context.execute("(a (-> d)) (-> true)"), "true");
assert_eq!(context.execute("(d (-> a)) (-> false)"), "true");
Internal changes:
replaced try! with ?
for most Context methods, replaced &self with &self, &[Self::Delta] and &mut self with &self, &mut self Vec<Self::Delta> to defer mutation of selfuntil execute method
refactor with more standard library features (methods for Option, Result, Vector, Iterator)
New features:
Internal changes:
try!
with?
Context
methods, replaced&self
with&self, &[Self::Delta]
and&mut self
with&self, &mut self Vec<Self::Delta>
to defer mutation ofself
untilexecute
methodOption
,Result
,Vector
,Iterator
)