removed dependency from glu, now cplint depends only on CUDD
This commit is contained in:
parent
5a19dd372a
commit
63e0523a43
371
configure
vendored
371
configure
vendored
@ -8301,374 +8301,13 @@ if test ! "$yap_cv_cplint" = "no"
|
||||
LDFLAGS=${LDFLAGS}" `echo $GLIBS | awk '{print $1}'` -L$prefix/lib/"
|
||||
if test ! "$yap_cv_cplint" = "yes"
|
||||
then
|
||||
LDFLAGS+=" -L${yap_cv_cplint}/lib"
|
||||
CPLINT_LDFLAGS+=" -L${yap_cv_cplint}/lib"
|
||||
CPLINT_LDFLAGS+=" -L${yap_cv_cplint}/cudd -L${yap_cv_cplint}/mtr -L${yap_cv_cplint}/st -L${yap_cv_cplint}/util -L${yap_cv_cplint}/epd "
|
||||
CPLINT_CFLAGS+=" -I${yap_cv_cplint}/include"
|
||||
CPLINT_LIBS="-lcudd -lmtr -lst -lutil -lepd -lm "$CPLINT_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:$LINENO: checking for library containing g_hash_table_new" >&5
|
||||
$as_echo_n "checking for library containing g_hash_table_new... " >&6; }
|
||||
if test "${ac_cv_search_g_hash_table_new+set}" = set; then
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_func_search_save_LIBS=$LIBS
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char g_hash_table_new ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return g_hash_table_new ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
for ac_lib in '' glib-2.0; do
|
||||
if test -z "$ac_lib"; then
|
||||
ac_res="none required"
|
||||
else
|
||||
ac_res=-l$ac_lib
|
||||
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
|
||||
fi
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
|
||||
$as_echo "$ac_try_echo") >&5
|
||||
(eval "$ac_link") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest$ac_exeext && {
|
||||
test "$cross_compiling" = yes ||
|
||||
$as_test_x conftest$ac_exeext
|
||||
}; then
|
||||
ac_cv_search_g_hash_table_new=$ac_res
|
||||
else
|
||||
$as_echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
|
||||
fi
|
||||
|
||||
rm -rf conftest.dSYM
|
||||
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
||||
conftest$ac_exeext
|
||||
if test "${ac_cv_search_g_hash_table_new+set}" = set; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test "${ac_cv_search_g_hash_table_new+set}" = set; then
|
||||
:
|
||||
else
|
||||
ac_cv_search_g_hash_table_new=no
|
||||
fi
|
||||
rm conftest.$ac_ext
|
||||
LIBS=$ac_func_search_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_g_hash_table_new" >&5
|
||||
$as_echo "$ac_cv_search_g_hash_table_new" >&6; }
|
||||
ac_res=$ac_cv_search_g_hash_table_new
|
||||
if test "$ac_res" != no; then
|
||||
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||
CPLINT_LIBS="-lglib-2.0 "
|
||||
else
|
||||
{ { $as_echo "$as_me:$LINENO: error: This package needs glib >=2.0." >&5
|
||||
$as_echo "$as_me: error: This package needs glib >=2.0." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:$LINENO: checking for library containing array_do_alloc" >&5
|
||||
$as_echo_n "checking for library containing array_do_alloc... " >&6; }
|
||||
if test "${ac_cv_search_array_do_alloc+set}" = set; then
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_func_search_save_LIBS=$LIBS
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char array_do_alloc ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return array_do_alloc ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
for ac_lib in '' glu; do
|
||||
if test -z "$ac_lib"; then
|
||||
ac_res="none required"
|
||||
else
|
||||
ac_res=-l$ac_lib
|
||||
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
|
||||
fi
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
|
||||
$as_echo "$ac_try_echo") >&5
|
||||
(eval "$ac_link") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest$ac_exeext && {
|
||||
test "$cross_compiling" = yes ||
|
||||
$as_test_x conftest$ac_exeext
|
||||
}; then
|
||||
ac_cv_search_array_do_alloc=$ac_res
|
||||
else
|
||||
$as_echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
|
||||
fi
|
||||
|
||||
rm -rf conftest.dSYM
|
||||
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
||||
conftest$ac_exeext
|
||||
if test "${ac_cv_search_array_do_alloc+set}" = set; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test "${ac_cv_search_array_do_alloc+set}" = set; then
|
||||
:
|
||||
else
|
||||
ac_cv_search_array_do_alloc=no
|
||||
fi
|
||||
rm conftest.$ac_ext
|
||||
LIBS=$ac_func_search_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_array_do_alloc" >&5
|
||||
$as_echo "$ac_cv_search_array_do_alloc" >&6; }
|
||||
ac_res=$ac_cv_search_array_do_alloc
|
||||
if test "$ac_res" != no; then
|
||||
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||
CPLINT_LIBS="-lglu "$CPLINT_LIBS
|
||||
else
|
||||
{ { $as_echo "$as_me:$LINENO: error: This package needs glu." >&5
|
||||
$as_echo "$as_me: error: This package needs glu." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:$LINENO: checking for library containing Cudd_Init" >&5
|
||||
$as_echo_n "checking for library containing Cudd_Init... " >&6; }
|
||||
if test "${ac_cv_search_Cudd_Init+set}" = set; then
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_func_search_save_LIBS=$LIBS
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char Cudd_Init ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return Cudd_Init ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
for ac_lib in '' cu; do
|
||||
if test -z "$ac_lib"; then
|
||||
ac_res="none required"
|
||||
else
|
||||
ac_res=-l$ac_lib
|
||||
LIBS="-l$ac_lib -lglu -lm $ac_func_search_save_LIBS"
|
||||
fi
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
|
||||
$as_echo "$ac_try_echo") >&5
|
||||
(eval "$ac_link") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest$ac_exeext && {
|
||||
test "$cross_compiling" = yes ||
|
||||
$as_test_x conftest$ac_exeext
|
||||
}; then
|
||||
ac_cv_search_Cudd_Init=$ac_res
|
||||
else
|
||||
$as_echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
|
||||
fi
|
||||
|
||||
rm -rf conftest.dSYM
|
||||
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
||||
conftest$ac_exeext
|
||||
if test "${ac_cv_search_Cudd_Init+set}" = set; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test "${ac_cv_search_Cudd_Init+set}" = set; then
|
||||
:
|
||||
else
|
||||
ac_cv_search_Cudd_Init=no
|
||||
fi
|
||||
rm conftest.$ac_ext
|
||||
LIBS=$ac_func_search_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_Cudd_Init" >&5
|
||||
$as_echo "$ac_cv_search_Cudd_Init" >&6; }
|
||||
ac_res=$ac_cv_search_Cudd_Init
|
||||
if test "$ac_res" != no; then
|
||||
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||
CPLINT_LIBS="-lcu "$CPLINT_LIBS
|
||||
else
|
||||
{ { $as_echo "$as_me:$LINENO: error: This package needs glu." >&5
|
||||
$as_echo "$as_me: error: This package needs glu." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:$LINENO: checking for library containing pow" >&5
|
||||
$as_echo_n "checking for library containing pow... " >&6; }
|
||||
if test "${ac_cv_search_pow+set}" = set; then
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_func_search_save_LIBS=$LIBS
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
|
||||
/* Override any GCC internal prototype to avoid an error.
|
||||
Use char because int might match the return type of a GCC
|
||||
builtin and then its argument prototype would still apply. */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
char pow ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return pow ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
for ac_lib in '' m; do
|
||||
if test -z "$ac_lib"; then
|
||||
ac_res="none required"
|
||||
else
|
||||
ac_res=-l$ac_lib
|
||||
LIBS="-l$ac_lib -lglu -lm $ac_func_search_save_LIBS"
|
||||
fi
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (ac_try="$ac_link"
|
||||
case "(($ac_try" in
|
||||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
|
||||
*) ac_try_echo=$ac_try;;
|
||||
esac
|
||||
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
|
||||
$as_echo "$ac_try_echo") >&5
|
||||
(eval "$ac_link") 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } && {
|
||||
test -z "$ac_c_werror_flag" ||
|
||||
test ! -s conftest.err
|
||||
} && test -s conftest$ac_exeext && {
|
||||
test "$cross_compiling" = yes ||
|
||||
$as_test_x conftest$ac_exeext
|
||||
}; then
|
||||
ac_cv_search_pow=$ac_res
|
||||
else
|
||||
$as_echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
|
||||
fi
|
||||
|
||||
rm -rf conftest.dSYM
|
||||
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
|
||||
conftest$ac_exeext
|
||||
if test "${ac_cv_search_pow+set}" = set; then
|
||||
break
|
||||
fi
|
||||
done
|
||||
if test "${ac_cv_search_pow+set}" = set; then
|
||||
:
|
||||
else
|
||||
ac_cv_search_pow=no
|
||||
fi
|
||||
rm conftest.$ac_ext
|
||||
LIBS=$ac_func_search_save_LIBS
|
||||
fi
|
||||
{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_pow" >&5
|
||||
$as_echo "$ac_cv_search_pow" >&6; }
|
||||
ac_res=$ac_cv_search_pow
|
||||
if test "$ac_res" != no; then
|
||||
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||
CPLINT_LIBS="-lm "$CPLINT_LIBS
|
||||
else
|
||||
{ { $as_echo "$as_me:$LINENO: error: This package needs m." >&5
|
||||
$as_echo "$as_me: error: This package needs m." >&2;}
|
||||
{ (exit 1); exit 1; }; }
|
||||
fi
|
||||
|
||||
#AC_SEARCH_LIBS([g_hash_table_new], [glib-2.0], [], [AC_MSG_ERROR([This package needs glib >=2.0.], [1])], [])
|
||||
#AC_SEARCH_LIBS([Cudd_Init], [cudd], [], [AC_MSG_ERROR([This package needs CUDD.], [1])], [-lcudd -lmtr -lst -lutil -lepd -lm])
|
||||
#AC_SEARCH_LIBS([pow], [m], [], [AC_MSG_ERROR([This package needs m.], [1])], [-lm])
|
||||
ENABLE_CPLINT=""
|
||||
if test "$target_os" = "cygwin" -o "$target_os" = "mingw32"
|
||||
then
|
||||
|
11
configure.in
11
configure.in
@ -1239,14 +1239,13 @@ if test ! "$yap_cv_cplint" = "no"
|
||||
LDFLAGS=${LDFLAGS}" `echo $GLIBS | awk '{print $1}'` -L$prefix/lib/"
|
||||
if test ! "$yap_cv_cplint" = "yes"
|
||||
then
|
||||
LDFLAGS+=" -L${yap_cv_cplint}/lib"
|
||||
CPLINT_LDFLAGS+=" -L${yap_cv_cplint}/lib"
|
||||
CPLINT_LDFLAGS+=" -L${yap_cv_cplint}/cudd -L${yap_cv_cplint}/mtr -L${yap_cv_cplint}/st -L${yap_cv_cplint}/util -L${yap_cv_cplint}/epd "
|
||||
CPLINT_CFLAGS+=" -I${yap_cv_cplint}/include"
|
||||
CPLINT_LIBS="-lcudd -lmtr -lst -lutil -lepd -lm "$CPLINT_LIBS
|
||||
fi
|
||||
AC_SEARCH_LIBS([g_hash_table_new], [glib-2.0], [CPLINT_LIBS="-lglib-2.0 "], [AC_MSG_ERROR([This package needs glib >=2.0.], [1])], [])
|
||||
AC_SEARCH_LIBS([array_do_alloc], [glu], [CPLINT_LIBS="-lglu "$CPLINT_LIBS], [AC_MSG_ERROR([This package needs glu.], [1])], [])
|
||||
AC_SEARCH_LIBS([Cudd_Init], [cu], [CPLINT_LIBS="-lcu "$CPLINT_LIBS], [AC_MSG_ERROR([This package needs glu.], [1])], [-lglu -lm])
|
||||
AC_SEARCH_LIBS([pow], [m], [CPLINT_LIBS="-lm "$CPLINT_LIBS], [AC_MSG_ERROR([This package needs m.], [1])], [-lglu -lm])
|
||||
#AC_SEARCH_LIBS([g_hash_table_new], [glib-2.0], [], [AC_MSG_ERROR([This package needs glib >=2.0.], [1])], [])
|
||||
#AC_SEARCH_LIBS([Cudd_Init], [cudd], [], [AC_MSG_ERROR([This package needs CUDD.], [1])], [-lcudd -lmtr -lst -lutil -lepd -lm])
|
||||
#AC_SEARCH_LIBS([pow], [m], [], [AC_MSG_ERROR([This package needs m.], [1])], [-lm])
|
||||
ENABLE_CPLINT=""
|
||||
if test "$target_os" = "cygwin" -o "$target_os" = "mingw32"
|
||||
then
|
||||
|
@ -1,32 +1,26 @@
|
||||
This directory contains the code of the LPAD anc CP-logic interpreter cplint
|
||||
|
||||
COMPILATION:
|
||||
This package requires GLU (a subpackage of VIS) and GLIB version 1.2.
|
||||
You can download GLU from http://vlsi.colorado.edu/~vis/getting_VIS_2.1.html
|
||||
This package requires CUDD and GLIB version 1.2.
|
||||
You can download CUDD from http://vlsi.colorado.edu/~fabio/CUDD/
|
||||
You can download GLIB from http://www.gtk.org/. This is a standard Linux package
|
||||
so it is easy to install using the package management software of your Linux
|
||||
distribution
|
||||
|
||||
INSTALLATION:
|
||||
Install glu:
|
||||
1) downlad glu-2.1.tar.gz
|
||||
Compile CUDD:
|
||||
1) downlad cudd-2.4.2.tar.gz
|
||||
2) decompress it
|
||||
3) cd glu-2.1
|
||||
3) mkdir arch
|
||||
4) cd arch
|
||||
5) ../configure
|
||||
6) make
|
||||
7) su
|
||||
8) make install
|
||||
This will install glu into /usr/local, if you want to install to a different DIR
|
||||
use ../configure --prefix DIR
|
||||
3) cd cudd-2.4.2
|
||||
4) check makefile options
|
||||
5) make
|
||||
|
||||
Installation of cplint:
|
||||
When compiling Yap, use
|
||||
configure --enable-cplint
|
||||
Under Windows, you have to use cygwin (glu does not compile under MinGW), so
|
||||
configure --enable-cplint --enable-cygwin
|
||||
If you installed glu in DIR, use --enable-cplint=DIR
|
||||
configure --enable-cplint=DIR
|
||||
Under Windows, you have to use cygwin (CUDD does not compile under MinGW), so
|
||||
configure --enable-cplint --enable-cygwin=DIR
|
||||
where DIR is the directory where you compiled CUDD
|
||||
|
||||
|
||||
FEEDBACK:
|
||||
|
@ -42,6 +42,7 @@ returns also the names of the variables to be used to save the ADD in dot format
|
||||
|
||||
b=0;
|
||||
vars.nVar=0;
|
||||
varIndex=0;
|
||||
while(YAP_IsPairTerm(t))
|
||||
{
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
.cmtt-10{font-family: monospace;}
|
||||
.cmti-10{ font-style: italic;}
|
||||
p.noindent { text-indent: 0em }
|
||||
td p.noindent { text-indent: 0em; margin-top:0em; }
|
||||
p.nopar { text-indent: 0em; }
|
||||
p.indent{ text-indent: 1.5em }
|
||||
@media print {div.crosslinks {visibility:hidden;}}
|
||||
@ -20,6 +21,9 @@ td center { margin-top:0em; margin-bottom:0em; }
|
||||
.Canvas { position:relative; }
|
||||
img.math{vertical-align:middle;}
|
||||
li p.indent { text-indent: 0em }
|
||||
li p:first-child{ margin-top:0em; }
|
||||
li p:last-child, li div:last-child { margin-bottom:0.5em; }
|
||||
li p~ul:last-child, li p~ol:last-child{ margin-bottom:0.5em; }
|
||||
.enumerate1 {list-style-type:decimal;}
|
||||
.enumerate2 {list-style-type:lower-alpha;}
|
||||
.enumerate3 {list-style-type:lower-roman;}
|
||||
@ -32,11 +36,11 @@ div.obeylines-v p { margin-top:0; margin-bottom:0; }
|
||||
td.displaylines {text-align:center; white-space:nowrap;}
|
||||
.centerline {text-align:center;}
|
||||
.rightline {text-align:right;}
|
||||
div.verbatim {font-family: monospace; white-space: nowrap; }
|
||||
table.verbatim {width:100%;}
|
||||
div.verbatim {font-family: monospace; white-space: nowrap; text-align:left; clear:both; }
|
||||
.fbox {padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; }
|
||||
div.fbox {display:table}
|
||||
div.center div.fbox {text-align:center; clear:both; padding-left:3.0pt; padding-right:3.0pt; text-indent:0pt; border:solid black 0.4pt; }
|
||||
table.minipage{width:100%;}
|
||||
div.minipage{width:100%;}
|
||||
div.center, div.center div.center {text-align: center; margin-left:1em; margin-right:1em;}
|
||||
div.center div {text-align: left;}
|
||||
div.flushright, div.flushright div.flushright {text-align: right;}
|
||||
@ -53,6 +57,8 @@ span.footnote-mark sup.textsuperscript, span.footnote-mark a sup.textsuperscript
|
||||
div.tabular, div.center div.tabular {text-align: center; margin-top:0.5em; margin-bottom:0.5em; }
|
||||
table.tabular td p{margin-top:0em;}
|
||||
table.tabular {margin-left: auto; margin-right: auto;}
|
||||
td p:first-child{ margin-top:0em; }
|
||||
td p:last-child{ margin-bottom:0em; }
|
||||
div.td00{ margin-left:0pt; margin-right:0pt; }
|
||||
div.td01{ margin-left:0pt; margin-right:5pt; }
|
||||
div.td10{ margin-left:5pt; margin-right:0pt; }
|
||||
@ -70,8 +76,9 @@ span.TEX span.E{ position:relative;top:0.5ex;left:-0.0417em;}
|
||||
a span.TEX span.E {text-decoration: none; }
|
||||
span.LATEX span.A{ position:relative; top:-0.5ex; left:-0.4em; font-size:85%;}
|
||||
span.LATEX span.TEX{ position:relative; left: -0.4em; }
|
||||
div.float img, div.float .caption {text-align:center;}
|
||||
div.figure img, div.figure .caption {text-align:center;}
|
||||
div.float, div.figure {margin-left: auto; margin-right: auto;}
|
||||
div.float img {text-align:center;}
|
||||
div.figure img {text-align:center;}
|
||||
.marginpar {width:20%; float:right; text-align:left; margin-left:auto; margin-top:0.5em; font-size:85%; text-decoration:underline;}
|
||||
.marginpar p{margin-top:0.4em; margin-bottom:0.4em;}
|
||||
table.equation {width:100%;}
|
||||
@ -88,10 +95,12 @@ table.pmatrix {width:100%;}
|
||||
span.pmatrix img{vertical-align:middle;}
|
||||
div.pmatrix {text-align:center;}
|
||||
table.pmatrix {width:100%;}
|
||||
span.bar-css {text-decoration:overline;}
|
||||
img.cdots{vertical-align:middle;}
|
||||
.partToc a, .partToc, .likepartToc a, .likepartToc {line-height: 200%; font-weight:bold; font-size:110%;}
|
||||
.caption td.id{font-weight: bold; white-space: nowrap; }
|
||||
table.caption {text-align:center;}
|
||||
.index-item, .index-subitem, .index-subsubitem {display:block}
|
||||
div.caption {text-indent:-2em; margin-left:3em; margin-right:1em; text-align:left;}
|
||||
div.caption span.id{font-weight: bold; white-space: nowrap; }
|
||||
h1.partHead{text-align: center}
|
||||
p.bibitem { text-indent: -2em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; }
|
||||
p.bibitem-p { text-indent: 0em; margin-left: 2em; margin-top:0.6em; margin-bottom:0.6em; }
|
||||
@ -107,7 +116,7 @@ div.thanks{text-align:left; margin-left:10%; font-size:85%; font-style:italic; }
|
||||
div.author{white-space: nowrap;}
|
||||
.quotation {margin-bottom:0.25em; margin-top:0.25em; margin-left:1em; }
|
||||
.abstract p {margin-left:5%; margin-right:5%;}
|
||||
table.abstract {width:100%;}
|
||||
div.abstract {width:100%;}
|
||||
.figure img.graphics {margin-left:10%;}
|
||||
/* end css.sty */
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html >
|
||||
<head><title>cplint Version beta2.0 Manual</title>
|
||||
<head><title>cplint Version 2.0 Manual</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
||||
<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)">
|
||||
<meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)">
|
||||
<!-- html -->
|
||||
<meta name="src" content="manual.tex">
|
||||
<meta name="date" content="2008-06-19 23:25:00">
|
||||
<meta name="date" content="2010-07-27 17:55:00">
|
||||
<link rel="stylesheet" type="text/css" href="manual.css">
|
||||
</head><body
|
||||
>
|
||||
@ -15,28 +15,27 @@
|
||||
|
||||
|
||||
|
||||
<h2 class="titleHead">cplint Version beta2.0 Manual</h2>
|
||||
<h2 class="titleHead">cplint Version 2.0 Manual</h2>
|
||||
<div class="author" ><span
|
||||
class="cmr-12">Fabrizio Riguzzi</span>
|
||||
<br /><span
|
||||
class="cmr-12">fabrizio.riguzzi@unife.it</span></div>
|
||||
<br />
|
||||
class="cmr-12">fabrizio.riguzzi@unife.it</span></div><br />
|
||||
<div class="date" ><span
|
||||
class="cmr-12">June 19, 2008</span></div>
|
||||
class="cmr-12">July 27, 2010</span></div>
|
||||
</div>
|
||||
<h3 class="sectionHead"><span class="titlemark">1 </span> <a
|
||||
id="x1-10001"></a>Introduction</h3>
|
||||
<!--l. 30--><p class="noindent"><span
|
||||
<!--l. 31--><p class="noindent" ><span
|
||||
class="cmtt-10">cplint </span>is a suite of programs for reasoning with LPADs <span class="cite">[<a
|
||||
href="#XVenVer03-TR">11</a>, <a
|
||||
href="#XVenVer04-ICLP04-IC">12</a>]</span> and CP-logic
|
||||
programs <span class="cite">[<a
|
||||
href="#XVenDenBru-JELIA06">10</a>, <a
|
||||
href="#XCP-logic-unp">13</a>]</span>.
|
||||
<!--l. 32--><p class="indent"> It consists of three Prolog modules for answering queries using goal-oriented
|
||||
<!--l. 33--><p class="indent" > It consists of three Prolog modules for answering queries using goal-oriented
|
||||
procedures plus three Prolog modules for answering queries using the definition of the
|
||||
semantics of LPADs and CP-logic.
|
||||
<!--l. 36--><p class="indent"> The modules for answering queries using using goal-oriented procedures are
|
||||
<!--l. 37--><p class="indent" > The modules for answering queries using using goal-oriented procedures are
|
||||
<span
|
||||
class="cmtt-10">lpadsld.pl</span>, <span
|
||||
class="cmtt-10">lpad.pl </span>and <span
|
||||
@ -49,11 +48,11 @@ href="#XRig-AIIA07-IC">7</a>]</span> and <span class="cite">[<a
|
||||
href="#XRig-RCRA07-IC">8</a>]</span>. It is based on SLDNF resolution and
|
||||
is an adaptation of the interpreter for ProbLog <span class="cite">[<a
|
||||
href="#XDBLP:conf/ijcai/RaedtKT07">4</a>]</span>.
|
||||
<!--l. 42--><p class="noindent">It was proved correct <span class="cite">[<a
|
||||
<!--l. 43--><p class="noindent" >It was proved correct <span class="cite">[<a
|
||||
href="#XRig-RCRA07-IC">8</a>]</span> with respect to the semantics of LPADs for range
|
||||
restricted acyclic programs <span class="cite">[<a
|
||||
href="#XDBLP:journals/ngc/AptB91">1</a>]</span> without function symbols.
|
||||
<!--l. 44--><p class="noindent">It is also able to deal with extensions of LPADs and CP-logic: the clause
|
||||
<!--l. 45--><p class="noindent" >It is also able to deal with extensions of LPADs and CP-logic: the clause
|
||||
bodies can contain <span
|
||||
class="cmtt-10">setof </span>and <span
|
||||
class="cmtt-10">bagof</span>, the probabilities in the head may
|
||||
@ -84,7 +83,7 @@ href="#XDBLP:journals/jacm/ChenW96">3</a>]</span>. As a consequence, it works fo
|
||||
class="cmtt-10">cpl.pl</span>: computes the probability of a query using a top-down procedure
|
||||
based on SLG resolution and moreover checks that the CP-logic program
|
||||
is valid, i.e., that it has at least an execution model.</li></ul>
|
||||
<!--l. 50--><p class="indent"> The modules for answering queries using the definition of the semantics of LPADs
|
||||
<!--l. 51--><p class="indent" > The modules for answering queries using the definition of the semantics of LPADs
|
||||
and CP-logic are <span
|
||||
class="cmtt-10">semlpadsld.pl</span>, <span
|
||||
class="cmtt-10">semlpad.pl </span>and <span
|
||||
@ -117,102 +116,73 @@ class="cmmi-10">P</span>, i.e.,
|
||||
and temporal precedence. It uses the definition of the semantics given in
|
||||
<span class="cite">[<a
|
||||
href="#XCP-logic-unp">13</a>]</span>.</li></ul>
|
||||
<!--l. 59--><p class="noindent">
|
||||
<!--l. 60--><p class="noindent" >
|
||||
<h3 class="sectionHead"><span class="titlemark">2 </span> <a
|
||||
id="x1-20002"></a>Installation</h3>
|
||||
<!--l. 60--><p class="noindent"><span
|
||||
class="cmtt-10">cplint </span>is distributed in source code in the CVS version of Yap. It
|
||||
<!--l. 61--><p class="noindent" ><span
|
||||
class="cmtt-10">cplint </span>is distributed in source code in the git version of Yap. It
|
||||
includes Prolog and C files. Download it by following the instruction in <a
|
||||
href="http://www.ncc.up.pt/\protect \unhbox \voidb@x \penalty \@M \relax \unhbox \voidb@x \special {t4ht@+&{35}x00A0{59}}x{}vsc/Yap/downloads.html" >
|
||||
http://www.ncc.up.pt/<span
|
||||
class="cmsy-10">~</span>vsc/Yap/downloads.html </a>.
|
||||
<!--l. 62--><p class="indent"> <span
|
||||
class="cmtt-10">cplint </span>requires glu (a subpackage of vis) and glib-2.0. You can download glu
|
||||
from <a
|
||||
href="http://vlsi.colorado.edu/\protect \unhbox \voidb@x \penalty \@M \relax \unhbox \voidb@x \special {t4ht@+&{35}x00A0{59}}x{}vis/getting_VIS_2.1.html" > http://vlsi.colorado.edu/<span
|
||||
class="cmsy-10">~</span>vis/getting_VIS_2.1.html </a> You can download
|
||||
glib-2.0 (version <span
|
||||
http://www.ncc.up.pt/ vsc/Yap/downloads.html </a>.
|
||||
<!--l. 63--><p class="indent" > <span
|
||||
class="cmtt-10">cplint </span>requires cudd and glib-2.0. You can download cudd from <a
|
||||
href="http://vlsi.colorado.edu/\protect \unhbox \voidb@x \penalty \@M \relax \unhbox \voidb@x \special {t4ht@+&{35}x00A0{59}}x{}fabio/CUDD/" >
|
||||
http://vlsi.colorado.edu/ fabio/CUDD/ </a>. You can download glib-2.0 (version <span
|
||||
class="cmsy-10">≥ </span>2<span
|
||||
class="cmmi-10">.</span>0) from <a
|
||||
href="http://www.gtk.org/" > http://www.gtk.org/ </a>. This is a standard GNU package
|
||||
so it is easy to install it using the package management software of your Linux or
|
||||
Cygwin distribution.
|
||||
<!--l. 68--><p class="indent"> Install glu:
|
||||
class="cmmi-10">.</span>0)
|
||||
from <a
|
||||
href="http://www.gtk.org/" > http://www.gtk.org/ </a>. This is a standard GNU package so it is easy to
|
||||
install it using the package management software of your Linux or Cygwin
|
||||
distribution.
|
||||
<!--l. 69--><p class="indent" > Compile cudd:
|
||||
<ol class="enumerate1" >
|
||||
<li class="enumerate"><a
|
||||
id="x1-2002x1"></a>downlad <span
|
||||
class="cmtt-10">glu-2.1.tar.gz</span>
|
||||
<li
|
||||
class="enumerate" id="x1-2002x1">downlad <span
|
||||
class="cmtt-10">cudd-2.4.2.tar.gz</span>
|
||||
|
||||
</li>
|
||||
<li class="enumerate"><a
|
||||
id="x1-2004x2"></a>decompress it
|
||||
<li
|
||||
class="enumerate" id="x1-2004x2">decompress it
|
||||
</li>
|
||||
<li class="enumerate"><a
|
||||
id="x1-2006x3"></a><span
|
||||
class="cmtt-10">cd glu-2.1</span>
|
||||
<li
|
||||
class="enumerate" id="x1-2006x3"><span
|
||||
class="cmtt-10">cd cudd-2.4.2</span>
|
||||
</li>
|
||||
<li class="enumerate"><a
|
||||
id="x1-2008x4"></a><span
|
||||
class="cmtt-10">mkdir arch</span>
|
||||
<li
|
||||
class="enumerate" id="x1-2008x4">check makefile options
|
||||
</li>
|
||||
<li class="enumerate"><a
|
||||
id="x1-2010x5"></a><span
|
||||
class="cmtt-10">cd arch</span>
|
||||
</li>
|
||||
<li class="enumerate"><a
|
||||
id="x1-2012x6"></a><span
|
||||
class="cmtt-10">../configure</span>
|
||||
</li>
|
||||
<li class="enumerate"><a
|
||||
id="x1-2014x7"></a><span
|
||||
class="cmtt-10">make</span>
|
||||
</li>
|
||||
<li class="enumerate"><a
|
||||
id="x1-2016x8"></a><span
|
||||
class="cmtt-10">su</span>
|
||||
</li>
|
||||
<li class="enumerate"><a
|
||||
id="x1-2018x9"></a><span
|
||||
class="cmtt-10">make install</span></li></ol>
|
||||
<!--l. 80--><p class="noindent">This will install glu into <span
|
||||
class="cmtt-10">/usr/local</span>, if you want to install to a different <span
|
||||
class="cmtt-10">DIR </span>use
|
||||
<span
|
||||
class="cmtt-10">../configure --prefix DIR</span>
|
||||
<!--l. 83--><p class="indent"> Install Yap together with <span
|
||||
<li
|
||||
class="enumerate" id="x1-2010x5"><span
|
||||
class="cmtt-10">make</span></li></ol>
|
||||
<!--l. 78--><p class="indent" > Install Yap together with <span
|
||||
class="cmtt-10">cplint</span>: when compiling Yap following the instuction of
|
||||
the <span
|
||||
class="cmtt-10">INSTALL </span>file in the root of the Yap folder, use
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
configure --enable-cplint
|
||||
<div class="verbatim" id="verbatim-1">
|
||||
configure --enable-cplint=DIR
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 87--><p class="nopar"> Under Windows, you have to use Cygwin (glu does not compile under MinGW),
|
||||
so
|
||||
<br class="newline" />
|
||||
<!--l. 82--><p class="nopar" > Under Windows, you have to use Cygwin (glu does not compile under MinGW),
|
||||
so<br
|
||||
class="newline" />
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
configure --enable-cplint --enable-cygwin
|
||||
<div class="verbatim" id="verbatim-2">
|
||||
configure --enable-cplint=DIR --enable-cygwin
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 91--><p class="nopar"> If you installed glu in <span
|
||||
class="cmtt-10">DIR</span>, use <span
|
||||
class="cmtt-10">--enable-cplint=DIR</span>
|
||||
<!--l. 94--><p class="indent"> After having performed <span
|
||||
<!--l. 86--><p class="nopar" > where <span
|
||||
class="cmtt-10">DIR </span>is the path to the directory <span
|
||||
class="cmtt-10">cudd-2.4.2 </span>(including <span
|
||||
class="cmtt-10">cudd-2.4.2</span>).
|
||||
<!--l. 89--><p class="indent" > After having performed <span
|
||||
class="cmtt-10">make install </span>you can do <span
|
||||
class="cmtt-10">make installcheck </span>that will
|
||||
execute a suite of tests of the various programs. If no error is reported you have a
|
||||
working installation of <span
|
||||
class="cmtt-10">cplint</span>.
|
||||
<!--l. 97--><p class="noindent">
|
||||
<!--l. 92--><p class="noindent" >
|
||||
<h3 class="sectionHead"><span class="titlemark">3 </span> <a
|
||||
id="x1-30003"></a>Syntax</h3>
|
||||
<!--l. 99--><p class="noindent">Disjunction in the head is represented with a semicolon and atoms in the head are
|
||||
<!--l. 94--><p class="noindent" >Disjunction in the head is represented with a semicolon and atoms in the head are
|
||||
separated from probabilities by a colon. For the rest, the usual syntax of Prolog is
|
||||
used. For example, the CP-logic clause
|
||||
<center class="math-display" >
|
||||
@ -220,49 +190,35 @@ used. For example, the CP-logic clause
|
||||
src="manual0x.png" alt="h1 : p1 ∨...∨ hn : pn ← b1,...,bm,¬c1,...,¬cl " class="math-display" ></center> is
|
||||
represented by
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-3">
|
||||
h1:p1 ; ... ; hn:pn :- b1,...,bm,\+ c1,....,\+ cl
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 105--><p class="nopar"> No parentheses are necessary. The <span
|
||||
<!--l. 100--><p class="nopar" > No parentheses are necessary. The <span
|
||||
class="cmtt-10">pi </span>are numeric expressions. It is up to the user to
|
||||
ensure that the numeric expressions are legal, i.e. that they sum up to less than
|
||||
one.
|
||||
<!--l. 108--><p class="indent"> If the clause has an empty body, it can be represented like this
|
||||
<!--l. 103--><p class="indent" > If the clause has an empty body, it can be represented like this
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-4">
|
||||
h1:p1 ; ... ;hn:pn.
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 111--><p class="nopar"> If the clause has a single head with probability 1, the annotation can be omitted and
|
||||
<!--l. 106--><p class="nopar" > If the clause has a single head with probability 1, the annotation can be omitted and
|
||||
the clause takes the form of a normal prolog clause, i.e.
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-5">
|
||||
h1:- b1,...,bm,\+ c1,...,\+ cl.
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 115--><p class="nopar"> stands for
|
||||
<!--l. 110--><p class="nopar" > stands for
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-6">
|
||||
h1:1 :- b1,...,bm,\+ c1,...,\+ cl.
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 119--><p class="nopar">
|
||||
<!--l. 121--><p class="indent"> The coin example of <span class="cite">[<a
|
||||
<!--l. 114--><p class="nopar" >
|
||||
<!--l. 116--><p class="indent" > The coin example of <span class="cite">[<a
|
||||
href="#XVenVer04-ICLP04-IC">12</a>]</span> is represented as (see file <span
|
||||
class="cmtt-10">coin.cpl</span>)
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-7">
|
||||
heads(Coin):1/2 ; tails(Coin):1/2:-
|
||||
 <br />     toss(Coin),\+biased(Coin).
|
||||
 <br />
|
||||
@ -273,16 +229,15 @@ heads(Coin):1/2 ; tails(Coin):1/2:-
|
||||
 <br />
|
||||
 <br />toss(coin).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 132--><p class="nopar"> The first clause states that if we toss a coin that is not biased it has equal
|
||||
<!--l. 127--><p class="nopar" > The first clause states that if we toss a coin that is not biased it has equal
|
||||
probability of landing heads and tails. The second states that if the coin is biased it
|
||||
has a slightly higher probability of landing heads. The third states that the coin is
|
||||
fair with probability 0.9 and biased with probability 0.1 and the last clause states
|
||||
that we toss a coin with certainty.
|
||||
<!--l. 137--><p class="noindent">
|
||||
<!--l. 132--><p class="noindent" >
|
||||
<h3 class="sectionHead"><span class="titlemark">4 </span> <a
|
||||
id="x1-40004"></a>Commands</h3>
|
||||
<!--l. 138--><p class="noindent">All six modules accept the same commands for reading in files and answering queries.
|
||||
<!--l. 133--><p class="noindent" >All six modules accept the same commands for reading in files and answering queries.
|
||||
The LPAD or CP-logic program must be stored in a text file with extension <span
|
||||
class="cmtt-10">.cpl</span>.
|
||||
Suppose you have stored the example above in file <span
|
||||
@ -291,32 +246,23 @@ queries from this program, you have to run Yap, load one of the modules (such as
|
||||
example <span
|
||||
class="cmtt-10">lpad.pl</span>) by issuing the command
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-8">
|
||||
use_module(library(lpad)).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 144--><p class="nopar"> at the command prompt. Then you must parse the source file <span
|
||||
<!--l. 139--><p class="nopar" > at the command prompt. Then you must parse the source file <span
|
||||
class="cmtt-10">coin.cpl </span>with the
|
||||
command
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-9">
|
||||
p(coin).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 149--><p class="nopar"> if <span
|
||||
<!--l. 144--><p class="nopar" > if <span
|
||||
class="cmtt-10">coin.cpl </span>is in the current directory, or
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-10">
|
||||
p(’path_to_coin/coin’).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 153--><p class="nopar"> if <span
|
||||
<!--l. 148--><p class="nopar" > if <span
|
||||
class="cmtt-10">coin.cpl </span>is in a different directory. At this point you can pose query to the
|
||||
program by using the predicate <span
|
||||
class="cmtt-10">s/2 </span>(for solve) that takes as its first argument a
|
||||
@ -325,13 +271,10 @@ as its second argument. For example, the probability of the conjunction
|
||||
<span
|
||||
class="cmtt-10">head(coin),biased(coin) </span>can be asked with the query
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-11">
|
||||
s([head(coin),biased(coin)],P).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 158--><p class="nopar"> For computing the probability of a conjunction given another conjunction you can
|
||||
<!--l. 153--><p class="nopar" > For computing the probability of a conjunction given another conjunction you can
|
||||
use the predicate <span
|
||||
class="cmtt-10">sc/3 </span>(for solve conditional) that take takes as input the query
|
||||
conjunction as its first argument, the evidence conjunction as its second argument
|
||||
@ -341,25 +284,22 @@ class="cmtt-10">heads(coin) </span>given the evidence <span
|
||||
class="cmtt-10">biased(coin) </span>can be asked with the
|
||||
query
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-12">
|
||||
sc([heads(coin)],[biased(coin)],P).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 163--><p class="nopar"> After having parsed a program, in order to read in a new program you must restart
|
||||
<!--l. 158--><p class="nopar" > After having parsed a program, in order to read in a new program you must restart
|
||||
Yap when using <span
|
||||
class="cmtt-10">semlpadsld.pl </span>and <span
|
||||
class="cmtt-10">semlpad.pl</span>. With the other modules, you can
|
||||
directly parse a new program.
|
||||
<!--l. 167--><p class="indent"> When using <span
|
||||
<!--l. 162--><p class="indent" > When using <span
|
||||
class="cmtt-10">lpad.pl</span>, the system can print the message “Uunsound program” in
|
||||
the case in which an instance with a three valued well founded model is found.
|
||||
Moreover, it can print the message “It requires the choice of a head atom from a non
|
||||
ground head”: in this case, in order to answer the query, all the groundings of the
|
||||
culprit clause must be generated, which may be impossible for programs with
|
||||
function symbols.
|
||||
<!--l. 169--><p class="indent"> When using <span
|
||||
<!--l. 164--><p class="indent" > When using <span
|
||||
class="cmtt-10">semcpl.pl</span>, you can print the execution process by using the
|
||||
command <span
|
||||
class="cmtt-10">print. </span>after <span
|
||||
@ -372,31 +312,25 @@ class="cmtt-10">context </span>is a list of atoms that are true in the context.
|
||||
<span
|
||||
class="cmtt-10">semcpl.pl </span>can print “Invalid program” in the case in which no execution process
|
||||
exists.
|
||||
<!--l. 174--><p class="indent"> When using <span
|
||||
<!--l. 169--><p class="indent" > When using <span
|
||||
class="cmtt-10">cpl.pl </span>you can print a partial execution model including all the
|
||||
clauses involved in the query issued with <span
|
||||
class="cmtt-10">print. cpl.pl </span>can print the messages
|
||||
“Uunsound program”, “It requires the choice of a head atom from a non ground
|
||||
head” and “Invalid program”.
|
||||
<!--l. 177--><p class="indent"> The modules make use of a number of parameters in order to control their
|
||||
<!--l. 172--><p class="indent" > The modules make use of a number of parameters in order to control their
|
||||
behavior. They that can be set with the command
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-13">
|
||||
set(parameter,value).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 180--><p class="nopar"> from the Yap prompt after having loaded the module. The current value can be read
|
||||
<!--l. 175--><p class="nopar" > from the Yap prompt after having loaded the module. The current value can be read
|
||||
with
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-14">
|
||||
setting(parameter,Value).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 185--><p class="nopar"> from the Yap prompt. The available parameters are:
|
||||
<!--l. 180--><p class="nopar" > from the Yap prompt. The available parameters are:
|
||||
<ul class="itemize1">
|
||||
<li class="itemize"><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-10">epsilon_parsing</span></span></span> (valid for all six modules): if (1 - the sum of the
|
||||
@ -418,13 +352,10 @@ class="cmtt-10">m </span>is the number of the binary variable. The correspondenc
|
||||
between variables and clauses can be evinced from the message printed on the
|
||||
screen, such as
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-15">
|
||||
Variables: [(2,[X=2,X1=1]),(2,[X=1,X1=0]),(1,[])]
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 199--><p class="nopar"> where the first element of each couple is the clause number of the input file
|
||||
<!--l. 194--><p class="nopar" > where the first element of each couple is the clause number of the input file
|
||||
(starting from 1). In the example above variable <span
|
||||
class="cmtt-10">X0 </span>corresponds to clause <span
|
||||
class="cmtt-10">2</span>
|
||||
@ -441,13 +372,10 @@ class="cmtt-10">graphviz </span>(<a
|
||||
href="www.graphviz.org" > www.graphviz.org </a>)
|
||||
using the command
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-16">
|
||||
dotty cpl.dot &
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 208--><p class="nopar">
|
||||
<!--l. 203--><p class="nopar" >
|
||||
</li>
|
||||
<li class="itemize"><span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-10">ground_body</span></span></span> (valid for <span
|
||||
@ -460,27 +388,24 @@ class="cmtt-10">false</span>, ground
|
||||
constant. In the case where the body contains variables not in the
|
||||
head, setting it to false means that the body represents an existential
|
||||
event.</li></ul>
|
||||
<!--l. 212--><p class="noindent">
|
||||
<!--l. 207--><p class="noindent" >
|
||||
<h3 class="sectionHead"><span class="titlemark">5 </span> <a
|
||||
id="x1-50005"></a>Semantic Modules</h3>
|
||||
<!--l. 213--><p class="noindent">The three semantic modules need to produce a grounding of the program in order to
|
||||
<!--l. 208--><p class="noindent" >The three semantic modules need to produce a grounding of the program in order to
|
||||
compute the semantics. They require an extra file with extension <span
|
||||
class="cmtt-10">.uni </span>(for universe)
|
||||
in the same directory where the <span
|
||||
class="cmtt-10">.cpl </span>file is.
|
||||
<!--l. 216--><p class="indent"> There are two ways to specify how to ground a program. The first consists in
|
||||
<!--l. 211--><p class="indent" > There are two ways to specify how to ground a program. The first consists in
|
||||
providing the list of constants to which each variable can be instantiated. For
|
||||
example, in our case the current directory will contain a file <span
|
||||
class="cmtt-10">coin.uni </span>that is a
|
||||
Prolog file containing facts of the form
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-17">
|
||||
universe(var_list,const_list).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 219--><p class="nopar"> where <span class="obeylines-h"><span class="verb"><span
|
||||
<!--l. 214--><p class="nopar" > where <span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-10">var_list</span></span></span> is a list of variables names (each must be included in single quotes)
|
||||
and <span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-10">const_list</span></span></span> is a list of constants. The semantic modules generate the grounding
|
||||
@ -490,29 +415,23 @@ class="cmtt-10">var_list</span></span></span> with the constants of
|
||||
class="cmtt-10">const_list</span></span></span>. Note that the variables are identified by name, so a variable with
|
||||
the same name in two different clauses will be instantiated with the same
|
||||
constants.
|
||||
<!--l. 222--><p class="indent"> The other way to specify how to ground a program consists in using mode and
|
||||
<!--l. 217--><p class="indent" > The other way to specify how to ground a program consists in using mode and
|
||||
type information. For each predicate, the file <span
|
||||
class="cmtt-10">.uni </span>must contain a fact of the
|
||||
form
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-18">
|
||||
mode(predicate(t1,...,tn)).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 225--><p class="nopar"> that specifies the number and types of each argument of the predicate. Then, the list
|
||||
<!--l. 220--><p class="nopar" > that specifies the number and types of each argument of the predicate. Then, the list
|
||||
of constants that are in the domain of each type <span
|
||||
class="cmtt-10">ti </span>must be specified with a fact of
|
||||
the form
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-19">
|
||||
type(ti,list_of_constants).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 230--><p class="nopar"> The file <span
|
||||
<!--l. 225--><p class="nopar" > The file <span
|
||||
class="cmtt-10">.uni </span>can contain both universe and mode declaration, the ones to be used
|
||||
depend on the value of the parameter <span
|
||||
class="cmtt-10">grounding</span>: with value <span
|
||||
@ -520,20 +439,18 @@ class="cmtt-10">variables</span>, the
|
||||
universe declarations are used, with value <span
|
||||
class="cmtt-10">modes </span>the mode declarations are
|
||||
used.
|
||||
<!--l. 233--><p class="indent"> With <span
|
||||
<!--l. 228--><p class="indent" > With <span
|
||||
class="cmtt-10">semcpl.pl </span>only mode declarations can be used.
|
||||
<!--l. 237--><p class="noindent">
|
||||
<!--l. 232--><p class="noindent" >
|
||||
<h3 class="sectionHead"><span class="titlemark">6 </span> <a
|
||||
id="x1-60006"></a>Extensions</h3>
|
||||
<!--l. 238--><p class="noindent">In this section we will present the extensions to the syntax of LPADs and CP-logic
|
||||
<!--l. 233--><p class="noindent" >In this section we will present the extensions to the syntax of LPADs and CP-logic
|
||||
programs that <span
|
||||
class="cmtt-10">cplint </span>can handle.
|
||||
<!--l. 240--><p class="indent"> The first is the use of some standard Prolog predicates. The bodies can contain
|
||||
<!--l. 235--><p class="indent" > The first is the use of some standard Prolog predicates. The bodies can contain
|
||||
the built-in predicates:
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-20">
|
||||
is/2
|
||||
 <br />>/2
|
||||
 <br /></2
|
||||
@ -549,55 +466,43 @@ is/2
|
||||
 <br />\==/2
|
||||
 <br />length/2
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 257--><p class="nopar"> The bodies can also contain the following library predicates:
|
||||
<!--l. 252--><p class="nopar" > The bodies can also contain the following library predicates:
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-21">
|
||||
member/2
|
||||
 <br />max_list/2
|
||||
 <br />min_list/2
|
||||
 <br />nth0/3
|
||||
 <br />nth/3
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 266--><p class="nopar"> plus the predicate
|
||||
<!--l. 261--><p class="nopar" > plus the predicate
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-22">
|
||||
average/2
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 270--><p class="nopar"> that, given a list of numbers, computes its arithmetic mean.
|
||||
<!--l. 273--><p class="indent"> When using <span
|
||||
<!--l. 265--><p class="nopar" > that, given a list of numbers, computes its arithmetic mean.
|
||||
<!--l. 268--><p class="indent" > When using <span
|
||||
class="cmtt-10">lpadsld.pl</span>, the bodies can contain the predicates <span
|
||||
class="cmtt-10">setof/3 </span>and
|
||||
<span
|
||||
class="cmtt-10">bagof/3 </span>with the same meaning as in Prolog. Existential quantifiers are allowed in
|
||||
both, so for example the query
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-23">
|
||||
setof(Z, (term(X,Y))^foo(X,Y,Z), L).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 276--><p class="nopar"> returns all the instantiations of <span
|
||||
<!--l. 271--><p class="nopar" > returns all the instantiations of <span
|
||||
class="cmtt-10">Z </span>such that there exists an instantiation of <span
|
||||
class="cmtt-10">X </span>and <span
|
||||
class="cmtt-10">Y</span>
|
||||
for which <span
|
||||
class="cmtt-10">foo(X,Y,Z) </span>is true.
|
||||
<!--l. 279--><p class="indent"> An example of the use of <span
|
||||
<!--l. 274--><p class="indent" > An example of the use of <span
|
||||
class="cmtt-10">setof </span>and <span
|
||||
class="cmtt-10">bagof </span>is in the file <span
|
||||
class="cmtt-10">female.cpl</span>:
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-24">
|
||||
male(C):M/P ; female(C):F/P:-
|
||||
 <br />    person(C),
|
||||
 <br />    setof(Male,known_male(Male),LM),
|
||||
@ -618,25 +523,22 @@ male(C):M/P ; female(C):F/P:-
|
||||
 <br />
|
||||
 <br />known_male(e).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 300--><p class="nopar"> The disjunctive rule expresses the probability of a person of unknown sex of being
|
||||
<!--l. 295--><p class="nopar" > The disjunctive rule expresses the probability of a person of unknown sex of being
|
||||
male or female depending on the number of males and females that are known. This
|
||||
is an example of the use of expressions in the probabilities in the head that depend
|
||||
on variables in the body. The probabilities are well defined because they always sum
|
||||
to 1 (unless <span
|
||||
class="cmtt-10">P </span>is 0).
|
||||
<!--l. 304--><p class="indent"> Another use of <span
|
||||
<!--l. 299--><p class="indent" > Another use of <span
|
||||
class="cmtt-10">setof </span>and <span
|
||||
class="cmtt-10">bagof </span>is to have an attribute depend on an
|
||||
aggregate function of another attribute, similarly to what is done in PRM and
|
||||
CLP(BN).
|
||||
<!--l. 306--><p class="indent"> So, in the classical school example (available in <span
|
||||
<!--l. 301--><p class="indent" > So, in the classical school example (available in <span
|
||||
class="cmtt-10">student.cpl</span>) you can find the
|
||||
following clauses:
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-25">
|
||||
student_rank(S,h):0.6 ; student_rank(S,l):0.4:-
|
||||
 <br />    bagof(G,R^(registr_stu(R,S),registr_gr(R,G)),L),
|
||||
 <br />    average(L,Av),Av>1.5.
|
||||
@ -645,8 +547,7 @@ student_rank(S,h):0.6 ; student_rank(S,l):0.4:-
|
||||
 <br />    bagof(G,R^(registr_stu(R,S),registr_gr(R,G)),L),
|
||||
 <br />    average(L,Av),Av =< 1.5.
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 316--><p class="nopar"> where <span class="obeylines-h"><span class="verb"><span
|
||||
<!--l. 311--><p class="nopar" > where <span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-10">registr_stu(R,S)</span></span></span> expresses that registration <span
|
||||
class="cmtt-10">R </span>refers to student <span
|
||||
class="cmtt-10">S </span>and
|
||||
@ -656,7 +557,7 @@ class="cmtt-10">R </span>reports grade <span
|
||||
class="cmtt-10">G </span>which is a natural
|
||||
number. The two clauses express a dependency of the rank of the student from the
|
||||
average of her grades.
|
||||
<!--l. 319--><p class="indent"> Another extension can be used with <span
|
||||
<!--l. 314--><p class="indent" > Another extension can be used with <span
|
||||
class="cmtt-10">lpadsld.pl </span>in order to be able to represent
|
||||
reference uncertainty of PRMs. Reference uncertainty means that the link structure
|
||||
of a relational model is not fixed but is uncertain: this is represented by having the
|
||||
@ -668,31 +569,25 @@ selected uniformly from certain sets, the following clauses can be used (see fil
|
||||
<span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-10">paper_ref_simple.cpl</span></span></span>):
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-26">
|
||||
uniform(cites_cited(C,P),P,L):-
|
||||
 <br />    bagof(Pap,paper_topic(Pap,theory),L).
|
||||
 <br />
|
||||
 <br />uniform(cites_citing(C,P),P,L):-
|
||||
 <br />    bagof(Pap,paper_topic(Pap,ai),L).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 326--><p class="nopar"> The first clauses states that the paper <span
|
||||
<!--l. 321--><p class="nopar" > The first clauses states that the paper <span
|
||||
class="cmtt-10">P </span>cited in a citation <span
|
||||
class="cmtt-10">C </span>is selected
|
||||
uniformly from the set of all papers with topic theory. The second clauses
|
||||
expresses that the citing paper is selected uniformly from the papers with topic
|
||||
ai.
|
||||
<!--l. 331--><p class="indent"> These clauses make use of the predicate
|
||||
<!--l. 326--><p class="indent" > These clauses make use of the predicate
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-27">
|
||||
uniform(Atom,Variable,List)
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 334--><p class="nopar"> in the head, where <span
|
||||
<!--l. 329--><p class="nopar" > in the head, where <span
|
||||
class="cmtt-10">Atom </span>must contain <span
|
||||
class="cmtt-10">Variable</span>. The meaning is the following:
|
||||
the set of all the atoms obtained by instantiating <span
|
||||
@ -705,12 +600,10 @@ class="cmmi-10">∕N </span>where <span
|
||||
class="cmmi-10">N </span>is the length of
|
||||
<span
|
||||
class="cmtt-10">List</span>.
|
||||
<!--l. 338--><p class="indent"> A more elaborate example is present in file <span class="obeylines-h"><span class="verb"><span
|
||||
<!--l. 333--><p class="indent" > A more elaborate example is present in file <span class="obeylines-h"><span class="verb"><span
|
||||
class="cmtt-10">paper_ref.cpl</span></span></span>:
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-28">
|
||||
uniform(cites_citing(C,P),P,L):-
|
||||
 <br />    setof(Pap,paper(Pap),L).
|
||||
 <br />
|
||||
@ -723,22 +616,19 @@ uniform(cites_citing(C,P),P,L):-
|
||||
 <br />uniform(cites_cited(C,P),P,L):-
|
||||
 <br />    cites_cited_group(C,T),bagof(Pap,paper_topic(Pap,T),L).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 351--><p class="nopar"> where the cited paper depends on the topic of the citing paper. In particular, if the
|
||||
<!--l. 346--><p class="nopar" > where the cited paper depends on the topic of the citing paper. In particular, if the
|
||||
topic is theory, the cited paper is selected uniformly from the papers about theory
|
||||
with probability 0.9 and from the papers about ai with probability 0.1. if
|
||||
the topic is ai, the cited paper is selected uniformly from the papers about
|
||||
theory with probability 0.01 and from the papers about ai with probability
|
||||
0.99.
|
||||
<!--l. 354--><p class="indent"> PRMs take into account as well existence uncertainty, where the existence of
|
||||
<!--l. 349--><p class="indent" > PRMs take into account as well existence uncertainty, where the existence of
|
||||
instances is also probabilistic. For example, in the paper domain, the total number of
|
||||
citations may be unknown and a citation between any two paper may have a
|
||||
probability of existing. For example, a citation between two paper may be more
|
||||
probable if they are about the same topic:
|
||||
|
||||
<table
|
||||
class="verbatim"><tr class="verbatim"><td
|
||||
class="verbatim"><div class="verbatim">
|
||||
<div class="verbatim" id="verbatim-29">
|
||||
cites(X,Y):0.005 :-
|
||||
 <br />    paper_topic(X,theory),paper_topic(Y,theory).
|
||||
 <br />
|
||||
@ -751,8 +641,7 @@ cites(X,Y):0.005 :-
|
||||
 <br />cites(X,Y):0.008 :-
|
||||
 <br />    paper_topic(X,ai),paper_topic(Y,ai).
|
||||
</div>
|
||||
</td></tr></table>
|
||||
<!--l. 367--><p class="nopar"> This is an example where the probabilities in the head do not sum up to one so the
|
||||
<!--l. 362--><p class="nopar" > This is an example where the probabilities in the head do not sum up to one so the
|
||||
null event is automatically added to the head. The first clause states that, if the topic
|
||||
of a paper <span
|
||||
class="cmtt-10">X </span>is theory and of paper <span
|
||||
@ -761,10 +650,10 @@ there is a citation from <span
|
||||
class="cmtt-10">X </span>to <span
|
||||
class="cmtt-10">Y</span>. The other clauses consider the remaining cases for the
|
||||
topics.
|
||||
<!--l. 372--><p class="noindent">
|
||||
<!--l. 367--><p class="noindent" >
|
||||
<h3 class="sectionHead"><span class="titlemark">7 </span> <a
|
||||
id="x1-70007"></a>Additional Files</h3>
|
||||
<!--l. 373--><p class="noindent">In the directory where Yap keeps the library files (usually <span
|
||||
<!--l. 368--><p class="noindent" >In the directory where Yap keeps the library files (usually <span
|
||||
class="cmtt-10">/usr/local/share/ Yap</span>)
|
||||
you can find the directory <span
|
||||
class="cmtt-10">cplint </span>that contains the files:
|
||||
@ -861,13 +750,13 @@ class="cmtt-10">student.cpl</span></span></span>: student example from Figure 1.
|
||||
href="#XGetFri01-BC">5</a>]</span>.
|
||||
</li>
|
||||
<li class="itemize"><span
|
||||
class="cmtt-10">win.cpl, light.cpl, trigger.cpl, throws.cpl, hiv.cpl,</span>
|
||||
<br class="newline" /> <span
|
||||
class="cmtt-10">win.cpl, light.cpl, trigger.cpl, throws.cpl, hiv.cpl,</span><br
|
||||
class="newline" /> <span
|
||||
class="cmtt-10">invalid.cpl</span>: programs taken from <span class="cite">[<a
|
||||
href="#XCP-logic-unp">13</a>]</span>. <span
|
||||
class="cmtt-10">invalid.cpl </span>is an example
|
||||
of a program that is invalid but sound.</li></ul>
|
||||
<!--l. 398--><p class="noindent">The files <span
|
||||
<!--l. 393--><p class="noindent" >The files <span
|
||||
class="cmtt-10">*.uni </span>that are present for some of the examples are used by the
|
||||
semantical modules. Some of the example files contain in an initial comment
|
||||
some queries together with their result.
|
||||
@ -875,18 +764,18 @@ class="cmtt-10">*.uni </span>that are present for some of the examples are used
|
||||
<li class="itemize">Subdirectory <span
|
||||
class="cmtt-10">doc</span>: contains this manual in latex, html and pdf.</li></ul>
|
||||
|
||||
<!--l. 401--><p class="noindent">
|
||||
<!--l. 396--><p class="noindent" >
|
||||
<h3 class="sectionHead"><span class="titlemark">8 </span> <a
|
||||
id="x1-80008"></a>License</h3>
|
||||
<!--l. 406--><p class="noindent"><span
|
||||
<!--l. 401--><p class="noindent" ><span
|
||||
class="cmtt-10">cplint</span>, as Yap, follows the Artistic License 2.0 that you can find in Yap CVS root
|
||||
dir. The copyright is by Fabrizio Riguzzi.
|
||||
<!--l. 411--><p class="indent"> The program uses the library <a
|
||||
<!--l. 406--><p class="indent" > The program uses the library <a
|
||||
href="http://vlsi.colorado.edu/\protect \unhbox \voidb@x \penalty \@M \relax \unhbox \voidb@x \special {t4ht@+&{35}x00A0{59}}x{}fabio/" > CUDD </a> for manipulating BDDs that is included in
|
||||
glu. For the use of CUDD, the following license must be accepted:
|
||||
<!--l. 416--><p class="indent"> Copyright (c) 1995-2004, Regents of the University of Colorado
|
||||
<!--l. 418--><p class="indent"> All rights reserved.
|
||||
<!--l. 420--><p class="indent"> Redistribution and use in source and binary forms, with or without modification,
|
||||
<!--l. 411--><p class="indent" > Copyright (c) 1995-2004, Regents of the University of Colorado
|
||||
<!--l. 413--><p class="indent" > All rights reserved.
|
||||
<!--l. 415--><p class="indent" > Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
<ul class="itemize1">
|
||||
<li class="itemize">Redistributions of source code must retain the above copyright notice, this
|
||||
@ -899,8 +788,8 @@ are permitted provided that the following conditions are met:
|
||||
<li class="itemize">Neither the name of the University of Colorado nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.</li></ul>
|
||||
<!--l. 437--><p class="noindent">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
|
||||
<br class="newline" />AND CONTRIBUTORS ”AS IS” AND ANY EXPRESS OR IMPLIED
|
||||
<!--l. 432--><p class="noindent" >THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS <br
|
||||
class="newline" />AND CONTRIBUTORS ”AS IS” AND ANY EXPRESS OR IMPLIED
|
||||
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
@ -908,12 +797,12 @@ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAU-SED
|
||||
<br class="newline" />AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
INTERRUPTION) HOWEVER CAU-SED <br
|
||||
class="newline" />AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
<!--l. 451--><p class="indent"> <span
|
||||
<!--l. 446--><p class="indent" > <span
|
||||
class="cmtt-10">lpad.pl</span>, <span
|
||||
class="cmtt-10">semlpad.pl </span>and <span
|
||||
class="cmtt-10">cpl.pl </span>are based on the SLG system by <a
|
||||
@ -923,19 +812,19 @@ href="http://www.cs.sunysb.edu/\protect \unhbox \voidb@x \penalty \@M \relax \un
|
||||
1993 SUNY at Stony Brook, see the file COYPRIGHT_SLG for detailed information
|
||||
on this copyright.
|
||||
|
||||
<!--l. 1--><p class="noindent">
|
||||
<!--l. 1--><p class="noindent" >
|
||||
<h3 class="likesectionHead"><a
|
||||
id="x1-90008"></a>References</h3>
|
||||
<!--l. 1--><p class="noindent">
|
||||
<!--l. 1--><p class="noindent" >
|
||||
<div class="thebibliography">
|
||||
<p class="bibitem"><span class="biblabel">
|
||||
<p class="bibitem" ><span class="biblabel">
|
||||
[1]<span class="bibsp">   </span></span><a
|
||||
id="XDBLP:journals/ngc/AptB91"></a>K. R. Apt and M. Bezem. Acyclic programs. <span
|
||||
class="cmti-10">New Generation</span>
|
||||
<span
|
||||
class="cmti-10">Comput.</span>, 9(3/4):335–364, 1991.
|
||||
</p>
|
||||
<p class="bibitem"><span class="biblabel">
|
||||
<p class="bibitem" ><span class="biblabel">
|
||||
[2]<span class="bibsp">   </span></span><a
|
||||
id="XBlo04-ILP04WIP-IC"></a>H. Blockeel. Probabilistic logical models for mendel’s experiments: An
|
||||
exercise. In <span
|
||||
@ -943,13 +832,13 @@ class="cmti-10">Inductive Logic Programming (ILP 2004), Work in Progress</span>
|
||||
<span
|
||||
class="cmti-10">Track</span>, 2004.
|
||||
</p>
|
||||
<p class="bibitem"><span class="biblabel">
|
||||
<p class="bibitem" ><span class="biblabel">
|
||||
[3]<span class="bibsp">   </span></span><a
|
||||
id="XDBLP:journals/jacm/ChenW96"></a>Weidong Chen and David Scott Warren. Tabled evaluation with
|
||||
delaying for general logic programs. <span
|
||||
class="cmti-10">J. ACM</span>, 43(1):20–74, 1996.
|
||||
</p>
|
||||
<p class="bibitem"><span class="biblabel">
|
||||
<p class="bibitem" ><span class="biblabel">
|
||||
[4]<span class="bibsp">   </span></span><a
|
||||
id="XDBLP:conf/ijcai/RaedtKT07"></a>L. De Raedt, A. Kimmig, and H. Toivonen. Problog: A probabilistic
|
||||
prolog and its application in link discovery. In <span
|
||||
@ -958,14 +847,14 @@ class="cmti-10">Proceedings of the 20th</span>
|
||||
class="cmti-10">International Joint Conference on Artificial Intelligence</span>, pages 2462–2467,
|
||||
2007.
|
||||
</p>
|
||||
<p class="bibitem"><span class="biblabel">
|
||||
<p class="bibitem" ><span class="biblabel">
|
||||
[5]<span class="bibsp">   </span></span><a
|
||||
id="XGetFri01-BC"></a>L. Getoor, N. Friedman, D. Koller, and A. Pfeffer. Learning
|
||||
probabilistic relational models. In Saso Dzeroski and Nada Lavrac, editors,
|
||||
<span
|
||||
class="cmti-10">Relational Data Mining</span>. Springer-Verlag, Berlin, 2001.
|
||||
</p>
|
||||
<p class="bibitem"><span class="biblabel">
|
||||
<p class="bibitem" ><span class="biblabel">
|
||||
[6]<span class="bibsp">   </span></span><a
|
||||
id="XGetoor+al:JMLR02"></a>L. Getoor, N. Friedman, D. Koller, and B. Taskar. Learning
|
||||
probabilistic models of relational structure. <span
|
||||
@ -973,7 +862,7 @@ class="cmti-10">Journal of Machine Learning</span>
|
||||
<span
|
||||
class="cmti-10">Research</span>, 3:679–707, December 2002.
|
||||
</p>
|
||||
<p class="bibitem"><span class="biblabel">
|
||||
<p class="bibitem" ><span class="biblabel">
|
||||
[7]<span class="bibsp">   </span></span><a
|
||||
id="XRig-AIIA07-IC"></a>Fabrizio Riguzzi. A top down interpreter for lpad and cp-logic. In
|
||||
<span
|
||||
@ -984,7 +873,7 @@ href="http://www.ing.unife.it/docenti/FabrizioRiguzzi/Papers/Rig-AIIA07.pdf" > h
|
||||
</a>.
|
||||
|
||||
</p>
|
||||
<p class="bibitem"><span class="biblabel">
|
||||
<p class="bibitem" ><span class="biblabel">
|
||||
[8]<span class="bibsp">   </span></span><a
|
||||
id="XRig-RCRA07-IC"></a>Fabrizio Riguzzi. A top down interpreter for lpad and
|
||||
cp-logic. In <span
|
||||
@ -994,7 +883,7 @@ class="cmti-10">Algorithms for Solving Problems with Combinatorial Explosion</sp
|
||||
href="http://pst.istc.cnr.it/RCRA07/articoli/P19-riguzzi-RCRA07.pdf" >
|
||||
http://pst.istc.cnr.it/RCRA07/articoli/P19-riguzzi-RCRA07.pdf </a>.
|
||||
</p>
|
||||
<p class="bibitem"><span class="biblabel">
|
||||
<p class="bibitem" ><span class="biblabel">
|
||||
[9]<span class="bibsp">   </span></span><a
|
||||
id="XSanPagQaz03-UAI-IC"></a>V. Santos Costa, D. Page, M. Qazi, and J. Cussens. CLP(BN):
|
||||
Constraint logic programming for probabilistic knowledge. In <span
|
||||
@ -1002,7 +891,7 @@ class="cmti-10">Uncertainty</span>
|
||||
<span
|
||||
class="cmti-10">in Artificial Intelligence (UAI 2003)</span>, 2003.
|
||||
</p>
|
||||
<p class="bibitem"><span class="biblabel">
|
||||
<p class="bibitem" ><span class="biblabel">
|
||||
[10]<span class="bibsp">   </span></span><a
|
||||
id="XVenDenBru-JELIA06"></a>J. Vennekens, M. Denecker, and M. Bruynooghe. Representing causal
|
||||
information about a probabilistic process. In <span
|
||||
@ -1011,7 +900,7 @@ class="cmti-10">10th European Conference on</span>
|
||||
class="cmti-10">Logics in Artificial Intelligence, JELIA 2006</span>, LNAI. Springer, September
|
||||
2006.
|
||||
</p>
|
||||
<p class="bibitem"><span class="biblabel">
|
||||
<p class="bibitem" ><span class="biblabel">
|
||||
[11]<span class="bibsp">   </span></span><a
|
||||
id="XVenVer03-TR"></a>J. Vennekens and S. Verbaeten. Logic programs with annotated
|
||||
disjunctions. Technical Report CW386, K. U. Leuven, 2003. <a
|
||||
@ -1019,7 +908,7 @@ href="http://www.cs.kuleuven.ac.be/\protect \unhbox \voidb@x \penalty \@M \relax
|
||||
http://www.cs.kuleuven.ac.be/<span
|
||||
class="cmsy-10">~</span>joost/techrep.ps </a>.
|
||||
</p>
|
||||
<p class="bibitem"><span class="biblabel">
|
||||
<p class="bibitem" ><span class="biblabel">
|
||||
[12]<span class="bibsp">   </span></span><a
|
||||
id="XVenVer04-ICLP04-IC"></a>J. Vennekens, S. Verbaeten, and M. Bruynooghe. Logic programs with
|
||||
annotated disjunctions. In <span
|
||||
@ -1030,7 +919,7 @@ href="http://www.cs.kuleuven.ac.be/\protect \unhbox \voidb@x \penalty \@M \relax
|
||||
class="cmsy-10">~</span>joost/
|
||||
</a>.
|
||||
</p>
|
||||
<p class="bibitem"><span class="biblabel">
|
||||
<p class="bibitem" ><span class="biblabel">
|
||||
[13]<span class="bibsp">   </span></span><a
|
||||
id="XCP-logic-unp"></a>Joost Vennekens, Marc Denecker, and Maurice Bruynooge. Extending
|
||||
the role of causality in
|
||||
|
Binary file not shown.
@ -7,6 +7,7 @@
|
||||
\documentclass{article}
|
||||
\usepackage{graphicx}
|
||||
\DeclareGraphicsExtensions{.png, .gif, .jpg}
|
||||
\newcommand{\url}[1]{\Link[#1]{}{} #1 \EndLink}
|
||||
\newcommand{\href}[2]{\Link[#1]{}{} #2 \EndLink}
|
||||
\newcommand{\hypertarget}[2]{\Link[]{}{#1} #2 \EndLink}
|
||||
\newcommand{\hyperlink}[2]{\Link[]{#1}{} #2 \EndLink}
|
||||
@ -15,7 +16,7 @@
|
||||
|
||||
|
||||
\begin{document}
|
||||
\title{\texttt{cplint} Version beta2.0 Manual}
|
||||
\title{\texttt{cplint} Version 2.0 Manual}
|
||||
|
||||
|
||||
\author{Fabrizio Riguzzi\\
|
||||
@ -57,39 +58,33 @@ The modules for answering queries using the definition of the semantics of LPADs
|
||||
%For program with function symbols, the semantics of LPADs and CP-logic are not defined. However, the interpreter accepts programs with function symbols and, if it does not go into a loop, it returns an answer. What is the meaning of this answer is subject of current study.
|
||||
|
||||
\section{Installation}
|
||||
\texttt{cplint} is distributed in source code in the CVS version of Yap. It includes Prolog and C files. Download it by following the instruction in \href{http://www.ncc.up.pt/~vsc/Yap/downloads.html}{http://www.ncc.up.pt/$\sim$vsc/Yap/downloads.html}.
|
||||
\texttt{cplint} is distributed in source code in the git version of Yap. It includes Prolog and C files. Download it by following the instruction in \url{http://www.ncc.up.pt/~vsc/Yap/downloads.html}.
|
||||
|
||||
\texttt{cplint} requires glu (a subpackage of vis) and glib-2.0.
|
||||
You can download glu from \href{http://vlsi.colorado.edu/~vis/getting_VIS_2.1.html}{http://vlsi.colorado.edu/$\sim$vis/getting\_VIS\_2.1.html}
|
||||
You can download glib-2.0 (version $\geq 2.0$) from \href{http://www.gtk.org/}{http://www.gtk.org/}. This is a standard GNU package
|
||||
\texttt{cplint} requires cudd and glib-2.0.
|
||||
You can download cudd from \url{http://vlsi.colorado.edu/~fabio/CUDD/}.
|
||||
You can download glib-2.0 (version $\geq 2.0$) from \url{http://www.gtk.org/}. This is a standard GNU package
|
||||
so it is easy to install it using the package management software of your Linux or Cygwin
|
||||
distribution.
|
||||
|
||||
Install glu:
|
||||
Compile cudd:
|
||||
\begin{enumerate}
|
||||
\item downlad \texttt{glu-2.1.tar.gz}
|
||||
\item downlad \texttt{cudd-2.4.2.tar.gz}
|
||||
\item decompress it
|
||||
\item \texttt{cd glu-2.1}
|
||||
\item \texttt{mkdir arch}
|
||||
\item \texttt{cd arch}
|
||||
\item \texttt{../configure}
|
||||
\item \texttt{cd cudd-2.4.2}
|
||||
\item check makefile options
|
||||
\item \texttt{make}
|
||||
\item \texttt{su}
|
||||
\item \texttt{make install}
|
||||
\end{enumerate}
|
||||
This will install glu into \texttt{/usr/local}, if you want to install to a different \texttt{DIR}
|
||||
use \texttt{../configure --prefix DIR}
|
||||
|
||||
Install Yap together with \texttt{cplint}:
|
||||
when compiling Yap following the instuction of the \texttt{INSTALL} file in the root of the Yap folder, use
|
||||
\begin{verbatim}
|
||||
configure --enable-cplint
|
||||
configure --enable-cplint=DIR
|
||||
\end{verbatim}
|
||||
Under Windows, you have to use Cygwin (glu does not compile under MinGW), so\\
|
||||
\begin{verbatim}
|
||||
configure --enable-cplint --enable-cygwin
|
||||
configure --enable-cplint=DIR --enable-cygwin
|
||||
\end{verbatim}
|
||||
If you installed glu in \texttt{DIR}, use \texttt{--enable-cplint=DIR}
|
||||
where \texttt{DIR} is the path to the directory \texttt{cudd-2.4.2} (including \texttt{cudd-2.4.2}).
|
||||
|
||||
After having performed \texttt{make install} you can do \texttt{make installcheck} that will execute a suite of tests of the various programs. If no error is reported you have a working installation of \texttt{cplint}.
|
||||
|
||||
@ -201,7 +196,7 @@ Variables: [(2,[X=2,X1=1]),(2,[X=1,X1=0]),(1,[])]
|
||||
In the example above variable \texttt{X0} corresponds to clause \texttt{2} with the substitutions \texttt{X=2,X1=1},
|
||||
variable \texttt{X1} corresponds to clause \texttt{2} with the substitutions \texttt{X=1,X1=0} and
|
||||
variable \texttt{X2} corresponds to clause \texttt{1} with the empty substitution.
|
||||
You can view the graph with \texttt{graphviz} (\href{www.graphviz.org}{www.graphviz.org}) using the
|
||||
You can view the graph with \texttt{graphviz} (\url{www.graphviz.org}) using the
|
||||
command
|
||||
\begin{verbatim}
|
||||
dotty cpl.dot &
|
||||
|
Reference in New Issue
Block a user