Among the known state models we chose
weighted tree-like automata and extended finite
automata for code optimization. We provided
several heuristics of how the original models can be
changed in such a way that substituting / deleting a
submachine of the corresponding automaton can
lead to a code with a better performance, disk load,
energy consumption, etc. As the extraction of
original weighted / extended automaton is a hard
problem by itself, we briefly describe how the
corresponding automata can be derived.
We mention that optimization techniques
discussed in the paper are mostly based on the
flexibility of the original model and extracting a sub-
model that can be substituted or simply, deleted.
Such flexibility can be effectively preserved as a
largest solution of the corresponding FSM/automata
equation (Villa et al., 2015). Therefore, as a future
work we would like to apply this theory of equation
solving for code optimization. However, such
perspective arises new theoretical issues such as
solving equations over weighted / extended
automata, establishing (necessary and) sufficient
conditions for the existence of solutions to such
equations, etc. These questions are out of the scope
of this position paper and are left for the future
work. On the other hand, given the fact that state
models are known to be effective for code
generation (Giegerich and Graham, 1992), we are
also interested in the application of FSM / Automata
equation solving for an optimal synthesis of an
‘unknown’ code component.
Certainly, the efficiency of proposed techniques
needs to be experimentally evaluated over larger test
cases (larger source code) and this is another
direction of our future work. We also plan to
experiment in different environments (including
compiled languages) given the fact that the proposed
approach seems to be applicable for any language
parse trees.
ACKNOWLEDGEMENTS
The work was partially supported by the ITEA3
project 14009, MEASURE (http://measure.softeam-
rd.eu, https://itea3.org/project/measure.html).
REFERENCES
Villa, T., Petrenko, A., Yevtushenko, N., Mishchenko, A.
and Brayton, R., 2015. Component-Based Design by
Solving Language Equations. Proceedings of the
IEEE, DOI: 10.1109/JPROC.2015.2450937, Volume:
103, Issue: 11, P: 2152-2167, 2015.
Jones, J., 2003. Abstract syntax tree implementation
idioms. In the proceedings of the 10th conference on
pattern languages of programs.
Nentwich, F., Jovanovic, N., Kirda, E., Kruegel, C.,
Vigna, G., 2007. Cross-Site Scripting Prevention with
Dynamic Data Tainting and Static Analysis. In the
proceedings of the Network and Distributed System
Security Symposium (NDSS’07).
Halfond, W. G. J.,Orso, A., 2005. AMNESIA: Analysis
and Monitoring for NEutralizing SQL-injection
Attacks. In the proceedings of the 20th IEEE/ACM
International Conference on Automated Software
Engineering. P: 174-183.
Smith, R., Estan, C.,Jha, S., Kong, S., 2008. Deflating the
Big Bang: Fast and Scalable Deep Packet Inspection
with Extended Finite Automata. In the proceedings of
the ACM SIGCOMM 2008 Conference on Data
Communication, P:207-218.
Ivan, I., Boja, C., Vochin, M., Nitescu, I., Toma, C., Popa,
M., 2007. Using Genetic Algorithms in Software
Optimization. In WSEAS’07, 6th Int. Conference on
TELECOMMUNICATIONS and INFORMATICS,
Dallas, Texas, USA.
Stallman, R. M. and GCC Developer Community, 2009.
Using The Gnu Compiler Collection: A Gnu Manual
For Gcc Version 4.3.3, CreateSpace, Paramount, CA,
First Edition.
Bakken, S. S., Suraski, Z., Schmid, E., 2000. PHP Manual:
Volume 2, iUniverse, Incorporated.
Wall, L., 2000. Programming Perl, O'Reilly & Associates,
Inc. 3rd edition. Sebastopol, CA, USA.
Popov N., 2016 PHP Parser, URL:
https://github.com/nikic/PHP-Parser, Last visited:
2016-01-14.
Fülöp, Z., Vogler, H., 2009. Weighted Tree Automata and
Tree Transducers, P: 313-403, Handbook of Weighted
Automata, Springer, Berlin Heidelberg
Giegerich, R., and Graham, S L., 1992. Code Generation
— Concepts, Tools, Techniques, the proceedings of
the International Workshop on Code Generation,
Dagstuhl, Germany, Springer –Verlag London