public void Unify_str_lis() { StructureTerm s = new StructureTerm("s", 2); ListTerm l = new ListTerm(); Assert.IsFalse(s.Unify(l)); }
public void Unify_str_con() { ConstantTerm term = new ConstantTerm("ali"); StructureTerm s = new StructureTerm("s", 2); Assert.IsFalse(s.Unify(term)); }
public void Unify_str_ref() { AbstractTerm term = new AbstractTerm(); StructureTerm s = new StructureTerm("s", 2); Assert.IsTrue(s.Unify(term)); Assert.AreEqual(term.Arity, s.Arity); Assert.AreEqual(term.Name, s.Name); }
public void Unify_str_ref_str() { StructureTerm s1 = new StructureTerm("s", 1); s1.Next = new AbstractTerm(); StructureTerm s2 = new StructureTerm("s", 1); s2.Next = new ConstantTerm("ali"); Assert.IsTrue(s1.Unify(s2)); Assert.AreEqual(s1[0].Data(), s2[0].Data()); }
public void Unify_str_ne_str() { StructureTerm s1 = new StructureTerm("s", 2); s1.Next = new ConstantTerm("ali"); s1.Next.Next = new ConstantTerm("samir"); StructureTerm s2 = new StructureTerm("s", 2); s2.Next = new ConstantTerm("samir"); s2.Next.Next = new ConstantTerm("samir"); Assert.IsFalse(s1.Unify(s2)); }