}
}
+pub type Predicate = Vec<PredicateClause>;
+
pub enum PredicateClause {
Fact(Term),
Rule(Rule)
pub enum TopLevel {
Declaration(Declaration),
Fact(Term),
- Predicate(Vec<PredicateClause>),
+ Predicate(Predicate),
Query(Vec<QueryTerm>),
Rule(Rule)
}
InadmissibleFact,
InadmissibleQueryTerm,
IncompleteReduction,
- InconsistentDeclaration,
- InconsistentPredicate,
+ InconsistentEntry, // was InconsistentDeclaration.
+// InconsistentPredicate, //TODO: admit this is not needed.
InvalidRuleHead,
ParseBigInt,
ParseFloat(ParseFloatError),
-Subproject commit e15eb2d27bb866d7a94fe47a829f5c51893bede3
+Subproject commit f44720afd708c8778e0eeafc0a34121299d0ac86
pub type TabledData<T> = Rc<RefCell<HashSet<Rc<T>>>>;
-#[derive(Clone, PartialEq, Eq)]
+#[derive(Clone)]
pub struct TabledRc<T: Hash + Eq> {
atom: Rc<T>,
table: TabledData<T>
}
+impl<T: Hash + Eq> PartialEq for TabledRc<T> {
+ fn eq(&self, other: &TabledRc<T>) -> bool
+ {
+ self.atom == other.atom
+ }
+}
+
+impl<T: Hash + Eq> Eq for TabledRc<T> {}
+
impl<T: Hash + Eq> Hash for TabledRc<T> {
fn hash<H: Hasher>(&self, state: &mut H)
{
assert_prolog_success!(&mut wam, "?- f(1,2,3) =.. [f,1,2,3].");
assert_prolog_failure!(&mut wam, "?- f(1,2,3) =.. [f,1].");
assert_prolog_failure!(&mut wam, "?- f(1,2,3) =.. [g,1,2,3].");
+ assert_prolog_success!(&mut wam, "?- f(1,2,3) =.. [f,X,Y,Z].",
+ [["X = 1", "Y = 2", "Z = 3"]]);
assert_prolog_success_with_limit!(&mut wam, "?- length(Xs, N).",
[["N = 0", "Xs = []"],