EECE 571F= Domain-Specific Languages  
This is a page from yet
another great ECE, UBC subject.
[ Home | Assignments | Lectures |
DSL rules | Articles | Resources ]

A Logical Approach

Fall 2001.

[Subject | Subject timetable | Lecturer | Textbook | Assessment | Special consideration | Assignments | Mailing list ]


Making languages bear-able:
    For I am a bear of very little brain and long words confuse me. [Milne 1926]

The premise of this subject is that computers should adapt to the ways of people, and not the other way around.

One method for doing this is a domain-specific langauge (DSL). A DSL is a very high-level language that a user can learn and use in less than a day. Such productivity can only be achieved by tailoring the language to the special needs and skills of a particular class of users in a particular domain.

In a DSL-based software development process, the analyst:

  • Identifies the users and their tasks;
  • Identifies the common idioms used by those users;
  • Invents a declarative language to handle those idioms;
  • Generates sample sentences in that language;
  • Shows those sentences to the user and trains them how to write their own.
That is, instead of the analyst writing the application, the analysts writes tools that let a user community write and maintain their own knowledge.

The benefits of DSL (productivity, explanatory, ownership by the users) can be out-weighed by the cost of building the DSL. Traditional methods for DSL construction include writing interpreters of some domain-specific syntax into some procedural language (e.g. AWK, Perl, Java, etc). This subject offers a more general approach in which:

  • The DSL syntax is expressed as logical horn clauses using Prolog's infix operator notation.
  • Interpreters and meta-interpreters are used to execute that syntax.
  • The DSL system is explored using stochastic abduction (for what-if queries) and treatment learners (to find controllers for that system).
In this subject, students will:
  • Study all the terms shown above in italics
  • Examine case studies of successful DSLs.
  • Build their own DSL, optimize it with a compiler, study it using abduction, then learn controllers for their DSL system.

Subject timetable

MCLD 402
Mondays, 2pm - 5pm
NOTE: No lecture in week 1 of the fall 2001 term.


Dr. Tim Menzies (PhD, AI, UNSW, 1995)
MCLD 341
Australian lost in North America for a while. Ex-nurse, ex-taxi driver, , ex-OO consultant, ex-NASAish. Mad. Keen. Mad keen on applying artificial intelligence techniques to software engineering. Been using logic programming to write DSLs for years. Wrote Australia's first exported expert system in 1988- which was a DSL (of course) [Menzies, 1988].


No textbook for logic-based DSLs exist. Instead, students should get the excellent Prolog Programming for Artificial Intelligence by Ivan Bratko (third edition, Addison Wesley).


No exams.

15% Participation in discussions.
15% Assignment 1
20% Assignment 2
25% Assignment 3
25% Assignment 4

Special Consideration

Students requesting special consideration regarding poor marks must provide documentary evidence for the reason of the poor marks (e.g. doctor's certificates).


Four assignments due Friday week 4,7,10,and 13:
  1. Parse a DSL
  2. Build a DSL interpreter
  3. Build a DSL compiler
  4. Use treatment learning to find controllers for a DSL.
For more details, see the assignments page.

Mailing list

Subscribe to dslece
Powered by
All students should join this subject's news group. Note: to do so, I think you also have to join up to Yahoo.

Once joined it is very important that students go to the "Subscribe" page and select "Send email messages to <your email>" option in the section Message Delivery:

Not © Tim Menzies, 2001
Share and enjoy- information wants to be free.
But if you take anything from this site,
please credit