Index: examples/example_scripts/allout.save
===================================================================
--- examples/example_scripts/allout.save	(revision 41a0c1ef709f6be34d6d973101d1064a45dcd1e0)
+++ examples/example_scripts/allout.save	(revision da736573573da179d232c5929bf29d356f62d270)
@@ -2,4 +2,6 @@
  ==> RUN on c
 ---running (c) attr script
+   PASSED
+---running (c) attr partial script
    PASSED
 ---running (c) prover script
Index: examples/example_scripts/c/Makefile
===================================================================
--- examples/example_scripts/c/Makefile	(revision 41a0c1ef709f6be34d6d973101d1064a45dcd1e0)
+++ examples/example_scripts/c/Makefile	(revision da736573573da179d232c5929bf29d356f62d270)
@@ -1,3 +1,3 @@
-all: attr prove
+all: attr prove attr_partial
 
 abac_attr.o: abac_attr.c
@@ -6,4 +6,10 @@
 abac_attr: abac_attr.o
 	gcc -g -o abac_attr abac_attr.o -L/usr/local/lib -L/usr/local/lib/ipsec -labac -lYap -lreadline -lm -lstrongswan -Wl,-rpath -Wl,/usr/local/lib/ipsec
+
+abac_attr_partial.o: abac_attr_partial.c
+	gcc -g -I/usr/local/include -c abac_attr_partial.c -o abac_attr_partial.o
+
+abac_attr_partial: abac_attr_partial.o
+	gcc -g -o abac_attr_partial abac_attr_partial.o -L/usr/local/lib -L/usr/local/lib/ipsec -labac -lYap -lreadline -lm -lstrongswan -Wl,-rpath -Wl,/usr/local/lib/ipsec
 
 abac_prover.o: abac_prover.c
@@ -15,15 +21,19 @@
 
 clean:
-	@rm -f abac_attr.o abac_attr *.pem *.der abac_prover.o abac_prover *.log
+	@rm -f abac_attr.o abac_attr *.pem *.der abac_prover.o abac_prover *.log abac_attr_partial.o abac_attr_partial
 
-setup: abac_attr abac_prover
+setup: abac_attr abac_prover abac_attr_partial
 	creddy --generate --cn IceCream
 	creddy --generate --cn Chocolate
 
 attr: 
-	make clean
 	rm -rf attr.log
 	make setup
 	./abac_attr IceCream_ID.pem  IceCream_private.pem IceCream_attr.der Chocolate_ID.pem 1>attr.log 2>&1
+
+attr_partial: 
+	rm -rf attr_partial.log
+	make setup
+	./abac_attr_partial IceCream_ID.pem  IceCream_private.pem IceCream_attr.der Chocolate_ID.pem 1>attr_partial.log 2>&1
 
 prove: 
Index: examples/example_scripts/c/abac_attr_partial.c
===================================================================
--- examples/example_scripts/c/abac_attr_partial.c	(revision da736573573da179d232c5929bf29d356f62d270)
+++ examples/example_scripts/c/abac_attr_partial.c	(revision da736573573da179d232c5929bf29d356f62d270)
@@ -0,0 +1,96 @@
+/**
+   attr_abac.c
+
+   To demonstrate how to use ABAC's api in C with partial proof result
+
+   call:   attr_abac_partial IceCream_ID.pem IceCream_private.pem IceCream_attr.der
+
+   pre-condition: generate IceCream_ID.pem and IceCream_private.pem with
+           creddy --generate --cn IceCream
+                  generate Chocolate_ID.pem and Chocolate_private.pem with
+           creddy --generate --cn IceCream
+
+   This program will generate an attribute rule, write it out to an external
+           file and also load it into the context (prolog db)
+           [keyid:IceCream].delicious <- [Keyid:Chocolate]
+
+   Then, a invalid query is made against the context to see if partial proof is
+working in c
+
+**/
+
+#include <err.h>
+#include <stdio.h>
+#include <assert.h>
+
+#include <abac.h>
+
+extern void abac_print_cred_info(abac_credential_t*, FILE*);
+extern char *abac_id_keyid(abac_id_t *id);
+extern abac_attribute_t *abac_attribute_add_tail(abac_attribute_t *ptr, abac_aspect_t *);
+
+int main(int argc, char **argv) {
+    int i, success=0;
+    abac_credential_t *cred=NULL;
+    abac_credential_t **credentials=NULL;
+
+    abac_context_t *ctx = abac_context_new();
+
+    if(argc != 5) return 1;
+
+    /* build up structure */
+    abac_id_t *id =NULL;
+    id = abac_id_from_file(argv[1]);
+    int rc=abac_id_load_privkey_file(id,argv[2]);
+
+    rc=abac_context_load_id_privkey_chunk(ctx, 
+                  abac_id_cert_chunk(id), 
+                  abac_id_privkey_chunk(id));
+
+    abac_id_t *chocolate_id = abac_id_from_file(argv[4]);
+    rc=abac_context_load_id_id(ctx, chocolate_id); 
+
+    abac_aspect_t *head=abac_role_create(abac_id_keyid(id),"delicious");
+    abac_aspect_t *tail=abac_role_principal_create(abac_id_keyid(chocolate_id));
+    abac_attribute_t *attr;
+    rc=abac_attribute_create(&attr, head, NULL, 1800);
+    abac_attribute_add_tail(attr, tail);
+    rc=abac_attribute_bake(attr);
+
+    printf(" attribute being made : %s\n",abac_attribute_string(attr));
+
+    abac_attribute_write_cert_fname(attr,argv[3]);
+    abac_context_load_attribute_chunk(ctx,abac_attribute_cert_chunk(attr));
+
+    
+    /* make a query */
+    abac_aspect_t *q=abac_role_create(abac_id_keyid(id),"yummy");
+    abac_aspect_t *w=abac_role_principal_create(abac_id_keyid(chocolate_id));
+    char *with=abac_aspect_typed_string(w);
+    char *query=abac_aspect_typed_string(q);
+
+printf("query %s\n", query);
+printf("with %s\n", with);
+
+    if(query !=NULL && with!=NULL) {
+        credentials = abac_context_query(ctx,
+                            query, with,
+                            &success);
+        if (success)
+            puts("prover success!!");
+            else puts("prover failed!!");
+
+        if (credentials != NULL && success) {
+            puts("credentials needed :");
+            for (i = 0; credentials[i] != NULL; ++i) {
+               cred = credentials[i];
+               abac_print_cred_info(cred,NULL);
+            }
+        }
+        if(credentials)
+            abac_context_credentials_free(credentials);
+    }
+
+    abac_context_free(ctx);
+    return 0;
+}
Index: examples/example_scripts/c/run_test
===================================================================
--- examples/example_scripts/c/run_test	(revision 41a0c1ef709f6be34d6d973101d1064a45dcd1e0)
+++ examples/example_scripts/c/run_test	(revision da736573573da179d232c5929bf29d356f62d270)
@@ -6,4 +6,13 @@
 make attr 1>/dev/null 2>& 1
 result=`grep "prover success" attr.log 2>/dev/null`
+if [ "$result" = "" ]; then
+   echo "   ERROR"
+else   
+   echo "   PASSED"
+fi
+
+echo '---running (c) attr partial script'
+make attr_partial 1>/dev/null 2>& 1
+result=`grep "A partial proof" attr_partial.log 2>/dev/null`
 if [ "$result" = "" ]; then
    echo "   ERROR"
