Langdon, William B;
Generating Random Infix Expressions for GNU coreutils expr.
UCL Computer Science: London, UK.
Access restricted to UCL open access staff
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.
|Title:||Generating Random Infix Expressions for GNU coreutils expr|
|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
Downloads since deposit
Archive Staff Only