| |
SPARCL HelpCopyright © 2002 Lindsey Spratt. All rights reserved. |
|
|
Related topics: Programming Environment, How Programs Work, Release Notes, Interaction Log, Comments about SPARCL |
|
Introduction SPARCL is a visual logic programming language based on sets with partitioning constraints by Lindsey Spratt. The name derives from "Sets PARtitioning Constraints and Logic". This is implemented as part of the PhD research by Lindsey Spratt. This implementation is incomplete in many respects - it is only a demonstration of the basic ideas of the research project, not a full realization. The semantics of SPARCL are similar in many ways to Prolog.
Comments about SPARCL may be recorded via "Record Comment about SPARCL..."
in a file in the folder with the SPARCL application.
|
|
|
Related topics: Release 2.E.1 Release 2.E.0 Release 2.D.6 Release 2.D.5 Release 2.D.4 Release 2.D.2 Release 2.D.1 Release 2.D.0 Release 2.C.2 Release 2.C.1 Release 2.B.1 |
|
Release Notes This is release 2.E.2; the previous release was 2.E.1. The current release includes:
|
|
|
|
|
Release 2.E.1 Release 2.E.1 includes:
|
|
|
|
|
Release 2.E.0 Release 2.E.0 includes:
|
|
|
|
|
Release 2.D.6 Release 2.D.6 includes:
|
|
|
|
|
Release 2.D.5 Release 2.D.5 includes:
|
|
|
|
|
Release 2.D.4 This is release 2.D.4; the previous release was 2.D.3. (there is no separate info for release 2.D.3) The current release includes:
|
|
|
|
|
Release 2.D.2 Release 2.D.2 includes:
|
|
|
|
|
Release 2.D.1 Release 2.D.1 includes:
|
|
|
|
|
Release 2.D.0 Release 2.D.0 includes:
|
|
|
|
|
Release 2.C.2 Release 2.C.2 includes:
|
|
|
|
|
Release 2.C.1 Release 2.C.1 includes:
|
|
|
|
|
Release 2.B.1 Release 2.B.1 includes:
|
|
|
Related Topics: Programs, Term Sets, and Projects, Information Windows, Programming Tools, Preferences. |
|
Programming Environment The major programming environment elements are evaluable programs, term sets, and projects. Additional information is presented in the *Output*, *Program Size Measurements*, *Program Overview*, *Trace Ancestors*, and *Trace Delays* windows. Tools to help with programming in SPARCL are the "Program Overview Graph", "Undefined Literal References...", and "Program Size Measurements" options of the "File " menu. Various aspects of the SPARCL environment may be tailored via the "Specify Preferences".
There is a multi-level undo/redo facility, available through the 'Edit '
menu.
Also on the 'Edit ' menu are the cut, copy, paste, and clear operations
for either text or "objects". The objects are the "display objects" which
are the components of programs and terms. The paste operation pastes INTO
the selected object, rather than REPLACING the selected object. The 'Copy
Image' option puts a quickdraw image of the selected object (and all of
its subobjects) on the *clipboard*, this can then be pasted into other
applications as a simple picture.
SPARCL records every user interaction in interaction logs (one per user
per day), by default (this can be turned off). These provide data for
studying how people use SPARCL (this is a research project, after all...).
Users can record comments via the 'Record Comment About SPARCL...' option
of the 'File ' menu. These comments are date&time/user/version stamped and
placed in a per-month system comment log.
|
|
|
|
|
Information Windows The information windows are *Output*, *Program Size Measurements*, *Program Overview*, *Trace Ancestors*, and *Trace Delays*. These are created by SPARCL as needed. Closing one of these windows (as with program windows) does not remove any information, it only "hides" the window. These windows are all listed on the 'Windows ' menu and can be made visible by selecting them from that menu .
*Output* is created by the 'Query:Verbose' or 'Query:Brief' options of the
'program' popup menu (in a program window). It is used to display basic
trace and timing information for evaluating queries.
*Program Size Measurements* is created by the 'Program Size Measurements'
option of the 'File ' menu. It is used to display metrics for the
currently open SPARCL programs.
*Program Overview* is created by the 'Program Overview Graph' submenu of
the 'File ' menu. It is used to display a graph showing which predicates
"use" (or "call") which other predicates.
*Trace Ancestors* is created by 'Query:Verbose' when the 'Ancestors'
secondary info mode is selected for Verbose display mode (which is set via
the 'Execution Trace Mode...' option of the 'Specify Preferences' submenu
of the 'File ' menu). It is used during evaluation of a query to show the
"current" stack of goals being evaluated at each "step" of the evaluation
process.
*Trace Delays* is created by 'Query:Verbose' when the 'Delays' secondary
info mode is selected for Verbose display mode. It is used during
evaluation of a query to show the "current" set of goals which have had
their evaluation "delayed" at each "step" of the evaluation process.
|
|
|
Related Topics: Program Overview Graph, Undefined Literal References..., Program Size Measurements. |
|
Programming Tools Tools for programming in SPARCL are invoked by the "Program Overview Graph", "Undefined Literal References...", and "Program Size Measurements" options of the "File " menu. The "Program Overview Graph" displays the relationships among SPARCL predicates. "Undefined Literal References..." presents a menu of predicates which still need to be defined. The "Program Size Measurements" are several measurements of how "big" is the currently loaded group of programs. |
|
|
|
|
Program Overview Graph The Program Overview Graph, or "call" graph, shows a graph of predicates (relations) where two predicates (relations) are connected if one of them "uses" the other in one (or more) of the bodies of its defining clauses. This graph can be generated with or without the SPARCL builtins. |
|
|
|
|
Undefined Literal References... "Undefined Literal References..." presents a menu of predicates are present in the body of some clause and for which there are no defining clauses. |
|
|
|
|
Program Size Measurements The "Program Size Measurements" are several measurements of how "big" is the currently loaded group of programs. These measurements are based on an analysis of the number of "tokens" used in representing the loaded programs. These tokens are divided into operators and operands. These counts of operators and operands are used in various combinations to create values for "vocabulary", "size", "volume (basic)", "program level", "language level (basic)". The "special" measurements rely on the special vocabulary measurement, which in turn is based on the basic token counts divided more finely than the operator and operand categorization. |
|
|
|
|
Programs, Term Sets, and Projects Evaluable programs, term sets, and projects are the major programming environment elements. A term set is sometimes considered to be a non-evaluable program (or a "term set program"). A program or a term set is associated with a window. A project is a collection of programs and term sets. Programs, term sets, and projects all have the basic commands of new, open, close, and save. |
|
|
Related Topics: 'Execution Trace Mode...' 'Display Object Parameters...', 'Undo Limit...', 'Model Type...', 'Program Colors...', 'User Name...', 'User Name Refresh Mode...', 'Record Interaction'. 'Record Script Steps'. |
|
Preferences Many aspects of SPARCL are controlled by 'preferences'. These are specified via the 'Specify Preferences' submenu of the 'File ' menu. These preferences are saved by the 'Save Preferences' option of the 'File ' menu. Preferences are automatically loaded when SPARCL starts up. Preferences are NOT automatically saved, so the 'Save Preferences' option must be used to make changes to preferences be used in subsequent invocations of SPARCL. The preference options are:
|
|
|
|
|
Execution Trace Mode... This option of the 'Specify Preferences' submenu of the 'File ' menu is for specifying which of the ancestors and delay traces to show when executing a verbose query. |
|
|
|
|
Display Object Parameters... This option of the 'Specify Preferences' submenu of the 'File ' menu is for specifying various parameters which control the display program windows. The various elements displayed in program windows are referred to as "display objects". Each type of display object has its own set of parameters. Only a few of the display object types currently have user-settable parameters. |
|
|
|
|
Undo Limit... This option of the 'Specify Preferences' submenu of the 'File ' menu is for specifying how many steps "back" the "undo" mechanism allows the user to "undo". The larger this limit is set, the more storage the mechanism must use to keep track of the undoable steps. A fairly low number is advisable (e.g. 5). |
|
|
|
|
Model Type... This option of the 'Specify Preferences' submenu of the 'File ' menu is for specifying which kind of 3D model file is to be generated by the 'Write Model' option of the clause popup menu (in a program window). There are three kinds of files: QuickDraw3D metafile, SGI Open Inventor file, and POV-Ray file. None of these is completely implemented: all three formats are undefined for the Term Table and Fact Table display objects. |
|
|
|
|
Program Colors... This option of the 'Specify Preferences' submenu of the 'File ' menu is for specifying the colors of the two parts of a program window: the "Drawing" paper (main viewing portion of the window) and the "Tools" paper (the small portion to the left of the window). |
|
|
|
|
User Name.. This option of the 'Specify Preferences' submenu of the 'File ' menu is for specifying the name of the person using SPARCL. This "user name" is used in recording interactions (there is an interaction log per-user-name per-day) and in recording system comments. |
|
|
|
|
User Name Refresh Mode.. This option of the 'Specify Preferences' submenu of the 'File ' menu is for specifying whether SPARCL should always query for the user's name when starting up, or if it should only query if the user name hasn't been set. |
|
|
|
|
Record Interaction This option of the 'Specify Preferences' submenu of the 'File ' menu sets the "record interactions" mode. When it has a check mark, then all of the user's interactions with SPARCL are recorded in an interaction log. This log is stored in the 'User Documents.X' folder in the same folder as the SPARCL application file and is per-user-name per-day. If this option is not check marked, then the user's interactions are not recorded. |
|
|
|
|
Record Script Steps This option of the 'Specify Preferences' submenu of the 'File ' menu sets the "recording script steps" mode. When it has a check mark, then all of the user's steps in a script (e.g. in the tutorial) are recorded in an "script record". This file is stored in the 'User Documents.X' folder in the same folder as the SPARCL application file and is per-user-name per-day. If this option is not check marked, then the user's script steps are not recorded. |
|
|
Related topics: Parts of a Program |
|
How Programs Work SPARCL is a logic programming language based on Horn clauses. A program is all of the items in the same window (or file) in the editing environment. Informally, these items are rules and facts. One runs a program by picking a particular rule and telling the system to "run" that rule as a "query" - try to determine if there is a way in which that rule's antecedents can be shown to be true using all of the other rules and facts given by the defined programs. If there is such a way, the result is reported as a term in a "term set" window. |
|
|
Related topics: Theory, Relation, Clause, Term. |
|
Parts of a Program The parts of a program are: theory, relation (relation name, relation arity), clause (clause head, clause argument, clause body), literal (literal name, literal argument), term (empty set, ur term, variable, partitioned set, ntuple, table, intensional set). |
|
|
|
|
Theory A *theory* is a set of relations (which are defined in a set of programs). |
|
|
|
|
Clause A *clause* has a head and a body.
A *clause head* is a positive literal.
A *clause argument* is any element of the *clause head* except the first
one.
A *clause body* is a set of positive literals.
|
|
|
|
|
Literal A (positive) *literal* is an ntuple that has a *literal name* as its first element and any number of *literal arguments* as its other elements.
A *literal name* is an ur element which is the first element of a
*literal* ntuple.
A *literal argument* is any element other than the first one of a
*literal* ntuple.
|
|
|
|
|
Relation The set of all of the clauses that have clause heads with identical relation names and relation arities defines a *relation*, with that name and arity.
A *relation name* is the first element of a *clause head*.
The *relation arity* of a *clause* is the number of *clause arguments* for
that *clause*.
|
|
|
Related topics: Basic Terms Alternative Set Representation Terms |
|
Term A *term* is a basic term (empty set, ur term, or variable, partitioned set) or an alternative set representation term (ntuple, table, or intensional set). The ntuple, table, and intensional set terms are alternative representations of sets. Thus, all terms in SPARCL are semantically built out of only empty set, ur, variable, and partitioned set terms. |
|
|
|
|
Basic Terms An *empty set* is a constant value used to represent an empty set.
An *ur term* is any constant value other than the empty set.
A *variable* is a term which can be "bound" to another term.
A *partitioned set* is a set of partitioning parts, where each part is a
set of terms or is unoccupied. An unoccupied part of a partitioning is a
variable which may be bound to a variable, partitioned set, or other
partitioned part.
|
|
|
|
|
Alternative Set Representation Terms An *ntuple* is a sequence of N elements. The ntuple is equivalent to the pair set {{a}, {a,b}}. An ntuple of more than two elements,
A *term table* is a set of terms with particular properties. There are
four kinds of term tables. Each row may be either an *ntuple* or a
*function*. The rows may be either the elements of an ntuple or a set.
If a table has ntuple-type rows, then all of these row ntuples must have
the same length. If a table has function-type rows, then all of these
functions must have the same domain.
A *function* is a set of ordered pairs ('
An *intensional set* (or *intenSet*) is a definition of a set as the
collection of terms which satisfy a property, i.e. the set of all X such
that predicate(X).
|
|
|
|
|
Interaction Log The Interaction Log is a text file formatted for easy "reading" from PROLOG. There is an interaction log per user name per day located in the same folder as the SPARCL application. The file is named '<UserName>, <CompactDate>.log', where the UserName is set via the 'Specify Preferences/User Name' option, the CompactDate is of the form <YYYYMMDD> (YYYY is the year, MM is the month, and DD is the day). There are log entries for nearly every interaction the user has with SPARCL. A log entry contains a time stamp, an action name, and the arguments for the action. |
|
|
|
|
Comments about SPARCL The comments about SPARCL are recorded is a text file formatted for easy "reading" from PROLOG. There is a comment log per month located in the same folder as the SPARCL application. The file is named '<YYYYMM>.syscom' (YYYY is the year, MM is the month). |
|