[comp.lang.prolog] Questionnaire on advanced Logic Programming features

pgl@cup.portal.com (Peter G Ludemann) (09/19/90)

The recent postings on arrays in Prolog have given me the idea
of taking a survey of advanced Logic Programming features.
I'm thinking of the concepts which make Prolog-III, NU-Prolog,
Trilogy, CLP(R) and other such implementations special.
If you can help, please fill in the survey below and
send it to me; when I have collected everything, I will post a
summary (if there's enough interesting information, I will write a
Technical Report).
 
For some questions, I have given a choice:
  Logical:       does not allow updating ground terms.
  Quasi-logical: allows destructive updating of a ground term; any
                 changes are undone on backtracking.
  Non-logical:   allows destructive updating of a ground term but
                 changes are *not* undone on backtracking.
 
For example, suppose an implementation provides character strings
and ha the ability to update a character.  Notice that the
"logical" flavour has one extra parameter (the InString cannot be
changed, so OutString gets a modified copy).  A "logical"
implementation is, of course, free to analyze the code and do
destructive updating if it is safe.
 
   Logical:   update(InString, Position, Character, OutString):
                 ?-  S1 = 'abc',
                    (update(S1, 2, '-', S2),
                     write([s1 = S1, s2 = S2]),
                     fail)
                   ; write([s1 = S1, s2 = S2]) .
 
                 [s1 = 'abc', s2 = 'a-c'] .
                 [s1 = 'abc', s2 = _1] .
 
   Quasi-logical:  update(String, Position, Character):
                     ?- S1 = 'abc',
                        (update(S1, 2, '-'),
                         write(s1 = S1))
                      ; write(s1 = S1) .
 
                  s1 = 'a-c' .
                  s1 = 'abc' .
 
   Non-logical:  update(String, Position, Character):
                     ?- S1 = 'abc',
                        (update(S1, 2, '-'),
                         write(s1 = S1))
                      ; write(s1 = S1) .
 
                  s1 = 'a-c' .
                  s1 = 'a-c' .
 
 
<<<----------------------------------------------------------------->>>
 
