What are the operators available in tlcore? If we are loading up the integer library, we should provide the operations therein, as in the five operators. Is this done?
Recent Updates Page 3 Toggle Comment Threads  Keyboard Shortcuts

cartesianprogramming

cartesianprogramming
Outputtting uuid in tlcore
tlcore uuid
%%
x=5;;
%%
x;;
4557f67592cb498fa684d50f5511a65
intmp<5>This is neat, here are a few comments.
1. The output from the equations section should be separated from the output from the expressions section with a %%.
2. The uuid “4557f67592cb498fa684d50f5511a65” should read “uuid<4557f67592cb498fa684d50f5511a65>“.
3. The output from the equations section is not taking into account the –verbose option.
4. In –verbose mode, we should output equations, demands and expressions as eqn<…>, dem<…> and expr<…>, respectively.
5. Should there be ;; at the end of each line of output?
6. Should there be a separator between the input and output? As in a line —?

jarro2783
uuid or uuid … ?
The rest is easily fixed.
cartesianprogramming
Problems with angle brackets. Now fixed.

jarro2783
and my reply got broken with the angle brackets too, that doesn’t say what I intended it to.


cartesianprogramming
The fix looks good. Points 5 and 6 should be tried out. For point 6, that is two dashes on a separate line, to separate the input lines from the output lines. In the reactive mode, there should be two lines with two dashes, before and after each output. If this is too verbose, we can remove it.



Blanca Mancilla
Yes, the trick is that SorceForge tl doc pages is not updated automatically with the your updates. Local copies do look better. Can this be done automatically?

jarro2783
I’m not sure how to do this automatically. I can at least make a script that uploads the latest documentation, and then we would need to rebuild it every now and then as we add to the code.


Blanca Mancilla
Jarryd, why the “TransLucid Doxygen documentation” doesn’t include all the methods available to a class? Unless I’m missing something, I can’t find the class “Translator” under the class list, only under the “TransLucid Namespace Reference” and there, I can’t find the methods available. Is there a trick?

cartesianprogramming
The “tlcore with demands” and “reactive tlcore” entries have been updated: The ## has been replaced with $$.

Jarryd Beck
Current todo list
This is the current list of features that are required to work to make tlcore begin to be useful. The important system at the moment is the reactive one.
Load libraries in the headerdefine time and pass it in the contextadd time : #time .. inf to the definition of equationsonly begin execution after $$ bestfit with priority
 print uuids
 add a uuid type to allow the manipulation of equations
 delete and replace

cartesianprogramming
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:
dem_{1} → demanswer_{1};;
...
dem_{m} → demanswer_{m} ;;
%%
answer_{1};;
...
answer_{n};;
If the –uuid option is set, then the UUID of the demands is printed out, as it is for equations:
eqnuuid_{1};;
...
eqnuuid_{l};;
%%
dem_{1} → demuuid_{1} → demanswer_{1};;
...
dem_{m} → demuuid_{m} → demanswer_{m} ;;
%%
answer_{1};;
...
answer_{n};;
Should the –verbose option also be set, then the results will be of the form
eqn_{1} → eqnuuid_{1};;
...
eqn_{l} → eqnuuid_{l};;
%%
dem_{1} → demuuid_{1} → demanswer_{1};;
...
dem_{m} → demuuid_{m} → demanswer_{m} ;;
%%
expr_{1} → answer_{1};;
...
expr_{n} → answer_{n};;

jarro2783
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
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
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
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.

cartesianprogramming
tlcore now works up to the level of tlcore –reactive, so it is possible now to have an interactive session. The manual is not yet written, so we will put some examples on the blog.

cartesianprogramming
The first release of TransLucid is now out. See the post from today for downloading TransLucid from Sourceforge. Also see the examples available at


superspreadsheet
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
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 (x_{q}, P_{q}, K_{q}, E_{q}), where P_{q} is the priority of q. Then
q ⊂ q' if x_{q} = x_{q'} and P_{q} < P_{q'} or K_{q} ⊃ K_{q'}

cartesianprogramming
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 (x_{q}, K_{q}, E_{q}), where x_{q} is the variable being defined, K_{q} is the set of contexts where the equation is valid, and E_{q} is the defining expression.
Given two equations q and q’, we write q ⊂ q’ if x_{q} = x_{q’} and K_{q} ⊃ K_{q’}.
If we have a set of equations σ, then best(σ) consists of the bestfit equations in σ , i.e.,
best(σ) = {q ∊ σ  ∄ q' ∊ σ. q ⊂ q'}
The restriction of a set of equations σ to an identifier x and a context κ is written
σxκ = {q ∊ σ  x = x_{q} and κ ∊ K_{q}}
We can now write the semantics for identifiers in equations.
⟦x⟧σκ =
let {q_{1}, ..., q_{n}} = best(σxκ) in
let v_{i} = ⟦E_{qi}⟧σκ in
v_{1} ⊕ ⋯ ⊕ v_{n}
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
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(E_{1}, ..., E_{n})⟧σκ = op(⟦E_{1}⟧σκ, ..., ⟦E_{n}⟧σκ)
⟦if E_{1} then E_{2} else E_{3}⟧σκ = if ⟦E_{1}⟧σκ then ⟦E_{2}⟧σκ else ⟦E_{3}⟧σκ
⟦#E⟧σκ = κ(⟦E⟧σκ)
⟦E_{11}:E_{12}, ..., E_{n1}:E_{n2}⟧σκ = {⟦E_{11}⟧σκ ⟼ ⟦E_{12}⟧σκ, ..., ⟦E_{n1}⟧σκ ⟼ ⟦E_{n2}⟧σκ}
⟦E_{2} @ E_{1}⟧σκ = ⟦E_{2}⟧σ(κ † ⟦E_{1}⟧σκ)
jarro2783 01:29 on 2010/08/27 Permalink 
I don’t understand the question.
tlcore has no built in operators, they all come through loading the integer library and declaring things in the header. Are you wanting some of this to be automatic?
To which five operators are you referring? There are plenty that we could have, all the arithmetic and comparison operators, we could have bitwise operators too. It’s partly a question of how we can implement these with a minimum of typing too.
cartesianprogramming 04:08 on 2010/08/27 Permalink 
I think that there should be a default set of operators. We can always use a flag to turn these on and off. For integers, at the minimum, +, , *, /, %. For comparison, we have a problem with the angle brackets, we could use ge, gt, le, lt.
cartesianprogramming 05:01 on 2010/08/27 Permalink 
Parsing negative numbers is also problematic if we are not using the intmp interface. I propose that we do the same as in Haskell, and use the tilde (~) to indicate a negative number. That way there will be no confusion between ~3 (negativethree) and 3 (the negation operator applied to three).
jarro2783 04:04 on 2010/08/30 Permalink 
I forgot about the angle brackets. Although only < is a problem. Using tilde is a good idea. I think having a default set of operators is a good idea too. We should come up with a reasonable set of associativities and precedences and allow them to be redefined.