Index: libabac/abac_oset.c
===================================================================
--- libabac/abac_oset.c	(revision 0d0c3a932f0e71b959b6fd3977a3727d9113db47)
+++ libabac/abac_oset.c	(revision c586a3c974eed872c4a41b9c2f5f7db8484b0eef)
@@ -568,4 +568,5 @@
     assert(oset != NULL && oset->is_object);
     abac_term_t *obj=oset->principal_object;
+    char *tmp=abac_term_name(obj);
     return abac_term_name(obj);
 }
Index: libabac/abac_pl.c
===================================================================
--- libabac/abac_pl.c	(revision 0d0c3a932f0e71b959b6fd3977a3727d9113db47)
+++ libabac/abac_pl.c	(revision c586a3c974eed872c4a41b9c2f5f7db8484b0eef)
@@ -212,11 +212,15 @@
  * Run a query on the data in an abac context. Returns a NULL-terminated array
  * of abac_credential_t. Success/failure in *success.
- */
-abac_credential_t **abac_context_query(abac_context_t *ctx, char *role, char *principal, int *success) {
+ * queryfor(either role or oset), with(either keyid or object type)
+ */
+abac_credential_t **abac_context_query(abac_context_t *ctx, char *queryfor, char *with, int *success) {
+    if(debug) {
+         printf("abac_context_query about(%s) with(%s)\n", queryfor, with);
+    }
     abac_credential_t **credentials = NULL, *cur;
-    assert(ctx != NULL); assert(role != NULL);
-    assert(principal != NULL); assert(success != NULL);
-
-    abac_stack_t *result = abac_pl_query(ctx->pl, role, principal);
+    assert(ctx != NULL); assert(queryfor != NULL);
+    assert(with != NULL); assert(success != NULL);
+
+    abac_stack_t *result = abac_pl_query(ctx->pl, queryfor, with);
 
     int size = abac_stack_size(result);
Index: libabac/abac_pl_yap.c
===================================================================
--- libabac/abac_pl_yap.c	(revision 0d0c3a932f0e71b959b6fd3977a3727d9113db47)
+++ libabac/abac_pl_yap.c	(revision c586a3c974eed872c4a41b9c2f5f7db8484b0eef)
@@ -241,6 +241,9 @@
 
     if(debug) printf(" the role part(%s)\n", estring);
+    /* it is possible that cn_prin might have quotes around it */
+    cn_prin=abac_trim_quotes(cn_prin);
     arg[0]=YAP_MkAtomTerm(YAP_LookupAtom(cn_prin));
     if(debug) printf(" the principal part(%s)\n", cn_prin);
+    free(cn_prin);
     arg[1]=YAP_ReadBuffer(estring,eterm);
     arg[2]=YAP_MkVarTerm();
@@ -281,5 +284,5 @@
     abac_stack_t *ret=NULL;
 
-    if(1)
+    if(debug)
         _show_yap_db("DEBUG:calling within _query_with_role");
 
Index: libabac/abac_pl_yy.c
===================================================================
--- libabac/abac_pl_yy.c	(revision 0d0c3a932f0e71b959b6fd3977a3727d9113db47)
+++ libabac/abac_pl_yy.c	(revision c586a3c974eed872c4a41b9c2f5f7db8484b0eef)
@@ -433,6 +433,5 @@
     if(ptr->cond_head_expr != NULL)
         return 1;
-/* only select few */
-    if( ptr->cond_range != NULL && abac_term_is_integer_type(ptr->type))
+    if(ptr->cond_range != NULL)
         return 1;
     return 0;
@@ -1314,4 +1313,5 @@
 void make_yy_range_constraint(abac_yy_term_data_t *ptr, char *var)
 {
+   /* XXXX this only works for integer and float */
    char *typestr=abac_term_type(ptr->type);
    abac_list_t *rlist=get_yy_term_data_cond_range(ptr);
Index: libabac/abac_util.c
===================================================================
--- libabac/abac_util.c	(revision 0d0c3a932f0e71b959b6fd3977a3727d9113db47)
+++ libabac/abac_util.c	(revision c586a3c974eed872c4a41b9c2f5f7db8484b0eef)
@@ -32,4 +32,18 @@
 }
 
+/* make a brand new string with or without being trimmed */
+char *abac_trim_quotes(char *string) {
+    char *tmp=abac_xstrdup(string);
+    int len=strlen(tmp);
+    if( (tmp[len-1] == '\'' || tmp[len-1] == '"') &&
+                       (tmp[0] == '\'' || tmp[0] == '"')) {
+       tmp[len-1]='\0';
+       char *ntmp=abac_xstrdup(&tmp[1]);
+       free(tmp);
+       return ntmp;
+    }
+    return tmp;
+}
+
 /**
  * Split a string based on the given delimiter.
Index: libabac/abac_util.h
===================================================================
--- libabac/abac_util.h	(revision 0d0c3a932f0e71b959b6fd3977a3727d9113db47)
+++ libabac/abac_util.h	(revision c586a3c974eed872c4a41b9c2f5f7db8484b0eef)
@@ -7,4 +7,5 @@
 char *abac_xstrdup(char *);
 void abac_split(char *string, char *delim, char **ret, int *num);
+char *abac_trim_quotes(char *);
 
 #ifdef DEBUG
Index: libabac/prover_yap.c
===================================================================
--- libabac/prover_yap.c	(revision 0d0c3a932f0e71b959b6fd3977a3727d9113db47)
+++ libabac/prover_yap.c	(revision c586a3c974eed872c4a41b9c2f5f7db8484b0eef)
@@ -44,9 +44,11 @@
             if(opts.oset) {
                 query=opts.oset;
-            } else if(opts.principal) {
+            } 
+            if(opts.principal) {
                 with=opts.principal;
             } else if(opts.object) {
                 with=opts.object;
-            } else {
+            }
+            if(with==NULL || query==NULL) {
                 puts("prover eeekkk \n");
                 assert(0);
Index: libabac/rt2.l
===================================================================
--- libabac/rt2.l	(revision 0d0c3a932f0e71b959b6fd3977a3727d9113db47)
+++ libabac/rt2.l	(revision c586a3c974eed872c4a41b9c2f5f7db8484b0eef)
@@ -132,6 +132,13 @@
              if(debug) fprintf(yyout," DOTDOT ");
              return DOTDOT; }
+<STRING_S>[']([^']|\\')*['] |
+<STRING_S>["]([^"]|\")*["] {
+             yylval.string=strdup(yytext); 
+             if(debug) fprintf(yyout," VALUE(STRING)(%s) ", yylval.string);
+             return VALUE; }
 <RANGE_S>{DIGIT}+ | 
 <RANGE_S>-{DIGIT}+ |
+<RANGE_S>-{DIGIT}.{DIGIT}+ |
+<RANGE_S>{DIGIT}.{DIGIT}+ |
 <RANGE_S>{DIGIT}+T{DIGIT}+ {
              yylval.string=strdup(yytext);
Index: libabac/rt2.y
===================================================================
--- libabac/rt2.y	(revision 0d0c3a932f0e71b959b6fd3977a3727d9113db47)
+++ libabac/rt2.y	(revision c586a3c974eed872c4a41b9c2f5f7db8484b0eef)
@@ -216,4 +216,8 @@
 /* [otype:?Z:{oset-constraint}] */
 /* [int:?I:[10 .. 20] */
+/* [float:?F:[0.5 .. 2.5] */
+/* [string:?S:["abc",'efg',"hij"] -only listed range */
+/* urn same as string */
+/* time like int but with quoted string values */
 otypetail :  VARIABLE_CONSTANT COLON 
              { 
