The following example return UNSAT.
var hampiStringVar : 5 ;
cfg flax0 := q0;
cfg q0 := "=" q1 ;
cfg q1 := ;
// --------------------------------
assert hampiStringVar not in flax0 ;
If the first line is changed to "var hampiStringVar : 1", it works.
-- Prateek.
var hampiStringVar : 2 ;
cfg flax0 := "x";
assert hampiStringVar not in flax0 ;
I believe (without looking at the code yet) the reason is that Hampi
is trying to be smart and notices that flax0 cannot be expanded to
size 2 and so it says UNSAT! without checking whether the assertion is
an 'in' or 'not in'.
I'm may going to be able to fix this right now due to other work. Can
you look into it? I'll be very happy to put the patch in.
Thanks
./adam
I removed the check that returned NULL when a grammar can't return
empty string and I think that this fixes it.
@Adam : I might be really wrong .. please confirm!
--- src/hampi/grammars/apps/GrammarStringBounder.java (revision 20)
+++ src/hampi/grammars/apps/GrammarStringBounder.java (working copy)
@@ -141,9 +141,8 @@
}
Regexp result;
- if (x.isEmpty() && !canGenerateEmptyString){
- result = null;
- }else if (x.isEmpty() && canGenerateEmptyString){
+
+ if (x.isEmpty()){
Hampi h = new Hampi();
result = h.constRegexp("");
}else if (x.size() == 1){
Index: src/hampi/Hampi.java
Cheers
Devdatta
2009/11/2 prateeks <prat...@eecs.berkeley.edu>:
Consider that I want to find a string that is of length 5 and does not
contain "=" in it. How would I write this as a constraint to Hampi ?
Cheers
Devdatta
2009/11/2 Devdatta <dev.a...@gmail.com>:
./adam
var hampiStringVar : 5 ;
cfg Text := (Sigma)* ;
cfg Sigma := ['a'-'z'] | "=" | "_";
assert hampiStringVar in Text ;
assert hampiStringVar not contains "=";
This limitation is something I'd like to see resolved at some point -
I think Hampi could just assume the ASCII alphabet (or, at least emit
a warning that specifying an alphabet is required).
./adam