Updates from June, 2010 Toggle Comment Threads | Keyboard Shortcuts

  • cartesianprogramming 05:36 on 2010/06/15 Permalink | Reply  

    tlcore with demands 

    When the –demands option is set in tlcore, then it can handle demands. In this case, in each instant, there are four parts, not three. The fourth part is introduced with another %% pair, as follows:

    header
    %%
    equations
    %%
    demands
    %%
    expressions
    $$
    header
    %%
    equations
    %%
    demands
    %%
    expressions
    $$
    ...

    A demand requests that a variable be computed in a specific context. It is written as a pair

    (x,tuple);;

    and it is registered internally by the system with a UUID. At each instant, should the tuple be valid in that instant, then this pair is evaluated, producing the result, along with the other expressions. The response for an instant therefore looks like this:

    dem1demanswer1;;
    ...
    demmdemanswerm ;;
    %%
    answer1;;
    ...
    answern;;

    If the –uuid option is set, then the UUID of the demands is printed out, as it is for equations:

    eqnuuid1;;
    ...
    eqnuuidl;;
    %%
    dem1demuuid1demanswer1;;
    ...
    demmdemuuidmdemanswerm ;;
    %%
    answer1;;
    ...
    answern;;

    Should the –verbose option also be set, then the results will be of the form

    eqn1eqnuuid1;;
    ...
    eqnleqnuuidl;;
    %%
    dem1demuuid1demanswer1;;
    ...
    demmdemuuidmdemanswerm ;;
    %%
    expr1answer1;;
    ...
    exprnanswern;;

     
    • jarro2783 14:00 on 2010/06/20 Permalink | Reply

      Are demands always added to the previous demands? So at any time instant, all the demands from previous instants are evaluated if valid?
      Also where is this context for demands coming from?
      Suppose I write
      (fact, [0:15]);;
      Where does the 0 dimension come from?

      • cartesianprogramming 19:37 on 2010/06/24 Permalink | Reply

        Yes, demands are added to previous demands. But, because there are UUIDs, you can also replace and delete demands, as you can for definitions.

        The 0 dimension just is.

    • yvdriess 13:02 on 2010/06/30 Permalink | Reply

      Could you give a usage example of tlcore? I’ve managed to compile everything, but I cannot seem to get anything out of tlcore.

    • yvdriess 13:43 on 2010/07/07 Permalink | Reply

      Do you have some example input you can pass to tlcore for this? I tried out the repository code, but it isn’t reacting to any input.

    • superspreadsheet 05:47 on 2010/08/24 Permalink | Reply

      Dimension 0 comes from the equations, right? What would happen differently if there were an aether? I’m still looking for the notion of a context in the way TransLucid is running now.

  • cartesianprogramming 04:43 on 2010/06/15 Permalink | Reply  

    Bestfitting with time and priority 

    The simplified bestfitting becomes even simpler in the presence of time and priority. We no longer need deftime nor validtime dimensions. We simply need to use the time dimension. Then definitions might have the form

    x | [time:40..50, priority:2] = E

    There is nothing special about the time dimension as far as bestfitting is concerned. For the priority dimension, this is different, as it is an ordered dimension. We need to adapt the refinement order ⊂ on equations so that the priority is considered first. We can consider an equation q as a quadruple (xq, Pq, Kq, Eq), where Pq is the priority of q. Then

    qq' if xq = xq' and Pq < Pq' or KqKq'

     
  • cartesianprogramming 04:31 on 2010/06/15 Permalink | Reply  

    Bestfitting simplified 

    With the simplification of contexts, bestfitting becomes simpler as well, as does the semantics for identifiers in expressions.

    An equation q is, conceptually, a triple (xq, Kq, Eq), where xq is the variable being defined, Kq is the set of contexts where the equation is valid, and Eq is the defining expression.

    Given two equations q and q’, we write qq’ if xq = xq’ and KqKq’.

    If we have a set of equations σ, then best(σ) consists of the bestfit equations in σ , i.e.,

    best(σ) = {q ∊ σ | ∄ q' ∊ σ. qq'}

    The restriction of a set of equations σ to an identifier x and a context κ is written

    σ|xκ = {q ∊ σ | x = xq and κ ∊ Kq}

    We can now write the semantics for identifiers in equations.

    x⟧σκ =
    let {q1, ..., qn} = best(σ|xκ) in
    let vi = ⟦Eqi⟧σκ in
    v1 ⊕ ⋯ ⊕ vn

    where ⊕ is the combining operator. The simplest combining operator checks that all of its arguments are identical, and returns that value. In the general language, each identifier could have its own combining operator, which could be any commutative, associative operator.

     
  • cartesianprogramming 03:40 on 2010/06/15 Permalink | Reply  

    Contexts simplified 

    In previous work on TransLucid, it was never clear whether a context was a finite or an infinite object. Well, it turns out that by making it an infinite object, then the semantics is a lot cleaner, and bestfitting will become simpler as well. This is the way that it works. Let D be the domain of atomic values. Then a context κ is an element of K = D to D, and a set of contexts K is a subset of K. Then the denotational semantics of TransLucid expressions is much more easily expressed. Here it is, ignoring identifiers and undefined values:


    c⟧σκ = c
    op(E1, ..., En)⟧σκ = op(⟦E1⟧σκ, ..., ⟦En⟧σκ)
    if E1 then E2 else E3⟧σκ = if ⟦E1⟧σκ then ⟦E2⟧σκ else ⟦E3⟧σκ
    #E⟧σκ = κ(⟦E⟧σκ)
    ⟦E11:E12, ..., En1:En2⟧σκ = {⟦E11⟧σκ ⟼ ⟦E12⟧σκ, ..., ⟦En1⟧σκ ⟼ ⟦En2⟧σκ}
    ⟦E2 @ E1⟧σκ = ⟦E2⟧σ(κ † ⟦E1⟧σκ)

     
  • cartesianprogramming 19:36 on 2010/06/10 Permalink | Reply  

    TransLucid Doxygen documentation 

    The documentation automatically generated by Doxygen for the TransLucid code can be found at
    http://translucid.sourceforge.net/doc/index.html

     
  • cartesianprogramming 19:33 on 2010/06/10 Permalink | Reply  

    Reactive tlcore 

    When the –reactive option is set for tlcore, then the application becomes reactive, and the set of equations is allowed to vary over time, and the expressions being evaluated can refer to the time dimension. The idea is that at each instant,

    • The header may be added to.
    • The set of equations may be modified.
    • The set of expressions to be evaluated may be modified.
    • Then the expressions for that instant are evaluated.

    When tlcore is reading from the standard input, then the input will be of the form

    header
    %%
    equations
    %%
    expressions
    $$
    header
    %%
    equations
    %%
    expressions
    $$
    ...

    Each instant corresponds to the lines appearing between successive occurrences of $$.
    The output is of the same form as the input, with occurrences of $$ to separate the different instants.

    When the input is given in the form of option —input=infile, then the entire input, for all instants, is read from infile. When the input is given in the form of option –inputiter=inprefix, then the input for instant n comes from file inprefixn. In other words, the input for each instant is placed in a different file.

    Similarly for –output and –outputiter.

    If the –uuid option is set, then the universal identifiers for the equations are presented to the programmer, who can then manipulate them explicitly, with lines like the following two:

    delete eqnuuid1;;
    replace eqnuuid2 equation;;

    For the first line, if #time, the time that this line is added to the equations, has value t, then from t on, eqnuuid1 is no longer usable. For the second line, the equation corresponding to eqnuuid2 is replaced, from t on, with equation. If the value of #time is changed to t’, which happens to be less than t, then all of the equations available at time t’ continue to be accessible.

    Changes to the set of equations are done synchronously. All additions, deletions and replacements for a given instant are done as a single transaction, and must be consistent.

    An empty instant stops the tlcore program.

     
  • cartesianprogramming 18:41 on 2010/06/10 Permalink | Reply  

    Equation UUIDs 

    When an equation is added to the TransLucid system, it is automatically given a unique identifier, generated by the Boost.UUID library. When tlcore is passed the –uuid option, then both the equations and the expressions will return results. The results will be of the form

    eqnuuid1;;
    ...
    eqnuuidm;;
    %%
    answer1;;
    ...
    answern;;

    Should the –verbose option also be set, then the results will be of the form

    eqn1eqnuuid1;;
    ...
    eqnmeqnuuidm;;
    %%
    expr1answer1;;
    ...
    exprnanswern;;

     
    • superspreadsheet 15:49 on 2010/06/11 Permalink | Reply

      From a practical point of view, it is not clear to me what the difference is between expressions and equations. They could both define and both be evaluated… No?

  • cartesianprogramming 17:26 on 2010/06/10 Permalink | Reply  

    Bestfitting 

    When the interpreter is evaluating an expression in a given context κ and comes across a variable x to be evaluated, the bestfit definition of x must be chosen. This process consists of examining, for each definition, the context guard and Boolean guard for that definition. The applicable definitions are the ones for which the current context κ is enclosed in the context guard and for which the Boolean guard evaluates to true. The bestfit definition, should it exist, is the one applicable definition whose context guard defines a region completely (and strictly) contained inside the context guard of each of the other applicable definitions.

    Bestfitting becomes more complicated when the predefined priority, deftime and validtime dimensions are introduced. Both deftime and validtime are natural numbers, referring to the same time line, while priority is a natural number meaning that the higher the priority, the higher the number. The priority and validtime dimensions are controlled by the programmer, while the deftime dimension is controlled by the interpreter. For example, for the equation


    should #time be between 10 and 15, inclusive, then this equation is valid and has priority 2. The deftime for this equation is when it is added to the system.

    The validtime dimension is simply used to restrict the context guard. However, the deftime and priority act differently, as they are ordered dimensions. Once all of the applicable definitions are found, then they are further restricted, first using the priority dimension, then the deftime dimension. For both these dimensions, higher numbers are favored.

     
  • cartesianprogramming 12:51 on 2010/06/10 Permalink | Reply  

    The tlcore application 

    Now that the Core TransLucid library has been developed, it is time to develop some applications.
    The first application is called tlcore. It simply reads, either from a file or from the standard input, a TransLucid header, set of equations and set of expressions. The expressions are then evaluated one by one, and the results are placed on the standard output or in a file.

    The interface is as follows:

    tlcore --input=infile --output=outfile

    along with the standard –verbose and –version options.

    If the –input option is not provided, input is read from the standard input.
    If the –output option is not provided, output is written to the standard output.
    All errors or log messages, including version information, are written to the standard error.

    The syntax of the files is simple. It consists of three parts:

    header
    %%
    equations
    %%
    expressions

    where each part follows its standard syntax.

    The expressions are to be read, one by one, and then evaluated. The answers are provided as follows:

    answer1;;
    ...;;
    answern;;

    Should the –verbose option be used, then the output will be

    expr1answer1;;
    ...;;
    exprnanswern;;

    The inContext variable is used to define the default context for parsing expressions.

    The outContext variable is used to define the default context for printing expressions.

     
    • superspreadsheet 15:31 on 2010/06/11 Permalink | Reply

      What is the difference between the Core TransLucid library and tlcore? Why is tlcore an application? Or rather what does it do exactly for the user?

      • cartesianprogramming 15:34 on 2010/06/11 Permalink | Reply

        tlcore is an interpreter of the TransLucid language, implemented using the Core TransLucid library. It allows direct use of TransLucid without having to write any C++ code.

    • superspreadsheet 15:34 on 2010/06/11 Permalink | Reply

      Again, from a user point of view, what ts the syntax of the header, equation and expression. Where can we find out? Is there a link?

      • cartesianprogramming 15:37 on 2010/06/11 Permalink | Reply

        Official user documentation does not yet exist. When it does, it will be made part of the TransLucid distribution. In the meantime, use the papers on TransLucid as a guide.

    • superspreadsheet 15:36 on 2010/06/11 Permalink | Reply

      Where are inContext and outContext defined? In the command line? In the program? IOW, by user or programmer?

  • cartesianprogramming 09:06 on 2010/06/10 Permalink | Reply  

    TransLucid 

    The language for developing Cartesian Programming is called TransLucid.
    Its home site, with the source code, is http://translucid.sourceforge.net

     
c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel