Пример #1
0
 def __str__(self):
     """Representation as a GDL string."""
     with Frame():
         return prolog_term_to_prefix_gdl(self._term_record.get())
Пример #2
0
 def test_variable_term(self):
     assert_equal(prolog_term_to_prefix_gdl(Term())[0], '?')
Пример #3
0
 def test_compound_term(self):
     assert_equal(prolog_term_to_prefix_gdl(
         Functor('foo', 2)(Term.from_atom_name('bar'),
                           Term.from_atom_name('2'))),
         '(foo bar 2)')
Пример #4
0
 def test_atom_term(self):
     assert_equal(prolog_term_to_prefix_gdl(Term.from_atom_name('foo')),
                  'foo')