CLACL (programming language)

From Seo Wiki - Search Engine Optimization and Programming Languages

Jump to: navigation, search
Paradigm Logic programming
Appeared in January 2000
Designed by Mauro Gazzelloni
Developer Mauro Gazzelloni
Stable release 00.06.00 (18/03/2009)
Influenced Prolog, C
Programming language C++
OS Microsoft Windows
License Creative
Website Project Site

CLACL (representing CLAC-Language where CLAC stands for Logical Composition with the Assistance of Computers) is the result of theoretical research, still in progress, which aims to provide a formal description of the logical choices relating to the definition of organisational processes of composition.

CLACL is an interpreted language and integrated into a production environment that provides several tools to facilitate writing code and its graphical representation.

The first version (00.02.00) of the language was made available on the Internet in 2000 at the site of the project. The last version (00.06.00) was distributed at the 2009 Festival of Mathematics which was held in Rome and during which the project CLAC was presented.


Characteristics of the Language

Given this background, it is clear that the target of potential users of the language are those working within creative fields, tending to be in different areas: from design to the musician. Since the compositional process is guided by logical choices, the program is centred around the information science area of Artificial Intelligence. It is for this reason that the project is mentioned in the entry Computational creativity External_links in the wikipedia as one of the few examples of the application of Information science to creativity.

In view of the target of the language, the closely logic-driven syntax, somewhat challenging for anyone not accustomed to working in AI, was supplemented by constructs more readily usable in practice.

As an example, see the description of a cycle (loop) implemented in Prolog and CLACL.

With the following example in prolog, a loop is run that prints the loop index:

loop(X,Y) :-
    !,X < Y,
    X2 is X + 1,

In CLACL the same process is carried out using the following code:

FOR ($x) IN I[]

as can be seen, the formalism of the cycle, which in prolog per se does not exist, in CLACL is carried out in a very similar way to the C-Language.

The language adopts a combination of the declarative and procedural paradigms. The two languages are Prolog and C-Language. The declarative aspect comes from prolog and is used in statements and in scanning the tree of alternatives (backtracking). The procedural aspect is derived from C-Language and is highlighted in particular in the control structures of the procedural flow.

Structure of the language

The commands are listed in a script that is subjected to an interpreter that generates the result. The purpose of the carrying out of controls is to produce a logical configuration of entities and represent it in graphic form, and as such, as a product of processing, there will be a graph. The set of entities that form part of the graph is called a domain.

CLACL has three groups of statements:

  • Declarations
  • Controls
  • Commands

The declarations reflect the situations of the domain and are the most similar to Prolog.
The controls implement constructs for controlling the flow of the code with loops and expressions.
The commands require or set conditions on the domain.

As with all programming languages, CLACL implements the following key concepts:

  • Variable
  • Instruction
  • Expression
  • Control structures
  • Subprogram
  • Information structures

and additionally implements specialist concepts of the domain of the issues which address:

  • Statements
  • Tests
  • States

The entities that can be generated via the interpretation of the script are:

  • instances
  • relations
  • models
  • forms
  • figure

Instance An instance can be seen as a geometric point in the plane but we are not interested in its position; our interest is its existence within the domain and its relationship with other entities.
Relation A relation describes the relationship between different instances.
Model A model allows the description of complex relations.
Form The form describes the characteristics of a logical figure.
Figure A logical figure can be seen as a geometrical figure.


Generation of an instance:




Generation of a relation:

relation:rl1(instance:a, instance:b)


&rl1(!a, !b)

Definition of a model that represents a triangular configuration:

define model: tris(!a,!b,!c)

Implementation of a cycle:

FOR ($a,$b) in SET[]
    @PRINT(“Instances “,$a,“ - “,$b,NL)

Implementation of a condition

CASE ($x == 0)
    @PRINT(“The value of $x is zero“,NL)

Definition of a function:

define function: switch($a,$b,$c)
    CASE ($a == 1)
        @PRINT($b,” - “,$c,NL)
    CASE ($a == 2)
        @PRINT($c,” - “,$b,NL)

some operations on the set:

def INSI1[4]  // definition of the set of 4 items
ST1[] = ST1[] + ST2[]    // add
ST1[] = ST1[] - ST2[]    // subtract
( ST1[] == ST2[] )    // equals

Example of an expression:

(( ST1[] == ST2[] ) AND (( ST3[] == ST2[] ) OR ( ST4[] == ST1[] )) AND pos(!a == !b))


External links

Personal tools

Served in 0.200 secs.