Reference() public méthode

Returns the reference of this object.
public Reference ( ) : AbstractTerm
Résultat AbstractTerm
Exemple #1
0
 /// <summary>
 /// Returns the reference of this object.
 /// </summary>
 /// <returns></returns>
 public virtual AbstractTerm Reference()
 {
     if (IsAssigned())
     {
         return(_containee.Reference());
     }
     return(this);
 }
Exemple #2
0
        public void Bind()
        {
            AbstractTerm term = new AbstractTerm();
            AbstractTerm term2 = new AbstractTerm();

            term.Bind(term2);

            Assert.AreSame(term2, term.Reference());
        }
Exemple #3
0
        public void Assign()
        {
            AbstractTerm term = new AbstractTerm();
            ConstantTerm con = new ConstantTerm("ali");

            term.Assign(con);

            Assert.AreSame(term.Dereference(), con);
            Assert.AreSame(term.Dereference(), con.Dereference());
            Assert.AreEqual(term.Data(), con.Data());
            Assert.AreSame(term.Reference(), con.Reference());
            Assert.IsFalse(term.IsList);
            Assert.IsFalse(term.IsObject);
            Assert.IsFalse(term.IsReference);
            Assert.IsFalse(term.IsStructure);
            Assert.IsTrue(term.IsConstant);
        }
Exemple #4
0
        public void Unify_ref_str()
        {
            AbstractTerm term = new AbstractTerm();
            StructureTerm con = new StructureTerm();

            Assert.IsTrue(term.Unify(con));

            Assert.AreSame(term.Reference(), con.Reference());
            Assert.IsTrue(term.IsStructure);
            Assert.IsFalse(term.IsReference);
        }
Exemple #5
0
        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);
        }
Exemple #6
0
        public void Unify_ref_con()
        {
            AbstractTerm term = new AbstractTerm();
            ConstantTerm con = new ConstantTerm();

            Assert.IsTrue(term.Unify(con));

            Assert.AreEqual(term.Data(), con.Data());
            Assert.AreSame(term.Reference(), con.Reference());
            Assert.IsTrue(term.IsConstant);
            Assert.IsFalse(term.IsReference);
        }
Exemple #7
0
        public void Unbind()
        {
            AbstractTerm term = new AbstractTerm();
            ConstantTerm con = new ConstantTerm("ali");

            term.Assign(con);

            term.Unbind();

            Assert.AreNotSame(term.Reference(), con.Reference());
        }