public void Unify_lis_con() { ListTerm list = new ListTerm(); ConstantTerm con = new ConstantTerm(); Assert.IsFalse(list.Unify(con)); }
public void Unify_lis_str() { ListTerm list = new ListTerm(); StructureTerm con = new StructureTerm("s", 2); Assert.IsFalse(list.Unify(con)); }
public void Unify_lis_ne_lis() { ListTerm list1 = new ListTerm(); list1.Next = new ConstantTerm("ali"); list1.Next.Next = new ConstantTerm("[]"); ListTerm list2 = new ListTerm(); list2.Next = new ConstantTerm("ali"); list2.Next.Next = new ConstantTerm("foo"); Assert.IsFalse(list1.Unify(list2)); }
public void Unify_lis_ref() { ListTerm list = new ListTerm(); list.Next = new ConstantTerm("ali"); list.Next.Next = new ConstantTerm("samir"); AbstractTerm term = new AbstractTerm(); Assert.IsTrue(list.Unify(term)); Assert.AreSame(list.Head, term.Head); Assert.AreSame(list.Tail, term.Tail); }
public void Unify_list_ref_lis() { ListTerm list1 = new ListTerm(); list1.Next = new AbstractTerm(); list1.Next.Next = new ConstantTerm("[]"); ListTerm list2 = new ListTerm(); list2.Next = new ConstantTerm("ali"); list2.Next.Next = new ConstantTerm("[]"); Assert.IsTrue(list1.Unify(list2)); Assert.AreEqual(list1.Head.Data(), list2.Head.Data()); }