Difference between revisions of "The Latex to LSC Compiler"

From WeizmannWiki
Jump to: navigation, search
Line 28: Line 28:
 
Our group has developed a dedicated Latex package for easily creating diagrams with a simple textual notation, and presenting them graphically.
 
Our group has developed a dedicated Latex package for easily creating diagrams with a simple textual notation, and presenting them graphically.
  
The package, called '''pgf-playgo-lsc''', is built upon the ''pgf<ref>T. Tantau and C. Feuersnger, “pgf—Create PostScript and PDF graphics in TEX,” Version 3.01a, 08 2015. [Online]. Available: https://www.ctan.org/pkg/pgf</ref>'' and ''pgf-uml''<ref>X. Yuan, “pgf-umlsd—Draw UML Sequence Diagrams,” Version 0.7, 02 2014. [Online]. Available: https://www.ctan.org/pkg/pgf-umlsd</ref> packages. The package imlements only part of the PlayGo LSC idioms. The complete list of the supported idoms in Latex Con-LSC is given in the Latex [http://www Con-LSC package]. The language semantics is defined in the&nbsp;[https://weizmann.box.com/s/irjrbvlipdol1vm64v0kf7uju00lqzn1 PlayGo userguide], except for the context idioms that are given in the paper.
+
The package, called '''pgf-playgo-lsc''', is built upon the ''pgf<ref>T. Tantau and C. Feuersnger, “pgf—Create PostScript and PDF graphics in TEX,” Version 3.01a, 08 2015. [Online]. Available: https://www.ctan.org/pkg/pgf</ref>'' and ''pgf-uml''<ref>X. Yuan, “pgf-umlsd—Draw UML Sequence Diagrams,” Version 0.7, 02 2014. [Online]. Available: https://www.ctan.org/pkg/pgf-umlsd</ref> packages. The package imlements only part of the PlayGo LSC idioms. The complete list of the supported idioms in Latex Con-LSC is given in the Latex [http://www Con-LSC package]. The language semantics is defined in the&nbsp;[https://weizmann.box.com/s/irjrbvlipdol1vm64v0kf7uju00lqzn1 PlayGo userguide], except for the context idioms that are given in the paper.
  
 
We present here a short example for creating an LSC chart using pgf-playgo-lsc:
 
We present here a short example for creating an LSC chart using pgf-playgo-lsc:
Line 34: Line 34:
 
{| cellspacing="1" cellpadding="0" style="border-top: 1px solid; border-left: 0px; border-right: 0px; border-bottom: 1px solid; width: 600px"
 
{| cellspacing="1" cellpadding="0" style="border-top: 1px solid; border-left: 0px; border-right: 0px; border-bottom: 1px solid; width: 600px"
 
|-
 
|-
| style="vertical-align: top; width: 550px; border:none;" | <div>\begin{LSCnameddiagram}</div><div style="margin-left: 80px;">[title width=p{65px}]<br/></div><div style="margin-left: 80px;">{Turn lights off when motion has stopped}</div><div style="margin-left: 40px;">\newlifeline {light} {light}</div><div style="margin-left: 40px;">\newlifeline {office} {office}</div><div style="margin-left: 40px;">\newlifeline {sensor} {mSensor}</div><div style="margin-left: 40px;"><br/></div><div style="margin-left: 40px;"></div><div style="margin-left: 40px;">\coldmonitor {sensor} {motionStopped()} {office}</div><div style="margin-left: 40px;">\hotexecute {office} {setOff()} {light}</div><div>\end{LSCnameddiagram}</div>
+
| style="vertical-align: top; width: 550px; border:none;" | <div><br/></div><div>\begin{LSCnameddiagram}</div><div style="margin-left: 80px;">[title width=p{65px}]<br/></div><div style="margin-left: 80px;">{Turn lights off when motion has stopped}</div><div style="margin-left: 80px;"><br/></div><div style="margin-left: 40px;">\newlifeline {light} {light}</div><div style="margin-left: 40px;">\newlifeline {office} {office}</div><div style="margin-left: 40px;">\newlifeline {sensor} {mSensor}</div><div style="margin-left: 40px;"><br/></div><div style="margin-left: 40px;"></div><div style="margin-left: 40px;">\coldmonitor {sensor} {motionStopped()} {office}</div><div style="margin-left: 40px;">\hotexecute {office} {setOff()} {light}</div><div style="margin-left: 40px;"><br/></div><div>\end{LSCnameddiagram}</div>
 
| style="border: none; vertical-align: top;" |  
 
| style="border: none; vertical-align: top;" |  
 
[[File:Latex-LSC.jpg|200px|Compiled pgf-playgo-lsc chart]]
 
[[File:Latex-LSC.jpg|200px|Compiled pgf-playgo-lsc chart]]
Line 40: Line 40:
 
|}
 
|}
 
<div></div>
 
<div></div>
The above
+
The above example&nbsp;
  
 
= References =
 
= References =
  
 
<references />
 
<references />

Revision as of 12:39, 18 May 2017

This page explains how to write Contextul LSCs (Con-LSC) in Latex, compile them into PlayGo LSC instances, and finally execute them.

In nutshell, these are the required steps:

  1. Download the PlayGo Environment.
  2. Add Latex Con-LSCs to LSC.tex.
  3. Execute the Latex2PlayGo compiler.
  4. Import the compiled file in PlayGo and execute it.

The PlayGo Environment

First you need to download (here) a PlayGo version that includes a template project and the Latex2PlayGo compiler.

After extracting the zip file you will find the following directory structure (the structure includes only directories relevant to this tutorial). Directories are marked with (D) and files with (F):

(D) PlayGo_4.0_19042017
|
(D) playgo
|
(F) playgo.exe
(D) workspace
|
(D) Latex2Lsc
|
(F) LSC.tex
(F) GeneratedLSC.lsc
(D) src
|
(F) Latex2PlayGoCompiler.java


Executin playgo.exe will start PlayGo.

General links:

PlayGo userguide.

PlayGo homepage - more information and tutorials.

Latex Con-LSC

The Latex Con-LSC Language

Our group has developed a dedicated Latex package for easily creating diagrams with a simple textual notation, and presenting them graphically.

The package, called pgf-playgo-lsc, is built upon the pgf[1] and pgf-uml[2] packages. The package imlements only part of the PlayGo LSC idioms. The complete list of the supported idioms in Latex Con-LSC is given in the Latex Con-LSC package. The language semantics is defined in the PlayGo userguide, except for the context idioms that are given in the paper.

We present here a short example for creating an LSC chart using pgf-playgo-lsc:


\begin{LSCnameddiagram}
[title width=p{65px}]
{Turn lights off when motion has stopped}

\newlifeline {light} {light}
\newlifeline {office} {office}
\newlifeline {sensor} {mSensor}

\coldmonitor {sensor} {motionStopped()} {office}
\hotexecute {office} {setOff()} {light}

\end{LSCnameddiagram}

Compiled pgf-playgo-lsc chart

The above example 

References

  1. T. Tantau and C. Feuersnger, “pgf—Create PostScript and PDF graphics in TEX,” Version 3.01a, 08 2015. [Online]. Available: https://www.ctan.org/pkg/pgf
  2. X. Yuan, “pgf-umlsd—Draw UML Sequence Diagrams,” Version 0.7, 02 2014. [Online]. Available: https://www.ctan.org/pkg/pgf-umlsd