Langdon, William B;
(2022)
Generating Random Infix Expressions for GNU coreutils expr.
UCL Computer Science: London, UK.
Preview |
Text
Langdon_2022_prefix2infix.pdf Download (158kB) | Preview |
Abstract
We use the recent random_tree() addition to GPquick [arXiv:2001.04505] to uniformly sample in linear time the space of binary trees. A unix gawk script transforms these to uniform random infix expressions, as used by Free Software Foundation GNU core utility expr. It converts from Lisp s-expression like prefix representation used by GPquick to bracketed infix expressions, e.g. "(" 3050 "=" 5514 ")" "-" 3073. gawk randomly labels internal tree nodes with the 14 functions known to expr and replaces leafs with randomly chosen positive integers up to 32768. About 80 percent of random expressions are rejected, since they cause expr to fail, typically due to division by zero.
Type: | Report |
---|---|
Title: | Generating Random Infix Expressions for GNU coreutils expr |
Open access status: | An open access version is available from UCL Discovery |
DOI: | 10.14324/000.rp.10157010 |
Publisher version: | https://www.ucl.ac.uk/computer-science/ |
Language: | English |
UCL classification: | UCL > Provost and Vice Provost Offices > UCL BEAMS > Faculty of Engineering Science UCL > Provost and Vice Provost Offices > UCL BEAMS > Faculty of Engineering Science > Dept of Computer Science UCL > Provost and Vice Provost Offices > UCL BEAMS UCL |
URI: | https://discovery-pp.ucl.ac.uk/id/eprint/10157010 |
Archive Staff Only
![]() |
View Item |