*--------------------------------------------------------------------*
| This questionnaire is for my own personal research and will not    |
| be used for commercial purposes.  After I have collected the data, |
| a summary will be posted.                                          |
|                                                                    |
| Please feel free to insert additional information in the           |
| questionnaire, or add comments at the end.  Please return to:      |
|                                                                    |
| ludemann@mlpvm1.iinus1.ibm.com                                     *
*--------------------------------------------------------------------*
 
 
  Name of the logic pramming product: ______________________________
  Contact address: _________________________________________________
  Contact e-mail: __________________________________________________
 
  I am:   _ implementer    _ friend/colleague of the implementer
          _ user           _ passing on what I've heard
 
  Type of implementation:
    _ Commercial
    _ Academic only
    _ Robust limited distribution
    _ Experimental
 
  Hardware/software platform(s): _______________________________
 
  Type of "logic programming" implemented:
    _ Prolog
    _ Prolog + extensions
    _ Functional language + logic programming extensions
    _ Object-oriented language + logic programming extensions
    _ Guarded Horn clauses
    _ Other
 
  Arrays and tables:
    _ Integer indexes
      _ O(1) access
      _ Can change size dynamically
    _ Atom indexes (associative tables)
    _ Multiple indexes (e.g. 3-dimensional arrays)
    _ Complex indexes (e.g., functors)
    _ Logical / Quasi-logical / Non-logical
    _ Built-in
    _ Library package
 
  Character manipulation:
    _ Strings as a primitive datatype
    _ Predicates for substring, concatenate, search, index, etc.
    _ Kanji support
      _ "string length" predicate counts characters, not bytes
 
  Internal database:
    _ Undone on backtracking
    _ Not undone on backtracking (that is, permanent)
    _ Atom indexes (associative tables)
    _ Multiple indexes (e.g. 3-dimensional arrays)
    _ Complex indexes (e.g., functors)
 
  Arithmetic:
    _ Overflow detected
    _ "Big numbers" ("infinite precision")
    _ Rational numbers
    _ Floating point
 
  Types:
    _ User-defined types and unification
    _ Functors with non-atomic names, e.g.: P(X)
    _ Type-checking predicates
    _ Lattice or hierarchy of types
    _ "Infinite" (or circular) terms
    _ Printing terminates for:     ?- X = f(X), write(X)
    _ Unification terminates for:  ?- X = f(X), f(f(Z)) = X
    _ Object-oriented features
      _ Built-in
      _ Provided by a library package
 
  Syntax:
    _ Clocksin&Mellish
      _ expand_term or expand_rule predicates
      _ operator declarations
      _ DCG or other grammar rule notation
    _ Not Clocksin&Mellish
    _ Syntax can be tailored by the user
    _ Multiple syntaxes supported
    _ Support for non-standard keyboards
 
  Control:
    _ Interrupts
    _ Delayed evaluation (wait/freeze/geler/etc.)
    _ Co-routines
    _ Lazy evaluation
    _ Eager evaluation
    _ User-defined functions (e.g., evaluated by is/2)
    _ Higher-order functions ("thunks"/continuations)
    _ Constraints
      _ Floating point
      _ Integer
      _ User-tailorable
    _ Logical if-then-else
    _ Logical negation
    _ Multi-way switch
    _ Error trapping and recovery
      _ Recover from stack overflow
      _ Recover from operating system traps
      _ Recover from foreign-language traps
      _ Detect undefined or incomplete predicate
      _ Can intercept *all* error messages
    _ User can write own debugging predicates
 
  Modules:
    _ Atom-based
    _ Predicate-based
    _ Can hide predicates (control of exporting)
    _ Can control importing
    _ Can rename on import or export
    _ Can override built-in predicates
    _ Meta-predicates can control module context on call(_)
 
  Implementation:
    _ Compiler
      _ Compiles some built-in predicates into in-line code
      _ Compiles arithmetic in-line
    _ Compiled and interpreted code can readily call each other
      with the same semantics
    _ Generates machine code
    _ Generates optimized WAM-like code
    _ Can create stand-alone read-only modules
    _ Mode declarations (in,out,ground,etc.)
      _ Automatically propagated by compiler
      _ Multi-argument indexing
      _ Indexing within an argument
      _ Compiler detects deterministic predicates
    _ Data area / stack limited to 2**16
    _ Data area / stack limited to 2**24
    _ Data area / stack limited to 2**31
    _ Data area / stack is limited only by hardware resources
    _ Global stack garbage collector
    _ Local/trail stacks garbage collector
    _ Incremental (background) garbage collector
    _ Can exploit parallel machines
 
  Database, I/O access:
    _ Internal database (record, recorded)
    _ Can call SQL
      _ Backtrack through all answers
      _ Get a list of answers
      _ Automatic translation of datatypes to/from SQL
    _ Can write predicates which are translated to external database
      (e.g., "database" predicates are combined so that SQL can do
      the joins)
    _ Logical I/O (that is, using lazy/eager lists)
 
  System integration:
    _ Formatted I/O (e.g., like C's printf)
    _ Windowing interface (X, Motif, PM, etc.)
    _ Editor interface
    _ Other interfaces
    _ On-line help / manual
    _ Can invoke system commands
    _ Can write predicates in:
      _ assembler   _ C/C++   _ Cobol
      _ Fortran     _ Lisp    _ Other
    _ Can call Prolog from:
      _ assembler   _ C/C++   _ Cobol
      _ Fortran     _ Lisp    _ Other
    _ Can pass arbitrary Prolog terms
    _ Can create Prolog terms inside foreign language code
    _ Can write backtrackable predicates in foreign languages
 
  Additional notes:
 
    If you could get 5 things which you haven't marked above,
        what would you pick?
    Would they be worth adding if they increased the
        product's price?
    Anything that is missing from the list?
    Anything you would like but haven't seen anywhere?
    Additional description of some of the above features?
 
 
<<<----------------------------------------------------------------->>>