Reference() public méthode

public Reference ( ) : AbstractTerm
Résultat AbstractTerm
Exemple #1
0
        public void Bind()
        {
            ConstantTerm term = new ConstantTerm();
            ConstantTerm term2 = new ConstantTerm();

            term.Bind(term2);

            Assert.AreSame(term, term.Reference());
        }
Exemple #2
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 #3
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 #4
0
        public void Unbind()
        {
            AbstractTerm term = new AbstractTerm();
            ConstantTerm con = new ConstantTerm("ali");

            term.Assign(con);

            term.Unbind();

            Assert.AreNotSame(term.Reference(), con.Reference());
        }
Exemple #5
0
        public void Reference()
        {
            ConstantTerm term1 = new ConstantTerm();
            ConstantTerm term2 = new ConstantTerm();

            term1.Bind(term2);

            Assert.AreSame(term1, term1.Reference());
        }