Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools

Questions about the Prologinterface and the PDT

  • Q: Why do I get arrays in the form ','(element1, element2)? Can I change that?
  • A: There are no arrays in Prolog. The only datastructure that Prolog supports are terms. A term is either a variable, an constant (called 'atom' in Prolog) or a compound term (one with a functor and arguments enclosed in round brackets). The copound term ','(element1, element2) is the Prolog representation of a list. Its first argument is the first list element and the second argument is the entire rest of the list. So a list with three elements will have the structure ','(element1, ','(element2, element3)). The syntax [element1, element2, element3] is just syntactic suggar for the same thing.
    You can change that if you retrieve the PrologSession yourself. See the JavaDoc of for details.
  • Q: Where is the structure of a result of a queryOnce(String) and queryAll(String) documented?
  • A: (dsp, 2009-02-25) Best guess till now: Nowhere.
teaching/labs/xp/2009a/pdt_questions.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024