Additional operators

5 views
Skip to first unread message

Adam Kiezun

unread,
Nov 19, 2009, 4:36:34 PM11/19/09
to hampi...@googlegroups.com
Can '<' be included in an uncontroversial way? Wouldn't there be more
than one idea what the order should be?

We have not seen an example constraint that needs these operators yet.
So I'm not able to comment on the final list of what we need. I do see
that we need simpler syntax for inputting regexps (this came up
multiple times), and that we need substring extraction. I see the
value of equality/inequality. I'm not sure about the len (because
everything is fixed length now) or the '<' (because I have not seen
examples of its use).

./adam

On Thu, Nov 19, 2009 at 4:29 PM, Vijay Ganesh <hello...@gmail.com> wrote:
> Hi All,
>
> Are we planning to support "not equal" in our language? More
> generally, would I be correct in saying that the following are the
> predicates and functions of HAMPI++:
>
>  == (equality),  != (not equal), < (some kind of ordering over
> strings, lexicographic?), member of, not member of, and the function
> len.
>
> -Vijay.
>

Vijay Ganesh

unread,
Nov 19, 2009, 4:38:35 PM11/19/09
to hampi...@googlegroups.com
Ok. How about 'not equal'?

-Vijay.

Adam Kiezun

unread,
Nov 19, 2009, 4:41:48 PM11/19/09
to hampi...@googlegroups.com
no problem about that. If we have equal, we need unequal.
./adam

Devdatta

unread,
Dec 7, 2009, 2:36:01 PM12/7/09
to hampi...@googlegroups.com
Hi

> So I'm not able to comment on the final list of what we need. I do see
> that we need simpler syntax for inputting regexps (this came up
> multiple times),

From your interactions with potential users, did you get examples of
RegExps that users want to use directly ? I could use them while
writing the PCRE->Hampi translator.

Cheers
Devdatta

Adam Kiezun

unread,
Dec 7, 2009, 2:52:16 PM12/7/09
to hampi-devel
I've requested comments about this from prof. Tao Xie from North
Carolina (who had expressed interest in this feature).

Perhaps prof. Willem Visser from Stellenbosch U. (who is on this list
mailing list, and who has included Hampi in JPF while at NASA) has
some examples also.

./adam

Tim Hinrichs

unread,
Dec 7, 2009, 3:47:22 PM12/7/09
to hampi...@googlegroups.com
Hi all,

I haven't been following the technical details of this discussion
closely, but as a potential user I have some example regexps for
you. They all come from Javascript.
http://www.javascriptkit.com/javatutors/redev2.shtml


^[\\w\\.=-]+@[\\w\\.-]+\\.[\\w\\.-]{2,4}$
^[a-zA-Z]*$
^\\w*$
^-?\\d\\d*$
^\\d\\d*$
^-?(\\d\\d*\\.\\d*$)|(^-?\\d\\d*$)|(^-?\\.\\d\\d*$)
[\\w_]*\\.([pP][dD][fF])$
[\\w_]*\\.([gG][iI][fF])|([jJ][pP][eE]?[gG])$
[\\w_]*\\.([jJ][pP][eE]?[gG])$
[\\w_]*\\.([zZ][iI][pP])$
[\\w_]*\\.\\w{3}$
^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$

Sorry if this isn't on point.
Tim

Adam Kiezun

unread,
Dec 7, 2009, 4:34:00 PM12/7/09
to hampi-devel
Thanks Tim. I think this is more or less what Devdatta was looking for.

One thing we could do is to write a simple generative grammar for
regexps and simply generate a ton of random examples (a generator like
that actually used to be part of Hampi, it would come handy here. I
still have the code actually). I guess these regexps don't even form
a cfg - you could write a regexp that generates the regexps. Or just
use Hampi itself - encode a grammar that genenerates the regexps and
repeatedly ask for examples from the grammar.

./adam

prateeks

unread,
Dec 7, 2009, 5:08:46 PM12/7/09
to hampi...@googlegroups.com

Adam Kiezun wrote:
> Thanks Tim. I think this is more or less what Devdatta was looking for.
>
> One thing we could do is to write a simple generative grammar for
> regexps and simply generate a ton of random examples (a generator like
> that actually used to be part of Hampi, it would come handy here. I
> still have the code actually). I guess these regexps don't even form
> a cfg - you could write a regexp that generates the regexps. Or just
> use Hampi itself - encode a grammar that genenerates the regexps and
> repeatedly ask for examples from the grammar.
>
>
We have a set of about 1000 that we collected in our experiments
(similar to Tim's collection), and WebKit comes with a bunch of regex
tests, I believe.

So, currently we don't plan to support back-references, though we know
how to encode it. I hope this isn't a deal breaker for anyone....

--Prateek.

Devdatta

unread,
Dec 7, 2009, 5:51:24 PM12/7/09
to hampi...@googlegroups.com
'\\w' seems to be common.

Is this '\' followed by 'w'
or is it just '\w' for word ?

Cheers
Devdatta

2009/12/7 Tim Hinrichs <thin...@gmail.com>:

Tim Hinrichs

unread,
Dec 7, 2009, 6:07:34 PM12/7/09
to hampi...@googlegroups.com
Sorry. There are double escapes in there b/c they're embedded in
Javascript. I didn't notice before sending. So \\w is just \w (for
word) and \\d is just \d (for digit). Below is the same list after
manually removing the double escapes.

^[\w\.=-]+@[\w\.-]+\.[\w\.-]{2,4}$
^[a-zA-Z]*$
^\w*$
^-?\d\d*$
^\d\d*$
^-?(\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)
[\w_]*\.([pP][dD][fF])$
[\w_]*\.([gG][iI][fF])|([jJ][pP][eE]?[gG])$
[\w_]*\.([jJ][pP][eE]?[gG])$
[\w_]*\.([zZ][iI][pP])$
[\w_]*\.\w{3}$
^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$

Tim

Adam Kiezun

unread,
Dec 7, 2009, 8:03:23 PM12/7/09
to hampi-devel
The recent paper by prof. Tao Xie and N. Tillman, J. de Halleux, and W. Schulte
https://sites.google.com/site/asergrp/projects/reggae
has some additional examples.

BTW, Prof. Xie and his student Madhuri R. Marri are now also members
of the mailing list. Welcome!

./adam
Reply all
Reply to author
Forward
0 new messages