public void IsStructure() { ListTerm t = new ListTerm(); AbstractTerm a = new ListTerm(); Assert.IsFalse(t.IsStructure); Assert.IsFalse(a.IsStructure); }
public void IsObject() { ListTerm t = new ListTerm(); AbstractTerm a = new ListTerm(); Assert.IsFalse(t.IsObject); Assert.IsFalse(a.IsObject); }
public void IsReference() { ListTerm t = new ListTerm(); AbstractTerm a = new ListTerm(); Assert.IsFalse(t.IsReference); Assert.IsFalse(a.IsReference); }
public void IsConstant() { ListTerm t = new ListTerm(); AbstractTerm a = new ListTerm(); Assert.IsFalse(t.IsConstant); Assert.IsFalse(a.IsConstant); }
public void IsList() { ListTerm t = new ListTerm(); AbstractTerm a = new ListTerm(); Assert.IsTrue(t.IsList); Assert.IsTrue(a.IsList); }
public void Bind() { ListTerm term = new ListTerm(); ListTerm term2 = new ListTerm(); term.Bind(term2); Assert.AreSame(term, term.Reference()); }
public void Dereference() { ListTerm term1 = new ListTerm(); ListTerm term2 = new ListTerm(); ListTerm term3 = new ListTerm(); term2.Bind(term3); term1.Bind(term2); Assert.AreSame(term1, term1.Dereference()); }
public void Unify_str_lis() { StructureTerm s = new StructureTerm("s", 2); ListTerm l = new ListTerm(); Assert.IsFalse(s.Unify(l)); }
public void ListTerm() { ListTerm list = new ListTerm(); Assert.IsNotNull(list); }
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()); }
public void Data() { ListTerm t = new ListTerm(); Assert.IsNull(t.Data()); }
public void Unify_lis_str() { ListTerm list = new ListTerm(); StructureTerm con = new StructureTerm("s", 2); Assert.IsFalse(list.Unify(con)); }
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_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_con() { ListTerm list = new ListTerm(); ConstantTerm con = new ConstantTerm(); Assert.IsFalse(list.Unify(con)); }
public void Unify_con_lis() { ConstantTerm con = new ConstantTerm("ali"); ListTerm term = new ListTerm(); Assert.IsFalse(con.Unify(term)); }
public void Unify_ref_lis() { AbstractTerm term = new AbstractTerm(); ListTerm con = new ListTerm(); Assert.IsTrue(term.Unify(con)); Assert.AreSame(term.Reference(), con.Reference()); Assert.IsTrue(term.IsList); Assert.IsFalse(term.IsReference); }
public void Push_ListTerm() { AMHeap heap = new AMHeap(); ListTerm con = new ListTerm(); heap.Push(con); Assert.AreSame(con, heap.Top()); }