Compare commits

...

5314 Commits
6.2 ... master

Author SHA1 Message Date
Vítor Santos Costa 6d018bbf2c sync 2019-05-28 22:48:00 +01:00
Vítor Santos Costa 92181e534e Merge https://github.com/vscosta/yap-6.3 2019-05-28 22:42:17 +01:00
Vítor Santos Costa d76fa9ca3d fix bad merge 2019-05-28 19:30:04 +01:00
Vitor Santos Costa e6ffe9c2a0 lbfgs and Problog ex. 2019-05-27 15:34:24 +01:00
Vitor Santos Costa ef8e9a2ea3 Problog testing: modules :( 2019-05-27 15:32:39 +01:00
Vitor Santos Costa 07cd79ccb7 fix overflow handling in global variables
fix use of must_be_callable.
2019-05-27 15:31:22 +01:00
Vitor Santos Costa 8f8da92603 getting better 2019-05-25 11:19:29 +01:00
Vitor Santos Costa 60adbb9a75 dbg 2019-05-25 09:06:55 +01:00
Vítor Santos Costa ee12fea7cd write 2019-05-25 01:19:20 +01:00
Vitor Santos Costa e96aea3340 wr 2019-05-24 15:26:21 +01:00
Vítor Santos Costa db7047249c small fixes: 2019-05-23 23:40:19 +01:00
Vitor Santos Costa 0036e3632e ovfl 2019-05-22 11:00:53 +01:00
Vitor Santos Costa 402e6cab55 tmp 2019-05-22 01:21:50 +01:00
Vítor Santos Costa 1a6e97655b - 0 char (from P Moura);
- stack shifting
- uninitialized pointers in jpl
2019-05-21 20:37:16 +01:00
Vitor Santos Costa e7535dd2ee ovfl 2019-05-21 13:50:41 +01:00
Vitor Santos Costa 8c3c3f921c debugger fixes; stack shifting init 2019-05-21 13:03:28 +01:00
Vitor Santos Costa 52da71cee7 debugging 2019-05-20 08:25:50 +01:00
Vitor Santos Costa 69dc2a963c debugger 2019-05-20 01:00:41 +01:00
Vítor Santos Costa 0e47ddc802 prompt 2019-05-19 09:48:13 +01:00
Vítor Santos Costa c3a254e44d deb_fixing 2019-05-18 09:47:17 +01:00
Vitor Santos Costa 0949f6b494 scanner-parser interface - I 2019-05-17 17:49:30 +01:00
Vítor Santos Costa 552cefbcd0 fixes 2019-05-17 06:08:00 +01:00
Vitor Santos Costa ef226da706 Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-05-16 13:25:04 +01:00
Vitor Santos Costa 5382d4739c deb 2019-05-16 13:24:20 +01:00
Vítor Santos Costa d3e3515a5f Merge /home/vsc/yap 2019-05-15 18:59:06 +01:00
Vítor Santos Costa 920b63c6bc Merge https://github.com/vscosta/yap-6.3 2019-05-15 18:54:04 +01:00
Vitor Santos Costa ef3d435dec debugger cleanup - I 2019-05-15 18:51:50 +01:00
Vítor Santos Costa 60890fbf0b python 2019-05-15 18:48:56 +01:00
Vítor Santos Costa fb73f42d26 Merge /home/vsc/yap 2019-05-14 15:08:21 +01:00
Vítor Santos Costa 203c064b03 merge 2019-05-14 15:06:12 +01:00
Vitor Santos Costa babf3dd77d gecode 2019-05-12 15:40:29 +01:00
Vitor Santos Costa 46b9b46bca debuggecode 2019-05-11 11:24:15 +01:00
Vítor Santos Costa 4d395761a4 debugger 2019-05-10 03:05:40 +01:00
Vitor Santos Costa e23055d4f0 gecode
debugger.
2019-05-09 12:44:50 +01:00
Vitor Santos Costa adf6ffd2a6 left-over 2019-05-04 10:45:42 +01:00
Vítor Santos Costa 937189ab9e Merge /home/vsc/yap 2019-05-03 19:09:26 +01:00
Vítor Santos Costa 008c091e3c yap4r 2019-05-03 19:08:47 +01:00
Vitor Santos Costa 874f621477 ovfl 2019-05-03 12:40:47 +01:00
Vitor Santos Costa 91a79d778b fix global overfloow. 2019-05-03 01:03:22 +01:00
Vitor Santos Costa 644606d8bb Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-05-02 21:03:57 +01:00
Vitor Santos Costa 86d6751c98 glucose-4 2019-05-02 20:54:22 +01:00
Vitor Santos Costa c91faf8bc3 fix tracing of functor/ arg
fix leaks in Malloc
handle overfows in globals.
2019-05-02 20:51:46 +01:00
Vitor Santos Costa 7c16af4edf -Interface issues 2019-05-01 01:34:58 +01:00
Vitor Santos Costa 54a222e5df call fixes 2019-04-27 11:55:22 -05:00
Vitor Santos Costa 984cf8a07c loaddb 2019-04-25 14:02:28 -05:00
Vitor Santos Costa dc5b90a643 compilation fixes 2019-04-25 19:02:01 +01:00
Vitor Santos Costa 5f819fd7b4 Merge branch 'master' of 192.168.1.79:/Users/vsc/github/yap-6.5 2019-04-25 16:15:55 +01:00
Vitor Santos Costa b97338f84d reset excess change 2019-04-24 12:10:06 +01:00
Vitor Santos Costa a87654b0b0 exec 2019-04-24 10:31:05 +01:00
Vitor Santos Costa 71fc7238ff exec 2019-04-22 12:18:22 +01:00
Vitor Santos Costa b1b6afe801 bee 2019-04-22 12:17:00 +01:00
Vitor Santos Costa 16015bd8e6 bee 2019-04-22 12:15:21 +01:00
Vitor Santos Costa 73b6dd4fac gecode 6.2
dbload
2019-04-20 13:27:37 +01:00
Vitor Santos Costa 6a65977b0f reuse buffer 2019-04-20 12:49:35 +01:00
Vitor Santos Costa 1f7835c5ef fix_dbload 2019-04-20 12:48:33 +01:00
Vitor Santos Costa 9101620974 conda 2019-04-20 03:25:12 -05:00
Vitor Santos Costa d8b4d1c878 fixes 2019-04-16 09:53:20 +01:00
Vítor Santos Costa 7d85bbfa27 py 2019-04-13 14:05:31 +01:00
Vitor Santos Costa 9172f2994b interfacing 2019-04-12 17:32:26 +01:00
Vitor Santos Costa 8070e65354 goal 2019-04-12 10:48:01 +01:00
Vitor Santos Costa e7a2195af6 6.1.1 2019-04-12 10:44:17 +01:00
Vítor Santos Costa 8da14e339a borders 2019-04-11 22:17:00 +01:00
Vítor Santos Costa 1739529c8b recursuve_calling 2019-04-10 18:51:40 +01:00
Vitor Santos Costa fda10395b8 c-interface 2019-04-09 18:06:27 +01:00
Vitor Santos Costa 9ea395c031 modules 2019-04-08 13:16:21 +01:00
Vitor Santos Costa 1cde9d0eed extras 2019-04-07 23:09:01 +01:00
Vitor Santos Costa 31743139b0 R-interface 2019-04-07 00:46:30 +01:00
Vitor Santos Costa cab11f5205 droid vs myddas 2019-04-07 00:25:10 +01:00
Vitor Santos Costa 0f1eaa827a droid 2019-04-06 10:07:54 +01:00
Vitor Santos Costa 186c156a4a android 2019-04-05 23:52:34 +01:00
Vitor Santos Costa 30a332b671 Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-04-05 18:47:11 +01:00
Vítor Santos Costa 3bfaee9226 Merge /home/vsc/yap 2019-04-05 18:32:04 +01:00
Vítor Santos Costa 0b5a5a33bb droid 2019-04-05 18:31:45 +01:00
Vitor Santos Costa d306a1bf0c plunit needs work 2019-04-05 16:56:01 +01:00
Vítor Santos Costa 07c8c6d7b1 docker 2019-04-05 10:53:03 +01:00
Vítor Santos Costa d72770a18c lbfgs 2019-04-05 08:55:12 +01:00
Vítor Santos Costa ead29987d6 lbfgs 2019-04-05 02:04:06 +01:00
Vitor Santos Costa c840e9cabb Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-04-04 13:27:47 +01:00
Vitor Santos Costa 13982dcc94 heap 2019-04-04 13:27:06 +01:00
Vítor Santos Costa 299a1edf8b Merge /home/vsc/yap 2019-04-03 17:09:29 +01:00
Vítor Santos Costa a237596736 fixes 2019-04-03 17:08:12 +01:00
Vitor Santos Costa b5205f1193 droid 2019-04-03 15:46:47 +01:00
Vitor Santos Costa 57cc6ab170 merge
Merge /home/vsc/github/yap-6.3
2019-04-03 15:15:33 +01:00
Vitor Santos Costa c04298c1d7 r + lbfhs 2019-04-03 15:04:24 +01:00
Vítor Santos Costa 134288da68 yapr 2019-04-03 10:39:22 +01:00
Vítor Santos Costa 03232f53ce install 2019-04-03 10:30:12 +01:00
Vitor Santos Costa 10307c27fe fixes 2019-04-02 15:32:50 +01:00
Vitor Santos Costa f54989e03e Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-04-02 11:23:39 +01:00
Vitor Santos Costa 644a9ad852 bug fixes 2019-04-02 11:22:01 +01:00
Vítor Santos Costa 63a514cad5 yap4r 2019-04-02 10:27:37 +01:00
Vitor Santos Costa 9156b90b66 bfgs 2019-04-01 13:40:17 +01:00
Vitor Santos Costa b24df86cb0 debugger
yap4r
2019-04-01 09:27:55 +01:00
Vitor Santos Costa 2f1eb61cf9 yap4r 2019-03-31 23:23:04 +01:00
Vitor Santos Costa 0112ad9c20 -temp fixes 2019-03-31 23:14:14 +01:00
Vitor Santos Costa 4926067be9 shift modules around. 2019-03-31 11:46:17 +01:00
Vitor Santos Costa 4dff2ad2ec allow (m:a)/i as indicator. 2019-03-31 11:45:03 +01:00
Vítor Santos Costa 3f9e57fc48 fixes in module flow
also:
  - user is everyone's parent;
  - system predicate <=> prolog:predicate
2019-03-30 10:37:16 +00:00
Vitor Santos Costa 2af4dae017 ilbfgs 2019-03-29 14:37:03 +00:00
Vitor Santos Costa de153bd479 errors 2019-03-28 14:06:16 +00:00
Vitor Santos Costa c50367325e jupyter 2019-03-27 16:31:31 +00:00
Vitor Santos Costa 78473ddd2c Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-03-27 11:04:07 +00:00
Vitor Santos Costa 7383ff79cc jupyter 2019-03-27 11:01:55 +00:00
Vitor Santos Costa b7cd534d80 jupyter 2019-03-26 23:53:47 +00:00
Vitor Santos Costa c0f7dfe3c3 jupyter 2019-03-26 15:34:42 +00:00
Vitor Santos Costa 69fcc9494c jupyter 2019-03-26 09:40:54 +00:00
Vitor Santos Costa 953667db21 bddss 2019-03-22 15:41:14 +00:00
Vitor Santos Costa 25afc1477c modules 2019-03-21 09:02:43 +00:00
Vitor Santos Costa 9980dd49a7 deb 2019-03-20 10:52:38 +00:00
Vitor Santos Costa e626847e93 synch 2019-03-19 20:51:11 +00:00
Vítor Santos Costa 044d455597 doc 2019-03-19 20:13:21 +00:00
Vitor Santos Costa 96a40f1d50 jupyter 2019-03-19 18:42:17 +00:00
Vitor Santos Costa 70a43ece1d jupyter 2019-03-18 14:47:29 +00:00
Vitor Santos Costa e8d9e71a4e lbfgs 2019-03-17 23:01:48 +00:00
Vitor Santos Costa d10589d60f Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/github/yap-6.3 2019-03-15 12:39:05 +00:00
Vitor Santos Costa 044329d115 bbdd 2019-03-15 12:38:09 +00:00
Vítor Santos Costa 6825c3e2ac missing file 2019-03-14 03:11:06 +00:00
Vitor Santos Costa e3c399af48 Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/github/yap-6.3 2019-03-14 02:13:28 +00:00
Vitor Santos Costa e5e38551e0 missing file 2019-03-14 02:11:50 +00:00
Vítor Santos Costa 47b13c3836 :Merge /home/vsc/yap 2019-03-12 15:57:40 +00:00
Vitor Santos Costa 4afbc4461c problog 2019-03-12 10:51:39 +00:00
Vítor Santos Costa 56c4220cf6 Merge /home/vsc/yap 2019-03-11 19:07:10 +00:00
Vítor Santos Costa 4d2b18908d fixes 2019-03-11 19:05:39 +00:00
Vitor Santos Costa ab56074bb1 assert(3) 2019-03-09 11:23:30 +00:00
Vítor Santos Costa 9378622d42 current_prdicate/2
r Please enter the commit message for your changes. Lines starting
2019-03-09 06:50:09 +00:00
Vitor Santos Costa 32a5158c6b problog 2019-03-06 10:49:55 +00:00
Vitor Santos Costa 21ff73dd70 modules 2019-03-04 15:49:53 +00:00
Vitor Santos Costa 7ab1624401 Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-03-03 12:27:29 +00:00
Vitor Santos Costa ae426a3b27 typos 2019-03-03 04:31:23 +00:00
Vitor Santos Costa 5ec424645d typos 2019-03-03 04:31:10 +00:00
Vitor Santos Costa 3f4fd7d7a3 silent 2019-03-03 02:19:34 +00:00
Vitor Santos Costa ff61ab9953 debugger emulation 2019-03-03 02:13:51 +00:00
Vitor Santos Costa 908cfe3b77 smallStuff 2019-03-03 02:01:39 +00:00
Vítor Santos Costa 5ff09fbf26 indicators 2019-02-28 21:57:48 +00:00
Vitor Santos Costa 8d30742d8f warnings 2019-02-27 15:54:20 +00:00
Vitor Santos Costa facf7ae8cd small patches 2019-02-27 11:04:32 +00:00
Vitor Santos Costa 2d65d0463c jupyter 2019-02-27 04:23:21 +00:00
Vitor Santos Costa 5d7c6378e7 :Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-02-27 04:22:59 +00:00
Vitor Santos Costa ccfbe3f809 various fixes 2019-02-21 21:03:44 +00:00
Vítor Santos Costa 7dca1f1390 fixes 2019-02-21 20:19:31 +00:00
Vitor Santos Costa 84721e1005 copy 2019-02-20 10:45:21 +00:00
Vitor Santos Costa c248ef9ccf Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-02-19 15:56:26 +00:00
Vitor Santos Costa cb0f5ec4db errors 2019-02-19 15:56:22 +00:00
Vitor Santos Costa f483838610 overflows 2019-02-19 15:53:36 +00:00
Vitor Santos Costa c792db26be fix tracer calls 2019-02-18 09:54:39 +00:00
Vitor Santos Costa 79d2330e71 handle Z=[X,Z], X=y(X) 2019-02-17 23:19:26 +00:00
Vitor Santos Costa 6a3c4bda79 fix 2019-02-17 07:58:06 +00:00
Vitor Santos Costa 2c1565ac0e trees 2019-02-16 13:09:30 +00:00
Vitor Santos Costa 5c41c509c0 fixes 2019-02-15 23:04:35 +00:00
Vítor Santos Costa 1ef3f738ee more loops. 2019-02-15 21:09:58 +00:00
Vitor Santos Costa 1bd2f0338c Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-02-15 13:51:22 +00:00
Vitor Santos Costa 90f5720fb0 boot 2019-02-15 13:50:24 +00:00
Vítor Santos Costa 244d04f90b :Merge /home/vsc/yap 2019-02-14 13:08:24 +00:00
Vitor Santos Costa 4b5ae9331f clpbn 2019-02-14 09:08:15 +00:00
Vítor Santos Costa 593877f39d fixes 2019-02-14 07:44:31 +00:00
Vitor Santos Costa 302519868f loops 2019-02-14 00:38:14 +00:00
Vitor Santos Costa 71940dec67 Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-02-14 00:38:02 +00:00
Vitor Santos Costa 394ecd4657 more PL fixes 2019-02-13 21:46:00 +00:00
Vítor Santos Costa 76b4ddee9c fixes 2019-02-13 14:31:29 +00:00
Vitor Santos Costa c4b78e161b moredeb 2019-02-13 09:44:24 +00:00
Vitor Santos Costa 2c80e33c6a more fixes to threes, 2019-02-11 18:10:31 +00:00
Vitor Santos Costa ac60bee30d loops 2019-02-11 09:28:46 +00:00
Vitor Santos Costa 3fdc260ee6 fixes 2019-02-10 00:18:08 +00:00
Vitor Santos Costa 24b6908225 write 2019-02-09 09:43:26 +00:00
Vitor Santos Costa d0f05d3578 new 2019-02-08 15:01:12 +00:00
Vitor Santos Costa 4678b2baee dbg 2019-02-08 09:33:07 +00:00
Vitor Santos Costa 933db5bc7e deb 2019-02-06 15:08:25 +00:00
Vitor Santos Costa 4092003cd6 deb 2019-02-06 00:08:15 +00:00
Vitor Santos Costa e5945b8e8b deb 2019-02-05 13:59:33 +00:00
Vitor Santos Costa 4bc0292ad6 fixes 2019-02-05 10:31:17 +00:00
Vítor Santos Costa 3b8475f882 ptd0 2019-02-04 22:10:30 +00:00
Vitor Santos Costa cb4d17cb4f deb 2019-02-04 15:10:06 +00:00
Vitor Santos Costa d874dc5857 fixes 2019-02-04 10:42:23 +00:00
Vitor Santos Costa 7045b6ef36 cyclic_term/1 2019-02-04 01:08:18 +00:00
Vitor Santos Costa 208438f0d0 debugging rts 2019-02-03 21:35:12 +00:00
Vítor Santos Costa 38610c0b0d rational trees 2019-02-02 22:33:18 +00:00
Vítor Santos Costa fa96ffa932 loops 2019-02-01 13:14:33 +00:00
Vitor Santos Costa ca2542c798 cou numbered vars 2019-01-31 16:40:41 +00:00
Vitor Santos Costa b382c060e3 booting 2019-01-31 12:46:35 +00:00
Vitor Santos Costa f6b16ca505 Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-01-31 12:08:28 +00:00
Vitor Santos Costa b71b4f6fca boot 2019-01-31 11:54:17 +00:00
Vitor Santos Costa c1dc6b7fb2 boot 2019-01-31 11:52:03 +00:00
Vitor Santos Costa f7ed109d1c debugging 2019-01-30 15:24:06 +00:00
Vitor Santos Costa 847edfd432 Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-01-30 11:18:09 +00:00
Vitor Santos Costa 0507d80403 docs 2019-01-30 11:17:53 +00:00
Vítor Santos Costa dfe0698f03 small booting fixes 2019-01-30 10:44:28 +00:00
Vitor Santos Costa 55ea7d35a3 Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-01-28 15:16:22 +00:00
Vitor Santos Costa 09d8d07b7e ugh 2019-01-28 15:02:55 +00:00
Vitor Santos Costa 7f71184785 bug 2019-01-27 23:54:02 +00:00
Vitor Santos Costa 36fedfa321 fixes 2019-01-27 11:05:20 +00:00
Vitor Santos Costa 13d764067f write 2019-01-27 10:11:56 +00:00
Vitor Santos Costa 5ec9e31eb9 Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-01-26 12:49:32 +00:00
Vitor Santos Costa b395177faa fixes 2019-01-26 12:44:43 +00:00
Vitor Santos Costa 700d6ae707 fixes 2019-01-25 13:54:02 +00:00
Vitor Santos Costa 650653cc64 fixes 2019-01-25 08:57:13 +00:00
Vítor Santos Costa bfe5fc2f49 tests on infinite terms. 2019-01-24 19:08:10 +00:00
Vítor Santos Costa 93bb39d5f7 copy_term 2019-01-24 19:03:18 +00:00
Vitor Santos Costa a3dd1a1520 Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-01-24 13:28:07 +00:00
Vitor Santos Costa 92089074f1 write_loops 2019-01-24 13:27:23 +00:00
Vítor Santos Costa e0467d95d4 merge 2019-01-23 18:16:13 +00:00
Vitor Santos Costa 2a090f3484 term to term 2019-01-23 14:31:31 +00:00
Vitor Santos Costa a6d709dabf copy_term 2019-01-22 19:32:19 +00:00
Vitor Santos Costa 8ce648422a Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-01-22 19:32:07 +00:00
Vitor Santos Costa c682058942 xmas 2019-01-22 03:08:26 +00:00
Vitor Santos Costa daa86e9c34 Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2019-01-22 01:59:13 +00:00
Vitor Santos Costa 17a75d79ff metas 2019-01-22 01:47:07 +00:00
Vitor Santos Costa 1c4e272b1d merge 2019-01-21 21:42:27 +00:00
Vítor Santos Costa 36b376d447 merge 2019-01-21 19:51:54 +00:00
Vítor Santos Costa e83d1f9d43 : 2019-01-21 18:54:14 +00:00
Vítor Santos Costa 4aaad2b221 Merge /home/vsc/github/yapdroid/join_yap/yap 2019-01-21 18:53:43 +00:00
Vitor Santos Costa 86decdddde modules 2019-01-21 01:11:42 +00:00
Vitor Santos Costa 8e2864c0cf offshore 2019-01-18 20:36:50 +00:00
Vitor Santos Costa 670bfd421d meta 2019-01-18 03:49:42 +00:00
Vítor Santos Costa c21c0079dc Merge /home/vsc/yap 2019-01-09 17:45:12 +00:00
Vitor Santos Costa 29c004d62a android 2019-01-09 13:59:58 +00:00
Vitor Santos Costa 6451328782 myddas 2019-01-09 09:32:09 +00:00
Vitor Santos Costa c2ebd2857c Android related patches
simpify meta-processing.
2019-01-07 14:59:20 +00:00
Vitor Santos Costa 9e1a2ad41e fix term predicates 2019-01-07 14:59:08 +00:00
Vitor Santos Costa 3f1c2352f3 jpl fixes 2018-12-28 17:44:28 +00:00
Vitor Santos Costa 3699a715ce yapi 2018-12-23 15:38:56 +00:00
Vitor Santos Costa d08c56fb56 Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-12-21 22:53:47 +00:00
Vitor Santos Costa 664c17f3b3 tuples 2018-12-21 22:51:52 +00:00
Vitor Santos Costa 7c1a6c9cef Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-12-21 22:45:52 +00:00
Vitor Santos Costa 92994fb0e4 debugging 2018-12-21 22:44:18 +00:00
Vitor Santos Costa 31423fcf90 yapi 2018-12-21 20:57:53 +00:00
Vitor Santos Costa f0a6018a00 Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-12-21 20:57:10 +00:00
Vitor Santos Costa 5b96e59311 yapi 2018-12-16 02:25:48 +00:00
Vitor Santos Costa 37d5dcedc1 yapi 2018-12-16 02:21:54 +00:00
Vitor Santos Costa 3fa4bfbcb2 flow 2018-12-14 14:53:39 +00:00
Vitor Santos Costa 890f77d698 Merge ../../yapdroid/YAPDROID_libs/yap_lib_project/yap 2018-12-14 11:37:20 +00:00
Vitor Santos Costa e66c3ab7cc :wMerge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-12-14 10:43:24 +00:00
Vitor Santos Costa 705cb09f8d droid 2018-12-14 10:40:01 +00:00
Vítor Santos Costa 44be8cf600 android 2018-12-14 10:29:12 +00:00
Vitor Santos Costa 473132c3ec yapi 2018-12-12 00:39:17 +00:00
Vitor Santos Costa 7e84455117 yap 2018-12-11 12:50:52 +00:00
Vitor Santos Costa afe5780fc1 bad chars? 2018-12-11 08:16:54 +00:00
Vitor Santos Costa 13a6cc8ece fix prolog mode 2018-12-10 22:55:52 +00:00
Vitor Santos Costa 18e437f038 yapi 2018-12-10 22:40:12 +00:00
Vítor Santos Costa ad57c3cad0 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2018-12-07 19:24:14 +00:00
Vítor Santos Costa d0418167a1 droid 2018-12-07 16:22:17 +00:00
Vitor Santos Costa 1797e5132e yap_kernel 2018-12-05 09:09:19 +00:00
Vítor Santos Costa 45f388156c :wqMerge branch 'master' of /home/vsc/github/YAPDroid/app/src/../../../yap-6.3 2018-11-30 18:09:56 +00:00
Vitor Santos Costa 6372151bf1 docs 2018-11-29 13:56:06 +00:00
Vitor Santos Costa 000c9c0968 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2018-11-29 03:03:16 +00:00
Vitor Santos Costa 87a568291b docs 2018-11-29 03:00:58 +00:00
Vitor Santos Costa b73a1f05ba Merge branch 'master' of https://github.com/vscosta/yap-6.3 2018-11-27 10:32:44 +00:00
Vitor Santos Costa 3d8858954d docs 2018-11-27 10:32:06 +00:00
Vitor Santos Costa 3a8738a7db gecode-6.1 2018-11-26 12:51:30 +00:00
Vitor Santos Costa 9dc86c735b myddas 2018-11-26 09:16:52 +00:00
Vitor Santos Costa 66167abba6 myddas 2018-11-25 13:27:48 +00:00
Vitor Santos Costa b87f0c79e9 typos/ro 2018-11-24 10:35:19 +00:00
Vitor Santos Costa 4f7a5809d5 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2018-11-24 10:25:05 +00:00
Vitor Santos Costa 286432a849 warnings 2018-11-24 10:23:52 +00:00
Vitor Santos Costa 91a5f0d1c3 swicompat 2018-11-24 10:13:59 +00:00
Vítor Santos Costa 81e37d5ce0 Merge /home/vsc/yap 2018-11-23 16:12:42 +00:00
Vitor Santos Costa 0230ff35d1 debugger 2018-11-23 14:00:20 +00:00
Vitor Santos Costa 999de8df19 configuration fixes 2018-11-23 10:55:05 +00:00
Vitor Santos Costa 9be6eb9132 small bugs 2018-11-23 00:01:55 +00:00
Vitor Santos Costa 5fdd481d6c merge 2018-11-22 13:48:21 +00:00
Vitor Santos Costa b7cdaa10ec Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-11-22 11:50:09 +00:00
Vitor Santos Costa 556fdefe83 myddas
docs
2018-11-22 11:48:47 +00:00
Vitor Santos Costa e2863854a9 Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-11-22 10:24:22 +00:00
Vitor Santos Costa e528893b73 fixes to interface code 2018-11-22 10:23:35 +00:00
Vitor Santos Costa cb8c37ce56 droid 2018-11-21 00:48:53 +00:00
Vitor Santos Costa 40633a3f83 Merge ../../yap-6.3 2018-11-17 23:56:48 +00:00
Vitor Santos Costa 17411a7384 progress 2018-11-17 23:39:55 +00:00
Vitor Santos Costa 9b31c93a46 Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-11-17 06:23:18 +00:00
Vitor Santos Costa e89bc55b9f cmake 2018-11-16 14:02:56 +00:00
Vítor Santos Costa 27227b75c7 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2018-11-15 15:40:01 +00:00
Vítor Santos Costa 2df29817c8 warnings 2018-11-15 15:39:33 +00:00
Vítor Santos Costa 50e1d90085 warnings 2018-11-15 15:38:40 +00:00
Vitor Santos Costa fc65bd6924 missin comma 2018-11-15 09:18:22 +00:00
Vitor Santos Costa 4fed99c0aa ismall bugs && docs 2018-11-14 09:35:24 +00:00
Vitor Santos Costa cb5dc1313a fix in numbervrs≈ 2018-11-08 02:33:36 +00:00
Vitor Santos Costa 337bf7b136 Merge ssh://ssh.dcc.fc.up.pt:31064//home/vsc/yap 2018-11-06 23:19:51 +00:00
Vitor Santos Costa b1635505ef Merge ssh://ssh.dcc.fc.up.pt:31064//home/vsc/yap 2018-11-06 23:02:33 +00:00
Vítor Santos Costa eb1dfc43b7 plunit 2018-11-06 22:53:47 +00:00
Vítor Santos Costa d297a8834e bad case in #if 2018-11-06 22:49:11 +00:00
Vítor Santos Costa 8d226bbfde fix buggy jubk 2018-11-06 22:47:44 +00:00
Vítor Santos Costa 54e16f6f19 Merge /home/vsc/yap 2018-11-06 16:50:42 +00:00
Vitor Santos Costa 55ebeb7dd8 fix numbervars 2018-11-05 01:24:08 +00:00
Vitor Santos Costa 76cfa609c2 listing 2018-11-04 10:55:58 +00:00
Vitor Santos Costa a1f8631844 reset 2018-11-03 10:49:35 +00:00
Vitor Santos Costa 0f313755cc top 2018-11-02 17:16:18 +00:00
Vitor Santos Costa 4a0dd26ecb hide´ 2018-11-02 15:32:05 +00:00
Vitor Santos Costa a6090a61ab metas 2018-11-02 12:14:04 +00:00
Vítor Santos Costa 52bb6a92f1 Merge /home/vsc/yap 2018-10-31 13:57:37 +00:00
Vítor Santos Costa 8e1945ad63 fix uninit field
improve lbfgs
2018-10-31 13:56:27 +00:00
Vitor Santos Costa 004bbef62b errors 2018-10-31 00:35:49 +00:00
Vitor Santos Costa a491f71cb0 stack 2018-10-29 13:32:29 +00:00
Vitor Santos Costa 0d8e28af3e Merge ssh://ssh.dcc.fc.up.pt:31064//home/vsc/yap 2018-10-29 13:32:15 +00:00
Vitor Santos Costa 670c2cbf13 errors 2018-10-29 10:42:36 +00:00
Vitor Santos Costa 5b21bc118f errirs 2018-10-29 10:24:32 +00:00
Vitor Santos Costa ebd4dffed3 error 2018-10-28 10:10:40 +00:00
Vitor Santos Costa 7381bf0d84 debuggere 2018-10-27 21:06:43 +01:00
Vitor Santos Costa a7fe5683a8 debugging 2018-10-25 18:03:54 +01:00
Vitor Santos Costa 408c15f5eb Merge ssh://ssh.dcc.fc.up.pt:31064//home/vsc/yap 2018-10-25 15:49:49 +01:00
Vitor Santos Costa 563b642672 debug 2018-10-25 13:57:18 +01:00
Vítor Santos Costa e163ccb6c0 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2018-10-24 21:58:47 +01:00
Vítor Santos Costa f0260d2978 fix debugger crssh 2018-10-24 21:45:41 +01:00
Vitor Santos Costa 3df0110947 cleanups for mac 2018-10-24 13:15:19 +01:00
Vitor Santos Costa e1bec5454d 6.1.0 2018-10-24 13:12:55 +01:00
vscosta e4dc9c2e9f
Merge pull request #23 from friguzzi/master
removed comments for Nicola from help
2018-10-23 16:02:55 +01:00
vscosta 18dad4d7e9
Merge pull request #27 from rpereira/master
Fix logo rendering
2018-10-23 16:02:07 +01:00
vscosta da6bd115d8
Merge branch 'master' into master 2018-10-23 16:01:30 +01:00
Vítor Santos Costa 37d9810a99 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2018-10-23 13:19:07 +01:00
Vitor Santos Costa 37212efc55 headers 2018-10-23 12:47:02 +01:00
Vitor Santos Costa 4bbf6f0367 try fixing includes 2018-10-23 12:20:05 +01:00
Vitor Santos Costa eed36e99a6 fix syntax error essages
WITH_PACKAGES
2018-10-23 10:09:17 +01:00
Vítor Santos Costa 0d47af2ad9 XyMerge /home/vsc/yap 2018-10-22 15:31:45 +01:00
Vitor Santos Costa 5f989e58b2 holes 2018-10-22 12:38:13 +01:00
Vítor Santos Costa fbcd45bdfe Merge /home/vsc/yap 2018-10-19 17:12:51 +01:00
Vítor Santos Costa 7986e21d59 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2018-10-19 17:11:11 +01:00
Vitor Santos Costa e117d51d98 Merge ssh://xato/home/vsc/yap 2018-10-19 16:24:51 +01:00
Vitor Santos Costa ced5916aa8 jpl
yapi back to work
2018-10-19 16:19:53 +01:00
Vitor Santos Costa 8fcf3eb008 lbfgs
memory leaks with _output_
improve configure
2018-10-19 14:56:49 +01:00
Vitor Santos Costa 3786de19de Merge ssh://ssh.dcc.fc.up.pt:31064//home/vsc/yap 2018-10-19 14:56:33 +01:00
Vítor Santos Costa b4bd6b4ba8 small fixes 2018-10-18 22:00:27 +01:00
Vitor Santos Costa 45439b8b86 fix backcall 2018-10-17 16:51:29 +01:00
Vitor Santos Costa 868961ebb5 Merge branch 'master' of github.com:vscosta/yap-6.3 2018-10-16 14:34:15 +01:00
Vitor Santos Costa c59b01e53c update jupyter 2018-10-16 14:33:16 +01:00
Vitor Santos Costa 3fdbbc6a77 Merge ssh://192.168.1.103/home/vsc/yap 2018-10-16 14:31:16 +01:00
Vitor Santos Costa 68ce1fd045 ipython 2018-10-15 23:59:08 +01:00
Vitor Santos Costa b31493c777 docs
update yap_kernel
lbfgs
2018-10-15 13:48:49 +01:00
Vitor Santos Costa 127ebb2523 fix bad reg
docs
2018-10-15 13:48:10 +01:00
Vitor Santos Costa b41986ee3c documentation. 2018-10-15 13:47:36 +01:00
Vitor Santos Costa 70cb6ed01e sum 2018-10-15 13:47:25 +01:00
Vitor Santos Costa a03aa3c27c Merge branch 'master' of https://github.com/vscosta/yap-6.3 2018-10-15 10:32:33 +01:00
Vitor Santos Costa de03a9da58 prepare merge 2018-10-15 10:29:32 +01:00
Vitor Santos Costa ac41673000 simplify 2018-10-15 10:24:30 +01:00
Vitor Santos Costa d4cdb52f2b fix sum 2018-10-15 10:23:08 +01:00
Vitor Santos Costa 5d69b09688 Merge branch 'master' of github.com:vscosta/yap-6.3 2018-10-13 14:13:31 +01:00
Vitor Santos Costa 50fb5d21c0 floats 2018-10-13 14:13:07 +01:00
Vitor Santos Costa 9dac6e9612 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2018-10-13 08:51:54 +01:00
Vitor Santos Costa c386e9d9f6 icollision 2018-10-13 08:46:58 +01:00
Vitor Santos Costa e747b7f9c1 docs 2018-10-13 08:45:40 +01:00
Vitor Santos Costa a33f2be18b docs 2018-10-13 08:42:41 +01:00
Vitor Santos Costa 7772699ef7 snapshot 2018-10-12 14:57:05 +01:00
Vítor Santos Costa 67cc23725f verbose vs verbosity 2018-10-11 07:47:28 +01:00
Vítor Santos Costa 6096c6407a fix bad patch 2018-10-10 19:20:32 +01:00
Vítor Santos Costa 7666a005dc missing file 2018-10-10 13:47:47 +01:00
Vitor Santos Costa cb1c73c973 small fixes 2018-10-10 12:33:05 +01:00
Vítor Santos Costa 32266a8b98 problog 2018-10-10 09:39:04 +01:00
Vitor Santos Costa 9e3a768220 singles 2018-10-09 13:47:27 +01:00
Vítor Santos Costa 48e398576f singleton 2018-10-08 19:03:29 +01:00
Vitor Santos Costa 50feadc341 ifix 2018-10-08 13:51:17 +01:00
Vitor Santos Costa be12fb92d6 Merge ssh://ssh.dcc.fc.up.pt:31064//home/vsc/yap 2018-10-07 17:00:51 +01:00
Vitor Santos Costa 3d5303529f fix_warnings 2018-10-07 16:57:44 +01:00
Vitor Santos Costa 6d0b702d1c small fixes 2018-10-07 14:27:01 +01:00
Vitor Santos Costa ba6e0728ae Merge 192.168.1.103:github/yap-6.3 2018-10-06 05:39:52 +01:00
Vitor Santos Costa 4f292cb521 usabiity 2018-10-05 10:27:03 +01:00
Vitor Santos Costa 5ea98bcf53 LBFGS 2018-10-05 10:26:34 +01:00
Vítor Santos Costa d0ed3cfe25 Merge /home/vsc/yap 2018-10-02 19:00:49 +01:00
Vitor Santos Costa 50b13a15a0 Merge ssh://ssh.dcc.fc.up.pt:31064//home/vsc/yap 2018-09-30 00:12:13 +01:00
Vitor Santos Costa f57377a23a maintain compatibility with olde linuxen. 2018-09-29 14:43:27 -05:00
Vitor Santos Costa 724681dde8 fix 2018-09-29 12:51:06 +01:00
Vítor Santos Costa cbc90a8293 Merge remote-tracking branch 'origin/master' 2018-09-27 18:28:40 +01:00
Vitor Santos Costa 990a86512d jpl 2018-09-26 11:46:26 +01:00
Vitor Santos Costa a01ba3383b hide 2018-09-26 01:16:07 +01:00
Vitor Santos Costa 87c6971bb6 WIN32 2018-09-26 01:14:14 +01:00
Vítor Santos Costa 13d609867c recover space on foreign exec 2018-09-21 13:31:22 +01:00
Vítor Santos Costa f6ca094534 Merge /home/vsc/yap 2018-09-18 19:50:03 +01:00
Vítor Santos Costa b6235d8ecd trust your head 2018-09-18 19:43:50 +01:00
Vítor Santos Costa a6e578090c C-interface 2018-09-18 19:27:10 +01:00
Vítor Santos Costa 7661b8581c typos 2018-09-18 19:26:51 +01:00
Vítor Santos Costa a2d397976f Use the C luke 2018-09-18 19:26:31 +01:00
Vitor Santos Costa bde725e016 fixes 2018-09-17 13:39:41 +01:00
Vítor Santos Costa 29f79473e5 Problog 2018-09-14 21:17:43 +01:00
Vitor Santos Costa 9ec1ffb2c7 Merge ssh://xato/home/vsc/yap 2018-09-14 17:46:00 +01:00
Vitor Santos Costa 46a32fbd83 heap 2018-09-14 17:43:36 +01:00
Vitor Santos Costa f8d0703983 fixes 2018-09-14 11:28:24 +01:00
Vítor Santos Costa 290ee932ed problog 2018-09-13 17:08:26 +01:00
Vítor Santos Costa b64853fd1a Merge /home/vsc/yap 2018-09-13 17:08:12 +01:00
Vitor Santos Costa a079139060 lbfgs 2018-09-13 13:35:37 +01:00
Vítor Santos Costa 46247bca56 Merge /home/vsc/yap 2018-09-12 16:18:30 +01:00
Vitor Santos Costa 724dfee44a fix alloc vs copy_term and leak 2018-09-12 12:02:42 +01:00
Vitor Santos Costa 059c406fd9 message handling. 2018-09-11 01:50:17 +01:00
Vitor Santos Costa 81998122a8 Merge ssh://ssh.dcc.fc.up.pt:31064//home/vsc/yap 2018-09-10 17:08:43 +01:00
Vitor Santos Costa 5c8f8457fa debugger 2018-09-10 17:06:13 +01:00
Vítor Santos Costa f6d8304fcf Problog 2018-08-31 20:03:00 +01:00
Vitor Santos Costa e0cc401381 remove debugging 2018-08-29 17:44:48 +01:00
Vitor Santos Costa f1066036ff maplist/6 2018-08-27 19:27:41 +01:00
Vitor Santos Costa 1e7ee487b6 errors 2018-08-21 14:34:41 +01:00
Vitor Santos Costa 63e4b31787 python 2018-08-21 03:01:03 +01:00
Vitor Santos Costa d4eea0fbb4 :Merge /home/vsc/yap 2018-08-19 14:45:25 +01:00
Vitor Santos Costa 3344dcaf7d disable_inf_tree 2018-08-19 14:43:24 +01:00
Vitor Santos Costa 244ee465c4 python 2018-08-19 14:39:12 +01:00
Vitor Santos Costa dc6a21dbc5 rational trees, problog, lbfgs 2018-08-17 17:35:02 +01:00
Vitor Santos Costa 208ed54b45 rational trees. 2018-08-15 01:29:20 +01:00
Vitor Santos Costa f329a715dd write rat trees 2018-08-10 03:40:56 +01:00
Vitor Santos Costa ecab37f72c write infinite terms 2018-08-09 16:42:43 +01:00
Vitor Santos Costa d5c1ca716e Write should not destroy the term
.
2018-08-09 15:38:47 +01:00
Vitor Santos Costa af7584e1f3 reexport 2018-08-09 02:10:30 +01:00
Vitor Santos Costa 4a28e5861a reexport 2018-08-09 02:07:57 +01:00
Vitor Santos Costa 3b186a064a listing 2018-08-09 02:07:25 +01:00
Vitor Santos Costa 015efac6df version 2018-08-09 02:06:30 +01:00
Vítor Santos Costa 1fbd0c49ba compile 2018-08-08 20:46:47 +01:00
Vítor Santos Costa 4a048aad7d name/2 fix 2018-08-08 20:45:35 +01:00
Vitor Santos Costa 1668763b19 Merge /home/vsc/github/yap-6.3 2018-08-07 21:49:03 +01:00
Vitor Santos Costa 8196666cdc Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-08-07 17:28:09 +01:00
Vitor Santos Costa 6cdd35b6e1 text 2018-08-07 17:25:05 +01:00
Vitor Santos Costa 05733938c1 android 2018-08-07 17:20:43 +01:00
Vitor Santos Costa f6596da27d Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-08-07 09:58:22 +01:00
Vitor Santos Costa a36a0e2e45 :wqMerge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-08-07 09:56:56 +01:00
Vitor Santos Costa 24014ded21 Merge ../../yap-6.3 2018-08-06 21:16:41 +01:00
Vitor Santos Costa e455d6cc6a mark visit with ,, instead of [] 2018-08-06 21:09:02 +01:00
Vitor Santos Costa 8f5fd1ddc2 6.4.1 2018-08-01 03:08:10 +01:00
Vitor Santos Costa cfaedf5db4 consult 2018-07-31 22:15:06 +01:00
Vitor Santos Costa 55b2325b2e sqlite3 2018-07-31 22:13:30 +01:00
Vitor Santos Costa 22cefb0b9c missing 2018-07-31 16:26:29 +01:00
Vitor Santos Costa 828a5ec1e9 jupyter 2018-07-31 15:18:56 +01:00
Vitor Santos Costa bf712034a9 jupyter 2018-07-27 11:11:04 +01:00
Vitor Santos Costa 436f1c205a jup 2018-07-24 20:18:41 +01:00
Vitor Santos Costa bac1b63080 ipython 2018-07-23 17:13:51 +01:00
Vitor Santos Costa b4201dd0f3 jupyter 2018-07-21 23:29:01 +01:00
Vitor Santos Costa 0c950ce5b3 jup 2018-07-21 12:08:09 +01:00
Vitor Santos Costa 562e9e5af3 jupyter 2018-07-21 01:56:48 +01:00
Vitor Santos Costa abc11dcfaa :fixes 2018-07-18 17:36:01 +01:00
Vitor Santos Costa e5748f3c9f error 2018-07-17 11:43:57 +01:00
Vitor Santos Costa 37992c77be trash 2018-07-16 08:47:11 +01:00
Vitor Santos Costa 69e0c739e8 Merge ../../yap-6.3 2018-07-15 13:46:58 +01:00
Vitor Santos Costa 52d69d3c06 droid 2018-07-15 13:46:26 +01:00
Vitor Santos Costa 4b3aedccb5 misc 2018-07-15 13:44:55 +01:00
Vitor Santos Costa 94621bf8f2 real 2018-07-15 13:43:29 +01:00
Vitor Santos Costa 2a1ec9c36b remove sleep`qq 2018-07-15 13:41:22 +01:00
Vitor Santos Costa ec61b3907e - add sleep
- fix suffix
2018-07-15 13:40:01 +01:00
Vitor Santos Costa 86c71b6da7 oops 2018-07-14 11:49:42 +01:00
Vítor Santos Costa 04fa39126c Merge /home/vsc/yap 2018-07-13 14:43:00 +01:00
Vitor Santos Costa 069fcc875c Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-07-13 14:42:36 +01:00
Vitor Santos Costa 6a70362a15 sqlite3 2018-07-13 14:42:12 +01:00
Vítor Santos Costa 3efb73f35d Merge /home/vsc/yap 2018-07-13 12:30:26 +01:00
Vítor Santos Costa 4b474574d8 memstream 2018-07-13 12:27:58 +01:00
Vitor Santos Costa 4fff363436 fixes 2018-07-12 15:17:01 +01:00
Vitor Santos Costa 4de58e0fe4 load_file 2018-07-12 11:02:09 +01:00
Vitor Santos Costa 7b774ef5cd Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-07-11 22:16:10 +01:00
Vitor Santos Costa 101bdf0f6c autoload 2018-07-11 22:15:54 +01:00
Vítor Santos Costa c2e2ec8fcf Merge /home/vsc/yap 2018-07-11 19:32:04 +01:00
Vítor Santos Costa aed15571ff R 2018-07-11 19:26:02 +01:00
Vitor Santos Costa 2e8dd92d89 jupyter-related-fixes 2018-07-10 23:21:19 +01:00
Vitor Santos Costa 387d7cc3fb py 2018-07-09 01:59:55 +01:00
Vitor Santos Costa 064b84895e py 2018-07-09 01:57:13 +01:00
Vitor Santos Costa ba00e98ad8 Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-07-09 00:53:03 +01:00
Vitor Santos Costa c93944192e py 2018-07-09 00:50:00 +01:00
Vitor Santos Costa db9823d5ef Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-07-07 02:13:18 +01:00
Vitor Santos Costa fb13a127b0 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2018-07-06 23:29:31 +01:00
Vítor Santos Costa 2905688c0f Merge /home/vsc/yap 2018-07-06 20:21:18 +01:00
Vítor Santos Costa ae35c229e8 merge 2018-07-06 19:59:12 +01:00
Vitor Santos Costa 260dcbe754 python 2018-07-06 16:51:19 +01:00
Vitor Santos Costa 8e43a02789 Merge branch 'master' of github.com:vscosta/yap-6.3 2018-07-04 11:24:46 +01:00
Vitor Santos Costa 75b7cebdaf atom_codes 2018-07-04 11:23:19 +01:00
Vitor Santos Costa 3bf897c503 more 2018-07-03 12:42:33 +01:00
Vitor Santos Costa 21a7a3ef44 fix 2018-07-03 10:45:22 +01:00
Vitor Santos Costa 48540ccc78 Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-07-03 00:08:30 +01:00
Vitor Santos Costa 176dc4bfb5 android. 2018-07-03 00:54:34 +01:00
Vitor Santos Costa e2a46cf423 droid 2018-07-03 00:08:19 +01:00
Vitor Santos Costa fd492b5b16 debug 2018-07-02 16:48:00 +01:00
Vitor Santos Costa 71aed8b870 error handling 2018-07-02 15:20:17 +01:00
Vitor Santos Costa 53de04c38f Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-06-30 16:31:40 +01:00
Vitor Santos Costa 5f96c07131 debugg 2018-06-30 14:33:32 +01:00
Vitor Santos Costa c5de0d647c fix 2018-06-30 00:57:41 +01:00
Vitor Santos Costa 6c1d3d1a95 :more db stuff 2018-06-28 12:48:29 +01:00
Vitor Santos Costa d3370ee141 modules 2018-06-28 01:45:42 +01:00
Vitor Santos Costa af1fcdac19 sqlite 2018-06-27 23:49:42 +01:00
Vitor Santos Costa 1caeb168e9 Merge /home/vsc/yap 2018-06-27 23:27:08 +01:00
Vitor Santos Costa cdd892c012 fix copy_term 2018-06-27 16:38:17 +01:00
Vitor Santos Costa f2d6c99c8a missing syspreds 2018-06-27 16:37:08 +01:00
Vitor Santos Costa 0c946038d5 fixes 2018-06-27 11:38:42 +01:00
Vitor Santos Costa 8911fea5ae 32 2018-06-26 15:35:47 +01:00
Vitor Santos Costa e97ea388f8 32 2018-06-26 15:35:38 +01:00
Vitor Santos Costa 0ca40875db fix_boot 2018-06-26 11:07:07 +01:00
Vitor Santos Costa 0bfc4d4525 debug 2018-06-26 10:22:10 +01:00
Vitor Santos Costa f6c8e204c7 Merge ../YAPDroid/yap 2018-06-26 10:21:06 +01:00
Vitor Santos Costa 510ba1b804 Merge /home/vsc/yap 2018-06-26 10:16:27 +01:00
Vitor Santos Costa 1fcc88865b :fix merge 2018-06-26 10:13:11 +01:00
Vitor Santos Costa 4495bb2661 Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-06-25 13:53:18 +01:00
Vitor Santos Costa edc7d2ceb4 droid 2018-06-25 13:44:09 +01:00
Vitor Santos Costa 81b165d3dc - Android fixes
- null pointers
2018-06-22 23:55:50 +01:00
Vitor Santos Costa 52df4c02ac merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-06-19 12:29:50 +01:00
Vitor Santos Costa 25faa8f67c droid 2018-06-19 12:29:16 +01:00
Vitor Santos Costa 58136ead22 fix boot, docs, compiler warnings 2018-06-18 22:53:53 +01:00
Vitor Santos Costa 3e5cd4b4f1 Merge /home/vsc/yap 2018-06-18 12:17:10 +01:00
Vitor Santos Costa 18c74933af full dir 2018-06-18 12:16:36 +01:00
Vitor Santos Costa d5b96ef518 full dir 2018-06-18 12:15:53 +01:00
Vitor Santos Costa eb43305a38 merge 2018-06-18 12:13:33 +01:00
Vitor Santos Costa 41bea46575 docs 2018-06-18 10:51:01 +01:00
Vitor Santos Costa ff2b867ec3 trash 2018-06-18 10:46:34 +01:00
Vitor Santos Costa 7522e54a2e gecode 6.0.1 2018-06-18 10:28:17 +01:00
Vitor Santos Costa c092d0f62b fix Malloc over/underflow
remove trash
2018-06-18 10:25:17 +01:00
Vitor Santos Costa fd4f53a899 stack info 2018-06-17 10:46:15 +01:00
Vitor Santos Costa 4fefb762f2 recursive throw 2018-06-17 10:44:38 +01:00
Vitor Santos Costa d92191874a Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-06-16 07:35:15 +01:00
Vitor Santos Costa 87f4092c19 better stack dump 2018-06-16 07:30:06 +01:00
Vitor Santos Costa 8ab005480f droid 2018-06-15 16:44:16 +01:00
Vitor Santos Costa ca814eef07 Merge ../YAPDroid/yap 2018-06-15 14:05:43 +01:00
Vitor Santos Costa f0343fc62c merge droid 2018-06-15 13:55:31 +01:00
Vitor Santos Costa a4dd2efbe7 ;Merge ../../yap-6.3 2018-06-15 13:50:55 +01:00
Vitor Santos Costa a6acc8e9e6 warning 2018-06-15 11:28:21 +01:00
Vitor Santos Costa 521a5df611 fixes 2018-06-15 11:09:04 +01:00
Vitor Santos Costa d2024c1aed state 2018-06-14 11:27:43 +01:00
Vitor Santos Costa 59534a04f6 doc 2018-06-07 18:05:45 +01:00
Vitor Santos Costa 54c6b8c041 documentation 2018-06-05 20:51:49 +01:00
Vitor Santos Costa 2d55f41ef6 docs 2018-06-05 11:20:39 +01:00
Vitor Santos Costa 40096b3fdc load 2018-06-03 23:59:17 +01:00
Vitor Santos Costa 840eb3b0fd debugging 2018-06-03 20:50:44 +01:00
Vitor Santos Costa 1201357017 ios 2018-06-03 12:07:38 +01:00
Vitor Santos Costa 72a703393f Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-06-02 23:05:33 +01:00
Vitor Santos Costa 19fef7d6ac notebook 2018-06-02 23:04:51 +01:00
Vitor Santos Costa 08ece03f4a more jupytr fixes 2018-06-02 10:36:04 +01:00
Vitor Santos Costa 94a826efcc jupyter 2018-06-01 13:22:13 +01:00
Vitor Santos Costa 725a0a692a jupyter 2018-06-01 08:37:25 +01:00
Vitor Santos Costa 7325407d23 debug 2018-05-31 00:15:48 +01:00
Vitor Santos Costa bbd0122fc3 docs & python: 2018-05-30 21:54:12 +01:00
Vitor Santos Costa 9afb5b07b2 meta 2018-05-30 13:07:45 +01:00
Vítor Santos Costa 8cfeb53e77 fixes to C interface 2018-05-30 08:12:51 +01:00
Vitor Santos Costa e9274ef5d3 debwq 2018-05-29 09:59:28 +01:00
Vitor Santos Costa 2415a2e58c debugging 2018-05-28 09:31:59 +01:00
Vitor Santos Costa b59af58616 Error handlng 2018-05-27 00:47:03 +01:00
Vitor Santos Costa eeb8f7c6a1 write fix 2018-05-26 12:02:39 +01:00
Vítor Santos Costa 4fe08fd82a memory 2018-05-26 00:22:27 +01:00
Vitor Santos Costa c4a0d5766b debug 2018-05-25 12:30:31 +01:00
Vítor Santos Costa 8c3bea4bce Merge /home/vsc/yap 2018-05-24 21:48:08 +01:00
Vítor Santos Costa 7c934d3f40 virtual streams 2018-05-24 21:45:38 +01:00
Vitor Santos Costa bb2d06fac9 debugging 2018-05-24 12:00:10 +01:00
Vitor Santos Costa ebe4ba266e Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-05-22 21:55:15 +01:00
Vitor Santos Costa 30a3b72d62 Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-05-22 21:40:22 +01:00
Vitor Santos Costa ce2185e162 cmake 2018-05-22 21:40:11 +01:00
Vítor Santos Costa 8607aee725 Errors in C++ 2018-05-22 21:33:34 +01:00
Vitor Santos Costa 9ea75834ff docs & compilation 2018-05-22 12:23:52 +01:00
Vitor Santos Costa 27b540b72b Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap 2018-05-22 00:27:54 +01:00
Vítor Santos Costa 03d8a64543 small fixes 2018-05-22 00:25:32 +01:00
Vitor Santos Costa b7a97a5b19 error handling 2018-05-21 14:45:24 +01:00
Vitor Santos Costa 518ce92bea docs 2018-05-20 18:40:56 +01:00
Vitor Santos Costa 6e9882c369 format 2018-05-20 15:47:13 +01:00
Vitor Santos Costa bdf7088665 docd 2018-05-20 00:47:27 +01:00
Vitor Santos Costa d7c4ac95e0 memmgr 2018-05-16 02:58:37 +01:00
Vítor Santos Costa 67a88a196d numbers
docs
2018-05-16 00:00:12 +01:00
Vitor Santos Costa 8a817a1dc4 simplify write 2018-05-15 12:36:18 +01:00
Vitor Santos Costa 65fa980773 error propagation 2018-05-14 16:03:02 +01:00
Vitor Santos Costa 3369e0085c error handling
documentation:
2018-05-13 12:59:17 +01:00
Vítor Santos Costa 37b1e9043b man 2018-05-10 23:27:41 +01:00
Vitor Santos Costa 7c4014d15b fix links 2018-05-10 13:23:14 +01:00
Vitor Santos Costa 1206035805 more doc stuff 2018-05-10 13:11:56 +01:00
Vitor Santos Costa 74222843e5 docs 2018-05-08 23:42:02 +01:00
Vítor Santos Costa 6fe162025b memstream 2018-05-07 09:13:06 +01:00
Vitor Santos Costa 98dd9394b4 fix path handling 2018-05-02 17:04:14 +01:00
Vitor Santos Costa 69e68ff3cc doc 2018-05-01 23:26:32 +01:00
Vitor Santos Costa ef04b30d66 doc 2018-05-01 23:25:58 +01:00
Vítor Santos Costa 44ac70d3ab docs 2018-04-27 17:37:42 +01:00
Vitor Santos Costa 1c293a9af4 docs 2018-04-27 13:01:08 +01:00
Vitor Santos Costa af848f28aa popen support 2018-04-24 17:51:00 +01:00
Vitor Santos Costa 2c1d6910de fixes 2018-04-24 08:31:11 +01:00
Vitor Santos Costa f39619b3ef doc fixes 2018-04-23 14:34:52 +01:00
Vítor Santos Costa dfacbdcfd1 Merge /home/vsc/yap 2018-04-20 19:16:13 +01:00
Vítor Santos Costa 9cfe3a4c7f taje care wih cases where is already FAIL 2018-04-20 19:16:01 +01:00
Vítor Santos Costa c7995f276c docs 2018-04-20 14:59:17 +01:00
Vitor Santos Costa 11dae5653e keep on fixing Paulo's tests 2018-04-20 14:27:26 +01:00
Vítor Santos Costa 1b27ef94bb gc 2018-04-18 15:45:14 +01:00
Vítor Santos Costa 6095fe6e00 error_handling 2018-04-18 15:13:11 +01:00
Vitor Santos Costa 8bfa835959 avoid getting stuck ith output. 2018-04-17 18:28:37 +01:00
Vitor Santos Costa 4b1efa59b4 more fixes 2018-04-17 17:47:40 +01:00
Vítor Santos Costa 7bfe8aedbe fix exception 2018-04-16 22:51:34 +01:00
Vitor Santos Costa abb328abf0 more exception handling. 2018-04-16 14:54:53 +01:00
Vitor Santos Costa df961cbd62 fix errors, goes òn.
fix overflow detection by using clang/gcc buit-ins..
2018-04-14 16:25:29 +01:00
Vitor Santos Costa d172c9a0f7 more on error handling
fiz inefficient grammar
output cmake recognised packages
2018-04-10 13:14:16 +01:00
Vítor Santos Costa 2c64eea060 Merge /home/vsc/yap 2018-04-10 00:55:25 +01:00
Vítor Santos Costa 470323da5c jumping 2018-04-10 00:54:34 +01:00
Vítor Santos Costa fb5564f9d1 status 2018-04-10 00:54:01 +01:00
Vitor Santos Costa ec8eb89cc7 use indexing to make the code easier to follow. 2018-04-09 22:16:50 +01:00
Vitor Santos Costa 04c38ecc29 fixes 2018-04-09 13:42:06 +01:00
Vítor Santos Costa 2d19db5fce debug exc 2018-04-09 02:00:51 +01:00
Vitor Santos Costa 7ce963b63c keep on working on exs. 2018-04-07 19:45:18 +01:00
Vítor Santos Costa bc3555dfbf errors 2018-04-05 00:58:25 +01:00
Vítor Santos Costa 3d8ef251a5 snapshot 2018-04-04 15:55:45 +01:00
Vitor Santos Costa c3b06ffdd1 debugging 2018-04-04 10:06:54 +01:00
Vítor Santos Costa d379034a96 exceptions 2018-04-04 01:37:15 +01:00
Vitor Santos Costa 3a44eb657d fixes 2018-04-03 18:31:51 +01:00
Vítor Santos Costa c1d81ea7c6 errors 2018-04-02 14:49:45 +01:00
Vitor Santos Costa 48bcffdce7 try to fix exceptions 2018-03-29 22:33:53 +01:00
Vitor Santos Costa 508e10d0be cleanup 2018-03-28 08:54:51 +01:00
Vítor Santos Costa e3ac349a0d droid 2018-03-26 23:12:48 +01:00
Vítor Santos Costa 29af01c288 Merge https://github.com/vscosta/yap-6.3 2018-03-26 15:01:27 +01:00
Vítor Santos Costa 3da111bd10 errors 2018-03-26 15:01:21 +01:00
Vítor Santos Costa 51fa95505f merge 2018-03-26 11:05:22 +01:00
Vítor Santos Costa 05356df347 Merge 192.168.1.79:github/yap-6.3 2018-03-26 11:03:08 +01:00
Vitor Santos Costa e02884a94f error handling 2018-03-24 22:56:52 +00:00
Vitor Santos Costa 0b67a66533 fix dlls 2018-03-24 22:56:21 +00:00
Vitor Santos Costa 4dfad0a7fe ninja 2018-03-24 22:55:32 +00:00
Vitor Santos Costa 7e0611b526 fix typo (by Paulo Moura) 2018-03-23 19:17:20 +00:00
Vitor Santos Costa 13cdd5124a typo 2018-03-23 18:48:48 +00:00
Vitor Santos Costa 56e676ef65 undef 2018-03-23 18:48:16 +00:00
Vítor Santos Costa 9b86a7869b fix typo 2018-03-22 07:18:07 +00:00
Vitor Santos Costa c2f2490fee Merge branch 'master' of github.com:vscosta/yap-6.3 2018-03-20 12:11:44 +00:00
Vítor Santos Costa ff149367e8 carry your own backall, and remove some debugging stuff 2018-03-20 00:57:27 +00:00
Vitor Santos Costa 98d52ba347 - install missing includes
- path handling  in python
- android-only stuff,
2018-03-19 23:01:55 +00:00
Vitor Santos Costa 1b2aa6417c Merge ../../yap-6.3 2018-03-19 16:45:32 +00:00
Vitor Santos Costa da68741b74 integrate backcall 2018-03-19 15:43:06 +00:00
Vitor Santos Costa 1ff06fd2e0 integrate backcall 2018-03-19 15:41:53 +00:00
Vitor Santos Costa 2e9be3d0d4 droid 2018-03-19 15:41:06 +00:00
Vitor Santos Costa 927a43933c pythonless 2018-03-19 14:26:29 +00:00
Vitor Santos Costa b54439d909 single_quotes 2018-03-19 11:44:16 +00:00
Vitor Santos Costa 8ab38125db gecide6_first_try 2018-03-19 11:43:41 +00:00
Vitor Santos Costa 9194fda6cc better_jupyter 2018-03-19 11:43:14 +00:00
Vitor Santos Costa 56f47acc49 malloc 2018-03-19 11:42:54 +00:00
Vitor Santos Costa 353690cc59 gecode6 2018-03-18 14:23:24 +00:00
Vítor Santos Costa af610dc16d locking 2018-03-18 00:44:08 +00:00
Vitor Santos Costa cc6eca6903 jupyter 2018-03-17 10:38:56 +00:00
Vitor Santos Costa c33a0d72db booting 2018-03-14 00:41:05 +00:00
Vitor Santos Costa 1a8c26b886 jupyter 2018-03-12 15:11:59 +00:00
Vitor Santos Costa 31fd3eb344 extensions 2018-03-02 21:18:24 +00:00
Vitor Santos Costa 3a36285bb2 jupyter 2018-02-26 21:38:19 +00:00
Vitor Santos Costa 530246688c jupyter 2018-02-25 00:29:08 +00:00
Vitor Santos Costa a073b663ae Merge ../../yap-6.3 2018-02-24 14:49:43 +00:00
Vitor Santos Costa 4db414a05a Merge 192.168.1.79:github/yap-6.3 2018-02-24 14:43:31 +00:00
Vitor Santos Costa 82df9ce5b5 jupyter_dbug 2018-02-24 14:39:17 +00:00
Vitor Santos Costa 921b5d497d Merge ../YAPDroid/yap 2018-02-23 14:16:20 +00:00
Vitor Santos Costa d6aaa8a03e blobs 2018-02-23 14:09:58 +00:00
Vitor Santos Costa 1066ded7d9 blobs 2018-02-23 14:09:09 +00:00
Vitor Santos Costa f798372fb1 simplify boot
rename boot vars for consistency
small fixes
2018-02-23 14:07:21 +00:00
Vitor Santos Costa 54e3d48fb1 Merge branch 'master' of /home/vsc/github/YAPDroid/app/src/../../../yap-6.3 2018-02-23 09:50:09 +00:00
Vitor Santos Costa 21b017967f android 2018-02-23 09:49:55 +00:00
Vitor Santos Costa 207d0acb03 Merge ../../yap-6.3 2018-02-22 09:34:23 +00:00
Vitor Santos Costa 81c7fc5d45 ipaths 2018-02-22 09:33:43 +00:00
Vitor Santos Costa 1cdd8a482b virtual_dir -> GLOBAL_dir
android ckf
2018-02-22 08:18:45 +00:00
Vitor Santos Costa 13f36c1f67 Merge vcosta-laptop:github/yap-6.3 2018-02-21 17:41:20 +00:00
Vitor Santos Costa 1289899918 ExportMemory 2018-02-21 17:41:00 +00:00
Vitor Santos Costa ca92d8631b configuration 2018-02-21 13:17:35 +00:00
Vitor Santos Costa bdc9e7005d scanner fixes
-> vs !
error handling
2018-02-21 13:02:20 +00:00
Vitor Santos Costa 3e71d171e7 small 2018-02-20 22:59:17 +00:00
Vitor Santos Costa 7219992154 android 2018-02-15 00:02:44 +00:00
Vitor Santos Costa e93c01f8e0 asserts 2018-02-14 14:17:57 +00:00
Vitor Santos Costa 76d0d54a34 boot 2018-02-14 10:37:07 +00:00
Vitor Santos Costa 311e1d697d use_module_3 2018-02-14 10:36:48 +00:00
Vitor Santos Costa fe496e840d android 2018-02-14 00:13:13 +00:00
Vitor Santos Costa 37f7eb3cf3 usefulboot 2018-02-13 01:02:20 +00:00
Vitor Santos Costa e7af316ad1 Merge branch 'master' of github.com:vscosta/yap-6.3 2018-02-10 14:13:21 +00:00
Vitor Santos Costa 608d87bafe mac 2018-02-10 14:12:29 +00:00
Vitor Santos Costa ba69fbc955 conda 2018-02-08 11:13:58 +00:00
Vitor Santos Costa 84aaa82dbe jupyter 2018-02-08 10:48:02 +00:00
Vitor Santos Costa b057ac92e4 demo 2018-02-08 10:46:22 +00:00
Vitor Santos Costa 0b742f3ae3 meta-calls
moduls vs python
2018-02-08 09:56:01 +00:00
Vitor Santos Costa eee6760f96 debugging 2018-02-07 23:18:43 +00:00
Vitor Santos Costa 8d6654d4cf Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/github/yap-6.3 2018-02-07 21:48:50 +00:00
Vitor Santos Costa 34c6ace8be fixes 2018-02-07 21:48:37 +00:00
Vitor Santos Costa 50b2bae12a 0 length strings, 2018-02-07 21:39:28 +00:00
Vitor Santos Costa f037b2478c fix throw 2018-02-07 17:46:36 +00:00
Vitor Santos Costa b02c775915 meta 2018-02-07 17:46:06 +00:00
Vitor Santos Costa fadf853e96 boot_fixes 2018-02-07 11:24:05 +00:00
Vitor Santos Costa 66db3d53f8 boot 2018-02-02 11:50:07 +00:00
Vitor Santos Costa 5ea47853ac jupyter 2018-02-01 14:55:09 +00:00
Vitor Santos Costa 24d895d100 Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/github/yap-6.3 2018-02-01 01:59:42 +00:00
Vitor Santos Costa 741c5a1e10 python 2018-02-01 01:57:46 +00:00
Vitor Santos Costa 1cafba0529 meta & kernel 2018-02-01 01:44:34 +00:00
Vitor Santos Costa aaadd51309 sync 2018-01-29 15:24:32 +00:00
Vitor Santos Costa eb9cc69bfb :module 2018-01-27 11:40:40 +00:00
Vitor Santos Costa f3f524960c fixes 2018-01-27 10:17:27 +00:00
Vitor Santos Costa 63e8e89dab sub_atom 2018-01-25 11:59:55 +00:00
Vitor Santos Costa 9fce1e9ba2 bootstrapping 2018-01-22 13:53:17 +00:00
Vitor Santos Costa fdf7bb516f fix 2018-01-19 14:38:26 +00:00
Vitor Santos Costa 4c25aa21c5 boot 2018-01-18 14:47:27 +00:00
Vitor Santos Costa 791484c132 inputhooks 2018-01-05 17:13:37 +00:00
Vitor Santos Costa 1cff18d1c0 inputhooks 2018-01-05 17:10:28 +00:00
Vitor Santos Costa 9c862c21bc jupyter 2018-01-05 16:57:38 +00:00
Vitor Santos Costa 814aa2bd4c python 2017-12-20 00:29:15 +00:00
Vitor Santos Costa 4a5002091f tmp 2017-12-14 18:40:22 +00:00
Vitor Santos Costa 6b03c96a78 anaconda, no goal expansion within call 2017-12-13 16:56:10 +00:00
Vitor Santos Costa 85f444cc94 android 2017-12-12 11:17:33 +00:00
Vitor Santos Costa 237430afb4 Merge /Users/vsc/github/yap-6.3 2017-12-11 17:22:24 +00:00
Vitor Santos Costa 5be3fe4555 access to libs 2017-12-11 04:01:11 +00:00
Vitor Santos Costa d348e8c563 ldd 2017-12-11 03:36:21 +00:00
Vitor Santos Costa 9a5681b2cb rpath 2017-12-10 11:42:51 +00:00
Vitor Santos Costa 65dd00be58 Merge branch 'master' of 192.168.1.103:github/yap-6.3 2017-12-10 01:37:02 +00:00
Vitor Santos Costa 3061844c95 Fixes, mostly to the biting o 2017-12-10 01:22:45 +00:00
Vitor Santos Costa 645b2c7d93 boot 2017-12-05 15:14:57 +00:00
Vitor Santos Costa b645f60405 Merge 192.168.1.103:github/YAPDroid/app/src/yap 2017-12-01 10:56:19 +00:00
Vitor Santos Costa 55f4767621 Merge 192.168.1.103:github/yap-6.3 2017-12-01 10:49:46 +00:00
Vitor Santos Costa 876e42d629 memory 2017-12-01 10:42:10 +00:00
Vitor Santos Costa 76fb202d7e nugs 2017-11-30 19:17:41 +00:00
Vitor Santos Costa c281d73aef warnings 2017-11-30 01:55:58 +00:00
Vitor Santos Costa 4f366726c6 merge 2017-11-30 01:53:43 +00:00
Vitor Santos Costa 2a93f1da99 swig streamer 2017-11-30 01:16:52 +00:00
Vitor Santos Costa 690f1d3830 android 2017-11-30 01:14:26 +00:00
Vitor Santos Costa 3688819ea2 iandroid 2017-11-29 13:47:57 +00:00
Vitor Santos Costa 8feca162bf android 2017-11-27 13:36:19 +00:00
Vitor Santos Costa 06485f071a iandroid 2017-11-21 15:44:43 +00:00
Vitor Santos Costa cdcb365a82 cmake first 2017-11-18 10:55:22 +00:00
Vitor Santos Costa 9dab200c61 treamer 2017-11-18 08:16:09 +00:00
Vitor Santos Costa 484213efb6 Merge branch 'master' of github.com:vscosta/yap-6.3 2017-11-18 00:27:26 +00:00
Vitor Santos Costa bf78d70d66 fix skip/1 and debugging stuff
formatting
2017-11-18 00:18:42 +00:00
Vitor Santos Costa 746a4b4ef8 Support sqlite3, basic ops 2017-11-18 00:04:42 +00:00
Vitor Santos Costa b8f0a34833 5.1.0 support fix error handling. 2017-11-17 23:56:51 +00:00
Vitor Santos Costa ed2c85a56b saved states and anaconda 2017-11-15 12:18:19 +00:00
Vitor Santos Costa 450d7a2bdd oops 2017-11-14 00:38:23 +00:00
Vitor Santos Costa 5f9e0299ee boot at diferent directories 2017-11-13 11:02:35 +00:00
Vitor Santos Costa bf67b8e609 cleanup 2017-11-11 22:48:09 +00:00
Vitor Santos Costa 23565fc351 2to3-err-extra 2017-11-11 21:50:55 +00:00
Vitor Santos Costa f7d6d70733 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2017-11-11 03:05:36 +00:00
Vitor Santos Costa d23f7c149f anaconda 2017-11-11 02:15:59 +00:00
Vitor Santos Costa 4271f3debe fix & 2017-11-11 02:14:46 +00:00
Vitor Santos Costa af233dbf36 configuration 2017-11-10 23:08:35 +00:00
Vitor Santos Costa 5c199984ed configuration 2017-11-09 12:14:41 +00:00
Vitor Santos Costa 3bb4570c55 typo 2017-11-08 10:55:38 +01:00
Vitor Santos Costa 538cb4eb2c dynamic loading 2017-11-08 10:29:01 +01:00
Vitor Santos Costa 9100e797f8 opaque terms 2017-11-08 10:26:51 +01:00
Vitor Santos Costa 7cd3fffe13 first fix for 5.1.0 2017-11-08 10:23:29 +01:00
Vitor Santos Costa 2be6dcdbac improve support for 5.1.0 2017-11-08 10:19:10 +01:00
Vitor Santos Costa e4fd6a153a error handling 2017-10-28 03:21:34 +01:00
Vitor Santos Costa 29f0f88025 init 2017-10-28 03:19:39 +01:00
Vitor Santos Costa 9a211ac1d4 ẗypo 2017-10-28 03:17:50 +01:00
Vitor Santos Costa 3789f69cf1 minor patches 2017-10-27 23:06:23 +01:00
Vitor Santos Costa 978e8e9788 cmake 2017-10-27 13:56:49 +01:00
Vitor Santos Costa 407815e09a skip1?? 2017-10-27 13:56:01 +01:00
Vitor Santos Costa 2e6684b995 immediate_writing 2017-10-27 13:55:34 +01:00
Vitor Santos Costa 75f5937e2b docs 2017-10-27 13:51:29 +01:00
Vitor Santos Costa e3ade13cfe debug && docs 2017-10-27 13:50:40 +01:00
Vitor Santos Costa a83d97f998 debugging the debugger 2017-10-27 13:49:55 +01:00
Vitor Santos Costa 368cb492ef solutions first 2017-10-27 13:49:08 +01:00
Vitor Santos Costa 73f05f2ed2 more text allocation 2017-10-27 13:48:07 +01:00
Vitor Santos Costa afd24bb8db fix uninit arrays 2017-10-27 13:47:00 +01:00
Vitor Santos Costa 74e902c257 fix early reset of local variables 2017-10-27 13:46:04 +01:00
Vitor Santos Costa f12d98a38c typos 2017-10-18 18:23:09 +01:00
Vitor Santos Costa 861f185ec6 atom_concat and empty atoms 2017-10-18 17:03:23 +01:00
Vitor Santos Costa 8baaa70cec sqlite is always available 2017-10-18 17:02:27 +01:00
Vitor Santos Costa 7dab812d64 chaeacters mostly 2017-10-18 01:02:52 +01:00
Vitor Santos Costa af38546a0d cuddInt 2017-10-17 10:56:41 +01:00
Vitor Santos Costa 8437007716 fix bad install paths 2017-10-17 08:32:51 +01:00
Vitor Santos Costa d93134dcf6 Makefiles 2017-10-17 00:13:09 +01:00
Vitor Santos Costa 7a7a9f56ed fix 2017-10-12 12:08:32 +01:00
Vitor Santos Costa 6b0478db00 anaconda 2017-10-11 02:24:15 +01:00
Vitor Santos Costa da94db80cf fix warnings 2017-10-06 13:05:12 +01:00
Vitor Santos Costa dd48ba6f91 swig 2017-10-04 09:18:17 +01:00
Vitor Santos Costa d05b1f4b2b commas 2017-10-02 16:04:34 +01:00
Vitor Santos Costa 9f1ef65ff5 generic tmp alloc fixes. 2017-10-02 08:58:51 +01:00
Vitor Santos Costa c06dd92761 portability 2017-10-01 23:30:53 +01:00
Vitor Santos Costa 46d997713f memory handling 2017-09-26 15:15:15 +01:00
Vitor Santos Costa a40fbe420f memory mgmt 2017-09-23 02:17:55 +01:00
Vitor Santos Costa 70f4f7adcf text handling/UNICODE 2017-09-21 09:47:21 +01:00
Vitor Santos Costa 4d1c031051 one_more 2017-09-19 14:23:20 +01:00
Vitor Santos Costa 27fdeb81cc trash 2017-09-19 13:24:16 +01:00
Vitor Santos Costa 98a5538f45 a question of size 2017-09-19 13:19:13 +01:00
Vitor Santos Costa 53822922c8 fixes for UTF-8 2017-09-18 10:17:01 +01:00
Vitor Santos Costa b24dc4893d text 2017-09-17 21:06:22 +01:00
Vitor Santos Costa 717aeb162a Merge ssh://192.168.1.79:/Users/vsc/github/yap-6.3 2017-09-17 08:04:57 +01:00
Vitor Santos Costa c1d9a00a81 debugging 2017-09-17 07:59:37 +01:00
Vitor Santos Costa 95dd4890cc cleanup 2017-09-17 07:58:20 +01:00
Vitor Santos Costa 5e761f7fd3 debugging 2017-09-17 07:55:36 +01:00
Vitor Santos Costa 00d1bf9af4 indenting 2017-09-17 07:53:43 +01:00
Vitor Santos Costa 35e12bd9c4 debugging support 2017-09-17 07:51:59 +01:00
Vitor Santos Costa 65126b1b54 debugging 2017-09-17 07:48:21 +01:00
Vitor Santos Costa ea51f06783 small API changes 2017-09-06 16:13:34 +01:00
Vitor Santos Costa 3fd8ccb06b missing 2017-09-06 02:15:22 +01:00
Vitor Santos Costa a64059612f docs 2017-09-06 02:07:46 +01:00
Vitor Santos Costa 81f5909095 fixss 2017-09-06 02:04:30 +01:00
Vitor Santos Costa b9c84ab7e9 cmake 2017-09-06 01:17:43 +01:00
Vitor Santos Costa 41dab59126 split: 2017-09-06 01:17:09 +01:00
Vitor Santos Costa 02a2bb0b0b varia 2017-09-06 01:16:36 +01:00
Vitor Santos Costa b5bfb638a3 call cleanup 2017-09-06 01:13:15 +01:00
Vitor Santos Costa e3ab36f091 call cleanup 2017-09-06 01:13:00 +01:00
Vitor Santos Costa af29600f09 debug 2017-09-06 01:11:32 +01:00
Vitor Santos Costa abdc8a35f9 cmmake 2017-09-06 01:09:46 +01:00
Vitor Santos Costa a115024aee Merge http://www.github.com/vscosta/yap-6.3 2017-09-03 10:49:16 +01:00
Vitor Santos Costa 5448987ad0 gated call 2017-09-03 00:15:54 +01:00
Vitor Santos Costa 22c0cbeca3 utf-8 in text 2017-09-03 00:15:04 +01:00
Vitor Santos Costa b2a30b0a53 docs 2017-09-03 00:14:09 +01:00
vscosta 11e81b457d Merge branch 'master' of https://github.com/vscosta/yap-6.3
# Conflicts:
#	packages/python/swig/CMakeLists.txt
#	packages/python/swig/setup.py.in
#	swi/library/CMakeLists.txt
2017-09-03 00:07:10 +01:00
Vitor Santoss Costa 675ce8c77b Merge branch 'master' of https://github.com/vscosta/yap-6.3 2017-09-03 00:05:33 +01:00
vscosta f255d629e9 try to improve dll search 2017-09-02 23:50:09 +01:00
vscosta 51d9637fc4 pass files to python 2017-09-02 23:49:19 +01:00
vscosta 70c25d37b6 tell where we built from 2017-09-02 23:48:49 +01:00
vscosta 93577a7481 trying to make sense of setuptools 2017-09-02 23:47:14 +01:00
vscosta b032803616 sytem_library/1should fail on not finding anything 2017-09-02 23:44:16 +01:00
vscosta d49a7387ef inform that we started from restore 2017-09-02 23:43:08 +01:00
Vitor Santos Costa 2efedcb131 mode 2017-08-27 22:31:38 +01:00
Vitor Santos Costa d2940c981c kernel 2017-08-27 22:27:51 +01:00
Vitor Santos Costa 6e6738b199 varia 2017-08-27 22:26:44 +01:00
Vitor Santos Costa 3239778cf5 python kernel 2017-08-27 22:24:34 +01:00
Vitor Santos Costa b1067dcc34 error handling 2017-08-27 22:22:34 +01:00
Vitor Santos Costa ec3995dd82 completion in readline 2017-08-27 22:20:38 +01:00
Vitor Santos Costa 2add5f2971 filter t def 2017-08-27 22:19:02 +01:00
Vitor Santos Costa 063806f2f3 style file 2017-08-27 22:18:04 +01:00
Vitor Santos Costa ce61f810c2 overflow in string 2017-08-27 22:17:00 +01:00
Vitor Santos Costa ccd7916d31 fix misformat header 2017-08-27 22:08:28 +01:00
Vitor Santos Costa 3d6d3f092a recover from OOM stack errord 2017-08-27 22:07:22 +01:00
Vitor Santos Costa 7ee2813f90 be more aggressive at recovering memory 2017-08-27 22:05:46 +01:00
Vitor Santos Costa 4574cdb4df bad call to longjmp 2017-08-27 22:04:36 +01:00
Vitor Santos Costa 51b99388e7 use same format for all call instructions; try to be more robust in doing g 2017-08-27 22:03:19 +01:00
Vitor Santos Costa 8bf607aa65 missing 2017-08-25 17:42:42 +01:00
Vitor Santos Costa de7ef115e7 jupyter 2017-08-21 15:16:06 +01:00
Vitor Santos Costa ed346ccc65 jupyter 2017-08-21 12:59:49 +01:00
Vitor Santos Costa ec518d7d36 jupiter 2017-08-21 12:42:51 +01:00
Vitor Santos Costa b2c8b9a06e setup_call 2017-08-21 12:41:15 +01:00
Vitor Santos Costa d2f87363ef more putter 2017-08-21 12:38:39 +01:00
Vitor Santos Costa 3e6c24cc0c new jupiter intrface 2017-08-21 12:36:48 +01:00
Vitor Santos Costa 54234c7e1d fix C major issues
- use delays to implement setup_call
- fix user_* flag
- error handling i CXX should b local
- fix mess on  how to call openQuert
- deter pt -> from a pointer to another one
- avoid text forms when you can use C: LOCLS to locals.h
- fux seto_call
- new gated call
- mem streams
2017-08-21 12:29:58 +01:00
Vitor Santos Costa f8f1d75ad6 remove bjp 2017-08-09 08:18:37 +01:00
Vitor Santos Costa a7bc4a3c71 fixes to use new IO 2017-08-09 08:15:51 +01:00
Vitor Santos Costa 5b5e954dbc use FeatureSummary 2017-07-30 22:24:00 +01:00
Vitor Santos Costa 8ad14f6765 fix prompting vs buffering outside readline 2017-07-30 22:23:16 +01:00
Vitor Santos Costa f99d048cc2 trail extension support 2017-07-30 22:20:12 +01:00
Vitor Santos Costa a1b04dee3e support new trail sus scheme 2017-07-30 22:10:12 +01:00
Vitor Santos Costa dac6dc7c22 replace cut_c by trail entries 2017-07-30 21:53:07 +01:00
Vitor Santos Costa 3d191957db unused test 2017-07-30 21:50:56 +01:00
Vitor Santos Costa 75befc69f7 Merge /home/vsc/github/yap-6.3 2017-07-25 01:11:16 +01:00
Vitor Santos Costa 963752fa9c Android support, 2017-07-25 01:10:44 +01:00
Vitor Santos Costa 46468803b1 fix warnings. 2017-07-25 01:09:29 +01:00
Vitor Santos Costa 63a1957d8e documentation. 2017-07-24 18:20:00 +01:00
Vitor Santos Costa 023c254d03 fix exit 2017-07-24 18:18:56 +01:00
Vitor Santos Costa 22837d498b improve signal handling. 2017-07-24 18:17:51 +01:00
Vitor Santos Costa 530d73c470 compilation with 5.1.0 (no testing). 2017-07-24 18:14:57 +01:00
Vitor Santoss Costa d91b06bb6c small 2017-07-06 01:04:06 +01:00
Vitor Santoss Costa a601d3ebb3 strings 2017-07-05 21:47:10 +01:00
Vitor Santos Costa 12f93e10d3 Merge branch 'master' of github.com:vscosta/yap-6.3 2017-07-05 03:37:50 +01:00
Vitor Santos Costa 1a78144190 keys_to_list 2017-07-05 03:36:42 +01:00
Vitor Santoss Costa efaf86c675 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2017-07-03 21:18:05 +01:00
Vitor Santos Costa 1dec8f5a55 indenting+python error hanadling 2017-07-03 22:12:31 +01:00
Vitor Santoss Costa f00b3ccab2 small fixes 2017-07-03 21:18:01 +01:00
Vitor Santos Costa c0cf2b0b83 fixes 2017-07-03 02:17:52 +01:00
Vitor Santos Costa ee9e596368 yap4py stuff 2017-07-01 23:25:22 +01:00
Vitor Santos Costa d0b2924322 doc 2017-06-26 01:17:51 +01:00
Vitor Santos Costa 9272a1c7d5 python 2017-06-22 10:41:41 +01:00
Vitor Santos Costa d7e21c80df fix swi call leak
improve yapi
reformat
2017-06-19 19:02:36 +01:00
Vitor Santos Costa 6b545c8f71 smallbugs 2017-06-18 11:14:55 +01:00
Vitor Santos Costa 31f1c25ee7 python 2017-06-16 11:53:46 +01:00
Vitor Santos Costa 8ac3d980c2 system_preds 2017-06-16 11:53:21 +01:00
Vitor Santos Costa 97aad19cd0 python vs modules 2017-06-15 22:40:55 +01:00
Vitor Santoss Costa 3a06d4fecb win python support 2017-06-14 12:34:12 +01:00
vsc e68630cd8a packaging 2017-06-13 22:02:22 +01:00
Vitor Santos Costa d06dd49dd0 python fixes for win32 2017-06-13 13:34:17 +01:00
Vitor Santos Costa bba62ea6eb Merge /home/vsc/yt 2017-06-12 18:03:18 +01:00
Vitor Santos Costa ea099c83bb python 2017-06-12 18:02:37 +01:00
Vitor Santos Costa 0d96197ddf X_API 2017-06-12 18:00:47 +01:00
vsc c2f6d968c3 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2017-06-08 22:20:21 +01:00
vsc 3938ed7150 abandoned 2017-06-08 22:20:12 +01:00
vsc ebd6f0a0c2 windows trouble 2017-06-08 22:16:52 +01:00
Vitor Santos Costa 732adf9f43 jupyter 2017-06-08 08:50:37 +01:00
Vitor Santos Costa f1ddb5822e fix predicate search 2017-06-06 12:47:59 +01:00
Vitor Santos Costa 2ad3420fac fixes 2017-06-05 13:06:12 +01:00
Vitor Santos Costa 78768c354c not in yap 2017-05-27 23:00:23 +01:00
Vitor Santos Costa 0c46c894d3 python support 2017-05-27 22:54:00 +01:00
Vitor Santos Costa 25a2b68b15 yap_kernl + docs 2017-05-25 19:20:16 +01:00
Vitor Santos Costa 9560aa026e Handle exported predicates in meta-calls 2017-05-25 19:02:33 +01:00
Vitor Santos Costa 6a2d74ac6e Merge branch 'master' of xato:0517 2017-05-19 10:03:49 +01:00
Vitor Santos Costa 18af47bdde Jupyter 2017-05-19 09:56:37 +01:00
Vitor Santos Costa 87851a68f4 documentation support 2017-05-19 09:54:35 +01:00
Vitor Santos Costa a828f3f899 improve 5,1,0 support (still broken) 2017-05-19 09:53:58 +01:00
Vitor Santos Costa 3802a588f9 Mostly about Jupyter support. 2017-05-14 11:36:09 +01:00
Vitor Santos Costa 386c88e372 update to latest ipykernel 2017-05-14 11:27:44 +01:00
Vitor Santos Costa 517667c1d5 Merge branch 'master' of 192.168.1.103:github/yap-6.3 2017-05-08 19:04:25 +01:00
Vitor Santos Costa 214daa5c40 swig 2017-05-08 19:04:16 +01:00
Vitor Santos Costa 149a010e05 Merge branch 'master' of 192.168.1.103:github/yap-6.3 2017-05-08 19:00:55 +01:00
Vitor Santos Costa 3e3893ceff docs 2017-05-08 18:55:34 +01:00
Vitor Santos Costa 48a2066f54 pythonlib 2017-05-08 18:53:43 +01:00
Vitor Santos Costa c2435673cd swig python support 2017-05-08 18:51:29 +01:00
Vitor Santos Costa d1e39368f4 reorganise python interface 2017-05-08 18:49:00 +01:00
Rui Afonso Pereira 84e90d764f
Fix logo rendering 2017-05-07 10:35:15 +01:00
Vitor Santos Costa 6e7846e210 docs 2017-05-02 07:42:21 +01:00
Vitor Santos Costa a6e6642eb2 fixes 2017-05-02 07:41:55 +01:00
Vitor Santos Costa b54dd37ef9 wheel/fixes/docs 2017-05-02 07:38:23 +01:00
Vitor Santos Costa a21dce7801 fixes 2017-05-02 07:31:42 +01:00
Vitor Santos Costa 0320d8b49b docs 2017-05-02 04:08:03 +01:00
Vitor Santos Costa 83b137f117 docs 2017-05-02 04:07:23 +01:00
Vitor Santos Costa 3cb343479e small compiler change 2017-05-02 03:34:56 +01:00
Vitor Santos Costa 70232133cc docs 2017-04-13 21:42:34 +01:00
Vitor Santos Costa 7063641a5b Merge /Users/vsc/yap-6.3 2017-04-08 11:53:14 +01:00
Vitor Santos Costa 4b350ccecc jmp 2017-04-08 11:29:29 +01:00
Vitor Santos Costa faf3c930c8 docs 2017-04-07 23:10:59 +01:00
Vitor Santos Costa a9f02dddca remove duplicated jpl 2017-03-27 11:28:37 +01:00
Vitor Santos Costa af38d14ba7 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2017-03-23 16:56:05 +00:00
Vitor Santos Costa 4180fd9737 error handling (Miguel Areias) 2017-03-23 12:28:46 +00:00
Vitor Santos Costa 6741d961b3 manual 2017-03-23 12:28:17 +00:00
Vitor Santos Costa 4deb28e4c6 tyos 2017-03-23 12:26:43 +00:00
Vitor Santos Costa 21ca8eccec typo 2017-03-23 12:24:51 +00:00
Vitor Santos Costa 6e2260471a fix msg 2017-03-20 15:53:17 +00:00
Vitor Santos Costa ad710f3a0c sstart fitting the docs 2017-03-20 15:52:48 +00:00
vsc 380132095a first try with NSIS64 2017-03-14 18:40:39 +00:00
vsc f1372f72b5 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2017-03-14 16:45:40 +00:00
Vitor Santos Costa fddb79895d fix prompting 2017-03-03 11:21:29 +00:00
Vitor Santos Costa f7efff157b tcflush 2017-03-02 22:01:32 +00:00
vsc 9c004e5446 win32 commit 2017-02-27 03:44:15 +00:00
vscosta 34d3d7c176 YAP allows a list to execute 2017-02-26 20:34:17 +00:00
Vitor Santoss Costa f3b0e962a7 win... 2017-02-22 21:28:05 +00:00
Vitor Santoss Costa 477772e703 Merge branch 'master' of http://www.github.com/vscosta/yap-6.3 2017-02-22 11:32:28 +00:00
Vitor Santoss Costa fa88de5951 windows 2017-02-22 11:32:16 +00:00
vscosta 6ec69aa3c8 win64 fixes 2017-02-22 00:56:20 -08:00
vsc 272ddc0228 bad merge :( 2017-02-21 14:34:34 -08:00
Vitor Santos Costa daffefe28d cmake 2017-02-20 16:21:37 +00:00
Vitor Santos Costa f426d25bef Merge branch 'master' of https://github.com/vscosta/yap-6.3 2017-02-20 15:48:22 +00:00
Vitor Santos Costa 65ff3ed471 Smaller updates:
constant use of longjmp
conflict with python headers
win32 support
dll support
2017-02-20 15:28:46 +00:00
Vitor Santos Costa 55879dbd6c handle overflows 2017-02-20 15:21:48 +00:00
Vitor Santos Costa 0ed4ea2aa1 text length bugs 2017-02-20 14:40:24 +00:00
Vitor Santos Costa 9e6e236ee1 temporary allocation protocol 2017-02-20 14:39:30 +00:00
Vitor Santos Costa cd776f4f70 fix debugging msgs 2017-02-20 14:38:38 +00:00
Vitor Santos Costa b17f4967cb support python interface. 2017-02-20 14:38:00 +00:00
Vitor Santos Costa 5d6ff87d19 Python Library improved 2017-02-20 14:37:26 +00:00
Vitor Santos Costa a53615ceaf python .h collision 2017-02-20 14:21:46 +00:00
Vitor Santos Costa 92e2d94186 oops 2017-02-20 12:06:49 +00:00
Vitor Santos Costa a5e74eddae fix sub_string 2017-01-22 22:29:27 +00:00
Vitor Santos Costa 7d230dac0f sizeof for space taken, kill wchar_t internally 2017-01-22 22:10:38 +00:00
Vitor Santos Costa 8dc3503eb7 merge 2017-01-09 20:29:52 +00:00
Vitor Santos Costa 53039d3785 Merge https://github.com/vscosta/yap-6.3 2017-01-09 20:28:28 +00:00
Vitor Santos Costa c6a02d3fe4 bdd 2017-01-09 15:00:03 +00:00
Vitor Santos Costa 4db2a1fe7f python 2017-01-09 14:58:57 +00:00
Vitor Santos Costa 6778ea2975 TEXT HANDLING BUGS 2017-01-09 14:58:01 +00:00
Vitor Santos Costa 1e379e7635 Merge branch 'master' of https://github.com/vscosta/yap-6.3
Conflicts:
	C/c_interface.c
	C/exec.c
2016-12-19 18:28:43 -06:00
Vitor Santos Costa 6aaa32363c ensure -fPIC 2016-12-16 17:22:50 +00:00
Vitor Santos Costa 747b0e9501 fix spurious changes 2016-12-16 17:21:56 +00:00
Vitor Santos Costa 80cb881f3c not used 2016-12-16 09:27:14 -06:00
Vitor Santos Costa 389a5a440d up version 2016-12-16 03:56:29 -06:00
Vitor Santos Costa 436a4b4235 smal fix 2016-12-16 03:54:16 -06:00
Vitor Santos Costa cacdd173b5 fix error msg 2016-12-16 03:40:37 -06:00
Vitor Santos Costa cd18a69561 allocation 2016-12-16 03:39:12 -06:00
Vitor Santos Costa 66bc426b09 interface design 2016-12-16 03:38:40 -06:00
Vitor Santos Costa a4bb9f6e0e 5.0. support 2016-12-16 03:37:59 -06:00
Vitor Santos Costa f0740e1b8f Embedded 2016-12-16 02:54:54 -06:00
Vitor Santos Costa 0a043720b1 What was this doing? 2016-12-16 02:52:34 -06:00
Vitor Santos Costa c9309dce75 embedded YAP should ignore int by default. 2016-12-16 02:51:17 -06:00
Vitor Santos Costa f98dfa6994 fix sspurious stack error 2016-12-16 02:48:07 -06:00
Vitor Santos Costa e6c021411b got you: 2016-12-10 03:17:41 -06:00
Vitor Santos Costa d9664b9ec4 docs 2016-12-10 03:13:43 -06:00
Vitor Santos Costa b0fdea6f34 derived file 2016-12-10 03:11:28 -06:00
Vitor Santos Costa 82ad65a344 Gecode 5.0.0 2016-12-10 03:09:59 -06:00
Vitor Santos Costa 45a54e2b04 fixes 2016-12-10 01:09:21 -06:00
Vitor Santos Costa 5526dc48bf Keep improving EH 2016-12-10 01:07:57 -06:00
Vitor Santos Costa cbb0d81ac4 sweeten cmake 2016-12-10 01:06:16 -06:00
Vitor Santos Costa 9f16487d0c indenting 2016-12-10 01:05:17 -06:00
Vitor Santos Costa d81e077cbe try to avoid unneeded malloc 2016-12-10 01:04:37 -06:00
Vitor Santos Costa 6e2d2628c6 cmake 2016-12-10 01:02:46 -06:00
Vitor Santos Costa 70b11ab8f9 trying to improve Python interface 2016-12-10 01:01:10 -06:00
Vitor Santos Costa 474fa2fe14 one_arg 2016-12-06 01:50:11 -06:00
Vitor Santos Costa ea72cd09e3 rxamples were broken 2016-12-05 20:49:10 -06:00
Vitor Santos Costa 4f423dc16a small bugs, especiall in error processing 2016-12-05 14:50:04 -06:00
Vitor Santos Costa 6a4dbd91ec merge text to term routines 2016-12-04 12:52:42 -06:00
Vitor Santos Costa b07a35a993 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-12-04 12:49:17 -06:00
Vitor Santos Costa 14e1b74572 modularize 2016-12-03 10:38:07 -06:00
Vitor Santos Costa 490a07ade2 improve configure 2016-12-03 10:35:39 -06:00
Vitor Santos Costa 47b5de9bfc oops 2016-12-03 10:34:09 -06:00
Vitor Santos Costa 44dab9ab33 fix atom_term 2016-12-03 10:32:13 -06:00
Vitor Santos Costa d37e198c12 signals
doc support
2016-11-23 22:35:39 -06:00
Vitor Santos Costa 6c96a8e35b include CLP(QR) 2016-11-23 18:07:15 -06:00
Vitor Santos Costa f44ef18fed fix atom_to_term and increase sharing on CUDD stuff 2016-11-23 17:23:59 -06:00
Vitor Santos Costa 8d1cc35a8a docsc 2016-11-16 17:17:33 -06:00
Vitor Santos Costa 56905d86ae more Android adjusts 2016-11-16 17:15:12 -06:00
Vitor Santos Costa cc7c0ebac8 error handling 2016-11-16 17:09:06 -06:00
Vitor Santos Costa da65d7bd3c fix bug in sb_atom 2016-11-16 17:06:37 -06:00
Vitor Santos Costa 0be43c6525 fix scripts 2016-11-11 09:53:09 -06:00
Vitor Santos Costa c49165a7af Android aupport 2016-11-11 01:23:34 -06:00
Vitor Santos Costa 51359cb175 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-11-08 01:40:22 -06:00
Vitor Santos Costa b03e0634c7 fixes + win64 2016-11-08 01:37:36 -06:00
Vitor Santos Costa 46a9d52d2d Memory management and UTF-8 for all fixes 2016-11-04 11:36:48 -05:00
Vitor Santos Costa 02e0e50915 Merge ssh://192.168.66.221/~vitor/Yap/yap-6.3 2016-11-02 00:16:36 -05:00
Vitor Santos Costa 117584e817 GIL 2016-10-28 12:24:52 -05:00
Vitor Santos Costa c959ceeb1d errors 2016-10-28 12:23:51 -05:00
Vitor Santos Costa d082af605d less invasive error handling 2016-10-19 22:44:59 -05:00
Vitor Santos Costa 8f72db3b56 fixes 2016-10-19 22:38:17 -05:00
Fabrizio Riguzzi e078156eb6 removed comments for Nicola from help 2016-10-18 19:48:05 +02:00
Vitor Santos Costa 8a6de8b157 Merge ssh://ub64:/home/vitor/Yap/yap-6.3 2016-10-16 17:23:04 -05:00
Vitor Santos Costa ad5347257b avoid long vrs in error handling 2016-10-16 17:23:00 -05:00
Vitor Santos Costa 08dd1dcdb3 python 2016-10-16 17:18:51 -05:00
Vitor Santos Costa 4a5540e645 Error Handling 2016-10-16 13:16:56 -05:00
Vitor Santos Costa 558c3eb35b fix warnings 2016-10-16 13:15:14 -05:00
Vitor Santos Costa 3b124549e4 try resetting obvioulsy bad handles 2016-10-16 13:13:34 -05:00
Vitor Santos Costa 5c33960535 stream cotrol was broken 2016-10-16 13:11:44 -05:00
Vitor Santos Costa 1c2880fd1b 32 bit in 64 bit code 2016-10-16 13:09:07 -05:00
Vitor Santos Costa 4c01fe8fe3 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-10-10 15:37:34 -05:00
Vitor Santos Costa df0ee8eaeb broken 2016-10-10 15:36:51 -05:00
Vitor Santos Costa 43d3579c57 python 2016-09-30 17:11:13 -05:00
Vitor Santos Costa 41ccbf7367 allocate space 2016-09-30 17:10:01 -05:00
Vitor Santos Costa ef38613229 don't follow as if code slots that point to the local stack. 2016-09-30 17:04:58 -05:00
Vitor Santos Costa 3f4fe6815f format was broken in old Linuxen 2016-09-28 09:08:22 -05:00
Vitor Santos Costa a1ee3b30d3 fix mess with memory streams 2016-09-27 19:32:27 -05:00
Vitor Santos Costa b0ce23f131 fix bad header
scan files for line count.
2016-09-27 12:32:48 -05:00
Vitor Santos Costa 51bf90908f error handling work 2016-09-27 12:31:12 -05:00
Vitor Santos Costa 97350da9bd interface work 2016-09-27 12:28:54 -05:00
Vitor Santos Costa e39b1e0127 split 2016-09-25 19:01:49 -05:00
Vitor Santos Costa 6802e83d83 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-09-23 13:25:29 -05:00
Vitor Santos Costa 94cde0bf18 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-09-23 01:38:09 -05:00
Vitor Santos Costa bee39cb385 MALLOC 2016-09-23 01:37:36 -05:00
Vitor Santos Costa 298b287859 op 2016-09-23 01:37:18 -05:00
Vitor Santos Costa cd3b94c40c balance 2016-09-23 01:36:14 -05:00
Vitor Santos Costa f9655cccb6 error handling 2016-09-23 01:21:42 -05:00
Vitor Santos Costa 2bbc3b9265 rrors 2016-09-22 21:53:42 -05:00
Vitor Santos Costa 09b7a5cbf9 bad init 2016-09-22 10:31:33 -05:00
Vitor Santos Costa 02dabe8e3a ignore 2016-09-21 15:01:42 -05:00
Vitor Santos Costa d273270c11 all the liles.. 2016-09-21 15:01:26 -05:00
Vitor Santos Costa e70b7060d1 errors 2016-09-21 15:00:58 -05:00
Vitor Santos Costa ea366ca22d meta 2016-09-21 14:59:30 -05:00
Vitor Santos Costa 87c6f13976 throw handler 2016-09-21 14:59:10 -05:00
Vitor Santos Costa 3fe4b70112 error work 2016-09-21 14:58:49 -05:00
Vitor Santos Costa 48c1bed5f9 oops :( 2016-09-21 14:57:59 -05:00
Vitor Santos Costa b5e1476a20 make it clear we are in error processing 2016-09-21 14:57:46 -05:00
Vitor Santos Costa 368cfd99d5 kernel work 2016-09-21 14:57:06 -05:00
Vitor Santos Costa ab9bff2ab5 kernel 2016-09-21 14:56:07 -05:00
Vitor Santos Costa b2156aad2d python swig work 2016-09-21 14:55:09 -05:00
Vitor Santos Costa c58064bd0b fix warnings 2016-09-21 14:50:47 -05:00
Vitor Santos Costa 21324d7434 fast access too lines in file 2016-09-21 14:47:05 -05:00
Vitor Santos Costa a478a83c27 missing define 2016-09-21 14:44:49 -05:00
Vitor Santos Costa f6d434e314 avoid silly seek 2016-09-21 14:43:18 -05:00
Vitor Santos Costa f35f0584eb swig/android support 2016-09-21 14:42:26 -05:00
Vitor Santos Costa db2aa5b5f2 improve error handling 2016-09-21 14:41:23 -05:00
Vitor Santos Costa 76b9946358 fix silly message 2016-09-21 14:40:32 -05:00
Vitor Santos Costa 868ecfe551 do not reset error status 2016-09-21 14:39:53 -05:00
Vitor Santos Costa 350081a90d error handling 2016-09-21 14:38:21 -05:00
Vitor Santos Costa bbd9049111 indenting 2016-09-21 14:33:28 -05:00
Vitor Santos Costa 3845d4e67d fix leak 2016-09-21 14:32:29 -05:00
Vitor Santos Costa 2f885bb6f3 nore error handling work. 2016-09-21 14:30:52 -05:00
Vitor Santos Costa 029d2836a2 error handling 2016-09-21 14:29:31 -05:00
Vitor Santos Costa df8b264751 meta stuff 2016-09-20 22:53:33 -05:00
Vitor Santos Costa 124b2e9069 move all error related state to a record 2016-09-20 22:52:34 -05:00
Vitor Santos Costa 6043125221 fix bugs in stack introspection 2016-09-20 22:50:08 -05:00
Vitor Santos Costa 1219fb6b6a meta-pred support 2016-09-20 22:49:16 -05:00
Vitor Santos Costa 7d66aa5d01 improv meta-calls 2016-09-20 22:48:28 -05:00
Vitor Santos Costa c78f3e085a fixes 2016-09-08 22:34:45 -05:00
Vitor Santos Costa e2f8430e00 debugging 2016-09-08 22:33:55 -05:00
Vitor Santos Costa c46228a03b Android supporte 2016-09-08 22:21:15 -05:00
Vitor Santos Costa 9bdfabc381 protect regs 2016-08-30 12:32:08 -05:00
Vitor Santos Costa e4c82910a2 improvements 2016-08-30 12:20:31 -05:00
Vitor Santos Costa 1e118bee6d slots 2016-08-30 11:03:42 -05:00
Vitor Santos Costa 06bbdfd553 android support 2016-08-30 11:01:55 -05:00
Vitor Santos Costa 04ff54917e Android support 2016-08-30 08:29:40 -05:00
Vitor Santos Costa 110a23b209 indenting 2016-08-30 08:27:32 -05:00
Vitor Santos Costa 5fcf173d0a empty strings 2016-08-30 08:26:14 -05:00
Vitor Santos Costa 269e7b8806 unused 2016-08-30 08:25:47 -05:00
Vitor Santos Costa 1ead544a50 support text to buffer 2016-08-29 18:07:22 -05:00
Vitor Santos Costa 15c6381579 file_name_extension 2016-08-29 17:35:01 -05:00
Vitor Santos Costa 85a88feb6f fix assert/2 given name chancge 2016-08-26 15:23:37 -05:00
Vitor Santos Costa 76638bb7d8 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-08-26 00:14:01 -05:00
Vitor Santos Costa 1a878579fd fixes 2016-08-26 00:13:50 -05:00
Vitor Santos Costa a5c09f9187 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2016-08-26 06:09:38 +01:00
Vitor Santos Costa aba60111cf more python interface. 2016-08-25 23:44:36 -05:00
Vitor Santos Costa 1bcbd5ce15 fix indexing when alloc is on floats. 2016-08-25 23:43:54 -05:00
Vitor Santos Costa e157740bda python 2016-08-25 12:10:33 -05:00
Vitor Santos Costa f12349993b python 2016-08-25 01:26:11 -05:00
Vitor Santos Costa 79791604d9 text problems 2016-08-24 02:04:49 -05:00
Vitor Santos Costa 67b72f4958 own repo 2016-08-23 17:44:17 -05:00
Vitor Santos Costa f2c6c85c17 PATH 2016-08-23 17:40:35 -05:00
Vitor Santos Costa b378cb8469 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-08-23 17:34:00 -05:00
Vitor Santos Costa cd53167d19 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2016-08-23 23:31:33 +01:00
Vitor Santos Costa 676582fe4f android and python updates 2016-08-23 17:28:23 -05:00
Vitor Santos Costa 227c75a213 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-08-23 15:14:19 -05:00
Vitor Santos Costa d9c1c85d30 cleanup 2016-08-23 15:14:12 -05:00
Vitor Santos Costa 6148e8199f linux_weird 2016-08-23 15:08:36 -05:00
Vitor Santos Costa cbef36b565 fix unneeded files 2016-08-23 11:18:00 -05:00
Vitor Santos Costa 1bea4230e4 cmake 2016-08-23 11:15:07 -05:00
Vitor Santos Costa cbafd93b03 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-08-23 10:01:23 -05:00
Vitor Santos Costa 6f6e294703 bad dependency 2016-08-23 15:52:03 +01:00
Vitor Santos Costa ba98f237ae oops 2016-08-23 15:51:39 +01:00
Vitor Santos Costa 23c1c2d4d7 python 2016-08-23 01:00:14 -05:00
Vitor Santos Costa 9ed1546ee6 bad calls to text.c 2016-08-23 00:58:42 -05:00
Vitor Santos Costa 297aae9d36 stub 2016-08-22 21:45:57 -05:00
Vitor Santos Costa c4544f042d python 2016-08-22 19:18:33 -05:00
Vitor Santos Costa f78ddb6724 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-08-22 17:08:52 -05:00
Vitor Santos Costa fce05b85d3 plot demo 2016-08-22 17:03:41 -05:00
Vitor Santos Costa eea3da22f1 fix python 2016-08-22 17:02:40 -05:00
Vitor Santos Costa a675f6f49e chars 2016-08-22 17:01:31 -05:00
Vitor Santos Costa 997a0b9895 generated 2016-08-22 14:06:49 -05:00
Vitor Santos Costa ce4b6c0931 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-08-22 10:54:49 -05:00
Vitor Santos Costa 4dcbac42e9 fix atom/term 2016-08-22 10:53:47 -05:00
Vitor Santos Costa 0b635cb2d5 fix compilation 2016-08-22 00:35:26 -05:00
Vitor Santos Costa 25e59ecd40 include module 2016-08-22 00:08:59 -05:00
Vitor Santos Costa e9e03f11d3 not being used 2016-08-21 23:41:01 -05:00
Vitor Santos Costa ddf40b67bd experiment 2016-08-21 23:34:43 -05:00
Vitor Santos Costa fe1a677778 support 2016-08-21 23:31:21 -05:00
Vitor Santos Costa 9e59f755ff python 2016-08-22 04:05:15 +01:00
Vitor Santos Costa ba730273e7 config 2016-08-22 04:01:38 +01:00
Vitor Santos Costa e50d722e66 fix write2atom and indent 2016-08-21 10:28:38 -05:00
Vitor Santos Costa 2aaca174e5 fix warnings 2016-08-19 21:40:01 -05:00
Vitor Santos Costa b80a6bad97 debugging 2016-08-19 21:38:07 -05:00
Vitor Santos Costa b218af8f1b debugging stuff 2016-08-19 21:37:02 -05:00
Vitor Santos Costa 56b2f14a32 fix dup code in directive handling 2016-08-19 21:34:24 -05:00
Vitor Santos Costa 03afaaf887 update 2016-08-18 02:17:04 -05:00
Vitor Santos Costa 843f9f8d87 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2016-08-18 02:14:45 -05:00
Vitor Santos Costa b27ab0811b new version 2016-08-18 02:13:55 -05:00
Vitor Santos Costa f6935510a9 python? 2016-08-18 08:12:40 +01:00
Vitor Santos Costa 56466a446a m & pthread? 2016-08-18 08:11:36 +01:00
Vitor Santos Costa 670eacc823 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-08-18 01:36:17 -05:00
Vitor Santos Costa a270349dae release mem 2016-08-18 01:34:37 -05:00
Vitor Santos Costa 9e5675755e emptybuffer 2016-08-16 17:11:14 -05:00
Vitor Santos Costa 2d94bba498 fixleak 2016-08-16 17:10:36 -05:00
Vitor Santos Costa 2a9a88c325 add a new split and filter 2016-08-16 09:49:43 -05:00
Vitor Santos Costa 3eeaac8d05 spy_call 2016-08-16 09:47:10 -05:00
Vitor Santos Costa 93068241d3 oops 2016-08-16 09:32:27 -05:00
Vitor Santos Costa 2726fb279c fix get_num 2016-08-15 23:42:49 -05:00
Vitor Santos Costa fab0075f9b new text interface 2016-08-15 15:30:26 -05:00
Vitor Santos Costa 0f32e2cc9f syntax 2016-08-15 14:57:32 -05:00
Vitor Santos Costa 27273290e1 text 2016-08-15 14:56:05 -05:00
Vitor Santos Costa f8b0cb2c2d - 2016-08-15 14:55:31 -05:00
Vitor Santos Costa eb54e3e052 simplify text code by just using UF8 and allocating in trail 2016-08-15 14:54:46 -05:00
Vitor Santos Costa cc1a44c7a7 ugh 2016-08-15 14:53:20 -05:00
Vitor Santos Costa 7b86e28e00 strncpy is trouble 2016-08-15 14:52:39 -05:00
Vitor Santos Costa 44262405df improve deb 2016-08-15 14:52:15 -05:00
Vitor Santos Costa ed6385a3e7 ugh 2016-08-15 14:51:46 -05:00
Vitor Santos Costa cad55bcf71 look for errors 2016-08-15 14:51:36 -05:00
Vitor Santos Costa fccf3d9f6f fix no output 2016-08-15 14:50:58 -05:00
Vitor Santos Costa 2595555982 make get_byte scan text 2016-08-15 14:50:23 -05:00
Vitor Santos Costa 02bd8a1760 initialise so that we can run queries 2016-08-07 09:49:34 -05:00
Vitor Santos Costa a4fa6c5b4b typing 2016-08-07 09:48:50 -05:00
Vitor Santos Costa afeb4b2870 tracing 2016-08-07 09:48:37 -05:00
Vitor Santos Costa 121d927e85 extern and protect Aux 2016-08-07 09:48:21 -05:00
Vitor Santos Costa 05d65070b8 typing 2016-08-07 09:47:47 -05:00
Vitor Santos Costa 7dcd5179ce ensure that MALLOC is respected 2016-08-07 09:46:43 -05:00
Vitor Santos Costa 8f3321d36b get rid of trading, init var 2016-08-07 09:45:17 -05:00
Vitor Santos Costa 9386d70280 only link with what exists 2016-08-05 16:45:19 -05:00
Vitor Santos Costa 339048c76b clean name on close 2016-08-05 16:44:38 -05:00
Vitor Santos Costa 04b1d2bafb skip msg 2016-08-05 16:44:15 -05:00
Vitor Santos Costa 729b798a23 testing slipcover 2016-08-05 16:43:58 -05:00
Vitor Santos Costa b3a11b339a init better; problog_low accepts conditional probabilities (untested); accept (p0::a;p1::b). 2016-08-05 16:43:11 -05:00
Vitor Santos Costa 0aeeb726e3 just indenting 2016-08-05 16:39:45 -05:00
Vitor Santos Costa 3d4a525e32 remove deb 2016-08-05 16:37:15 -05:00
Vitor Santos Costa 0f19d518f2 fixes 2016-08-05 16:37:02 -05:00
Vitor Santos Costa fdfefbbd46 curried, what else? 2016-08-05 16:36:48 -05:00
Vitor Santos Costa 833ffbb104 policy first 2016-08-05 16:36:26 -05:00
Vitor Santos Costa 384e74ae59 extern 2016-08-05 16:35:50 -05:00
Vitor Santos Costa be1ce69e07 handle stream error 2016-08-05 16:35:38 -05:00
Vitor Santos Costa 26d2e9721c indenting 2016-08-05 16:34:43 -05:00
Vitor Santos Costa 8594c41487 current_pred might lose the first solution 2016-08-05 16:34:05 -05:00
Vitor Santos Costa fd23360c63 people who don't like cmake 2016-08-04 16:42:57 -05:00
Vitor Santos Costa b705c07ac8 error 2016-08-04 10:26:18 -05:00
Vitor Santos Costa c79a5ec372 linking 2016-08-04 10:25:56 -05:00
Vitor Santos Costa 471d6e4f77 stillgoing 2016-08-04 10:25:26 -05:00
Vitor Santos Costa 0029fdd0b4 warnings 2016-08-04 10:25:07 -05:00
Vitor Santos Costa b8045f1a39 fix_floats 2016-08-04 10:24:32 -05:00
Vitor Santos Costa f5e560366c casts vs gcc 2016-08-03 11:16:40 -05:00
Vitor Santos Costa 2038dd42b6 fix warnings 2016-08-03 11:15:17 -05:00
Vitor Santos Costa e16c8c573d fix multioo#def 2016-08-03 11:14:27 -05:00
Vitor Santos Costa ca2dfeb51e cmake vs libraries 2016-08-02 18:30:02 -05:00
Vitor Santos Costa 3ff5ddf04a twice included 2016-08-02 18:29:57 -05:00
Vitor Santos Costa 69c3a54cb6 annoying msg 2016-08-02 18:29:35 -05:00
Vitor Santos Costa 99488a6cea older g++ 2016-08-02 18:28:02 -05:00
Vitor Santos Costa a560031167 let all atoms be equal in rights and duties 2016-08-02 18:26:48 -05:00
Vitor Santos Costa 0dd5da91ca fix use of pathconf 2016-08-02 18:25:39 -05:00
Vitor Santos Costa 8050747db7 allow earier jdk 2016-08-02 18:24:53 -05:00
Vitor Santos Costa 2dbf860a58 linux does not like setbuf on mem stream 2016-08-02 18:23:42 -05:00
Vitor Santos Costa 9ef2f87165 osx 2016-08-02 12:10:01 -05:00
Vitor Santos Costa 79a154cbf4 fix current_predicate/1 and arg/3 2016-08-02 11:34:58 -05:00
Vitor Santos Costa d54446d736 fix bad meta-call handling & throw(Var)
also warnings
2016-08-02 09:01:54 -05:00
Vitor Santos Costa 4628adc63e Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-08-01 21:45:42 -05:00
Vitor Santos Costa d0a8e4a722 image 2016-08-01 20:26:07 -05:00
Vitor Santos Costa 5e7c08fff7 interface 2016-08-01 20:23:23 -05:00
Vitor Santos Costa 304489c74f warnings and stream read wchar simplification 2016-08-01 19:17:56 -05:00
Vitor Santos Costa a82a72fc14 myddas cleanups 2016-08-01 19:16:39 -05:00
Vitor Santos Costa db0deea576 ugh, that hurts 2016-08-01 19:15:31 -05:00
Vitor Santos Costa 1d84d39b00 fix fix 2016-08-01 19:14:51 -05:00
Vitor Santos Costa afc6e64db2 warning 2016-08-01 19:14:23 -05:00
Vitor Santos Costa 897d59820f fix clang smarties 2016-08-01 19:14:01 -05:00
Vitor Santos Costa 9e01be6a22 clean 2016-08-01 17:50:31 -05:00
Vitor Santos Costa 8e52352878 protect call 2016-08-01 17:49:51 -05:00
Vitor Santos Costa 7651f507c6 error handling 2016-08-01 17:48:43 -05:00
Vitor Santos Costa 8973689b43 typos 2016-08-01 17:48:25 -05:00
Vitor Santos Costa 957aa9f977 fix existing-stream ase for with_output_to/2 2016-08-01 13:20:00 -05:00
Vitor Santos Costa 81c00f9736 compilation support 2016-08-01 06:54:28 -05:00
Vitor Santos Costa bff0440b64 out-of-date 2016-07-31 12:46:53 -05:00
Vitor Santos Costa ccc2efd456 out-of-date 2016-07-31 12:46:08 -05:00
Vitor Santos Costa 750b31b29a update instructions 2016-07-31 12:43:35 -05:00
Vitor Santos Costa 99e9809320 newtyle 2016-07-31 11:38:21 -05:00
Vitor Santos Costa d8ee7b1f89 fixes 2016-07-31 11:37:37 -05:00
Vitor Santos Costa 6163533208 python support 2016-07-31 11:36:51 -05:00
Vitor Santos Costa 37ddd18a9d new make setup 2016-07-31 11:35:57 -05:00
Vitor Santos Costa 73b10e7207 new style Makefile 2016-07-31 11:35:28 -05:00
Vitor Santos Costa 50e94c9094 support plant 2016-07-31 11:35:10 -05:00
Vitor Santos Costa d7b5be0ccd android 2016-07-31 10:43:31 -05:00
Vitor Santos Costa 5b8dd3eb03 system module 2016-07-31 10:42:56 -05:00
Vitor Santos Costa cbe205344d messages 2016-07-31 10:42:34 -05:00
Vitor Santos Costa 0248e3ec2f event handling 2016-07-31 10:42:15 -05:00
Vitor Santos Costa bb4820a086 this is hard 2016-07-31 10:41:54 -05:00
Vitor Santos Costa 2fef5ffcea multifile 2016-07-31 10:41:20 -05:00
Vitor Santos Costa f7a2c479e7 throw handling 2016-07-31 10:40:47 -05:00
Vitor Santos Costa 275e2c0059 try to use nicer swi interface 2016-07-31 10:40:29 -05:00
Vitor Santos Costa 9686275b34 reorg 2016-07-31 10:39:55 -05:00
Vitor Santos Costa 1aa3c26af6 hidden stuff 2016-07-31 10:39:30 -05:00
Vitor Santos Costa 7cda920dbc move undef_handler 2016-07-31 10:39:12 -05:00
Vitor Santos Costa 915316b712 move some stuff early 2016-07-31 10:38:36 -05:00
Vitor Santos Costa a2ab31757f undef 2016-07-31 10:38:03 -05:00
Vitor Santos Costa e138472f87 dupl code 2016-07-31 10:37:27 -05:00
Vitor Santos Costa 83326f1657 from absf 2016-07-31 10:36:57 -05:00
Vitor Santos Costa 1c698f596c fix 2016-07-31 10:36:45 -05:00
Vitor Santos Costa 71afcd0350 docs 2016-07-31 10:36:17 -05:00
Vitor Santos Costa f6a90c0cac skip early_print 2016-07-31 10:35:54 -05:00
Vitor Santos Costa 12664254e9 keep on trying to get this right 2016-07-31 10:35:18 -05:00
Vitor Santos Costa a21547d9d4 more files to consult 2016-07-31 10:34:54 -05:00
Vitor Santos Costa 9ac1b3f2c6 discontiguous 2016-07-31 10:34:24 -05:00
Vitor Santos Costa 9db06bcfe1 -B and fixes 2016-07-31 10:34:00 -05:00
Vitor Santos Costa 5db8e25735 must be early for boot 2016-07-31 10:33:20 -05:00
Vitor Santos Costa 77335f2ea0 split docs and user pred 2016-07-31 10:32:50 -05:00
Vitor Santos Costa 4477350d08 small fixes 2016-07-31 10:31:22 -05:00
Vitor Santos Costa 43993f2b08 use current dir 2016-07-31 10:30:15 -05:00
Vitor Santos Costa 14d8b7904f solid java testing 2016-07-31 10:29:56 -05:00
Vitor Santos Costa 19ec491d22 plit cidd testing 2016-07-31 10:29:36 -05:00
Vitor Santos Costa 7a7d36a3ef fixes 2016-07-31 10:29:15 -05:00
Vitor Santos Costa afc0f4386c new config 2016-07-31 10:28:56 -05:00
Vitor Santos Costa 8d19f397d4 android and encoding 2016-07-31 10:28:05 -05:00
Vitor Santos Costa 91120de170 script fixes: external 2016-07-31 10:27:18 -05:00
Vitor Santos Costa 0c305e8ce3 android 2016-07-31 10:26:36 -05:00
Vitor Santos Costa 9ad6bc3120 boot 2016-07-31 10:26:14 -05:00
Vitor Santos Costa a8f101cbcf malloc and android 2016-07-31 10:25:46 -05:00
Vitor Santos Costa d5ce45f09f indenting 2016-07-31 10:24:10 -05:00
Vitor Santos Costa 2213bc6f36 new atoms and functors 2016-07-31 10:23:19 -05:00
Vitor Santos Costa 460dfafcc8 improve C++ interface 2016-07-31 10:22:24 -05:00
Vitor Santos Costa be313a5b49 fixes 2016-07-31 10:21:45 -05:00
Vitor Santos Costa 468a2279c3 malloc 2016-07-31 10:21:09 -05:00
Vitor Santos Costa 4fa33de8a8 new make 2016-07-31 10:20:54 -05:00
Vitor Santos Costa 168d0b41ec rely on current dir 2016-07-31 10:20:36 -05:00
Vitor Santos Costa 591d5a8653 new make configuration 2016-07-31 10:19:58 -05:00
Vitor Santos Costa b6f1079503 fix warning 2016-07-31 10:19:11 -05:00
Vitor Santos Costa 04fd092e49 indenting 2016-07-31 10:18:50 -05:00
Vitor Santos Costa 133a4fc215 cx11 is needed 2016-07-31 10:18:21 -05:00
Vitor Santos Costa d91a0130fa fix missing cases 2016-07-31 10:17:54 -05:00
Vitor Santos Costa 2e6572bfe5 memory parsing here? 2016-07-31 10:17:10 -05:00
Vitor Santos Costa 57ae30c79c fixes and ~T 2016-07-31 10:16:20 -05:00
Vitor Santos Costa fa26588bbf indenting 2016-07-31 10:15:55 -05:00
Vitor Santos Costa 9d3b46132b fix prompting? 2016-07-31 10:14:47 -05:00
Vitor Santos Costa d3599da6dc new version of cuda interface 2016-07-31 10:14:02 -05:00
Vitor Santos Costa c6d174841a fixes 2016-07-31 10:11:36 -05:00
Vitor Santos Costa ee03af37fb new version of python interface 2016-07-31 10:09:21 -05:00
Vitor Santos Costa 728edb6b0a new version of myddas
fix modules
integrated myydas_driver.ypp for common stuff
test sqlite3
2016-07-31 10:02:06 -05:00
Vitor Santos Costa 84d5974cca Android support 2016-07-31 09:55:50 -05:00
Vitor Santos Costa 9b3bbf5e33 android 2016-07-31 09:54:43 -05:00
Vitor Santos Costa 5f2964cce6 handle EOF 2016-07-31 09:54:07 -05:00
Vitor Santos Costa 63b985c452 slots plus read from text 2016-07-31 09:53:23 -05:00
Vitor Santos Costa 943900865e limit history 2016-07-31 09:52:45 -05:00
Vitor Santos Costa 6a076bc8ac lots of fixes 2016-07-31 09:51:52 -05:00
Vitor Santos Costa 8ecb045cb5 win32 2016-07-31 04:58:08 -05:00
Vitor Santos Costa 5584eb1a55 Android support 2016-07-31 04:56:54 -05:00
Vitor Santos Costa 0f50b2e49c support Android port 2016-07-31 04:49:09 -05:00
Vitor Santos Costa dfd7b8f467 android boot 2016-07-31 04:47:55 -05:00
Vitor Santos Costa 7d6082d39a slots 2016-07-31 04:46:51 -05:00
Vitor Santos Costa 35e9d432c1 bool 2016-07-31 04:44:50 -05:00
Vitor Santos Costa 6a878d9568 kea 2016-07-31 04:42:47 -05:00
Vitor Santos Costa d922933898 android support 2016-07-31 04:42:00 -05:00
Vitor Santos Costa d4b77458e9 predicate 2016-07-31 04:41:25 -05:00
Vitor Santos Costa 2422417a05 myddas support 2016-07-31 04:36:49 -05:00
Vitor Santos Costa c663010312 avoid NULL 2016-07-31 04:35:31 -05:00
Vitor Santos Costa d8fd3de13a cleanyo 2016-07-31 04:35:00 -05:00
Vitor Santos Costa f474dbdb2a indenting 2016-07-31 04:34:22 -05:00
Vitor Santos Costa 9bfdfeb204 Abolish removes too much information 2016-07-31 04:32:41 -05:00
Vitor Santos Costa 557c89a4ad source_module/2 2016-07-31 04:30:46 -05:00
Vitor Santos Costa 4ebb83e998 add default executable 2016-07-31 04:29:47 -05:00
Vitor Santos Costa 0cc010bc42 clean-up 2016-07-31 04:28:14 -05:00
Vitor Santos Costa 075f50a11f bug in cleaning up index tree 2016-07-31 04:26:15 -05:00
Vitor Santos Costa 2b5f0e7705 executable, deadline 2016-07-31 04:22:22 -05:00
Vitor Santos Costa d6c768da2c indent 2016-07-30 23:23:26 -05:00
Vitor Santos Costa 5606410a64 avoid unnecessary slot ops
drop repeated code
2016-07-30 23:23:06 -05:00
Vitor Santos Costa 1da507902c use indicator instead of name 2016-07-30 23:19:56 -05:00
Vitor Santos Costa f555ea958c new ped: creat red if new
fix overfull in consult stack
2016-07-30 23:15:11 -05:00
Vitor Santos Costa 1740175e5c mega-call, init stuff 2016-07-30 23:10:39 -05:00
Vitor Santos Costa 85bcce7d19 cleanup 2016-07-30 23:08:59 -05:00
Vitor Santos Costa 72fcd2befa IndicatorOfPred 2016-07-30 23:08:05 -05:00
Vitor Santos Costa fb08cfe5f6 debugging 2016-07-30 23:07:06 -05:00
Vitor Santos Costa 7d44e3188b error handling 2016-07-30 23:06:28 -05:00
Vitor Santos Costa 0dd8f62237 i flags 2016-07-30 22:36:40 -05:00
Vitor Santos Costa 60687f4346 Ubuntu 2016-06-29 01:42:26 +01:00
Vitor Santos Costa 3f59ec40cd python support 2016-06-28 23:47:09 +01:00
Vitor Santos Costa c2fb631106 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-06-28 23:35:57 +01:00
Vitor Santos Costa d9b5a21a54 python 2016-06-28 23:35:45 +01:00
Vitor Santos Costa 06f5fa2614 update Python 2016-06-28 23:30:18 +01:00
Vitor Santos Costa a6a769c0de MAC ^&& 2016-06-28 23:10:35 +01:00
Vitor Santos Costa ff3185b551 memory streams 2016-06-28 16:45:35 +01:00
Vitor Santos Costa 8d64753c54 Python support 2016-06-28 16:43:33 +01:00
Vitor Santos Costa 7ca285eb40 YAPStreams 2016-06-28 16:40:48 +01:00
Vitor Santos Costa 736c8ee66e improve python 2016-06-28 16:39:02 +01:00
Vitor Santos Costa dbda4a4d7b vfs/stream 2016-06-28 16:37:36 +01:00
Vitor Santos Costa 46bf534a27 Android and swig 2016-06-17 17:34:01 +01:00
Vitor Santos Costa 37155d7296 compilation 2016-06-17 17:32:56 +01:00
Vitor Santos Costa ab135e8b74 bootstrap 2016-06-17 17:32:15 +01:00
Vitor Santos Costa 19a265073f config 2016-06-17 17:28:39 +01:00
Vitor Santos Costa 4123764fcc typo 2016-06-17 17:25:13 +01:00
Vitor Santos Costa e6eff20e82 assets VFS 2016-06-17 17:22:58 +01:00
Vitor Santos Costa 2b9b92dac7 hope it is useful 2016-06-17 17:21:41 +01:00
Vitor Santos Costa a382ca43fa cmake code 2016-06-17 17:19:47 +01:00
Vitor Santos Costa 4b33d5d87b bug fixes + Android 2016-06-17 17:13:17 +01:00
Vitor Santos Costa a9839b4d4a Leaks 2016-06-17 17:12:23 +01:00
Vitor Santos Costa d1b0f45c28 Prompt 2016-06-17 17:12:08 +01:00
Vitor Santos Costa eab3fc33be fix headers 2016-06-17 17:11:00 +01:00
Vitor Santos Costa fdc01b0c27 readline handling 2016-06-17 17:09:57 +01:00
Vitor Santos Costa 8d126b7de6 bootstrap right 2016-06-17 17:09:11 +01:00
Vitor Santos Costa a94260bd33 bootstrap right 2016-06-17 17:09:00 +01:00
Vitor Santos Costa dc2ed1bea8 bootstrap right 2016-06-17 17:08:21 +01:00
Vitor Santos Costa b2fe557503 garbagee 2016-06-17 17:07:26 +01:00
Vitor Santos Costa 710ca208d2 avoid messing with stream 1 2016-06-17 17:06:19 +01:00
Vitor Santos Costa 735ccca095 better supprt for python/ANdroid 2016-06-17 17:04:41 +01:00
Vitor Santos Costa 79d40f57b1 Android &&VFS 2016-06-17 16:44:14 +01:00
Vitor Santos Costa 647ebac5e4 Android && avoid mem size trouble 2016-06-17 16:42:26 +01:00
Vitor Santos Costa 3c28902ec5 basic documentation 2016-06-17 16:38:47 +01:00
Vitor Santos Costa 3dfab64306 trace in Android 2016-06-17 16:35:38 +01:00
Vitor Santos Costa 72f72929d3 fix unused mcros 2016-06-17 16:34:37 +01:00
Vitor Santos Costa 0007cb896b print predicate indicator 2016-06-17 16:29:23 +01:00
Vitor Santos Costa 8f489b0799 null pointer in errorr handling 2016-06-17 16:27:56 +01:00
Vitor Santos Costa 57161d83f4 compilation complaints on dead code 2016-06-17 16:26:58 +01:00
Vitor Santos Costa a1ec5e6198 boot flags update. 2016-06-17 16:25:43 +01:00
Vitor Santos Costa 730259d47e true vs TRUE 2016-06-17 16:20:10 +01:00
Vitor Santos Costa 5c83d305fc reorder init to handle possible overflows 2016-06-17 16:13:15 +01:00
Vitor Santos Costa 899e892aef call readline at the right time 2016-06-17 16:07:45 +01:00
Vitor Santos Costa 807cca51ec Add routine to output a directory in a string. 2016-06-17 16:04:33 +01:00
Vitor Santos Costa da6d41433f Support for booting when YAP is called from a generic app
- ensure pl boot works
- ensure yap is initialed before user code is called
- cleanup code to use file status
2016-06-17 16:02:36 +01:00
Vitor Santos Costa a7720d42ed YAPDroid project: use the latest Android SDK 2016-06-17 15:52:07 +01:00
Vitor Santos Costa a1a4ac9d0b fix dlmalloc 2016-06-17 15:50:04 +01:00
Vitor Santos Costa e6bbcc566c bad flag usage 2016-06-17 15:49:08 +01:00
Vitor Santos Costa cd05e3f6d8 Fix errno usage 2016-06-17 15:45:37 +01:00
Vitor Santos Costa eecc4ecf06 use Android toolchain 2016-06-17 15:43:41 +01:00
Vitor Santos Costa 7278d9ee0e fix tab/1 2016-06-07 10:29:46 +01:00
Vitor Santos Costa 8e5352bc03 fix EOF 2016-06-07 10:28:42 +01:00
Vitor Santos Costa ba78620e34 paths vs cuutil 2016-06-05 00:01:23 +01:00
Vitor Santos Costa 42347585d3 fix warning 2016-06-04 23:59:14 +01:00
Vitor Santos Costa b2cec5467c Boot fixes. 2016-06-04 23:19:49 +01:00
Vitor Santos Costa 3c91e1c9a0 add missing atom nodes to previous patch 2016-06-04 22:25:36 +01:00
Vitor Santos Costa 0069222b75 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2016-06-04 22:24:38 +01:00
Vitor Santos Costa 00cfb6e432 Merge branch 'josephnunn-merge' 2016-06-04 22:24:16 +01:00
Vitor Santos Costa 67c4e14318 Merge branch 'josephnunn' of https://github.com/josephnunn/yap-6.3 into josephnunn-merge 2016-06-04 22:19:29 +01:00
Vitor Santos Costa 8bb7aaad92 fix android chnages. 2016-06-04 22:18:08 +01:00
Vitor Santos Costa f905e4d297 "undefp_handler: This little piggy went away". 2016-06-04 22:12:30 +01:00
Vitor Santos Costa 67aba666c6 rely on Android version. 2016-06-04 22:11:52 +01:00
Vitor Santos Costa 99b3d0db99 android 2016-06-03 17:05:18 +01:00
Vitor Santos Costa 31abcd01c3 Merge branch 'master' of github.com:vscosta/yap-6.3 2016-06-03 16:55:19 +01:00
Vitor Santos Costa 52801b660f checker fixes 2016-06-03 16:54:17 +01:00
Vitor Santos Costa 32743f3731 undef handler 2016-06-03 16:53:43 +01:00
Vitor Santos Costa 8ce16f64d9 learn again 2016-06-03 16:23:28 +01:00
Vitor Santos Costa 79e6e3fcc1 fix is_abs_path 2016-06-02 12:49:06 +01:00
Vitor Santos Costa 0779639baf fix overwite 2016-06-02 12:47:36 +01:00
Vitor Santos Costa e441f30c4c android support 2016-06-02 11:52:22 +01:00
Vitor Santos Costa dce28a774e fixes in simplecudd & lbdd 2016-06-02 10:54:08 +01:00
Vitor Santos Costa 5fd4413ffd fixes in simplecudd & lbdd 2016-06-02 10:53:36 +01:00
Vitor Santos Costa f7c3aef830 don't blow up with bad modules 2016-06-02 10:52:06 +01:00
Vitor Santos Costa 66709db4bb don't blow up with bad modules 2016-06-02 10:51:36 +01:00
Joseph Lee Nunn III de693e2095 Fixed no rule for target bug, Cleaned up INSTALL.md compile instr.
Project would not build with error: [ 64%] Built target libYap
Scanning dependencies of target yap-bin
make[2]: *** No rule to make target `CMakeFiles/yap-bin.dir/build'.
Stop.
make[1]: *** [CMakeFiles/yap-bin.dir/all] Error 2
make: *** [all] Error 2

Cleaned up compilation instructions in INSTALL.md & added special
advice for OSX.
2016-05-31 14:47:10 -07:00
Vitor Santos Costa d0658b7b53 android left-overs 2016-05-31 19:28:29 +01:00
Vitor Santos Costa 8f3bb7fe26 prolog in men bed support 2016-05-30 11:29:26 +01:00
Vitor Santos Costa 71c49f5063 memory leaks 2016-05-30 11:25:28 +01:00
Vitor Santos Costa 4ac6d11dca path finding 2016-05-30 11:24:40 +01:00
Vitor Santos Costa 33fa5fa3c0 arch changes 2016-05-30 11:23:53 +01:00
Vitor Santos Costa d38986fa07 android+gmp+new cud 2016-05-30 11:23:36 +01:00
Vitor Santos Costa 5d4ee60fc9 upcast and downcast 2016-05-30 11:22:47 +01:00
Vitor Santos Costa ceb26b68a0 support other architectures: arm64, mips 2016-05-30 11:18:35 +01:00
Vitor Santos Costa cd7571da7a annoying small bugs 2016-05-26 22:47:19 +01:00
Vitor Santos Costa a9fe413dd0 valgrind. 2016-05-20 01:59:17 +01:00
Vitor Santos Costa 437a303681 modules and extra cut. 2016-05-19 13:38:54 +01:00
Vitor Santos Costa 7c1ea8f3ae add more error types 2016-05-19 13:36:29 +01:00
Vitor Santos Costa d00698b76a os/sysbits.c 2016-05-19 13:35:22 +01:00
Vitor Santos Costa a5bb2e226c simplifications 2016-05-19 13:34:27 +01:00
Vitor Santos Costa ef676f68b0 bad argument 2016-05-19 08:47:40 +01:00
Vitor Santos Costa 9fcbfca1fa Merge branch 'master' of github.com:vscosta/yap-6.3 2016-05-16 11:21:58 +01:00
Vitor Santos Costa f54e11db94 flush 2016-05-16 11:21:54 +01:00
Vitor Santos Costa 9f2ba2d4fb avoid repeated discontiguous messages 2016-05-16 09:35:29 +01:00
Vitor Santos Costa 87e13a9730 continue tracing after spy point 2016-05-16 09:22:29 +01:00
Vitor Santos Costa a72e66d2ae protect against files that consult themselves 2016-05-16 09:22:03 +01:00
Vitor Santos Costa 214b6a74ff debugging 2016-05-15 08:12:49 +01:00
Vitor Santos Costa 8e3789d92a debugging 2016-05-15 08:12:19 +01:00
Vitor Santos Costa af61c886b4 debugging 2016-05-15 08:09:56 +01:00
Vitor Santos Costa 9f664c9e36 exists 2016-05-15 08:08:42 +01:00
Vitor Santos Costa d375d0ffbb indenting 2016-05-14 11:34:27 +01:00
Vitor Santos Costa 7b977c2538 protect bad frees 2016-05-14 11:30:42 +01:00
Vitor Santos Costa 52442e08ec fix vanishing prompt 2016-05-14 11:29:50 +01:00
Vitor Santos Costa eadfef6c3f cudd.h 2016-05-14 11:29:15 +01:00
Vitor Santos Costa 3b8325bd41 bad gmp calls 2016-05-14 11:28:49 +01:00
Vitor Santos Costa d86f0d1942 fix bad consult stack expansion 2016-05-14 11:27:53 +01:00
Vitor Santos Costa c0db3d4e18 recover arg vector 2016-05-14 02:25:51 +01:00
Vitor Santos Costa 3a9ecf929e fix gmp calls 2016-05-13 11:43:01 +01:00
Vitor Santos Costa 428a6255e1 avoid small red flags 2016-05-13 11:42:35 +01:00
Vitor Santos Costa 03da182460 protect against unbound 2016-05-13 11:41:55 +01:00
Vitor Santos Costa e5891afe44 fix nil pointer in prolog profiler 2016-05-13 11:41:19 +01:00
Vitor Santos Costa b28deedffe TermZero for error handling 2016-05-12 11:50:53 +01:00
Vitor Santos Costa 033d77b47a fix current_predicate yet again 2016-05-12 11:50:30 +01:00
Vitor Santos Costa d58c071200 flags handling II 2016-05-12 11:49:40 +01:00
Vitor Santos Costa 70f6080857 simplify module unfolding 2016-05-12 11:49:04 +01:00
Vitor Santos Costa abe1168b1d recognise discontiguous flag 2016-05-12 11:48:39 +01:00
Vitor Santos Costa d46bef3adb verbose_load 2016-05-12 11:45:06 +01:00
Vitor Santos Costa ea7d247ec8 oops, writing the wrong stuff :( 2016-05-12 11:44:32 +01:00
Vitor Santos Costa 1573d5ebd2 flags 2016-05-12 11:44:00 +01:00
Vitor Santos Costa 9391a1499d WIN clash 2016-05-12 11:43:43 +01:00
Vitor Santos Costa 969b022e1c allow ins flag to change input: on -> true 2016-05-12 11:43:26 +01:00
Vitor Santos Costa c5323b2920 undef should not fail immediately: it needs to test for exports first 2016-05-12 11:42:22 +01:00
Vitor Santos Costa e92062886b fix format to use two streams, including a memory buffer; simpler 2016-05-12 11:40:22 +01:00
Vitor Santos Costa 407280ea3b fix tab/1 2016-05-12 11:39:29 +01:00
Vitor Santos Costa 516f89b76d verbosity cleanup -- not finished yet 2016-05-10 15:44:28 +01:00
Vitor Santos Costa e98c4c9f2a start cleaning up message code 2016-05-10 15:23:22 +01:00
Vitor Santos Costa efe827db6c allow static_claus on static clauses wo source 2016-05-10 15:22:25 +01:00
Vitor Santos Costa f94bec3cfc fix debugging sgs and repeated code. 2016-05-10 09:39:17 +01:00
Vitor Santos Costa 2eab5ef225 Aleph requires hide/1 2016-05-10 09:27:05 +01:00
Vitor Santos Costa 91e5f03121 Aleph uses system_predicate/2 2016-05-10 09:25:52 +01:00
Vitor Santos Costa 18ed15a4ce do not complain on multi-file predicates being discontiguous 2016-05-10 09:25:14 +01:00
Vitor Santos Costa 83a1269553 change bootstrap sequence to support -B and to allow booting from pl files 2016-05-10 08:33:44 +01:00
Vitor Santos Costa d7318266fe regression example, from Joana 2016-05-09 14:49:15 +01:00
Vitor Santos Costa 1e8c0b6583 debugging 2016-04-28 22:01:42 +01:00
Vitor Santos Costa c8f1e8a74a user:term_expansion 2016-04-28 21:59:06 +01:00
Vitor Santos Costa 70061308ff make modules remember which operators they ever defined.
Make modules import operators from other modules
2016-04-28 15:01:16 +01:00
Vitor Santos Costa 61ba15fa3a indenting 2016-04-28 14:58:56 +01:00
Vitor Santos Costa 235179ff47 get rid of warning 2016-04-28 14:57:59 +01:00
Vitor Santos Costa f23b8b5418 code source should never had the head in the module 2016-04-28 14:56:57 +01:00
Vitor Santos Costa 9b89e6fd92 fix scripts 2016-04-26 15:33:16 +01:00
Vitor Santos Costa f039a5d688 fix .% 2016-04-26 15:26:35 +01:00
Vitor Santos Costa 9d0722bf2f First step at a config file for CodeMirror: steal from Jan :) 2016-04-22 18:30:04 +01:00
Vitor Santos Costa 443fe5af18 warning 2016-04-22 18:27:44 +01:00
Vitor Santos Costa c0a45cf42c mostly fixes for Android 2016-04-22 18:27:25 +01:00
Vitor Santos Costa 2550fc5b87 win32 2016-04-22 18:26:37 +01:00
Vitor Santos Costa dbd4c979b1 erro handling, versioning, deterministic queries 2016-04-22 18:25:59 +01:00
Vitor Santos Costa 30593e86d6 indenting 2016-04-22 18:25:10 +01:00
Vitor Santos Costa f4111997e7 improve error handling in get_byte 2016-04-22 18:24:20 +01:00
Vitor Santos Costa c06d07985e macro conflict 2016-04-22 18:23:22 +01:00
Vitor Santos Costa b0766abb5c Bug in imported sw :( 2016-04-22 18:22:50 +01:00
Vitor Santos Costa 768b17751b fix redline to send history at the very end 2016-04-22 18:22:17 +01:00
Vitor Santos Costa 445a7f33c1 ANDROID doesn't ;like signals.. 2016-04-22 18:21:45 +01:00
Vitor Santos Costa ea90785c6a CUDA: the missing files 2016-04-22 18:21:05 +01:00
Vitor Santos Costa f966a5b912 Fixes for processing write to buffer: should b more robust, but we still may have memory leaks 2016-04-22 18:19:58 +01:00
Vitor Santos Costa cd41d373db hiatory 2016-04-19 23:30:02 +01:00
Vitor Santos Costa 3d68f0e06b readline completion 2016-04-19 22:42:44 +01:00
Vitor Santos Costa 96f03e26e8 fix WIN stuff 2016-04-18 16:41:30 +01:00
Vitor Santos Costa 49699f52e9 headers & booting 2016-04-18 16:40:17 +01:00
Vitor Santos Costa 3ac1a285a9 make syre we have a NUL pointer. 2016-04-18 16:38:29 +01:00
Vitor Santos Costa 6880fc20a6 win32 2016-04-18 13:37:31 +01:00
vscosta 37649b7d1a windows support 2016-04-17 17:10:58 -07:00
vscosta c1b8d140db av 2016-04-17 17:09:10 -07:00
vscosta 76f4868ff6 fix init to always be able to try booting from Prolog 2016-04-17 17:05:03 -07:00
Vitor Santos Costa 068b624fca fic tell/1 2016-04-16 02:55:17 +01:00
Vitor Santos Costa 631eb4c265 simplify FindCudd 2016-04-15 11:32:22 +01:00
Vitor Santos Costa ab1b8cea39 fix open/3 munging filenames in write mode 2016-04-15 11:30:33 +01:00
Vitor Santos Costa 6ff24e9a16 setup_call_catcher_cleanup 2016-04-15 11:28:07 +01:00
Vitor Santos Costa 97375d010b fix cmake for CUDD 2016-04-14 23:24:20 +01:00
Vitor Santos Costa a761bd752c fix cmake for CUDD 2016-04-14 23:24:07 +01:00
Vitor Santos Costa 05a76a2b3f Debugging meta-predicates 2016-04-14 18:06:52 +01:00
Vitor Santos Costa 1aa20e24b7 misc_bugs_when_compiling_problog 2016-04-14 12:00:09 +01:00
Vitor Santos Costa 29fba0238d support cudd 3.0 2016-04-14 11:58:35 +01:00
Vitor Santos Costa 5a5829a583 encoding not needed 2016-04-14 11:32:44 +01:00
Vitor Santos Costa 786cfb71ad python 2016-04-12 16:22:53 +01:00
Vitor Santos Costa c0c002134b Python support 2016-04-12 16:05:20 +01:00
Vitor Santos Costa e6c2503563 fixes + indenting 2016-04-12 16:04:33 +01:00
Vitor Santos Costa 69bb5c4d08 Memory stream handling 2016-04-12 15:18:42 +01:00
Vitor Santos Costa 65f1cb9741 win64 support: encodings 2016-04-10 06:21:17 -07:00
vscosta 5830eacfec ignore more stuff 2016-04-08 01:30:15 -07:00
vscosta 2a119fdf5e handle DLLs needed for booting. 2016-04-08 01:29:10 -07:00
vscosta 2f5386bd6f handle cases where mem streams do not have FILE* 2016-04-08 01:22:27 -07:00
vscosta 6ee452f0c5 handle null ptrs 2016-04-08 01:21:22 -07:00
vscosta 948c8e7cbb handle null pointers and memory streams 2016-04-08 01:18:28 -07:00
vscosta c3488eeaed socklen_t should be supported in WIN32 :( 2016-04-08 01:17:05 -07:00
vscosta 6b4cc7f8ff GMP/MPIR egg hunt 2016-04-08 01:14:08 -07:00
vscosta 1649366574 copy dlls to main binary directory 2016-04-08 01:13:45 -07:00
vscosta 429c8155c9 check for non-heap memory 2016-04-08 01:11:33 -07:00
Vitor Santos Costa fa650a6440 simplelog 2016-04-06 00:26:16 +01:00
Vitor Santos Costa b7eb38fc44 shffle 2016-04-05 23:56:25 +01:00
Vitor Santos Costa da315b2688 missing 2016-04-05 08:18:50 +01:00
Vitor Santos Costa d680fa0755 missing 2016-04-05 08:18:09 +01:00
Vitor Santos Costa 106e4bc13f cross_compiler 2016-04-05 08:13:21 +01:00
Vitor Santos Costa c7bc27cc3e detail 2016-04-05 08:12:39 +01:00
Vitor Santos Costa b89f6e55b4 indenting 2016-04-05 08:12:16 +01:00
Vitor Santos Costa 55a840e2d8 more fixes 2016-04-05 08:11:05 +01:00
Vitor Santos Costa 93bba89d52 indenting + fix compilation 2016-04-05 08:09:39 +01:00
Vitor Santos Costa 4cdbabfa69 oops 2016-04-05 08:08:11 +01:00
Vitor Santos Costa eb5d90d85f boot from pl 2016-04-05 08:07:28 +01:00
Vitor Santos Costa e485dbc59b new experiments 2016-04-05 08:06:46 +01:00
Vitor Santos Costa dfbdce4240 android 2016-04-05 08:04:09 +01:00
Vitor Santos Costa 5dbe54dadc android 2016-04-05 08:03:19 +01:00
Vitor Santos Costa 7bf8a20f1b android 2016-04-05 08:02:02 +01:00
Vitor Santos Costa 867c9ea47c unify java 2016-04-05 07:49:17 +01:00
Vitor Santos Costa 2e238f6bc1 unify java 2016-04-05 07:48:01 +01:00
vscosta 71f0076ed6 signed wchar 2016-04-05 02:53:39 +01:00
vscosta 4d3d9c408d adds 2016-04-05 02:52:50 +01:00
vscosta a5951daea9 indenting plus deoid 2016-04-05 02:28:56 +01:00
vscosta 562ac0251d indenting 2016-04-05 02:27:33 +01:00
vscosta ac71ba72b5 cosmetics 2016-04-05 02:26:33 +01:00
vscosta 24e6924769 indenting & Android support (one big lib) 2016-04-05 02:25:05 +01:00
vscosta abe5953da7 boot from prolog 2016-04-05 02:24:09 +01:00
vscosta 079ed60248 Android support (just build a big app) 2016-04-05 02:23:41 +01:00
vscosta d9bfcc0f78 cudd is now provided by brew 2016-04-05 02:22:49 +01:00
vscosta 07f105dd80 clang indenting 2016-04-05 02:22:04 +01:00
vscosta d4a9f97cdd InitTime is done automatically. 2016-04-05 02:21:19 +01:00
vscosta 40765a6afb booting from prolog plus indenting 2016-04-05 02:20:16 +01:00
vscosta 7312765824 hard to find 2016-04-05 02:19:31 +01:00
vscosta 396bd2f8c3 indenting, + don't use men streams in Android 2016-04-05 02:18:47 +01:00
Vítor Santos Costa 636992781c android 2016-03-30 17:38:11 +01:00
Vítor Santos Costa 145ad73255 small fixes
indenting
2016-03-30 17:35:03 +01:00
Vítor Santos Costa 78ba5d01f2 inlining related 2016-03-30 01:28:45 +01:00
Vítor Santos Costa 2d8fdad839 highlighting 2016-03-30 01:27:54 +01:00
Vítor Santos Costa a304fc721a improve error handling; be careful with trail. 2016-03-30 01:27:03 +01:00
Vítor Santos Costa 6b141078b4 fix typo 2016-03-30 01:26:02 +01:00
Vítor Santos Costa 1c2383b5b9 fix warnings 2016-03-30 01:25:43 +01:00
Vítor Santos Costa e0d82cfb23 don't inline 2016-03-30 01:24:59 +01:00
Vítor Santos Costa 4103aa6e83 don't inline == and \= for now. 2016-03-30 01:24:34 +01:00
Vítor Santos Costa f3e8b8b3da indenting; warning; exceptions; small fixes 2016-03-29 02:02:43 +01:00
Vítor Santos Costa 6bc4acec15 new exception 2016-03-29 02:00:07 +01:00
Vítor Santos Costa 9dacc20d34 fix 2016-03-29 01:59:01 +01:00
Vítor Santos Costa 06e5371afd exceptions 2016-03-29 01:57:55 +01:00
Vítor Santos Costa 2dae2363a3 fix tests 2016-03-29 01:57:13 +01:00
Vítor Santos Costa 9f722319ec fix utf-8 reading 2016-03-29 01:56:38 +01:00
Vítor Santos Costa cda490eda8 aliases should be global? 2016-03-29 01:56:00 +01:00
Vítor Santos Costa 1be002558c call_cleanup in C plus indenting 2016-03-29 01:55:12 +01:00
Vítor Santos Costa fa69950c67 fix warnings 2016-03-29 01:51:48 +01:00
Vítor Santos Costa f6379bcd48 indenting 2016-03-17 00:01:09 +00:00
Vítor Santos Costa e9cac424f0 more atoms plus cleanups 2016-03-16 23:57:41 +00:00
Vítor Santos Costa 88b179b603 more atoms plus cleanups 2016-03-16 23:56:24 +00:00
Vítor Santos Costa 9d1fa8a907 prototypes 2016-03-16 23:55:51 +00:00
Vítor Santos Costa cd1497c475 prototypes 2016-03-16 23:55:25 +00:00
Vítor Santos Costa b4742fb3cf fix trying to remove the same atom twice 2016-03-16 23:53:15 +00:00
Vítor Santos Costa 17ef6ddf34 singletons 2016-03-06 01:09:43 +00:00
Vítor Santos Costa bac60d2d94 bad typo in bom 2016-03-06 01:09:02 +00:00
Vítor Santos Costa bc914e9e91 fix lines that terminate on EOF 2016-03-05 23:43:11 +00:00
Vítor Santos Costa 79d99a7768 fix module_property, ignoring modules that are not actually implemented as files. 2016-03-05 23:18:57 +00:00
Vítor Santos Costa 23d18ac0fd Fix regression on handling system preds.
Algorithm
  - fix system modules
  - fix system predicates
  - hide atoms with $
2016-03-05 18:48:22 +00:00
Vítor Santos Costa a32ac66167 Fix fileName
Always return a legit atom
check for NULL
indenting
2016-03-05 17:38:08 +00:00
Vítor Santos Costa 1155b6b876 Paulo Moura: fix iso_is_2_35 2016-03-05 12:50:43 +00:00
Vítor Santos Costa da51cfe6b9 use system.2 2016-03-05 12:41:47 +00:00
Vítor Santos Costa cec2e9638a typo 2016-03-05 12:41:29 +00:00
Vítor Santos Costa 0f4448fdbe no need 2016-03-05 12:40:59 +00:00
Vítor Santos Costa 59b1aa9129 axe cross-compiler 2016-03-05 12:40:10 +00:00
Vítor Santos Costa 812a88e277 keep on simplifying modules 2016-03-05 12:37:58 +00:00
Vítor Santos Costa fdcc75d4ae keep on simplifying modules 2016-03-05 12:36:54 +00:00
Vítor Santos Costa 2fe198f68a jpg but n uni 2016-03-05 12:31:36 +00:00
Vítor Santos Costa 50bfe3c014 ugh 2016-03-05 12:31:09 +00:00
Vítor Santos Costa 0522720ff4 mostly indenting 2016-03-05 12:30:49 +00:00
Vítor Santos Costa 0fc0e96306 error should not be needed, 2016-03-05 12:30:13 +00:00
Vítor Santos Costa f1c9c08f1f win32: llibxml2 uses the YAP internals 2016-03-05 12:25:07 +00:00
Vítor Santos Costa 001b169d81 indenting 2016-03-05 12:21:58 +00:00
Vítor Santos Costa 52f949d3f9 further op stuff 2016-03-05 12:18:43 +00:00
Vítor Santos Costa 87c58493d4 /fix stream_prop; indenting 2016-03-05 12:17:23 +00:00
Vítor Santos Costa 96bc776375 avoid direct dependencies on CurrentModule 2016-03-05 12:12:37 +00:00
Vítor Santos Costa 5a95c6bbc7 fix stream_property 2016-03-05 00:08:04 +00:00
Vítor Santos Costa 27b7e32036 fix stupid typo 2016-03-04 00:09:33 +00:00
Vítor Santos Costa b50cf8d7b4 modules vs ops 2016-03-03 23:24:09 +00:00
Vítor Santos Costa 8c7756f8fb He who messes with error messages... 2016-03-03 23:23:32 +00:00
Vítor Santos Costa f20599478e consult Yap.h to get ocnfig.h 2016-03-03 23:21:45 +00:00
Vítor Santos Costa d3796aba5a ok, even if the locale is C, unicode is most often supported. 2016-03-03 23:19:19 +00:00
Vítor Santos Costa 5f9752baff use utf-8 internally: problem, still seems to core dump 2016-03-03 23:18:04 +00:00
Vítor Santos Costa 0db27196aa operator support. 2016-03-03 23:16:40 +00:00
Vítor Santos Costa 5c4cedd4fc VC++ no like ssize_t & indenting 2016-03-03 23:15:54 +00:00
Vítor Santos Costa c552dc6a2c libxml uses YAP internals-II 2016-02-29 08:04:33 +00:00
Vítor Santos Costa b384c40213 libxml uses YAP internals 2016-02-29 08:00:00 +00:00
Vítor Santos Costa 638f784f81 more oops 2016-02-29 03:36:10 +00:00
Vítor Santos Costa e81acc117b ugh 2016-02-29 03:28:50 +00:00
Vítor Santos Costa b9eb327d86 fix fixes (lots of white space, somehow. 2016-02-29 03:13:23 +00:00
Vítor Santos Costa 0ccee1aa55 Merge /Users/vsc/tmp/yap-6.3w 2016-02-28 19:43:26 +00:00
Vítor Santos Costa 2192f73b11 make it compile under MSN vc. Unfortunately it has a weird crash at boot :(
- Lots of indenting changes
- VC++ is strict with variadic macros
- VC++ does not accept unistd.h
- new interface for walltime
- VC++ does not seem to have support for integer overflow.
- VC++ defines YENV_REG?
- no access flags, x permissions ignored.
- new FindGMP supporting MPIR
- make horus optional (c++ is hard).
2016-02-28 19:32:55 +00:00
Vítor Santos Costa 7cc9d2f882 fix case where rheap thought a fact could actually stre its src 2016-02-28 19:30:46 +00:00
Vítor Santos Costa 675befae75 CRLF kind of magic 2016-02-28 19:29:30 +00:00
Vítor Santos Costa 56e9a8f8d9 add stub for SWI compat 2016-02-26 18:25:07 +00:00
Vítor Santos Costa 25ee4dd7e8 fix nissing file by Eric Dechter 2016-02-26 18:10:47 +00:00
Vítor Santos Costa 1f29aea94b clean-up 2016-02-26 17:53:20 +00:00
Vítor Santos Costa 56ebb0a91a more ice play 2016-02-26 17:52:53 +00:00
Vítor Santos Costa d8a7d05e01 typo 2016-02-26 17:52:34 +00:00
Vítor Santos Costa 733a03beef bootlist 2016-02-26 17:49:50 +00:00
Vítor Santos Costa 77123269e7 fix batched job :( 2016-02-26 17:47:40 +00:00
Vítor Santos Costa 54985f4678 fix eof handling + indent 2016-02-26 17:45:45 +00:00
Vítor Santos Costa 62e0f0bece ensure it goes to Prolog, no hidden module stuff. 2016-02-26 17:43:29 +00:00
Vítor Santos Costa 6ceb0bf9f3 understand more formats 2016-02-26 17:42:37 +00:00
Vítor Santos Costa e9712bc9ab we own bootlist 2016-02-26 17:41:55 +00:00
Vítor Santos Costa 7d3053b906 undef should obey flag. 2016-02-26 17:41:05 +00:00
Vítor Santos Costa 68633a9c34 ops & modules iii 2016-02-26 17:40:03 +00:00
Vítor Santos Costa 0e50546005 clang-format 2016-02-26 17:36:33 +00:00
Vítor Santos Costa f823ded57f Avoid warning & fix compilation scripts 2016-02-26 17:35:20 +00:00
Vítor Santos Costa d9fe5133d3 what happens when a filename is a base path? 2016-02-26 17:30:50 +00:00
Vítor Santos Costa 0e7cc378af shuffle list ops around 2016-02-26 17:29:54 +00:00
Vítor Santos Costa 46140f434d not being used 2016-02-26 17:29:09 +00:00
Vítor Santos Costa d2dceb91d3 fix syntax errors 2016-02-26 17:28:22 +00:00
Vítor Santos Costa bc291ed08b If user says use module m, then use module M 2016-02-26 17:25:33 +00:00
Vítor Santos Costa 34b731a4ae operator support 2016-02-26 17:22:41 +00:00
Vítor Santos Costa c25d35356a Try to clarify operators
prolog has priority and cannot be redefined by default.
user is global but may be redefined
others should just plug-in.
2016-02-26 17:18:37 +00:00
Vítor Santos Costa a448e25d8d handle no java 2016-02-24 02:08:18 +00:00
Vítor Santos Costa e4e59dedf7 win32 support, especially win does not allow file streaming in memory 2016-02-24 02:07:46 +00:00
Vítor Santos Costa 3af377d610 test import 2016-02-22 13:01:46 +00:00
Vítor Santos Costa 6f1b5fbef9 thread compilation 2016-02-22 13:01:09 +00:00
Vítor Santos Costa 712d79c7bb keep on fixing absolute_name 2016-02-22 12:59:49 +00:00
Vítor Santos Costa 588ef40a16 follow encoding directives 2016-02-22 12:57:46 +00:00
Vítor Santos Costa df7feea0aa warnings 2016-02-22 12:56:09 +00:00
Vítor Santos Costa 98bd9d7400 undefined predicate handling fixes
obey the flag
2016-02-22 12:55:05 +00:00
Vítor Santos Costa c7049b5467 garbage collection 2016-02-21 19:22:45 +00:00
Vítor Santos Costa 405b20e8fa ugh 2016-02-21 19:15:24 +00:00
Vítor Santos Costa 28b1262455 ugh 2016-02-21 19:13:35 +00:00
Vítor Santos Costa bd72ec8f50 typo 2016-02-21 19:09:25 +00:00
Vítor Santos Costa f017f38dee move error handling to early on so as to get feedback on errors since bootstrap. 2016-02-21 19:09:10 +00:00
Vítor Santos Costa d5862139c8 be more careful when to complain about redefining system press. 2016-02-21 19:07:14 +00:00
Vítor Santos Costa f7d23f9deb Simplify Input/Output
get rid of string I/O, did not add much
getc is never actually used by Prolog
try to use system I/O, even if it may be slower, at least for now.
extend IO C-interface to allow reading clauses
2016-02-21 19:06:25 +00:00
Vítor Santos Costa 19cedad41d more to ignore 2016-02-21 11:33:08 +00:00
Vítor Santos Costa 20f639fe7b simple, small test for error_handling 2016-02-21 11:32:08 +00:00
Vítor Santos Costa 2cacf6f63a fix source regression 2016-02-21 11:31:27 +00:00
Vítor Santos Costa 8f9fa802a9 debugging and mode operator. 2016-02-21 11:31:06 +00:00
Vítor Santos Costa 1d76cfc7cb typo 2016-02-21 11:30:29 +00:00
Vítor Santos Costa 26013e2fb9 fix regress in style_check caused by bad argument to add clause 2016-02-21 11:30:13 +00:00
Vítor Santos Costa 504734c879 typo 2016-02-20 23:58:37 +00:00
Vítor Santos Costa 1c68deb663 dump stack on YAP bug (maybe extend to user foreign code). 2016-02-20 23:58:06 +00:00
Vítor Santos Costa b7ee47ce46 facilitate peek processing when using system locale. 2016-02-20 21:50:06 +00:00
Vítor Santos Costa ef06ebe698 fix missing var warning 2016-02-20 20:40:23 +00:00
vscosta 52d0a38f8f Merge pull request #13 from edmcman/master
Fix a typo.
2016-02-20 01:48:47 +00:00
vscosta 33ebe61371 Merge pull request #14 from logicmoo/pre_dicate_flags
- pre_dicate_flags + predicate_flags'
2016-02-20 01:47:20 +00:00
Vítor Santos Costa 88df20efca bug in scanning numbers 2016-02-20 01:45:55 +00:00
Vítor Santos Costa eec32e698a stream_Property/2:
allow sp(X,Y), sp(u,Y), sp(X,t(Y))
 fix lines
2016-02-20 01:30:52 +00:00
DouglasRMiles 84b617314a - pre_dicate_flags + predicate_flags' 2016-02-19 13:41:17 -08:00
Edward J. Schwartz 12941d9b50 Fix a typo. 2016-02-19 15:46:20 -05:00
Vítor Santos Costa bc71e54f20 encoding stuff 2016-02-19 19:36:11 +00:00
Vítor Santos Costa b27c1964bf clean-up 2016-02-19 19:34:59 +00:00
Vítor Santos Costa d8620c785e lucky this wasn't noticed 2016-02-19 19:31:58 +00:00
Vítor Santos Costa efece26020 duplcated data is bad 2016-02-19 19:30:09 +00:00
Vítor Santos Costa 7b2ff0f16d fix regression in absf error messages. 2016-02-19 11:44:04 +00:00
Vítor Santos Costa 24bf4088d7 fix glob and multiple solutions support; hopefully the code is still readable. 2016-02-19 11:37:11 +00:00
Vítor Santos Costa 083d374e02 fix missing syntax errors regression :( 2016-02-19 11:34:48 +00:00
Vítor Santos Costa ad91eb0ec9 fix regression: checking for EOT should first peek, and if happy consume the blank after the dot. 2016-02-18 22:10:40 +00:00
Vítor Santos Costa 091be7677a Merge branch 'master' of github.com:vscosta/yap-6.3 2016-02-18 19:48:17 +00:00
Vítor Santos Costa c381dbe318 ISO error handling (Paulo Moura's suite). 2016-02-18 19:46:03 +00:00
Vítor Santos Costa 56024b2a2c Eyal Dechter: The YAP version of assoc.pl has gen_assoc(Assoc, Key, Value). Both SWI and Sicstus use gen_assoc(Key, Assoc, Value). Could it be changed for compatibility with the other systems? 2016-02-18 19:41:11 +00:00
vscosta a5e99e09bd Merge pull request #11 from edmcman/master
Fix compilation errors
2016-02-18 13:32:43 +00:00
Vitor Santos Costa 0e58a8f41e update README to refer to cmake, and to use MD format.
Moved autoconf files out of the way so that people won't try using them.
Removed INSTALL, as it just duplicates README.md. Maybe in the future.
2016-02-18 13:20:49 +00:00
Vítor Santos Costa fa0ef4e0c8 fix encoding 2016-02-18 12:11:17 +00:00
Vítor Santos Costa 484168b1ce Fix encoding 2016-02-18 12:10:58 +00:00
Edward J. Schwartz 9b38690055 Don't use reserved word thread_local 2016-02-16 09:35:10 -05:00
Edward J. Schwartz 693272ecdf Fix build when odbc is not available 2016-02-16 09:20:41 -05:00
Vítor Santos Costa 05a978ce82 be more struct; better support fir encodings. 2016-02-14 04:18:15 +00:00
Vítor Santos Costa fb966536a9 warnings 2016-02-14 04:15:53 +00:00
Vítor Santos Costa 0a9f37710c reformatting 2016-02-14 04:15:28 +00:00
Vítor Santos Costa ae65bb0265 fix peek 2016-02-14 04:14:31 +00:00
Vítor Santos Costa 42091deffc encoding fixes 2016-02-14 04:14:20 +00:00
Vítor Santos Costa 7b8c1815ae const 2016-02-14 04:12:53 +00:00
Vítor Santos Costa aed44554f2 warning 2016-02-14 04:12:31 +00:00
Vítor Santos Costa 92cb3e34eb don't consume char after '.', do peek instead.
early errors should leave early.
2016-02-14 04:11:55 +00:00
Vítor Santos Costa df0b3d3a0d make base name and dirname compatible with other prologs 2016-02-13 20:32:26 +00:00
Vítor Santos Costa 4138e46955 be more restrictive about atom_codes. 2016-02-13 20:18:10 +00:00
Vítor Santos Costa afa085de28 protect should be called before user goals. 2016-02-13 20:16:25 +00:00
Vítor Santos Costa 9860b6244f small changes 2016-02-13 03:11:25 +00:00
Vítor Santos Costa 994c5d0dfd first jvm then java and last jpl 2016-02-13 03:08:26 +00:00
Vítor Santos Costa 1deb238d10 skip OS preds 2016-02-13 03:07:48 +00:00
Vítor Santos Costa 78327cf885 rewrite 2016-02-13 03:07:04 +00:00
Vítor Santos Costa 48db20515f TrueFileName changed name :) 2016-02-13 02:56:19 +00:00
Vítor Santos Costa 52a2d00d0c init stuff. 2016-02-13 02:53:46 +00:00
Vítor Santos Costa c918c052fc DOMAIN_ERROR is an error class. 2016-02-13 02:53:18 +00:00
Vítor Santos Costa bea2431c3e back port 2016-02-11 15:39:04 +00:00
Vítor Santos Costa 8f9fb0437c git ... 2016-02-11 15:35:34 +00:00
Vítor Santos Costa 21fa15bf10 macos fixes 2016-02-11 15:32:42 +00:00
V'itor Santos Costa 485d20d908 related changes 2016-02-11 06:20:16 -08:00
V'itor Santos Costa 255da61029 rewrite library search code. 2016-02-11 06:18:41 -08:00
V'itor Santos Costa ee0335124f absolute_filename ^#%@% 2016-02-11 06:17:30 -08:00
V'itor Santos Costa 9a071d5823 split path processing 2016-02-11 06:15:30 -08:00
V'itor Santos Costa 6961626a3d - move all generated files to their own directory
- cleanups
`:wq
2016-02-11 06:13:16 -08:00
V'itor Santos Costa 74b2b5561d - add debugging code to memory allocation
= atom to number: cleanup function name as this is more than just supporting SWI
- SrcMask only applies to rules.
- add auxiliary type/error function
- fix typos
- fix enumeration mode in current_flag
- get rid of TrueName routines, use AbsoluteFileName instead.
- detail synatx error source
2016-02-11 06:03:33 -08:00
V'itor Santos Costa f440981b41 avoid going into build directories 2016-02-11 05:58:21 -08:00
V'itor Santos Costa 574ab5d0ca complain more + utility function 2016-02-11 05:57:03 -08:00
V'itor Santos Costa be835c73e6 protect from possible overflow 2016-02-11 05:55:53 -08:00
V'itor Santos Costa b13dc6812c avoid overflow 2016-02-11 05:53:47 -08:00
V'itor Santos Costa 55deb884d4 avoid a possible overflow. 2016-02-11 05:52:17 -08:00
Vitor Santos Costa c8305988ca Merge branch 'master' of github.com:vscosta/yap-6.3 2016-02-03 10:17:01 +00:00
Vitor Santos Costa 143684731e foreign files 2016-02-03 09:22:23 +00:00
Fabrizio Riguzzi ec999c1126 compiled ver pdf 2016-02-03 08:06:32 +01:00
Fabrizio Riguzzi 504407eac3 manual for yap version 2016-02-03 07:52:52 +01:00
Vitor Santos Costa e97eb4696e Linux 2016-02-03 02:48:18 +00:00
Vítor Santos Costa c6b7a186c1 android stuff 2016-02-01 10:06:09 +00:00
Vítor Santos Costa 965eb4739e Linux patches 2016-02-01 03:18:57 +00:00
V'itor Santos Costa 77d3101bd8 Merge branch 'master' of /mnt/hgfs/vsc/git/yap-6.3 2016-01-31 18:49:08 -08:00
V'itor Santos Costa d83c62051b file fixes 2016-01-31 18:48:07 -08:00
Vítor Santos Costa a7874dee62 fix abolish 2016-02-01 02:46:39 +00:00
Vítor Santos Costa 9b38290b8c current_pred again 2016-01-31 23:11:49 +00:00
Vítor Santos Costa f031e78def cleanup 2016-01-31 19:42:57 +00:00
Vítor Santos Costa 7aba41e7c2 cleanup 2016-01-31 19:41:10 +00:00
Vítor Santos Costa 3de5b2c2de error_handling 2016-01-31 11:54:45 +00:00
Vítor Santos Costa c9babdd03e win32 2016-01-31 10:58:24 +00:00
Vítor Santos Costa 73f6c456ae current_red 2016-01-31 10:48:53 +00:00
Vítor Santos Costa 0671a1623c fix win32 compilation 2016-01-31 10:48:17 +00:00
Vítor Santos Costa 60216989f3 activate deadline 2016-01-31 10:47:17 +00:00
Vítor Santos Costa a143f07ca0 vars 2016-01-31 10:47:00 +00:00
Vítor Santos Costa cdad87a6fc delete/3 2016-01-31 10:46:35 +00:00
Vítor Santos Costa c428e2256d avoid creeping 2016-01-31 10:46:14 +00:00
Vítor Santos Costa c40899d8ec badvar 2016-01-31 10:45:42 +00:00
Vítor Santos Costa 1f7608a735 cl 2016-01-31 10:45:00 +00:00
Vítor Santos Costa bd337494f1 protect goal expansion 2016-01-31 10:44:20 +00:00
Vítor Santos Costa 32f6c44dea relative paths. 2016-01-31 10:43:42 +00:00
Vítor Santos Costa ae771e70e2 compile without deadline, other win32 work 2016-01-31 10:42:57 +00:00
Vítor Santos Costa b28532a251 misc 2016-01-31 10:42:08 +00:00
Vítor Santos Costa e5009c733e use handles internally, not slots 2016-01-31 10:41:38 +00:00
Vítor Santos Costa ad7bef51c6 generated files 2016-01-31 10:41:01 +00:00
Vítor Santos Costa 06a2caf7a9 init fields
lots of docs, boolean -> booleanFlag
2016-01-31 10:39:15 +00:00
Vítor Santos Costa 794d04c851 flags & var init work 2016-01-31 10:37:41 +00:00
Vítor Santos Costa 825bfd11c2 X_API & docs 2016-01-31 10:35:53 +00:00
Vítor Santos Costa 5073ff9b43 win32 2016-01-31 10:33:32 +00:00
Vítor Santos Costa 8c873350c9 win32 2016-01-31 10:33:13 +00:00
Vítor Santos Costa 017e356cfb sockets use sysbtslu 2016-01-31 10:32:51 +00:00
Vítor Santos Costa 8cf73c59ae rid of error library 2016-01-31 10:30:54 +00:00
Vítor Santos Costa 9c78086a6a X_API WIN32 stuff 2016-01-31 10:29:36 +00:00
Vítor Santos Costa 35eb33e27f improve flag library 2016-01-31 10:27:08 +00:00
Vítor Santos Costa 1ebaf342b6 fix ordering that results in empty table 2016-01-31 10:26:13 +00:00
Vítor Santos Costa 680dae240f win32 if 2016-01-31 10:23:27 +00:00
Vítor Santos Costa ebc73ec01e docs + EVAL_H 2016-01-31 10:23:03 +00:00
Vítor Santos Costa 52b282442f small fixes 2016-01-31 10:22:24 +00:00
Vítor Santos Costa 4ff7bdd340 small cleanups 2016-01-31 10:21:50 +00:00
Vítor Santos Costa 5c1c9a8570 current_pred 2016-01-31 10:21:10 +00:00
Vítor Santos Costa fbf0c6bd0d cleanups on error handling and fix EOF. 2016-01-31 10:19:08 +00:00
Vítor Santos Costa 7491481e8e cleanups 2016-01-31 10:18:12 +00:00
Vítor Santos Costa 1b98e2238c more system_module stuff 2016-01-31 10:17:47 +00:00
Vítor Santos Costa 515d5f3705 cons stuff 2016-01-31 10:17:19 +00:00
Vítor Santos Costa 4f0c539ed6 set up flags to control IO. 2016-01-31 10:16:31 +00:00
Vítor Santos Costa f5c493507e CurrentModule needs to be set correctly, 2016-01-31 10:16:02 +00:00
Vítor Santos Costa 9444c36ff4 pretty print 2016-01-31 10:14:28 +00:00
Vítor Santos Costa d90a0f72b0 protect entry to critical section 2016-01-31 10:13:51 +00:00
Vítor Santos Costa ddabfe45b8 WIN32
cleanups
get rid of old log
2016-01-31 10:13:14 +00:00
Vítor Santos Costa 015fbe6703 flag work
boolean -> booleanFlag (win32)
2016-01-31 10:12:25 +00:00
Vítor Santos Costa d573407b4d retry_or des not have access to arguments 2016-01-31 10:06:30 +00:00
Vítor Santos Costa 2edae59610 fmemopen compat work on Unix 2016-01-31 10:05:15 +00:00
Vítor Santos Costa 697f57ecef memory streams
- work with blobs
- recover memory on close
- do not call Unix code on win32
2016-01-31 10:02:11 +00:00
Vitor Santos Costa 247aa763b5 android experiment 2016-01-27 17:12:13 +00:00
Vítor Santos Costa 703ac35735 fix error crash while constructing error term 2016-01-20 23:16:04 +00:00
Vítor Santos Costa ca2cd734a2 fix inconsistent errors 2016-01-20 22:39:32 +00:00
Vítor Santos Costa a249156989 docs 2016-01-20 22:39:10 +00:00
Vítor Santos Costa e8f87d2875 glob should not return error on miss 2016-01-20 22:38:42 +00:00
Vítor Santos Costa 10a29998a3 fix read_term options 2016-01-20 22:38:09 +00:00
Vítor Santos Costa 8c69e3811e docs 2016-01-20 22:37:13 +00:00
Vítor Santos Costa 3074256cc1 more win32 support 2016-01-20 22:36:52 +00:00
Vítor Santos Costa 828c2c9f6e docs 2016-01-20 22:36:16 +00:00
Vítor Santos Costa 3966bf2ee1 windows dlls, meet thy mxmake 2016-01-20 22:25:25 +00:00
Vítor Santos Costa f7207f3c9d Inconsistent error codes 2016-01-20 22:19:43 +00:00
Vítor Santos Costa a2f1ed92ea syntax error 2016-01-20 22:18:52 +00:00
Vítor Santos Costa 77a5090276 Add missing documentation 2016-01-20 22:18:17 +00:00
Vítor Santos Costa 8c7c258492 fix creeping over dealloc, even it requires duplicating some code 2016-01-20 22:15:23 +00:00
Vítor Santos Costa 97feeda48a support script option in open, both for reading and writing. 2016-01-20 22:12:41 +00:00
Vítor Santos Costa 6b60742700 system predicates should not belong to a file. 2016-01-12 17:03:57 +00:00
Vítor Santos Costa 93f8179b3b docs should be optional for now 2016-01-08 20:54:04 +00:00
Vítor Santos Costa f6a6c9deb6 last 2016-01-08 20:43:14 +00:00
Vítor Santos Costa 784f9a2880 BOM fixes 2016-01-08 20:04:31 +00:00
Vítor Santos Costa 1a23e47316 current_predicate 2016-01-08 03:18:36 +00:00
Vítor Santos Costa bdb2f0562a Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2016-01-07 23:43:05 +00:00
Vítor Santos Costa a8b8113a8d first try to hide $ predicates 2016-01-07 23:42:52 +00:00
Vitor Santos Costa fd2930cbf4 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2016-01-07 16:02:17 +00:00
Vitor Santos Costa 780f42210c swig-java 2016-01-07 16:02:08 +00:00
Vítor Santos Costa c11273bc44 gc_trace 2016-01-06 12:45:48 +00:00
Vítor Santos Costa 2aea33032b modules 2016-01-06 12:45:08 +00:00
Vítor Santos Costa f6c5a2eea1 docs and strings 2016-01-06 12:43:51 +00:00
Vítor Santos Costa e315217f0e xml fixes 2016-01-06 12:43:15 +00:00
Vítor Santos Costa 6d93c35c13 threads 2016-01-06 12:40:01 +00:00
Vítor Santos Costa 13f020ad25 threads 2016-01-06 12:39:42 +00:00
Vítor Santos Costa 55c83fc2c8 improve performance 2016-01-06 12:39:12 +00:00
Vítor Santos Costa 0eac6ac20b fix gc_trace flag 2016-01-06 12:38:28 +00:00
Vítor Santos Costa c104fb946d use slots 2016-01-06 12:36:59 +00:00
Vítor Santos Costa 3704392811 xml2 early support 2016-01-06 12:36:36 +00:00
Vítor Santos Costa d6c6cecb27 moving icons around 2016-01-06 12:35:31 +00:00
Vítor Santos Costa c0aa90bc38 add some little support for xml2 2016-01-06 12:31:53 +00:00
Vítor Santos Costa c8addfd509 fix gc handling from deallocate 2016-01-06 12:30:33 +00:00
Vítor Santos Costa c56b822cba clang does not like -freorder-blocks 2016-01-05 03:33:34 +00:00
Vítor Santos Costa cfbbf6e97e avoid depending on library/... 2016-01-05 03:32:51 +00:00
Vítor Santos Costa 07a37b8c52 compile with other utf8proc around 2016-01-05 03:30:31 +00:00
Vítor Santos Costa a03e93a70e Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2016-01-04 23:14:15 +00:00
Vítor Santos Costa 5e4cbcef56 cleanup 2016-01-04 17:24:53 +00:00
Vítor Santos Costa 5fd4add82b Hide and Seek 2016-01-04 17:18:43 +00:00
Vítor Santos Costa 713e9dc9d8 init 2016-01-04 15:12:44 +00:00
Vítor Santos Costa 50c8724322 linux backport
file exists system predicate
$source_file -> $user source
hide and make system preds
fix check_head_and_body
user_expansion never fails
goal expansion is controlled b dynamic procedure
add must_be_of_type predicate_indicator
fix neat_call, debug flag is user controlled
use simplecudd, not ptoblogbdd
compile all of myddas
fx junk in file_name
fix warnings
use common file opening struct and funds
avoid pairs module
fix db queues
2016-01-04 14:11:09 +00:00
Vítor Santos Costa c0f00e7a0f missing file 2016-01-04 02:21:05 +00:00
Vítor Santos Costa 99e0458e15 missing file 2016-01-04 02:14:05 +00:00
Vítor Santos Costa 0f121e7f9d // support 2016-01-03 15:44:33 +00:00
Vítor Santos Costa 801944a0cc // support 2016-01-03 15:40:49 +00:00
Vítor Santos Costa cde63e2be2 // support 2016-01-03 15:35:04 +00:00
Vítor Santos Costa bc53e8bae9 some tests 2016-01-03 13:54:14 +00:00
Vítor Santos Costa 1c5b6c3687 some tests 2016-01-03 13:52:48 +00:00
Vítor Santos Costa a8d146dd4d missing_files 2016-01-03 04:53:42 +00:00
Vítor Santos Costa bd208fe63e new files 2016-01-03 03:21:00 +00:00
Vítor Santos Costa 661f33ac7e bug fices 2016-01-03 02:06:09 +00:00
Vítor Santos Costa 7a7354fb2b restore clauses 2016-01-03 02:02:41 +00:00
Vítor Santos Costa 5ca49ae202 mostly reindenting. 2016-01-03 01:34:09 +00:00
Vítor Santos Costa 811808fc34 improve mod flags & system flags 2016-01-03 01:32:04 +00:00
Vítor Santos Costa eabc869c69 user expansion
pretty
2016-01-03 01:31:21 +00:00
Vítor Santos Costa c927cd5133 fix flags 2016-01-03 01:29:27 +00:00
Vítor Santos Costa 792f3e9dd9 small LU changes 2016-01-03 01:28:21 +00:00
Vítor Santos Costa d942b55dc4 varia 2016-01-03 01:27:36 +00:00
Vítor Santos Costa ca7d66a791 remove old xomment 2016-01-03 01:26:09 +00:00
Vítor Santos Costa 4e2649c743 thread support 2016-01-03 01:25:31 +00:00
Vítor Santos Costa 9bcd3de29d hide -> hide_atom 2016-01-03 01:24:57 +00:00
Vítor Santos Costa 09106b9a6e prettification 2016-01-03 01:17:39 +00:00
Vítor Santos Costa 7a24d3015e debugging 2016-01-03 01:16:51 +00:00
Vítor Santos Costa 062293055b protect systemm 2016-01-03 01:16:38 +00:00
Vítor Santos Costa 344cdc69be owner file 2016-01-03 01:15:29 +00:00
Vítor Santos Costa da66171f3d mod 0 protection 2016-01-03 01:15:11 +00:00
Vítor Santos Costa 3ee2a11529 thread support 2016-01-03 01:13:39 +00:00
Vítor Santos Costa f0cf91548a change hash function to not be inline 2016-01-03 01:09:57 +00:00
Vítor Santos Costa 3d0e6659b6 speed up fail on undef 2016-01-03 01:03:37 +00:00
Vítor Santos Costa 60a8efb467 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2015-12-15 09:29:44 +00:00
Vítor Santos Costa 15404b3835 small
- do not call goal expansion on meta-calls (that is done by undef).
- docs updates
- fix init code
2015-12-15 09:28:43 +00:00
Vítor Santos Costa 14459cce03 undefined with fast_fail support 2015-12-15 09:18:36 +00:00
Vítor Santos Costa 5ceb98bdf9 peek support 2015-12-15 09:14:15 +00:00
Vítor Santos Costa e95e795e08 docs 2015-12-15 09:07:36 +00:00
Vítor Santos Costa 892cfaed02 docs 2015-12-15 09:07:18 +00:00
Vítor Santos Costa 63a4b67787 avoid duplicated error 2015-12-15 09:06:03 +00:00
Vítor Santos Costa 83a3c52a75 move length to lists 2015-12-15 09:05:24 +00:00
Vítor Santos Costa a3a6386353 max op 2015-12-15 09:04:47 +00:00
Vítor Santos Costa 3eda5cf68a reorg of predicate handling
use strip_module for clearer code.
- separate dynamic predicates
- separate declarations
2015-12-15 09:04:08 +00:00
Vítor Santos Costa d2ad352f78 The big module cleanup
meta.yap contains meta-expansion
new mod.yap contains module declarations
module.yap keeps the rest.
undefcode refers to meta expansion

lots of annoying little errors.
2015-12-15 09:01:44 +00:00
Vítor Santos Costa 95f770f747 glob fixes (how to handle non-existing files) 2015-12-15 08:54:47 +00:00
Vítor Santos Costa 9f55c13c34 move docs to absf.md 2015-12-15 08:54:21 +00:00
Vítor Santos Costa e51de5f83c remove support for confusing manipulation of $VAR 2015-12-15 08:48:53 +00:00
Vítor Santos Costa 2bd2de1b9f also display B 2015-12-15 08:40:23 +00:00
Vítor Santos Costa edb6189512 allow the option to have priorities above 1200 2015-12-15 08:38:56 +00:00
Vítor Santos Costa c6f1c328f8 use swi must_be declarations in YAP 2015-12-15 08:25:16 +00:00
Vítor Santos Costa c04a63d61b move big doc chunks to md files
also moe icons to docs/
2015-12-15 08:24:11 +00:00
Vitor Santos Costa 8da8e0e472 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2015-11-18 15:34:36 +00:00
Vítor Santos Costa ce8a19d381 Add documentation 2015-11-18 15:06:25 +00:00
Vítor Santos Costa 7236d4a527 initial updates 2015-11-13 13:24:31 +00:00
Vítor Santos Costa 4cea2839e4 add read_line_to_string 2015-11-13 13:23:49 +00:00
Vítor Santos Costa 54d7d52b09 a few more cases of conversion 2015-11-13 13:22:50 +00:00
Vítor Santos Costa 5d5ac22834 add line_count/2 built-in 2015-11-13 13:21:45 +00:00
Vítor Santos Costa 120d6ff19a add missing directory_files/2 2015-11-13 13:21:21 +00:00
Vítor Santos Costa bc54d4458a improve tracing over multi-arguments meatballs. 2015-11-13 13:20:29 +00:00
Vítor Santos Costa f17fae43e3 add read_line_to_string/2 2015-11-13 13:19:42 +00:00
Vitor Santos Costa bfc67e5e35 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2015-11-12 15:01:36 +00:00
Vitor Santos Costa 3437f9e04b configutaion fixes 2015-11-12 14:59:07 +00:00
Vítor Santos Costa 67c8253135 fix creeping with debugger after failing a static clause 2015-11-12 14:56:31 +00:00
Vítor Santos Costa 832599d220 system_predicate/1 was broken 2015-11-12 14:54:01 +00:00
Vítor Santos Costa e4f5264ded oops... 2015-11-12 14:53:31 +00:00
Vítor Santos Costa a91796e4c8 Follow actual syntax 2015-11-12 14:53:14 +00:00
Vítor Santos Costa 504268d5b3 GLOBAL -> *.h files 2015-11-11 17:15:14 +00:00
Vitor Santos Costa 51d0612f59 support yapor 2015-11-11 17:13:12 +00:00
Vítor Santos Costa 2b5f5c3d0a another useless message 2015-11-11 16:49:44 +00:00
Vítor Santos Costa f822bc8077 debugging message: not being used any longer 2015-11-11 16:47:25 +00:00
Vítor Santos Costa 85fe3399b4 match C and Prolog names 2015-11-11 16:46:30 +00:00
Vítor Santos Costa 2466db7ff5 skip/2 was using user_input 2015-11-11 08:45:03 +00:00
Vítor Santos Costa edd5c007c8 make sudoku work 2015-11-11 07:51:52 +00:00
Vítor Santos Costa 0b982a72fe fix broken padding 2015-11-11 07:50:12 +00:00
Vítor Santos Costa e4bcc5e8a2 use main to call all tests: 2015-11-10 14:22:13 +00:00
Vítor Santos Costa adf3ed0311 docs 2015-11-10 14:18:27 +00:00
Vítor Santos Costa 7468de4553 indenting 2015-11-10 14:16:10 +00:00
Vítor Santos Costa a3c09d66be docs 2015-11-10 14:13:56 +00:00
Vitor Santos Costa cddb8191c8 config changes 2015-11-09 18:22:43 +00:00
Vitor Santos Costa 3aeebed2cf postgres 2015-11-09 18:21:54 +00:00
Vitor Santos Costa af67ebf5da forget the past for now 2015-11-09 18:21:19 +00:00
Vitor Santos Costa e6b6e7c593 don't loop for ever, and utf8 2015-11-09 18:19:51 +00:00
Vitor Santos Costa 5314a47b14 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2015-11-09 11:38:33 +00:00
Vitor Santos Costa ef0673aa2b package support 2015-11-09 11:36:33 +00:00
Vítor Santos Costa 5035f4efe6 move horus to CL(BN) 2015-11-09 11:32:25 +00:00
Vítor Santos Costa 759ff81e39 absolute_file_name support. 2015-11-09 11:31:58 +00:00
Vítor Santos Costa 4b74421a36 policy and extra packages. 2015-11-09 11:30:40 +00:00
Vítor Santos Costa e400857810 absolute_file_name again 2015-11-09 11:30:21 +00:00
Vítor Santos Costa 9f3e3baf2b gap and C++ :( 2015-11-09 11:30:04 +00:00
Vítor Santos Costa 03c79a89ef support for absolut_file_name 2015-11-09 11:29:40 +00:00
Vítor Santos Costa 2d330f3bee user defined directives are multiple. 2015-11-09 11:29:09 +00:00
Vítor Santos Costa 6975c60645 support interface to minisat2. 2015-11-09 11:28:44 +00:00
Vítor Santos Costa 1d66c45fc2 more fixes to absolute_file_names and a new option, glob/1. 2015-11-09 11:27:46 +00:00
Vítor Santos Costa a8b51a1ada check full file path 2015-11-09 11:26:22 +00:00
Vítor Santos Costa ca81e5d8ea use unification, not wakeup, to verify if two terms are unifiable. Fixes Ulrich Neumerkel #306
Also renitent
2015-11-09 11:25:55 +00:00
Vítor Santos Costa 50c04116c8 moved from H 2015-11-06 18:22:31 +00:00
Vítor Santos Costa d66db4cf70 make fixes
- options to use WITH
- FIX RPATH ON MAC
- newer Find
- bdd exports to cplint
2015-11-05 23:51:35 +00:00
Vítor Santos Costa c450a712d0 typos 2015-11-05 23:47:28 +00:00
Vítor Santos Costa 5205921541 MYDDAS support 2015-11-05 23:45:48 +00:00
Vítor Santos Costa e9debf4d83 MYDDAS Support 2015-11-05 23:45:07 +00:00
Vítor Santos Costa f8b5ca8291 init and friends : cleanup 2015-11-05 19:33:38 +00:00
Vítor Santos Costa 44dc6f06d7 newer Find R module 2015-11-05 19:28:22 +00:00
Vítor Santos Costa aa2fb8f0c5 the photos for Debug IO 2015-11-05 19:27:57 +00:00
Vítor Santos Costa 5f58216315 init and new text size function 2015-11-05 19:27:34 +00:00
Vítor Santos Costa df273f549a prompt flag 2015-11-05 19:26:44 +00:00
Vítor Santos Costa c1ca214932 Actually use GMP 2015-11-05 19:26:22 +00:00
Vítor Santos Costa 5f76e105b1 Debug IO stuff 2015-11-05 19:25:54 +00:00
Vítor Santos Costa 4354083208 YAP_TextLllength and the init saga 2015-11-05 19:24:55 +00:00
Vítor Santos Costa e04dd14bed md5 support 2015-11-05 19:22:40 +00:00
Vítor Santos Costa 4cbeb6df39 oops.... 2015-11-05 17:27:20 +00:00
Vítor Santos Costa 4dfcdd4e87 current_predicate & abolish (Paulo Moura's tests) 2015-11-05 17:26:50 +00:00
Vítor Santos Costa e162ec9ef9 don't debug !(_) 2015-11-05 17:26:04 +00:00
Vítor Santos Costa 9ed0389186 file press used by Prolog 2015-11-05 17:25:09 +00:00
Vítor Santos Costa f9b19af0ea typo 2015-11-05 17:24:43 +00:00
Vítor Santos Costa 148a5f3acd avoid hiding without reason 2015-11-05 17:24:22 +00:00
Vítor Santos Costa 35bebd3a56 lots of annoying small bugs 2015-11-05 17:23:26 +00:00
Vítor Santos Costa b7f16997df non-traceable stuff. 2015-11-05 17:22:49 +00:00
Vítor Santos Costa e2cac6279c rebound 2015-11-05 17:22:17 +00:00
Vítor Santos Costa f8fc35a548 bug in module expansion 2015-11-05 17:21:48 +00:00
Vítor Santos Costa 9ffe2ddddc init handling 2015-11-05 17:21:19 +00:00
Vítor Santos Costa ed4b76ddc6 ?? 2015-11-05 17:20:25 +00:00
Vítor Santos Costa 27bfbdc1be improve prompt 2015-11-05 17:19:25 +00:00
Vítor Santos Costa 14250cfff6 rebound 2015-11-05 17:18:29 +00:00
Vítor Santos Costa 53927de579 char_type/2, or is it UNICODE? 2015-11-05 17:17:51 +00:00
Vítor Santos Costa b84262238d stupid bug: format would always use user_output 2015-11-05 17:16:55 +00:00
Vítor Santos Costa 83fdeab85f DebugIO + the big sys split 2015-11-05 17:16:10 +00:00
Vítor Santos Costa 99ee24ba69 the big sys split and make DebugIO more available 2015-11-05 17:15:32 +00:00
Vítor Santos Costa 5278affb0e Edinburgh IO, still useful. 2015-11-05 17:14:31 +00:00
Vítor Santos Costa 5db391b60a separate DB dependent from DB index. 2015-11-05 17:06:15 +00:00
Vítor Santos Costa b4f1a40b4b GMP vs C+++: I loose 2015-11-05 17:03:37 +00:00
Vítor Santos Costa 91d1cf2c52 annoying stuff 2015-11-05 16:59:56 +00:00
Vítor Santos Costa f8eb163a1d string to but and improve utf8 2015-11-05 16:59:30 +00:00
Vítor Santos Costa e4bfb263a0 md5 is in 2015-11-05 16:58:31 +00:00
Vítor Santos Costa bb5a506864 avoid USE_ 2015-11-05 16:58:04 +00:00
Vítor Santos Costa 7be5d1374a The big sys split was here 2015-11-05 16:57:24 +00:00
Vítor Santos Costa b323d17369 small fix 2015-11-05 16:56:59 +00:00
Vítor Santos Costa e9ed130ffd keep on improving syntax_error handler 2015-11-05 16:54:13 +00:00
Vítor Santos Costa ac48a263c4 fix $VAR 2015-11-05 16:53:11 +00:00
Vítor Santos Costa bd6ffb5d41 misc
make an extra flush at close, for luck
get rid of a p_
2015-11-05 16:52:22 +00:00
Vítor Santos Costa 77d57b90d4 expandVars through glob and wordexp 2015-11-05 16:47:52 +00:00
Vítor Santos Costa e3a56234e4 big sys split 2015-11-05 16:47:11 +00:00
Vítor Santos Costa ad56cc07df t->T 2015-11-05 16:41:39 +00:00
Vítor Santos Costa b701e571b0 fix conversion to be stricter, fix a looping bug 2015-11-05 16:40:25 +00:00
Vítor Santos Costa 8ac1e23450 free memory 2015-11-05 16:39:34 +00:00
Vítor Santos Costa 4224382be1 linting 2015-11-05 16:39:04 +00:00
Vítor Santos Costa a26dbe0dfc init spelling and remove debugging 2015-11-05 16:38:18 +00:00
Vítor Santos Costa 7034d7b307 init spelling 2015-11-05 16:36:55 +00:00
Vítor Santos Costa f758ac2fe4 misc
Allow string in $VAR
init spell
2015-11-05 16:35:25 +00:00
Vítor Santos Costa 67bb20cf0d init sellout 2015-11-05 16:32:34 +00:00
Vítor Santos Costa cc13181741 allow opening array with different size on top of other;
drop p_
take care with size < 0
2015-11-05 16:18:44 +00:00
Vítor Santos Costa cc632c08af caps 2015-11-05 16:15:35 +00:00
Vítor Santos Costa 4a200c3601 take your own MD5, use version in Python/SWI 2015-11-05 16:14:45 +00:00
Vítor Santos Costa 31246ccc0b init spelling 2015-11-05 16:13:47 +00:00
Vítor Santos Costa ffd2ef113b remove excessive care 2015-11-05 16:12:51 +00:00
Vítor Santos Costa 962130734e fix current_predicate
init spelling
2015-11-05 16:12:07 +00:00
Vítor Santos Costa 98e8bf63e0 remove debugging 2015-11-05 16:10:51 +00:00
Vítor Santos Costa 0fec4766e5 swap including and included. 2015-11-05 16:07:51 +00:00
Vítor Santos Costa 00245ff0fc fix bad replace; protect against undef red. 2015-11-05 16:00:54 +00:00
Vítor Santos Costa 9db87d1da4 atom versus atomic 2015-11-05 15:59:49 +00:00
Vítor Santos Costa 7fd6167c50 simple trick to do code sharing 2015-11-05 15:59:26 +00:00
Vítor Santos Costa 6cc1ed77ed the big split: break sysbits.c into 4 files; also, support glob 2015-11-05 15:47:36 +00:00
Vítor Santos Costa 9ce6ba5186 init tab/1 steam 2015-11-05 15:39:04 +00:00
Vítor Santos Costa b0f3cda2d7 Import MD5 support, Macs are weird 2015-11-05 15:38:39 +00:00
Vítor Santos Costa df26a7a84a gmp and C++, ugh 2015-11-05 15:35:03 +00:00
Vítor Santos Costa 3c4d6117e6 spelling 2015-11-05 15:34:30 +00:00
Vítor Santos Costa 1b2f2f0f93 avoid using Debug only constructs. 2015-11-05 15:32:57 +00:00
Vítor Santos Costa f133ff279e use same name for function and predicate. 2015-11-05 15:31:09 +00:00
Vítor Santos Costa bc8541666a init spelling 2015-11-05 15:28:39 +00:00
Vítor Santos Costa 691f02816d init spelling effort 2015-11-05 15:25:58 +00:00
Vítor Santos Costa 13aff4de32 init spelling effort 2015-11-05 15:25:12 +00:00
Vítor Santos Costa ddfed40e00 protect pointer 2015-11-05 15:24:27 +00:00
Vítor Santos Costa 8fcceb9957 Always know size limits 2015-11-05 15:24:03 +00:00
Vítor Santos Costa 9197b39393 init spell 2015-11-05 15:21:56 +00:00
Vítor Santos Costa 12dcbbc0f3 Fix error hanfler
bug location info
detail exit msg
fix error term construction.
2015-11-05 15:21:21 +00:00
Vítor Santos Costa b9369e1e7d handle user error in blob to file. 2015-11-05 15:14:11 +00:00
Vítor Santos Costa 4c0615bb54 init spelling 2015-11-05 15:12:29 +00:00
Vítor Santos Costa 72252ed817 various
init spelling
make style checker more like error handler.
ensure pointers are not null
2015-11-05 15:11:57 +00:00
Vítor Santos Costa e1dcdf0728 fix bug in big num to string 2015-11-05 15:09:54 +00:00
Vítor Santos Costa 6e9e383914 init spelling plus linter 2015-11-05 15:05:36 +00:00
Vítor Santos Costa b1ccb2e3ec Use z for initialisation 2015-11-05 15:04:12 +00:00
Vítor Santos Costa 036876299f first step on separating drivers from library 2015-10-28 09:30:36 +00:00
Vítor Santos Costa 48f5a824e0 use flags to control and float 2015-10-27 23:07:11 +00:00
Vítor Santos Costa 3f58566ac8 syntax errors 2015-10-27 23:05:21 +00:00
Vítor Santos Costa 4cb2e5c2fe Try to use USE for all options 2015-10-27 23:02:31 +00:00
Vítor Santos Costa 2047885bfa use flags to control and float 2015-10-27 22:58:06 +00:00
Vítor Santos Costa ce828f52c9 more changes to ignore 2015-10-22 12:10:20 +01:00
Vítor Santos Costa 64e6fd981f Use YAP blob_type internally 2015-10-22 12:03:19 +01:00
Vítor Santos Costa 9e0ce35d29 use YAP_blob type internally. 2015-10-22 12:02:53 +01:00
Vítor Santos Costa 759ce13bbf fix $VAR handling. 2015-10-22 12:01:54 +01:00
Vítor Santos Costa ad603a53ed add identical_member/2 2015-10-22 12:01:20 +01:00
Vítor Santos Costa f8836ec1b2 move char types to os 2015-10-22 12:00:27 +01:00
Vítor Santos Costa db8d44efdc recover deleted stuff 2015-10-22 11:58:59 +01:00
Vítor Santos Costa a9fa343bad don't expand meta-vars and don't expand expanded variables... 2015-10-22 11:58:29 +01:00
Vítor Santos Costa 9dd4a4a807 keep init goals in stack, to avoid collisions with other threads. 2015-10-22 11:57:46 +01:00
Vítor Santos Costa 442221604f ensure locks are library provided by default 2015-10-22 11:55:42 +01:00
Vítor Santos Costa b2b28a3dfe fix warnings 2015-10-22 11:55:09 +01:00
Vítor Santos Costa 37eae7b70a reset queue on close, so that it won;t be mistaken for an existing queue. 2015-10-22 11:53:21 +01:00
Vítor Santos Costa f1c9952c77 fixes for upcast and lowercase 2015-10-22 11:51:07 +01:00
Vítor Santos Costa aaa9aa2b7b more stuff to ignore 2015-10-22 11:50:15 +01:00
Vítor Santos Costa 2d1c11c42f fix Release and portability 2015-10-22 00:54:20 +01:00
Vítor Santos Costa 17e216c01b indenting 2015-10-22 00:53:26 +01:00
Vítor Santos Costa d70def0012 warning and other cleanups 2015-10-22 00:52:49 +01:00
Vítor Santos Costa 03850291c0 compilation warnings 2015-10-22 00:48:30 +01:00
Vítor Santos Costa 352ea085b7 configuration issues 2015-10-22 00:47:47 +01:00
Vítor Santos Costa 8cd22a0c18 strlcat 2015-10-22 00:45:47 +01:00
Vítor Santos Costa 42e2543ab7 generic fixes, mostly indentin 2015-10-22 00:45:21 +01:00
Vítor Santos Costa b2369175e5 mostly indenting 2015-10-22 00:41:52 +01:00
Vítor Santos Costa 3f2dbba042 avoid state in db 2015-10-22 00:40:13 +01:00
Vítor Santos Costa f1be0f94d0 restore prefix 2015-10-22 00:39:39 +01:00
Vítor Santos Costa 098be4aba0 remove chtypes 2015-10-22 00:39:10 +01:00
Vítor Santos Costa bcdfdeb65d fix pthread complaining 2015-10-22 00:33:38 +01:00
Vítor Santos Costa d6148eb8ad indenting 2015-10-22 00:25:11 +01:00
Vítor Santos Costa 7f8ebe18d0 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2015-10-20 08:14:31 +01:00
Vítor Santos Costa cc6949681b indenting 2015-10-20 08:13:09 +01:00
Vítor Santos Costa c26e5afaf0 fix bad arg order 2015-10-20 08:10:39 +01:00
Vitor Santos Costa 318b2e8df2 cmake: support older versions 2015-10-20 08:07:42 +01:00
Vitor Santos Costa 20c87f1ab6 gcc warnings 2015-10-20 08:06:46 +01:00
Vitor Santos Costa cba4fdfe95 remove host-specific code 2015-10-20 08:05:00 +01:00
Vitor Santos Costa e2363ca0d0 4.4 2015-10-20 08:03:42 +01:00
Vitor Santos Costa b95efeff90 char type support 2015-10-20 08:03:16 +01:00
Vitor Santos Costa 7a70280940 unused vars and gcc warnings 2015-10-20 08:01:20 +01:00
Vitor Santos Costa 885fc51225 move text stuff to YapText 2015-10-20 08:00:39 +01:00
Vitor Santos Costa 6a068a6e94 unused vars 2015-10-20 07:59:05 +01:00
Vitor Santos Costa b76be19b61 fix Darwin dep 2015-10-20 07:57:59 +01:00
Vitor Santos Costa aedc686ede avoid judi depeendencies 2015-10-20 07:56:07 +01:00
Vitor Santos Costa 2b5bddb690 module for charsio 2015-10-20 07:52:33 +01:00
Vitor Santos Costa d48772c24d move text stuff to YapText 2015-10-20 07:49:53 +01:00
Vitor Santos Costa b7c3cf5484 char_type/2 2015-10-20 07:46:52 +01:00
Vitor Santos Costa 438cd7dce5 fix config 2015-10-20 03:10:13 +01:00
Vitor Santos Costa 1d10b9c709 fix typo 2015-10-20 03:08:37 +01:00
Vitor Santos Costa 390e9e0557 Merge ssh://git.dcc.fc.up.pt/yap-6.3 2015-10-18 23:44:50 +01:00
Vitor Santos Costa 495fdca699 4.4 2015-10-18 23:44:32 +01:00
Vítor Santos Costa 468913e38c fix arithmetic exceptions 2015-10-18 12:28:02 +01:00
Vítor Santos Costa 98127b7102 error handling 2015-10-18 11:50:49 +01:00
Vítor Santos Costa d4dde8699d inline check stream 2015-10-18 11:49:18 +01:00
Vítor Santos Costa 1c727bbe45 scan numbers 2015-10-18 11:48:51 +01:00
Vítor Santos Costa 684e733c8b small fixes for compaibility 2015-10-18 11:48:14 +01:00
Vítor Santos Costa f4eee4782e more text fixes 2015-10-18 11:47:01 +01:00
Vítor Santos Costa 9fb7325f19 fix get_num init issues 2015-10-18 11:40:12 +01:00
Vítor Santos Costa 5762aa846c indenting, fix syntax erors 2015-10-18 11:39:25 +01:00
Vítor Santos Costa 8f7c43997e fix number_chars 2015-10-18 11:38:29 +01:00
Vitor Santos Costa 3c3eb0c398 Merge ssh://git.dcc.fc.up.pt/yap-6.3 2015-10-13 09:28:42 +01:00
Vitor Santos Costa 9c21463133 support older cmakes 2015-10-13 09:28:25 +01:00
Vítor Santos Costa 72c34cdb8f dropped packages 2015-10-13 09:27:43 +01:00
Vítor Santos Costa c4aae66f3e submods work 2015-10-13 09:10:53 +01:00
Vítor Santos Costa 1a5ba98950 stop using submodule 2015-10-13 08:25:49 +01:00
Vítor Santos Costa 25c3010de6 stop using submodule 2015-10-13 08:24:56 +01:00
Vítor Santos Costa 9b33c9d8ba stop using submodule 2015-10-13 08:17:51 +01:00
Vítor Santos Costa d47f59be09 remove session 2015-10-13 02:21:30 +01:00
Vítor Santos Costa b6130b0e7d long range errors and other fixes 2015-10-13 02:21:10 +01:00
Vítor Santos Costa ec1e35192f user handling of messages 2015-10-13 02:19:21 +01:00
Vítor Santos Costa 3368c84696 strings are atomic! 2015-10-13 02:15:32 +01:00
Vítor Santos Costa 30be57ed71 remove session 2015-10-13 02:14:45 +01:00
Vítor Santos Costa 66020422a8 remove real submodule 2015-10-13 02:08:30 +01:00
Vítor Santos Costa f56c80675b fix more pesky bugs in text to text conversion 2015-10-13 01:59:50 +01:00
Vítor Santos Costa 8dcae6ca47 restore to original code just in case. 2015-10-13 01:58:23 +01:00
Vítor Santos Costa 1408237215 publish peek 2015-10-11 04:23:16 +01:00
Vítor Santos Costa aaca416b93 just peek after a '.' 2015-10-11 04:20:57 +01:00
Vítor Santos Costa 68c29b3ab0 no need to change emv 2015-10-11 04:20:36 +01:00
Vítor Santos Costa ddbba89d16 fix repeat as last goal
- ensure allocate.
2015-10-11 04:19:33 +01:00
Vítor Santos Costa 9595bb4e6e warning 2015-10-09 19:06:07 +01:00
Vítor Santos Costa a66f5f0531 fix warning 2015-10-09 19:05:36 +01:00
Vítor Santos Costa f10a329f9f fix waening 2015-10-09 10:32:07 +01:00
Vítor Santos Costa 66372f256a fix typo 2015-10-09 10:31:52 +01:00
Vítor Santos Costa 1f3b2509f1 avoid warning 2015-10-09 10:31:26 +01:00
Vítor Santos Costa bc2dabbca5 fix slot leaks
also moe errot gandking
2015-10-09 10:31:07 +01:00
Vítor Santos Costa d5c21324a4 small typos 2015-10-09 10:27:48 +01:00
Vítor Santos Costa b654c8fe00 numbervars: support negative indices 2015-10-08 13:29:47 +01:00
Vítor Santos Costa fa738894a4 split ttys from other cases
also, get_wchar should be static
2015-10-08 11:28:28 +01:00
Vítor Santos Costa d94ffe2126 utf8 support 2015-10-08 10:21:09 +01:00
Vítor Santos Costa 1bbb761aec indent 2015-10-08 10:19:57 +01:00
Vítor Santos Costa 699dcfe6eb fix deadlock 2015-10-08 10:19:17 +01:00
Vítor Santos Costa 555d146dc5 clean_tok should reset ASP properly 2015-10-08 10:18:47 +01:00
Vítor Santos Costa e1f7333e2e bad call order in dopeek 2015-10-08 10:17:57 +01:00
Vítor Santos Costa 6169bbb3ad avoid confusing with term 2015-10-08 10:16:42 +01:00
Vítor Santos Costa d88c6199c2 docs 2015-10-08 10:16:10 +01:00
Vítor Santos Costa b3cc23ce64 IO patches
simplify error handling
use get and inject
use wide support in OS
be stricter in checkin streams and arguments
2015-10-08 02:23:45 +01:00
Vítor Santos Costa b788dc131d encoding 2015-10-08 02:14:34 +01:00
Vítor Santos Costa 4e60e9b0f9 encoding 2015-10-08 02:13:20 +01:00
Vítor Santos Costa d1c4db3c4b be careful about error mode 2015-10-08 02:12:56 +01:00
Vítor Santos Costa e8ed525e3b we usually are not sure how best to pass encoding: pass by ref 2015-10-08 02:12:06 +01:00
Vítor Santos Costa 3192e094af error handling 2015-10-08 02:11:10 +01:00
Vítor Santos Costa 5bf02425d2 shuffle 2015-10-05 10:41:14 +01:00
Vítor Santos Costa 6ec543c5f6 optimiser should never crash 2015-10-05 10:40:58 +01:00
Vítor Santos Costa 91c366d0d1 keep on cleaning 2015-10-05 10:40:30 +01:00
Vítor Santos Costa 0985a10078 remove debugging messsage 2015-10-05 10:40:02 +01:00
Vítor Santos Costa 59f6e89def make new framework more flexible. 2015-10-05 10:38:54 +01:00
Vítor Santos Costa 5ed065f92d separated from debug.yap 2015-10-05 10:38:20 +01:00
Vítor Santos Costa c1b977b901 make sure we release streams lock!! 2015-10-05 10:37:23 +01:00
Vítor Santos Costa 4d132d278c fix confused predicate term_to_string/2. 2015-10-05 10:36:43 +01:00
Vítor Santos Costa 4cbf3387e1 PLIOError should return file number, where 2015-10-05 10:34:32 +01:00
Vítor Santos Costa 166d4892f9 mostly indenting 2015-10-05 10:33:52 +01:00
Vítor Santos Costa e5fc818c37 encoding detection 2015-10-05 10:32:56 +01:00
Vítor Santos Costa 263fdf330d fix bad substitute 2015-10-05 10:32:31 +01:00
Vítor Santos Costa e9e34e086f sys/syscalls and gettid 2015-10-05 10:31:51 +01:00
Vítor Santos Costa 9075eb84d2 sys/syscalls and gettid 2015-10-05 10:31:13 +01:00
Vítor Santos Costa 784a058b04 me streams are now OS streams. 2015-10-05 10:30:47 +01:00
Vítor Santos Costa 9a962805ca fix gettid on MacOS 2015-10-05 10:30:17 +01:00
Vítor Santos Costa 544eeea97f unused declaration 2015-10-05 10:29:53 +01:00
Vítor Santos Costa c56276233a remove unused function 2015-10-05 10:29:23 +01:00
Vítor Santos Costa 7885433ab5 mostly indenting 2015-10-05 10:29:07 +01:00
Vítor Santos Costa a95b3e4fcd mostly indenting 2015-10-05 10:28:49 +01:00
Vítor Santos Costa 4ed6e4fae9 indent 2015-10-05 10:27:25 +01:00
Vítor Santos Costa c8ea14057c cleanup 2015-09-30 00:09:42 +01:00
Vítor Santos Costa 1ef7eeabdf fix files dragged in 2015-09-30 00:02:59 +01:00
Vítor Santos Costa f81f31a5f7 fix bad global replacement 2015-09-29 23:51:09 +01:00
Vítor Santos Costa e8bf2d4349 improve error handling 2015-09-29 23:49:03 +01:00
Vítor Santos Costa c61e721e73 cut the big file 2015-09-29 23:47:52 +01:00
Vítor Santos Costa 9326b2ea62 locking and other small fixes 2015-09-29 23:44:11 +01:00
Vítor Santos Costa 34fe3e6ded Error Handler 2015-09-29 23:43:02 +01:00
Vítor Santos Costa 4c368a59d3 error handling 2015-09-29 23:28:55 +01:00
Vítor Santos Costa db2cf949b4 oops
Signed-off-by: Vítor Santos Costa <vsc@dcc.fc.up.pt>
2015-09-29 23:24:33 +01:00
Vítor Santos Costa 7347edd5e0 first cut at detecting error source 2015-09-29 23:13:05 +01:00
Vítor Santos Costa a613f5428e small bugs 2015-09-29 23:11:57 +01:00
Vítor Santos Costa 58f34f7a5f first cut at detecting error source 2015-09-29 23:11:00 +01:00
Vítor Santos Costa cd7d654cca first cut at detecting error source 2015-09-29 23:09:12 +01:00
Vítor Santos Costa b3a262910f first cut at detecting error source 2015-09-29 23:08:10 +01:00
Vítor Santos Costa 04a2c10ebe support loop_stream while at initial boot (doesn't really do work so far) 2015-09-29 23:06:49 +01:00
Vítor Santos Costa 5c05b3be45 name(X,Y) is unbound 2015-09-29 23:05:33 +01:00
Vítor Santos Costa 059e38d8f0 call_w_fail should know the current P. 2015-09-29 23:05:04 +01:00
Vítor Santos Costa 2ac59d36aa Error handling: make PP or P available 2015-09-29 23:04:01 +01:00
Vítor Santos Costa 8208a181d3 thread support 2015-09-29 23:01:19 +01:00
Vítor Santos Costa fa586f8769 error handling woes 2015-09-25 14:31:58 +01:00
Vítor Santos Costa b871f6676e fix error handling 2015-09-25 10:57:26 +01:00
Vítor Santos Costa 4336b2ba88 Avoid complaining from strlen
`
2015-09-21 17:05:36 -05:00
Vítor Santos Costa 880a9989c3 small changes 2015-08-18 15:08:52 -05:00
Vítor Santos Costa f41a8c19ef better search for predicate location 2015-08-18 15:06:36 -05:00
Vítor Santos Costa 08733b815c move most everything to messages.yap 2015-08-18 15:05:43 -05:00
Vítor Santos Costa 72776e3b14 swig handling 2015-08-18 15:05:07 -05:00
Vítor Santos Costa 4cd70e68ce imrove python support
make syntax as Python-like as possible
get close to real.
2015-08-18 15:03:21 -05:00
Vítor Santos Costa 59f038386b syntax_eror support 2015-08-18 14:59:24 -05:00
Vítor Santos Costa b47ffd2f64 atom Term stuff 2015-08-18 14:57:53 -05:00
Vítor Santos Costa 338a4bb733 consistency changes 2015-08-18 14:56:54 -05:00
Vítor Santos Costa 80036958a1 atom term 2015-08-18 14:55:58 -05:00
Vítor Santos Costa c33a345429 pretty stuff 2015-08-18 14:55:34 -05:00
Vítor Santos Costa c97cd1fcae Rewrite message handling to be structured and less of a mess 2015-08-18 14:53:05 -05:00
Vítor Santos Costa 8cc38c3377 debugging support 2015-08-18 14:51:32 -05:00
Vítor Santos Costa 668f5f1503 support for multiple and discontiguous 2015-08-18 14:51:06 -05:00
Vítor Santos Costa 4ccb8cf210 more atom as terms stuff 2015-08-18 14:50:27 -05:00
Vítor Santos Costa 89b0279ca6 add TokRep to supper syntax error handling
improve handle management.
2015-08-18 14:47:01 -05:00
Vítor Santos Costa bb68d19d39 remove automatically generated atom terms 2015-08-18 14:38:36 -05:00
Vítor Santos Costa ca25eaa450 Improve error handling: calls to gc and syntax error management 2015-08-18 14:37:39 -05:00
Vítor Santos Costa 7c0ce9ee7e Generate automatically TermAtom from AtomAtom, and remove th ones
created manually.
2015-08-18 14:36:10 -05:00
Vítor Santos Costa b7a1e464ef add warning of discontiguous and multiple file predicates 2015-08-18 14:32:24 -05:00
Vítor Santos Costa 4e76d86083 AtomPtr -> AtomPointer 2015-08-18 14:30:25 -05:00
Vítor Santos Costa 2266bb9826 fix access to null pointer. 2015-08-18 14:30:00 -05:00
Vítor Santos Costa 56a3fc5651 project name 2015-08-08 09:11:29 -05:00
Vítor Santos Costa 6274a0662e fix regression tests 2015-08-07 16:58:20 -05:00
Vítor Santos Costa b164f53191 fix regression tests 2015-08-07 16:57:53 -05:00
Vítor Santos Costa dbdae6a930 syntax error handling 2015-07-27 22:22:44 -05:00
Vítor Santos Costa 36058116f5 missing files 2015-07-24 21:52:51 -05:00
Vítor Santos Costa 3761252735 missing files 2015-07-24 21:52:03 -05:00
Vítor Santos Costa 0ea8fb8d34 missing files 2015-07-24 21:49:56 -05:00
Vítor Santos Costa 3f55904bfe missing files 2015-07-24 21:35:02 -05:00
Vítor Santos Costa d4f49a20ba missing files 2015-07-24 21:28:04 -05:00
Vítor Santos Costa f3b84af062 bunch of fixes for YAP's own IO 2015-07-22 19:33:30 -05:00
Vítor Santos Costa 91d6faabc1 new atoms ] 2015-07-22 19:32:12 -05:00
Vítor Santos Costa 78ed4c9e5e debugging stuff 2015-07-22 19:31:03 -05:00
Vítor Santos Costa 019ca45bdb prettying 2015-07-22 19:27:29 -05:00
Vítor Santos Costa 0e1335d7ff make $ SY from very beginning 2015-07-22 19:26:40 -05:00
Vítor Santos Costa 6d507ff49f BEW CONSTANTS. 2015-07-22 19:19:35 -05:00
Vítor Santos Costa 01a720389e fix stack swap 2015-07-22 19:15:08 -05:00
Vítor Santos Costa 6ae0c450b3 export getval to C-code. 2015-07-22 19:12:32 -05:00
Vítor Santos Costa 99948c5acc fox tracing/ 2015-07-22 19:05:06 -05:00
Vítor Santos Costa 69344f26d1 fixes to warning and complicated cases where warnings are called insidewarning 2015-07-22 19:04:22 -05:00
Vítor Santos Costa 1c6a138ce2 let the compiler say what was the actual error. 2015-07-22 19:02:41 -05:00
Vítor Santos Costa 8dec7f6478 initialize YAAM regs earl on. 2015-07-22 19:01:15 -05:00
Vítor Santos Costa 520ce938fd SWI-style blobs 2015-07-22 19:00:28 -05:00
Vítor Santos Costa 2a20217c46 drop unnecessary cast 2015-07-22 18:59:57 -05:00
Vítor Santos Costa 98d7b2d7f8 avoi ugly unsigned char * 2015-07-22 18:59:07 -05:00
Vítor Santos Costa 78ef33c463 Debugger should lays trace callee, never caller. 2015-07-22 18:58:23 -05:00
Vítor Santos Costa e1597dd022 missing 2015-07-06 15:04:50 +01:00
Vítor Santos Costa 4eaf848e87 missing 2015-07-06 14:54:23 +01:00
Vítor Santos Costa a902b9bc79 extras under initial dev 2015-07-06 13:44:13 +01:00
Vítor Santos Costa 1d6f9981e1 mkdir and small stuff 2015-07-06 12:04:42 +01:00
Vítor Santos Costa 33de6766a5 bootstrap 2015-07-06 12:03:16 +01:00
Vítor Santos Costa 705a6e9b7f cleanups 2015-07-06 12:01:55 +01:00
Vítor Santos Costa 03d9fdd45a cleanups 2015-07-06 12:00:21 +01:00
Vítor Santos Costa 94092be293 bootstrap and small cleanups 2015-07-06 11:59:50 +01:00
Vítor Santos Costa 84afde2d56 deadlock avoidal; function renaming 2015-07-06 11:57:47 +01:00
Vítor Santos Costa a97754623f more bootstrap stuff 2015-07-06 11:56:16 +01:00
Vítor Santos Costa 9a638d1312 experiment 2015-07-06 11:55:02 +01:00
Vítor Santos Costa 421dee6881 register init (again) 2015-07-06 11:54:33 +01:00
Vítor Santos Costa 2cf9902dfe module specific flags 2015-07-06 11:53:50 +01:00
Vítor Santos Costa 3a00568489 warnings + some work on naming funnctions 2015-07-06 11:51:24 +01:00
Vítor Santos Costa 4c56769210 indent + EOF work in progress 2015-07-06 11:49:56 +01:00
Vítor Santos Costa f5b50a4179 fix locks 2015-06-19 10:10:02 +01:00
Vítor Santos Costa 1c06bfdc05 cmake & text support 2015-06-19 01:30:13 +01:00
Vítor Santos Costa 59de30d606 cmake & text support 2015-06-19 01:29:28 +01:00
Vítor Santos Costa 84b5fcce77 cmake & text support 2015-06-19 01:29:16 +01:00
Vítor Santos Costa edbd2654e8 cmake & files 2015-06-19 01:25:12 +01:00
Vítor Santos Costa 5f71b15c03 cmake 2 2015-06-19 01:23:51 +01:00
Vítor Santos Costa de3a6c5637 cmake 2015-06-19 01:22:23 +01:00
Vítor Santos Costa 9ad02e3f9a cmake 2015-06-19 01:22:12 +01:00
Vítor Santos Costa 1b8cd91618 cudd integration 2015-06-19 01:20:49 +01:00
Vítor Santos Costa 63c2fa3c6b warning, postgres 2015-06-19 01:19:48 +01:00
Vítor Santos Costa 8f90705e26 support 3.6 2015-06-19 01:17:07 +01:00
Vítor Santos Costa 497cc27003 git versioning 2015-06-19 01:14:28 +01:00
Vítor Santos Costa 0552edce2c SWI i/O lib 2015-06-19 01:13:46 +01:00
Vítor Santos Costa 0889596e8b flags etc 2015-06-19 01:12:05 +01:00
Vítor Santos Costa b93f10fe07 flags, etc 2015-06-19 01:11:30 +01:00
Vítor Santos Costa c3487d0fc0 tracking + flags 2015-06-19 01:09:54 +01:00
Vítor Santos Costa e8e33e405a join cud packages 2015-06-19 01:00:18 +01:00
Vítor Santos Costa 5746edafaf new atoms, terms and slight functionality 2015-06-19 00:56:24 +01:00
Vítor Santos Costa 3b42554a68 new callers 2015-06-19 00:53:43 +01:00
Vítor Santos Costa 0b68aea31e all kinds of stuff 2015-06-19 00:53:09 +01:00
Vítor Santos Costa 720f9e5242 threads 2015-06-19 00:52:33 +01:00
Vítor Santos Costa e77b9bd32d Some new functions 2015-06-19 00:52:03 +01:00
Vítor Santos Costa aef6cf35d6 more string support 2015-06-19 00:51:17 +01:00
Vítor Santos Costa 17049ce8ec flags support 2015-06-19 00:50:41 +01:00
Vítor Santos Costa e2fc835cfd less usage of slots 2015-06-19 00:45:54 +01:00
Vítor Santos Costa 3e14ec4cb6 yap flag no more 2015-06-19 00:44:49 +01:00
Vítor Santos Costa 2f96a24a1f SWI not default 2015-06-19 00:42:40 +01:00
Vítor Santos Costa 95a47702be threads 2015-06-19 00:42:15 +01:00
Vítor Santos Costa c0bb14416b use unistd 2015-06-19 00:41:29 +01:00
Vítor Santos Costa 86b11f5536 break now yap code 2015-06-19 00:41:12 +01:00
Vítor Santos Costa 1471d27d12 stderr stuff 2015-06-19 00:40:48 +01:00
Vítor Santos Costa 209ad287f8 SWI not automatic 2015-06-19 00:38:18 +01:00
Vítor Santos Costa d18c59f7eb argc/argv -> flags 2015-06-19 00:37:50 +01:00
Vítor Santos Costa 6bc1833d2f more yap_flags 2015-06-19 00:37:09 +01:00
Vítor Santos Costa c46345a0f0 remove original yap_lag/2 2015-06-19 00:35:42 +01:00
Vítor Santos Costa d602d3d9ea remove p_ 2015-06-19 00:34:33 +01:00
Vítor Santos Costa e60f1f2c3d IOSTREAM -> FiLE 2015-06-19 00:34:14 +01:00
Vítor Santos Costa 42b79d7ee7 IOSTREAM -> FILE 2015-06-19 00:32:38 +01:00
Vítor Santos Costa 144eb6ab47 small interf change 2015-06-19 00:31:44 +01:00
Vítor Santos Costa 29f87ccca6 interface changes
also support read_term extensions
2015-06-19 00:30:39 +01:00
Vítor Santos Costa b13f742f02 bag of changes
- spacing
- exception handling should be seen carefully.
2015-06-19 00:29:14 +01:00
Vítor Santos Costa 524a9ec738 LOCAL_c_error_stream Prolog only 2015-06-19 00:18:00 +01:00
Vítor Santos Costa df52ba811a check for null 2015-06-19 00:17:25 +01:00
Vítor Santos Costa 91d29112b0 flagsagain 2015-06-19 00:16:32 +01:00
Vítor Santos Costa e970df6dae compile with threads stuff 2015-06-19 00:15:39 +01:00
Vítor Santos Costa 315a882e8f remove swi deps 2015-06-18 08:09:31 +01:00
Vítor Santos Costa fec94d9cde get rid of GLOBAL_stderr 2015-06-18 08:00:48 +01:00
Vítor Santos Costa d7d2e320a8 fix stack expansion with slots 2015-06-18 07:59:53 +01:00
Vítor Santos Costa 6812940b8b doc support 2015-06-18 07:57:16 +01:00
Vítor Santos Costa 51564ec7bc removw swi deps 2015-06-18 07:56:35 +01:00
Vítor Santos Costa 429ebe5b27 doc fix 2015-06-18 07:56:16 +01:00
Vítor Santos Costa 2370a39b09 libyap source files 2015-06-18 07:55:39 +01:00
Vítor Santos Costa 60861649a0 New Flags code 2015-06-18 07:55:07 +01:00
Vítor Santos Costa 8fc4dc2219 new flag system 2015-06-18 01:59:07 +01:00
Vítor Santos Costa c755a6d4e5 configuration for os interface layer 2015-06-18 01:48:44 +01:00
Vítor Santos Costa c652f79f26 old swi library: replace by original yap code 2015-06-18 01:47:23 +01:00
Vítor Santos Costa eabf145052 write and write_term 2015-06-18 01:40:15 +01:00
Vítor Santos Costa 4f8b6929b9 g;ue 2015-06-18 01:39:03 +01:00
Vítor Santos Costa ef75c89c51 generic console 2015-06-18 01:35:39 +01:00
Vítor Santos Costa 8fb4f2a146 unicode 2015-06-18 01:34:39 +01:00
Vítor Santos Costa a9abd9ea6a char_type 2015-06-18 01:34:23 +01:00
Vítor Santos Costa b4e0cabb77 file and dir support 2015-06-18 01:33:55 +01:00
Vítor Santos Costa a721aa5a3c format/2 2015-06-18 01:33:21 +01:00
Vítor Santos Costa f4e4220130 in-memory streams 2015-06-18 01:32:33 +01:00
Vítor Santos Costa 3c0987ef55 piping support] 2015-06-18 01:31:02 +01:00
Vítor Santos Costa d5e85663d9 sockets i/o 2015-06-18 01:24:14 +01:00
Vítor Santos Costa 3d6a8ddc77 read lines and files 2015-06-18 01:21:20 +01:00
Vítor Santos Costa 1b975a7a78 read_term/3 2015-06-18 01:20:05 +01:00
Vítor Santos Costa aa29b88e70 swi utf-8 2015-06-18 01:18:24 +01:00
Vítor Santos Costa 14330244df unicode 2015-06-18 01:15:50 +01:00
Vítor Santos Costa 204f81876a not well supported in YAP 2015-06-18 01:02:06 +01:00
Vítor Santos Costa 9c1a3cc3b1 support for get and put 2015-06-18 00:59:10 +01:00
Vítor Santos Costa bd572cbb59 taken from iopreds.c: alias handling 2015-06-18 00:58:51 +01:00
Vítor Santos Costa 8ec89c5bef more cmake functionality 2015-06-18 00:55:12 +01:00
Vítor Santos Costa b2e102faa9 overlap 2015-06-18 00:54:17 +01:00
Vítor Santos Costa cd41137cbc just tests (including a few new ones) 2015-06-18 00:53:58 +01:00
Vítor Santos Costa 47c3f64eae Inp/Out changes, blobs 2015-06-18 00:52:31 +01:00
Vítor Santos Costa e535e16ae3 C-Interface should call new flags 2015-06-18 00:29:31 +01:00
Vítor Santos Costa 5829e326b7 Remove Old array based flags 2015-06-18 00:28:06 +01:00
Vítor Santos Costa e9a8e93474 DO not depend on SWI module 2015-06-18 00:25:39 +01:00
Vítor Santos Costa afa8d52e50 make sure too refer to dlfcn.h 2015-06-18 00:24:47 +01:00
Vítor Santos Costa 30af67b3ca do not use internal slots 2015-06-18 00:22:32 +01:00
Vítor Santos Costa 0e002f8ca0 improve error messages 2015-06-18 00:19:23 +01:00
Vítor Santos Costa adb8ff064d use new YAP flags 2015-06-18 00:18:28 +01:00
Vítor Santos Costa ff9051349b support for handling lists of arguments 2015-06-18 00:16:07 +01:00
Vítor Santos Costa d474437edc do not need to restore HashPreds 2015-06-18 00:14:59 +01:00
Vítor Santos Costa 7fda0bf07f Do not use SWI internal stuff directly 2015-06-18 00:12:59 +01:00
Vítor Santos Costa 254e63fc8c new flag design 2015-06-18 00:12:25 +01:00
Vítor Santos Costa 4e09c0faf1 more flag and simplification stuff 2015-06-18 00:11:02 +01:00
Vítor Santos Costa e989419605 Use new YAP flags 2015-06-18 00:05:49 +01:00
Vítor Santos Costa 6815d4b878 I/O update, small change 2015-06-17 23:54:54 +01:00
Vítor Santos Costa 52c8b478e5 lots of stuff we don't want to commit 2015-06-17 23:54:17 +01:00
Vítor Santos Costa 48ed9083d9 remove LOCAL_PL dependency 2015-06-17 23:53:45 +01:00
Vítor Santos Costa 102015785a fix call to module code 2015-06-17 23:53:13 +01:00
Vítor Santos Costa c26b5f3175 increase the ignore list 2015-06-17 23:49:02 +01:00
Vítor Santos Costa 4132854fbe avoid tagging unnecessary files 2015-06-17 23:48:25 +01:00
Vítor Santos Costa d8fa0ac8f6 small changes with new flag system. 2015-05-15 00:36:16 +01:00
Vítor Santos Costa 0ed3ee4fc4 enable path expansion by default 2015-04-24 10:03:44 -06:00
Vítor Santos Costa d5ce9a1376 last patch had broken include.
fix multiple initializations.
get rid of debugging messages.
2015-04-22 14:21:20 -06:00
Vítor Santos Costa 18fee4eee1 fix exec and wait;
support OpenSSL's md5.
2015-04-22 14:19:14 -06:00
Vítor Santos Costa db6074f839 cmake work 2015-04-21 16:12:39 -06:00
Vítor Santos Costa 3b4226bda1 cmake work 2015-04-21 16:12:18 -06:00
Vítor Santos Costa e043e7595e minor incompats 2015-04-21 16:12:01 -06:00
Vítor Santos Costa 742c299672 avoid using space on statistics 2015-04-21 16:11:00 -06:00
Vítor Santos Costa 660800af67 avoid using space on statistics 2015-04-21 16:09:43 -06:00
Vítor Santos Costa 94e2d3cf22 Ensure module files are seen as a singe instance, even if called from different modules 2015-04-21 16:08:58 -06:00
Vítor Santos Costa 9b0c606de3 fix atomic_list_concat/3 in splt mode 2015-04-21 16:07:16 -06:00
Vítor Santos Costa d1ec94c4c0 trying to fix current_predicate 2015-04-21 16:06:24 -06:00
Vítor Santos Costa e963c59649 fix ProbLog path issues 2015-04-21 09:25:12 -06:00
Vítor Santos Costa 76cd423784 cmake support for bdd package 2015-04-20 01:21:19 +01:00
Vítor Santos Costa e710319c0e Merge branch 'master' of github.com:vscosta/yap-6.3 2015-04-19 04:13:39 +01:00
Vítor Santos Costa 4489616b19 fix current_pred 2015-04-19 04:13:12 +01:00
Vitor Santos Costa 81909565bc debugging msh 2015-04-15 17:02:02 +01:00
Vítor Santos Costa 9fca32c7ac Merge branch 'master' of github.com:vscosta/yap-6.3 2015-04-15 15:10:14 +01:00
Vítor Santos Costa bfc5b4e3b1 disable wordexp 2015-04-15 15:07:04 +01:00
Vitor Santos Costa 800289f7bb weird module stuff 2015-04-15 11:45:49 +01:00
Vítor Santos Costa b97fa48cd2 typo 2015-04-15 11:24:24 +01:00
Vítor Santos Costa bf8beba466 more Android fixes
merge trueFileName so that we don;t redo code
support rand48 and srand48
drop support for odbc and prolite, too much work.
2015-04-15 11:21:15 +01:00
Vítor Santos Costa b14dc43bc9 initial module is user 2015-04-13 23:46:14 +01:00
Vítor Santos Costa 3c73a2e6d6 debugging msg 2015-04-13 13:35:37 +01:00
Vítor Santos Costa ecd980c491 thread support 2015-04-13 13:32:32 +01:00
Vítor Santos Costa ec7ddf0dba Merge branch 'master' of github.com:vscosta/yap-6.3 2015-04-13 13:28:42 +01:00
Vítor Santos Costa ef586e264e android debugging plus clean-ups 2015-04-13 13:28:17 +01:00
Vítor Santos Costa d1a230eb56 Cosmetic changes 2015-04-13 13:15:30 +01:00
Vítor Santos Costa 00c58f5572 Cosmetic changes 2015-04-13 13:14:36 +01:00
Paulo Moura b91c535ea3 Work in progress fixing evaluable type error terms 2015-04-09 01:51:36 +01:00
Vitor Santos Costa 756a79995b cpp 2015-03-28 21:55:29 +00:00
Vitor Santos Costa cd45c04514 improve mkandroid 2015-03-28 20:13:52 +00:00
Vitor Santos Costa 206d6cebcf autoloading is an import, like any other 2015-03-28 20:13:28 +00:00
Vitor Santos Costa a8b51d80ab New files, Android stuff 2015-03-28 20:13:10 +00:00
Vitor Santos Costa b3c0708240 new files 2015-03-28 20:08:33 +00:00
Vitor Santos Costa bd829946ed autoloading is an import, like any other 2015-03-28 19:42:10 +00:00
Vitor Santos Costa d6e648a7ff do not use SWI path handling code: YAP should not try to control cwd, that's the OS task 2015-03-28 19:41:12 +00:00
Vitor Santos Costa 9709c590bf YAP should not try to control cwd, that's the OS task 2015-03-28 19:38:54 +00:00
Vitor Santos Costa 666b68c1fb YAP should not try to control cwd, that's the OS task 2015-03-28 19:38:04 +00:00
Vitor Santos Costa 6c9c410283 get rid of findExecutable 2015-03-28 19:36:28 +00:00
Vítor Santos Costa c7f700627d disable BOM on ttys 2015-03-24 09:38:52 +00:00
Vítor Santos Costa 5f7101a9e3 fix parameters for open 2015-03-24 09:38:02 +00:00
Vítor Santos Costa 5d27ad0243 small stuff 2015-03-23 16:17:24 +00:00
Vítor Santos Costa 16c8d54f0e more debugging fixes 2015-03-23 16:16:48 +00:00
Vítor Santos Costa 4eeacd8b7b compile myddas interface to sqlite 2015-03-23 07:27:10 +00:00
Vítor Santos Costa c9aa53350a remove debugging method 2015-03-23 07:26:03 +00:00
Vítor Santos Costa 5150dcae3d file_select 2015-03-20 12:50:06 +00:00
Vítor Santos Costa 2b2e21ae64 handle redirection in debugging 2015-03-17 23:09:33 +00:00
Vítor Santos Costa 272d28ae5f android 2015-03-16 17:25:09 +00:00
Vítor Santos Costa 55bd75b8d8 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3
Conflicts:
	library/parameters.yap
	packages/myddas/pl/myddas.ypp
2015-03-11 22:31:18 +00:00
Vítor Santos Costa 7cceb655b3 protect against crashes in bad user code 2015-03-11 22:23:31 +00:00
Vítor Santos Costa 04ff7f3f2d fix warning 2015-03-11 22:22:27 +00:00
Vítor Santos Costa 82d4716339 better compat with bdds 2015-03-11 22:21:48 +00:00
Vitor Santos Costa 6a0b6fad8b C++ interface and ARM/Android 2015-03-11 22:18:00 +00:00
Vitor Santos Costa 580bc9eb27 fix baacktrackable predicates. 2015-03-09 17:27:35 +00:00
Vitor Santos Costa 252a2b7868 bdd stuff 2015-03-08 02:15:53 +00:00
Vítor Santos Costa 26b3cb5bb7 use 4.4 for android 2015-03-04 10:03:25 +00:00
Vítor Santos Costa a40c205d5f New files 2015-03-04 10:02:25 +00:00
Vítor Santos Costa 0f2d1e8429 improve notion of standadard predicate 2015-03-04 10:01:33 +00:00
Vítor Santos Costa 65c97e7072 postgres 2015-03-04 09:59:42 +00:00
Vítor Santos Costa 5b19e9546a fix foreach 2015-03-04 09:59:05 +00:00
Vítor Santos Costa 9b6bcdde16 improve notion of standadard predicate 2015-03-04 09:54:08 +00:00
Vítor Santos Costa 5ea3fcd08f men at work 2015-03-04 09:52:34 +00:00
Vítor Santos Costa 48c87bd775 support fpr conj etc 2015-03-04 09:52:06 +00:00
Vítor Santos Costa 4386c42d02 improve cudd with bdd printing -> nodes, and true=1 false=0 2015-03-04 09:50:15 +00:00
Vítor Santos Costa 3d9006db32 make var names available as a global var 2015-03-04 09:47:50 +00:00
Vítor Santos Costa 8ea17007f0 make var names available as a global var 2015-03-04 09:46:55 +00:00
Vítor Santos Costa dbfe42b360 clib and uuid support 2015-03-04 09:45:04 +00:00
Vítor Santos Costa da83ad447c make var names available as a global var 2015-03-04 09:44:26 +00:00
Vítor Santos Costa a9acacd1c5 android stopped working. 2015-03-04 09:43:37 +00:00
Vítor Santos Costa 8a4257d80a make var names available as a global var 2015-03-04 09:40:21 +00:00
Vítor Santos Costa 0839baf638 error handling should report the culprit . 2015-03-04 09:35:47 +00:00
Vítor Santos Costa 0b90870185 make var names available as a global var 2015-03-04 09:35:09 +00:00
Vítor Santos Costa 9d48f3c3c0 fix compilation of JIT (but still not working). 2015-02-18 10:03:57 +00:00
Vítor Santos Costa 2ebf6a5f0e android's target 2015-02-17 20:28:05 +00:00
Vítor Santos Costa e4b0b8c0df export 2015-02-17 20:27:31 +00:00
Vítor Santos Costa 291ec26d65 configuratio fixes 2015-02-17 20:26:46 +00:00
Vítor Santos Costa d805a474a4 redeclaration 2015-02-17 20:21:49 +00:00
Vítor Santos Costa a24c90334f first cut at postgres support 2015-02-16 11:44:37 +00:00
Vítor Santos Costa 9895ec63d0 add more lib paths 2015-02-16 11:43:42 +00:00
Vitor Santos Costa 1e57a2e978 path setup 2015-02-15 02:33:54 +00:00
Vitor Santos Costa 3d6c0e7933 avoid undefined predicates 2015-02-14 17:13:42 +00:00
Vitor Santos Costa 0d955797fe don't export config.h 2015-02-14 17:11:56 +00:00
Vitor Santos Costa 9fe1ec7e3e don't export config.h 2015-02-14 17:09:43 +00:00
Vitor Santos Costa 2d20db7e6d protect against mal-formed calls 2015-02-14 17:05:48 +00:00
Vitor Santos Costa 29ffb152e5 make module user available by default to all other modules 2015-02-14 11:39:07 +00:00
Vitor Santos Costa 63416fdc48 cut_c simplifications 2015-02-14 11:35:45 +00:00
Vitor Santos Costa ada2ad44de basic myddas with SQLITE3 2015-02-14 11:35:07 +00:00
Vítor Santos Costa 071bb36f0e fix alignment 2015-02-13 12:26:21 +00:00
Vítor Santos Costa bfa9578d5e fix alignment 2015-02-13 12:26:08 +00:00
Vítor Santos Costa d606a2820b bad typing 2015-02-13 12:24:50 +00:00
Vítor Santos Costa 71c9cb21b7 kill dead code 2015-02-13 12:24:15 +00:00
Vítor Santos Costa 68abafd024 YAP_FOUND says you are being compiled within YAP 2015-02-13 12:23:51 +00:00
Vítor Santos Costa 102c8a1dc1 bad typing 2015-02-13 12:21:50 +00:00
Vítor Santos Costa 3bcde55a77 -bad typing in SWI emulation. 2015-02-13 12:20:46 +00:00
Vitor Santos Costa dd22039a59 myddas 2015-02-11 23:44:16 +00:00
Vitor Santos Costa 61625ca7ad Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2015-02-11 10:33:43 +00:00
Vitor Santos Costa eef8bc8629 myddas fixes 2015-02-11 10:33:35 +00:00
Vítor Santos Costa 2d919a4a09 MPI fixes 2015-02-11 01:50:59 +00:00
Vítor Santos Costa 9743c81f05 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2015-02-10 09:20:12 +00:00
Vítor Santos Costa ab41d5411e RebootSlots when we start a new execution. 2015-02-10 09:19:05 +00:00
Vítor Santos Costa 081b2a464e USE_MYDDAS when we have a driver for the DBMS 2015-02-10 09:17:59 +00:00
Vítor Santos Costa 350caa388b fix clashing properties (Paulo Moura). 2015-02-10 09:14:55 +00:00
Vitor Santos Costa afd8c9b9c4 blanks and backslashed strings 2015-02-10 00:03:02 +00:00
Vitor Santos Costa 888a58b715 script improvements 2015-02-09 10:32:17 +00:00
Vitor Santos Costa 41baec9f6e c_interface still kicks 2015-02-09 10:31:50 +00:00
Vitor Santos Costa cd1d347cb0 ordering 2015-02-09 10:31:19 +00:00
Vitor Santos Costa e2cd49f408 win32 2015-02-09 10:30:24 +00:00
Vitor Santos Costa 9e24724f0b sqlite 2015-02-09 10:30:09 +00:00
Vitor Santos Costa f983c99313 c_interface still kicks 2015-02-09 10:21:53 +00:00
Vitor Santos Costa 5a7602dfff fix slot at init 2015-02-09 10:20:19 +00:00
Vitor Santos Costa 2ca29d208f sqlite3 2015-02-09 10:19:15 +00:00
Vitor Santos Costa d2769d975a configuration fix 2015-02-09 10:17:42 +00:00
Vitor Santos Costa a7ae565a75 configuration fix 2015-02-09 10:16:35 +00:00
Vítor Santos Costa 1f1aa72e4a Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2015-02-09 10:15:19 +00:00
Vítor Santos Costa 8dcdb6ce09 UM #303: integer handling 2015-02-09 10:15:11 +00:00
Vitor Santos Costa 2db0b9d6a6 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2015-02-09 09:00:37 +00:00
Vitor Santos Costa 886777f1e6 compilation 2015-02-09 09:00:00 +00:00
Vítor Santos Costa 88e3d637ec C++ & swig 2015-02-09 01:53:28 +00:00
Vítor Santos Costa a8a63a31ca improv C++ interface. 2015-02-09 01:52:10 +00:00
Vítor Santos Costa bdcd06cf04 enable swig 2015-02-07 01:11:52 +00:00
Vítor Santos Costa 4dd8ee803f fix bad JIT ifdefs 2015-02-07 01:08:32 +00:00
Vítor Santos Costa ba978d8275 just in time native code: now compiles by doing cmake; make.
no workie in this version, though :)
2015-02-06 18:11:52 +00:00
Vítor Santos Costa 42d7b305c0 patch by Fab. Riguzzi to fix MPI interface 2015-02-06 18:11:44 +00:00
Vítor Santos Costa 7b4cd0d256 patch by Fab. Riguzzi to fix MPI interface 2015-02-06 18:08:06 +00:00
Vítor Santos Costa bae7b716e2 fix import term to handle overflows. 2015-02-06 18:05:21 +00:00
Vítor Santos Costa c802669cf4 cleanups 2015-02-05 01:05:08 +00:00
Vítor Santos Costa e29b7afa1b fix warnings 2015-02-04 12:32:38 +00:00
Vítor Santos Costa cc1702d4b5 fix uuid and warnings 2015-02-04 12:32:12 +00:00
Vítor Santos Costa 1f3245243c add SQLITE3, first patch 2015-02-04 10:53:04 +00:00
Vítor Santos Costa 409a79d93a autoconf 2015-02-03 03:00:52 +00:00
Vítor Santos Costa 34eb3bd62b bool 2015-02-03 03:00:37 +00:00
Vítor Santos Costa 3f8074ede9 inlining 2015-02-03 03:00:00 +00:00
Vítor Santos Costa 5e1b92019b nullptr 2015-02-03 02:58:49 +00:00
Vítor Santos Costa 30664a5344 cmake 2015-02-03 02:40:41 +00:00
Vítor Santos Costa 916f010504 handle gmp in c++ 2015-02-03 02:39:57 +00:00
Vítor Santos Costa 2f621e5b47 make user functions return bool 2015-02-03 02:37:25 +00:00
Vítor Santos Costa 5a668febd9 new slot implementation 2015-02-03 02:36:51 +00:00
Vítor Santos Costa bf215e68a2 one Int to rule them all 2015-02-03 02:36:24 +00:00
Vítor Santos Costa 65bcdc541c make sure the swi handle to cacheregs is ok when you move around.
small speedup.
2015-02-03 02:34:01 +00:00
Vitor Santos Costa 4526350113 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2015-01-30 07:26:01 +00:00
Vitor Santos Costa 36e4cbf98b move handles to a separate handle stack. 2015-01-30 07:25:34 +00:00
Theo 75985b8fff Corrected a memory leak problem 2015-01-29 15:18:09 +00:00
Vítor Santos Costa 9f945c152d cmake 2015-01-27 03:42:24 +00:00
Vitor Santos Costa 4a5a3d833a fix tyes. 2015-01-27 03:25:56 +00:00
Vitor Santos Costa 1eeb17f6f1 fix loop on boot. 2015-01-27 03:25:31 +00:00
Vitor Santos Costa d9357d3f49 fix mpi 2015-01-27 03:16:07 +00:00
Vitor Santos Costa d023e2e493 search lib64 before lib 2015-01-26 09:44:39 +00:00
Vitor Santos Costa 461caf22b4 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2015-01-26 07:38:48 +00:00
Vítor Santos Costa a8b1872396 editors prefer h 2015-01-26 07:38:36 +00:00
Vitor Santos Costa 2c3a8390fe Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2015-01-26 07:37:24 +00:00
Vítor Santos Costa 4076d24022 editors prefer h 2015-01-26 07:36:54 +00:00
Vitor Santos Costa 4ad31b6593 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2015-01-26 07:34:41 +00:00
Vítor Santos Costa 9bc20918c9 JIT code 2015-01-26 07:34:09 +00:00
Vitor Santos Costa 865945317c fix moved files 2015-01-26 07:32:33 +00:00
Vítor Santos Costa 61a47b2874 cmake 2015-01-26 04:18:00 +00:00
Vítor Santos Costa bc1e70758e cmake and jit 2015-01-26 04:02:46 +00:00
Vítor Santos Costa 9d4b59f7d6 handle the case where the result
of file expansion is an alias
2015-01-26 03:33:47 +00:00
Vítor Santos Costa 70806f1841 JIT 2015-01-20 03:01:16 +00:00
Vítor Santos Costa bece9d05d8 JIT 2015-01-20 03:00:42 +00:00
Vítor Santos Costa 61d6015d76 JIT 2015-01-20 02:59:54 +00:00
Vítor Santos Costa 3acf4b3fea cleanups 2015-01-20 02:53:19 +00:00
Vítor Santos Costa 9fff6e7226 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2015-01-18 03:51:22 +00:00
Vítor Santos Costa 24a36002cc fix cmake debug 2015-01-18 03:48:26 +00:00
Vítor Santos Costa 8f1699a343 fix bad protos 2015-01-18 03:48:02 +00:00
Vítor Santos Costa 771610ffb6 fix bit count 2015-01-18 03:47:44 +00:00
Vítor Santos Costa d8fd232d78 split absmi 2015-01-18 03:00:19 +00:00
Vítor Santos Costa 7ede2cde5e Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3
Conflicts:
	JIT/JIT_Compiler.cpp
	JIT/configure.in
	JIT/jit_analysispreds.c
	JIT/jit_transformpreds.c
	configure
	packages/cplint/Makefile.in
2015-01-18 02:54:53 +00:00
Vítor Santos Costa 5c261da4f6 small fixes 2015-01-18 02:46:33 +00:00
Vítor Santos Costa 67609ed1ce llvm 3.5 2015-01-18 02:46:03 +00:00
Vitor Santos Costa 64da0b138f Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2015-01-18 01:33:03 +00:00
Vitor Santos Costa ce84e60d08 cosmetic 2015-01-18 01:32:13 +00:00
Vitor Santos Costa e40c248c16 Merge branch 'master' of /home/vsc/yap-6.3
Conflicts:
	C/cdmgr.c
	pl/preds.yap
2015-01-17 03:06:59 -08:00
Vitor Santos Costa ec0aa5ed0a JIT compilation 2015-01-17 02:59:49 -08:00
Vitor Santos Costa 21be46b123 blanks 2015-01-17 02:58:14 -08:00
Vitor Santos Costa 9623f70d3a fix types 2015-01-17 02:50:54 -08:00
Vitor Santos Costa 9dcfb6a745 doc and use bool 2015-01-17 02:48:48 -08:00
Vitor Santos Costa eeffeea9aa split for jit 2015-01-17 02:46:54 -08:00
Vitor Santos Costa 0c88265943 indenting 2015-01-17 02:44:13 -08:00
Vitor Santos Costa b494cce5dc fix unbound in , 2015-01-17 02:41:57 -08:00
Vitor Santos Costa e69c9fc056 fix spy 2015-01-17 02:41:30 -08:00
Vitor Santos Costa 45e3711ca2 remove system mod 2015-01-16 20:42:52 -08:00
Vitor Santos Costa f835ff153d remove deb output 2015-01-16 20:42:25 -08:00
Vitor Santos Costa 7a8f57eb63 current_predicate 2015-01-16 20:08:51 -08:00
Vitor Santos Costa 58357b1af4 fix spy 2015-01-16 20:07:18 -08:00
Vitor Santos Costa c081e9774d docs 2015-01-16 20:07:00 -08:00
Vitor Santos Costa 9b18f6aee4 utilities on conj 2015-01-16 20:05:51 -08:00
Vitor Santos Costa 242844d12f ensure order 2015-01-16 20:04:12 -08:00
Vitor Santos Costa 408333f0d4 types 2015-01-16 20:02:43 -08:00
Vitor Santos Costa 0cca59b36f cases 2015-01-16 19:59:43 -08:00
Vitor Santos Costa 62a2c14c12 debugging 2015-01-16 19:59:01 -08:00
Vitor Santos Costa 4052f9b910 type stuff 2015-01-16 19:58:12 -08:00
Theo a2cd68f1ca minor dbtries bug 2015-01-16 14:33:53 +00:00
Vitor Santos Costa 32ce8318a1 type stuff 2015-01-15 23:08:01 -08:00
Vitor Santos Costa 530764e196 avoid unnecessary search 2015-01-15 23:07:35 -08:00
Vitor Santos Costa 8c605a65fe ic_arith is not an actual module.w 2015-01-15 01:22:23 -08:00
Vitor Santos Costa 415d139ad7 ifix jit stuffy 2015-01-15 01:20:15 -08:00
Vitor Santos Costa 504d67375b fix warning 2015-01-15 01:19:07 -08:00
Vitor Santos Costa befedf8db2 fix 32/64 bits issue. 2015-01-15 01:15:57 -08:00
Vitor Santos Costa 326771d17b add utility routine to report on a predicate. 2015-01-15 01:14:47 -08:00
Vitor Santos Costa 3122d323b5 support 64 bit flags in 32 bit mode 2015-01-14 04:51:54 -08:00
Vitor Santos Costa 0d5fff0f16 improved support for export/import of 64 bits 2015-01-14 04:51:00 -08:00
Vítor Santos Costa 832b2258c8 support newer llvm, by J Santos 2015-01-07 10:22:52 +00:00
Vítor Santos Costa ac9070f120 fix typos 2015-01-07 10:17:19 +00:00
Vítor Santos Costa 797dd6452d fix typing 2015-01-06 22:33:24 +00:00
Vítor Santos Costa dbd2aa64aa fix bad header 2015-01-06 22:32:52 +00:00
Vitor Santos Costa b3754795a2 warnings 2015-01-06 17:49:35 +00:00
Vitor Santos Costa d3412c4d97 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2015-01-06 17:48:47 +00:00
Vitor Santos Costa f22f337f67 32 bit support:
use uint64_t for predflags
define a type for arity
2015-01-06 17:47:58 +00:00
Vitor Santos Costa de9a1d7429 fix trouble with raptor 2015-01-06 17:47:12 +00:00
Vítor Santos Costa 746740421d Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2015-01-06 17:39:42 +00:00
Vítor Santos Costa f121a4a1bd css stuff 2015-01-06 17:39:22 +00:00
Vitor Santos Costa f42f2ff57d warnings 2015-01-05 16:14:03 +00:00
Vitor Santos Costa fcf0f41312 infinity, try to fix the ffsll mess, warnings 2015-01-05 16:06:32 +00:00
Vitor Santos Costa 5053cfb571 fix recent typos 2015-01-05 12:21:58 +00:00
Vítor Santos Costa 77c2d53445 change udi module path. 2015-01-05 10:28:57 +00:00
Vítor Santos Costa 326a4de147 doc fixes 2015-01-05 08:46:11 +00:00
Vítor Santos Costa c0476daa53 doc fixes 2015-01-05 08:15:24 +00:00
Vítor Santos Costa 3164ed2d61 doc support 2015-01-04 23:58:23 +00:00
Vítor Santos Costa a87f1040ac new docs 2015-01-04 23:51:59 +00:00
Vítor Santos Costa 0722644f99 new docs 2015-01-01 17:35:43 +00:00
Vítor Santos Costa 53877ad426 docs 2014-12-24 15:32:29 +00:00
Vítor Santos Costa bc6bf8cdfd fix extra - 2014-12-24 15:32:06 +00:00
Vítor Santos Costa 37c6b9975b change out dir 2014-12-21 16:20:00 +00:00
Vitor Santos Costa ad2df06d2b doc support 2014-12-19 23:47:50 +00:00
Vítor Santos Costa 21d379bfb6 fix current_predicate missing predicates 2014-12-16 01:25:00 +00:00
Vitor Santos Costa 247371c095 cmake 2014-12-15 23:05:05 +00:00
Vitor Santos Costa 8e3eed1fe1 Linux 2014-12-15 14:32:35 +00:00
Vitor Santos Costa 66b8498e4b Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-12-15 13:40:12 +00:00
Vítor Santos Costa 5df70e13f7 cmake 2014-12-15 13:39:54 +00:00
Vitor Santos Costa f4a3c27ae9 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-12-15 13:38:46 +00:00
Vítor Santos Costa 535135b21c cmake 2014-12-15 13:37:53 +00:00
Vitor Santos Costa 7bdcf2cde6 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-12-15 12:28:13 +00:00
Vítor Santos Costa 58ece4fa43 missing CMake file
R is no longer supported, use real.
2014-12-15 12:27:07 +00:00
Vitor Santos Costa 3ecbd3aa65 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-12-15 12:24:09 +00:00
Vitor Santos Costa 1591bfd00d cmake 2014-12-15 12:24:02 +00:00
Vítor Santos Costa 83d80943b9 missing in repo 2014-12-15 12:22:58 +00:00
Vítor Santos Costa c2ea3b1cd2 make header scanning default 2014-12-15 08:54:23 +00:00
Vítor Santos Costa bad29b415d use real only 2014-12-15 01:12:51 +00:00
Vítor Santos Costa 93c8dd75e2 update 2014-12-15 01:11:58 +00:00
Vítor Santos Costa 374eb86c8a update 2014-12-15 01:11:11 +00:00
Vítor Santos Costa 72915ff622 fix string as atoms,, obs Paulo Moura 2014-12-15 00:53:56 +00:00
Vítor Santos Costa 0200f39661 oops 2014-12-14 19:21:51 +00:00
Vitor Santos Costa 656e27f5e0 mpi support 2014-12-14 16:44:52 +00:00
Vítor Santos Costa 90feb7f9f8 cmake support 2014-12-14 12:05:43 +00:00
Vítor Santos Costa 289a36a0a1 opentry had rwo defs 2014-12-14 11:57:31 +00:00
Vítor Santos Costa 0ae8785de5 use const char * 2014-12-14 11:56:20 +00:00
Vítor Santos Costa 5da1be61cb with_mutex is always needed 2014-12-14 11:55:39 +00:00
Vítor Santos Costa f5ef30563b use const char * 2014-12-14 11:52:07 +00:00
Vítor Santos Costa bed14749f8 use const char * 2014-12-14 11:49:51 +00:00
Vítor Santos Costa 15c79d8ecf indentation 2014-12-14 11:45:42 +00:00
Vítor Santos Costa 80363e359e add qend_program to bootstrap 2014-12-14 11:45:11 +00:00
Vítor Santos Costa 4ed4e776e6 fix meta-goal expansion 2014-12-14 11:44:23 +00:00
Vítor Santos Costa 7acb2110d2 Merge branch 'cmake' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-12-04 08:03:45 +00:00
Vitor Santos Costa ff977fbad8 cmake support: first cut from David Vaz work.i 2014-12-04 07:59:30 +00:00
Vítor Santos Costa 7ea6d84300 fix module exp in user 2014-12-02 02:34:58 +00:00
Vítor Santos Costa 2c5fa4a65e fix list of atoms (Paulo Moura obs) 2014-12-02 02:34:28 +00:00
Vítor Santos Costa 7038ea1958 fix list of atoms (Paulo Moura obs) 2014-12-02 01:46:03 +00:00
Vítor Santos Costa 0f560abc92 fix warnings 2014-12-01 00:02:59 +00:00
Vítor Santos Costa 5b37c15742 cur_pred was overeager 2014-11-29 08:08:20 +00:00
Vítor Santos Costa 9f28f7e836 fix test cases 2014-11-28 03:21:32 +00:00
Vítor Santos Costa 0cebf08bfe small fixes 2014-11-28 02:35:25 +00:00
Vítor Santos Costa 4117333f60 install 2014-11-28 02:35:09 +00:00
Vítor Santos Costa 197a943cd3 support search for predicates 2014-11-28 02:34:43 +00:00
Vítor Santos Costa 84e4162435 portability 2014-11-28 02:34:26 +00:00
Vítor Santos Costa 635d5166ce fixes 2014-11-28 02:33:28 +00:00
Vítor Santos Costa 097db1b0b6 support search for predicates 2014-11-28 02:32:35 +00:00
Vítor Santos Costa d44beea3aa does not fit an int 2014-11-28 02:31:30 +00:00
Vítor Santos Costa 3e0764edcf fix broken merge 2014-11-28 02:30:58 +00:00
Vítor Santos Costa c071e145a7 portabiity 2014-11-28 02:30:19 +00:00
Vítor Santos Costa 0b3fd61088 install fixes 2014-11-28 02:29:35 +00:00
Vítor Santos Costa 22acc44b4b install fixes 2014-11-28 02:29:02 +00:00
Vítor Santos Costa 7bca484b63 install fixes 2014-11-28 02:28:49 +00:00
Vítor Santos Costa d526545bc9 Merge branch 'master' of github.com:vscosta/yap-6.3
Conflicts:
	C/sysbits.c
	C/threads.c
2014-11-27 15:15:22 +00:00
Vítor Santos Costa 70060bf627 move to eval.h 2014-11-27 15:11:26 +00:00
Vítor Santos Costa 650f6eb827 try fixing tcapabilities 2014-11-27 15:10:25 +00:00
Vítor Santos Costa a83ff038f4 Mutex stuff movibg to C 2014-11-27 10:02:04 +00:00
Vítor Santos Costa c9c2d7233c fix warnings 2014-11-26 09:47:05 +00:00
Vítor Santos Costa 570513f8f9 fix mutex creation 2014-11-26 09:46:44 +00:00
Vítor Santos Costa 6d82d4816a fix mutex creation 2014-11-26 09:45:39 +00:00
Vítor Santos Costa dc21270454 fix small bugs 2014-11-26 09:45:11 +00:00
Vitor Santos Costa 624183b78e more thread work to cean-up mutexes. Not finshed yet 2014-11-25 19:52:51 +00:00
Vitor Santos Costa afc6c5d04e Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3
Conflicts:
	C/threads.c
	JIT/HPP/EnvironmentInit.h
	packages/ProbLog/simplecudd_lfi/problogbdd_lfi.c
	pl/preds.yap
2014-11-25 16:53:35 +00:00
Vitor Santos Costa 804504201d warnings 2014-11-25 16:44:00 +00:00
Vitor Santos Costa f79458bac2 typos 2014-11-25 16:43:43 +00:00
Vitor Santos Costa 2be225c17a small warnings. 2014-11-25 16:42:35 +00:00
Vitor Santos Costa 50659967ed begin of support for named mutexes. 2014-11-25 16:41:53 +00:00
Vítor Santos Costa 1ca062f558 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-11-25 12:04:05 +00:00
Vítor Santos Costa bb8ea9a27d fix current and system predicate 2014-11-25 12:03:48 +00:00
Theo cd4b9602ae depth breadth trie corrections and more :-) 2014-11-19 16:41:10 +00:00
Vitor Santos Costa ff6184863f Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-11-14 16:51:52 +00:00
Vitor Santos Costa addb8cbce3 ORP support 2014-11-14 16:51:42 +00:00
Theo ddb8e2dd3f Fixed the domain error flag_value message to be able to print the flag if given. 2014-11-13 18:13:49 +00:00
Vítor Santos Costa cfafc26b68 real 2014-11-10 04:23:44 +00:00
vscosta fa9ea6fd51 waenings 2014-11-10 02:00:10 +00:00
vscosta 6a6b3db0c6 Shlobj. 2014-11-10 01:59:51 +00:00
vscosta a8a535afa4 warnings 2014-11-10 01:56:56 +00:00
vscosta f1cbffae6f warnings & typo 2014-11-10 01:55:59 +00:00
vscosta c695e5e068 warnings 2014-11-10 01:55:19 +00:00
vscosta 04b87d2414 does not need duplcated functionality 2014-11-10 01:54:50 +00:00
vscosta 7094d604fb support windows
improve registry handling
2014-11-10 01:54:14 +00:00
vscosta 135e9127b1 warnings 2014-11-10 01:52:01 +00:00
vscosta 1650b12267 windows os stuff
-new subgroup
- avoid fied size types
- FOLDERID
-  registr get sub key
2014-11-10 01:51:33 +00:00
Vitor Santos Costa 24920a230f Merge branch 'master' of https://www.github.com/vscosta/yap-6.3 2014-11-09 17:30:15 +00:00
Vitor Santos Costa e7fcc5d9a1 with_mutex should succeed even in single-thread mode 2014-11-09 17:26:08 +00:00
vscosta 9868abab6c improvements 2014-11-09 12:08:23 +00:00
vscosta 9c2fd881f7 Directory lookup in win32 2014-11-09 12:06:40 +00:00
vscosta 2870395627 windows support 2014-11-09 11:18:33 +00:00
vscosta d8c4ea4364 support intptr_t and uintptr_t in swi api 2014-11-09 11:18:03 +00:00
vscosta 6958f4ce6d use __WINDOWS__ 2014-11-09 11:16:24 +00:00
Vitor Santos Costa 5dfb438abb Merge branch 'master' of https://github.com/vscosta/yap-6.3 2014-11-06 13:04:55 +00:00
Vitor Santos Costa ac85c0741d Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-11-06 13:04:40 +00:00
Vitor Santos Costa e351402ed9 Merge branch 'master' of https://github.com/vscosta/yap-6.3 2014-11-06 12:59:33 +00:00
vscosta 10e1080ddd keep on improving the script 2014-11-05 07:47:43 +00:00
vscosta ff761c4196 document prolog commons directory 2014-11-05 07:47:10 +00:00
vscosta 8f448c0284 registry changes 2014-11-05 07:46:09 +00:00
vscosta c633eac236 avoid using registry, clean-up 2014-11-05 07:45:36 +00:00
vscosta 605dd2abc1 add pointer to commons. 2014-11-05 07:43:48 +00:00
Theo 7e6ab7b0d2 Newest version of dbtries (several improvements and corrections of bugs) and the removal of a warning from flags 2014-11-04 18:04:54 +00:00
vscosta fdadf7d477 improved windows compilation script 2014-11-04 01:51:50 +00:00
vscosta 58734fe2e7 win32 support
- support for win graphic console
- correct versioning
- document mkwin script
2014-11-04 01:27:58 +00:00
Vítor Santos Costa 83a34ad849 fix var 2014-11-03 00:43:19 +00:00
Vítor Santos Costa 2036ec3137 update config 2014-11-03 00:26:04 +00:00
Vítor Santos Costa 9d615f3c24 win32 in submodules. 2014-11-03 00:25:30 +00:00
vscosta c7a3836b2c WIN32 support
Ugh
2014-11-03 00:13:34 +00:00
Vítor Santos Costa ef0d7b77fb Merge branch 'master' of github.com:vscosta/yap-6.3 2014-11-02 12:11:48 +00:00
Vítor Santos Costa c440ab239b doc changes 2014-11-02 12:10:32 +00:00
Vitor Santos Costa 9975ab9b94 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-10-30 17:27:21 +00:00
Vítor Santos Costa dce3e7a1bc short version 2014-10-30 17:26:29 +00:00
Vitor Santos Costa 1c8eb25ece Merge branch 'master' of https://github.com/vscosta/yap-6.3 2014-10-30 17:12:16 +00:00
vscosta 84c763b4b4 Fix merge
get corrected indent
2014-10-30 16:38:24 +00:00
Vítor Santos Costa 8af742e449 fizes to docs 2014-10-30 16:34:09 +00:00
vscosta 0f87d6a5f0 improve mkwin script 2014-10-30 07:47:16 +00:00
vscosta 091f9dda33 MSYS32 2014-10-30 07:46:17 +00:00
vscosta 93bad76d18 type mess in mingw32/MSYS
int or mode_t?
2014-10-30 07:44:43 +00:00
vscosta e0da1a2ae0 cplint path
give yap.dll path to cplint
2014-10-30 07:43:24 +00:00
vscosta 1bde3ae13a win32 headers
winsock should be tested before windows.h
2014-10-30 07:42:45 +00:00
vscosta f993421ac8 fix longint < intptr_t warnings
Handle printf mess
2014-10-30 07:41:30 +00:00
vscosta 7870416c1e Fix Message box
convert to win32 native chars
2014-10-30 07:40:00 +00:00
vscosta 604c28f8c1 Fix getpid warning
include <process,h> and use _getpid
2014-10-30 07:39:10 +00:00
Vítor Santos Costa 546af97345 win32 patches 2014-10-28 12:56:26 +00:00
Vítor Santos Costa 6b93b8ee5a config fixes 2014-10-26 18:47:15 +00:00
Vítor Santos Costa 2053c44054 try to clean-up makefiles and autoconfs 2014-10-26 17:39:52 +00:00
Vítor Santos Costa 9cd2975532 fix argv && os_argv 2014-10-26 17:39:13 +00:00
Vítor Santos Costa fca75670bc fix argv && os_argv 2014-10-26 17:38:41 +00:00
Vítor Santos Costa 86a79e2cab provide a real interface to exo routines: needed by raptor 2014-10-26 17:37:46 +00:00
Vitor Santos Costa 6c76a5f827 config libs vs ldflags, CPP VS C 2014-10-26 01:52:02 +01:00
Vitor Santos Costa 8f0ce4bb94 YAP meets exo 2014-10-26 01:50:18 +01:00
Vitor Santos Costa 9483572213 config libs vs ldflags 2014-10-26 01:49:15 +01:00
Vítor Santos Costa e7067559a0 config matters 2014-10-25 16:52:51 +01:00
Vítor Santos Costa b5a43ae9ff improve autoconf 2014-10-25 16:46:13 +01:00
Vitor Santos Costa f7fe32a03c fix win32 warnings: unsigned long != CELL, IOSTREAM with sace restore, _ffsll and _isatty, fp patches 2014-10-24 15:18:32 +01:00
Vitor Santos Costa 461dae09f7 fix self-deadlock. 2014-10-23 19:11:13 +01:00
Vitor Santos Costa 1ba8656e73 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-10-23 02:11:03 +01:00
Vitor Santos Costa 130d28ceb3 recover space after portray 2014-10-23 02:10:55 +01:00
Vitor Santos Costa 4844e43704 flags 2014-10-23 01:24:18 +01:00
Vitor Santos Costa 2f34be261e beauty 2014-10-23 01:23:29 +01:00
Vitor Santos Costa e25e7dab7b Fix deadlocks 2014-10-23 01:21:40 +01:00
Vitor Santos Costa d2984b6548 reimplement portray 2014-10-23 01:21:22 +01:00
Vitor Santos Costa 126e498c35 fix signals > 64, 2014-10-23 01:17:45 +01:00
Vitor Santos Costa dab3a4a4f6 fix msicalculaation in recovering cells. 2014-10-23 01:16:30 +01:00
Vítor Santos Costa 749ba13d3d fix retractall with numbers, Paulo Moura 2014-10-23 00:35:14 +01:00
Vítor Santos Costa 6c021e7899 fix typos in gmp support routines, by Paulo Moura. 2014-10-22 20:26:19 +01:00
Vítor Santos Costa 171dca1c8c Paulo Moura: fix atom_length/2 e atomic_length/2. 2014-10-22 17:54:50 +01:00
Vítor Santos Costa 0367f52840 string_concat 2014-10-22 17:22:37 +01:00
Vítor Santos Costa 92ffbe5a2e fix atomic_conct, Paulo Moura 2014-10-22 17:17:34 +01:00
Vítor Santos Costa 93270c125a fix several ISO compat bugs (Paulo Moura). 2014-10-22 16:50:12 +01:00
Vítor Santos Costa 1c3c0c6301 fix sub_atom, by Paulo Moura. 2014-10-22 16:22:38 +01:00
Vítor Santos Costa 61f5baf7a4 cuda links in osx; nullptr patch from mozilla 2014-10-22 14:54:54 +01:00
Vitor Santos Costa c13bf88377 error handling bugs in is/2 and =.., found by Paulo Moura. 2014-10-22 10:43:38 +01:00
Vitor Santos Costa b2caf2da77 integrate autoconf for cplint with remaining code.t 2014-10-22 10:11:20 +01:00
Vitor Santos Costa 57f928c621 isolate undef and spy code. 2014-10-22 10:10:43 +01:00
Vitor Santos Costa 799b4c0346 fix a case where a comparison entered the enext member of the switch.
This was introduced to get rid of eclipse warnings :(
2014-10-21 19:23:44 +01:00
Vítor Santos Costa ffb97269a0 ISO support (Paulo Moura). 2014-10-21 00:26:40 +01:00
Vitor Santos Costa a4081673e5 fix indexing on dynamics (bug introduced when fixing MT code). 2014-10-20 23:47:33 +01:00
Vitor Santos Costa 98ee3fd078 newer version of configure, whatever.. 2014-10-20 23:46:30 +01:00
Vitor Santos Costa 75c1e87470 callable strikes again. 2014-10-20 15:44:13 +01:00
Vitor Santos Costa 67de7e422d Separate callable errors that refer to the predicate indicator. 2014-10-20 15:40:19 +01:00
Vitor Santos Costa 7f4b478572 make pthread locking default 2014-10-20 15:36:23 +01:00
Vítor Santos Costa d40b9d1426 restore callable. 2014-10-20 09:20:56 +01:00
Vítor Santos Costa bf0844a2a0 make sure to reset state after error. 2014-10-20 00:33:36 +01:00
Vítor Santos Costa a837a303d4 fix warning. 2014-10-19 13:10:02 +01:00
Vítor Santos Costa 6a32efe51a fix \+((!,fail)). 2014-10-19 13:09:35 +01:00
Vítor Santos Costa 0cd0ece207 make error handling for callable more ISO like. 2014-10-19 12:48:14 +01:00
Vítor Santos Costa 47d1bd5ecc allow setting up arithmetic exception handling. 2014-10-19 11:27:53 +01:00
Vitor Santos Costa 13421d0cd7 fix minor locking problems and disable localization for now 2014-10-19 03:51:56 +01:00
Vítor Santos Costa 4a2d6b9137 typo. 2014-10-19 02:02:46 +01:00
Vítor Santos Costa 53a8a8f7c9 try to make MT more robust by:
- tracking memory overflows (still worried about blobs)
- moving core components to C-code, namely the mailboxes.
- reducing locking: too many locks == deadlock.
thanks to Paulo Moura for the test suite!
2014-10-19 01:54:57 +01:00
Vítor Santos Costa a351e1f38f use BGL lock for big operations. 2014-10-19 01:52:39 +01:00
Vítor Santos Costa c7d2973c1e avoid confusing gc. 2014-10-19 01:51:50 +01:00
Vítor Santos Costa 69d8b57776 allow peeking in dbterm queues. 2014-10-19 01:51:02 +01:00
Vítor Santos Costa e668908a6f beautifications. 2014-10-19 01:50:11 +01:00
Vítor Santos Costa 18506025c3 use PP with care:
- clean after interrupt;
  - use it only for indexing code.
2014-10-19 01:48:38 +01:00
Vítor Santos Costa 827be2f8d0 more debugging versions 2014-10-19 01:44:48 +01:00
Vítor Santos Costa 438c09b5d0 if THREADS on, please usse locking. 2014-10-19 01:44:11 +01:00
Vítor Santos Costa 71c587bec1 better safe than.. 2014-10-19 01:43:14 +01:00
Vítor Santos Costa ba03f1da65 avoid fuzzy f errors 2014-10-16 23:56:12 +01:00
Vítor Santos Costa 168f0c6c0c improve error handling 2014-10-16 23:55:34 +01:00
Theo f5b48e3f82 Removed a few inline definitions 2014-10-16 18:26:16 +01:00
Fabrizio Riguzzi fa24b214af Merge branch 'master' of git@git.dcc.fc.up.pt:yap-6.3 2014-10-16 17:23:22 +02:00
Fabrizio Riguzzi 3ee50baf11 lemur example 2014-10-16 17:22:57 +02:00
Fabrizio Riguzzi 089bd928cf fixed cplint compilation 2014-10-16 13:49:56 +02:00
Vitor Santos Costa 45e4384b6d Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-10-16 10:52:20 +01:00
Vitor Santos Costa 1bb12cbc35 second try to fix error handling in arithmetic expressions. THis time:
- exit at predicate end;
- just return first on multiple erors.
- YapArithError takes care of inner errors, Yp_EvalError fixes externals.
- a few ISO stuff to make Paulo's unit tests go happier.
2014-10-16 10:49:11 +01:00
Fabrizio Riguzzi 7227bc62f4 Merge branch 'master' of git@git.dcc.fc.up.pt:yap-6.3 2014-10-16 10:20:34 +02:00
Fabrizio Riguzzi 3c07f66cac repaired configure 2014-10-16 10:20:07 +02:00
Theo 44d38d3018 Theo corrected a bug in the dbtries implementation 2014-10-15 20:53:32 +01:00
Theo b9236fa5fa Theo corrected a bug in the dbtries implementation 2014-10-15 19:55:40 +01:00
Fabrizio Riguzzi ce12c424f3 initial version of LEMUR 2014-10-15 15:56:49 +02:00
Fabrizio Riguzzi b25c9e5b61 lemur 2014-10-15 15:15:46 +02:00
Fabrizio Riguzzi 1d98481ac3 fixed compilation problems 2014-10-15 15:15:24 +02:00
Vitor Santos Costa 46e1ce96b4 Yap_cputime() needs thread local memory, so be careful about releasing
local memory.
2014-10-15 12:32:00 +01:00
Vitor Santos Costa 8014110080 fix debugging letfover. 2014-10-15 12:10:39 +01:00
Vítor Santos Costa 8576e67d84 generate exceptions on arithmetic errors 2014-10-15 11:06:07 +01:00
Vítor Santos Costa a5d0b41f3b fix file filter breakage 2014-10-15 01:51:09 +01:00
Vitor Santos Costa 49ccb545f8 fix bad call. 2014-10-14 19:39:20 +01:00
Vitor Santos Costa aa80579684 recover the signals, like sigfpe. 2014-10-14 19:31:49 +01:00
Vitor Santos Costa 1983df00db use LIBS, even if the -fPIC versions do not need them, the standard
one does.
2014-10-14 19:30:56 +01:00
Vítor Santos Costa 186adc2053 More thread fixes, including true anonymous mqueues, worker_id for sequential,
support for arithmetic exceptions on mac, fixes for with_mutex, fixes for dangling pointers
 in thread termination. Uuufff...
2014-10-14 15:53:24 +01:00
Vítor Santos Costa 90289b7188 fix bad initialization. 2014-10-14 02:10:18 +01:00
Vítor Santos Costa d76c2a0039 fix duplicates. 2014-10-14 02:09:52 +01:00
Vítor Santos Costa c95045e14c improve support for floating point exceptions. 2014-10-14 01:13:31 +01:00
Vítor Santos Costa 3c7779ec78 move message queues to C 2014-10-13 12:34:52 +01:00
Vítor Santos Costa 7cbcd17993 avoid warning 2014-10-13 12:33:24 +01:00
Vítor Santos Costa ce390d987e fix initialization on undefined. 2014-10-12 11:02:47 +01:00
Vítor Santos Costa f2038e9e36 use meta-predicates. 2014-10-12 11:01:30 +01:00
Vítor Santos Costa c0b723ca14 fix module transparent. 2014-10-12 11:00:45 +01:00
Vítor Santos Costa d7bc8f80ce back to life, ProbLog-I 2014-10-12 00:33:34 +01:00
Vítor Santos Costa a64c6772fc fix atomic_concat/3 to be backtrackable. 2014-10-12 00:32:17 +01:00
Vítor Santos Costa 1a56819658 fix typo 2014-10-11 21:56:55 +01:00
Vítor Santos Costa 0c461c538b remove unneeded call 2014-10-11 14:10:35 +01:00
Vítor Santos Costa b40a5a7837 fix change in undef. 2014-10-11 14:09:40 +01:00
Vítor Santos Costa e3e1bcaca8 fix broken semantics. 2014-10-11 14:08:39 +01:00
Vítor Santos Costa 5312086b60 typo in expansion. 2014-10-11 14:07:34 +01:00
Vítor Santos Costa cf7dccdcdf fix handling of attributed vars. 2014-10-11 14:06:57 +01:00
Vítor Santos Costa 1461f44184 fix goal expansion problems 2014-10-11 12:45:54 +01:00
Vítor Santos Costa b2cd81f79a fix bb usage of DB. 2014-10-11 01:39:09 +01:00
Vítor Santos Costa 84527a8c77 fix bb usage of DB. 2014-10-11 01:38:32 +01:00
Vítor Santos Costa 5bf44d2378 fix signal handling in non-threaded (thanks to Paulo Moura). 2014-10-11 01:37:34 +01:00
Vitor Santos Costa 18aadaecd8 fix ways to call listing and improve documentation. 2014-10-10 15:52:14 +01:00
Vitor Santos Costa 4d3bb0143f small fix to hook case. 2014-10-10 15:50:41 +01:00
Vitor Santos Costa 96149d991f fix reloading of foreign files: don't allow it even if you are
reconsulting, it makes no sense.
2014-10-10 12:52:03 +01:00
Vitor Santos Costa 946f6cebf3 fix bad exit from undef code. 2014-10-10 12:39:54 +01:00
Vitor Santos Costa f6bcb22b7c fix undefined procedures to allow hooks as before. 2014-10-10 10:00:27 +01:00
Vitor Santos Costa b108380cfc utf8 2014-10-09 10:49:51 +01:00
Vitor Santos Costa 1896237ed3 remove unknows msg 2014-10-09 10:49:24 +01:00
Vitor Santos Costa fcd959a2cb cuda 2014-10-09 10:48:23 +01:00
Vitor Santos Costa e18f083da6 fix warning. 2014-10-09 10:47:41 +01:00
Vitor Santos Costa 48053694c7 document abolish and make sure that assert(m:(H:-B)) treats m as source
module.
2014-10-09 10:46:09 +01:00
Vitor Santos Costa ed6f7f8573 fix warning. 2014-10-09 10:45:38 +01:00
Vitor Santos Costa 716f80d4c8 ugh, did not allow loading more than a file. 2014-10-09 10:44:37 +01:00
Vitor Santos Costa 6ec4d99d86 allow users to load foreign code from cwd, as said in manual. 2014-10-09 10:43:44 +01:00
Vitor Santos Costa cbc579310a fix number_atom broken behaviour when atom was bound. 2014-10-09 10:42:15 +01:00
Vitor Santos Costa 5d84ce03ca fix configuration to support 6.5. 2014-10-08 16:50:33 +01:00
Vítor Santos Costa bd35580713 fixes for qly loading. 2014-10-08 00:28:14 +01:00
Vítor Santos Costa bcc8fea458 fix another typo. 2014-10-07 23:34:49 +01:00
Vítor Santos Costa ad82a2619d compute mian functor correctly a(X), [Y] <-- b(X,Y). 2014-10-07 21:04:54 +01:00
Vítor Santos Costa ef73a788d9 fix case where unnecessart messages wwere printed while if disables code reading. 2014-10-07 10:28:43 +01:00
Vítor Santos Costa 46a81e8d2b more typos. 2014-10-07 10:13:31 +01:00
Vítor Santos Costa cff80914e4 handle modules in exporteed procedures. 2014-10-07 09:59:59 +01:00
Vítor Santos Costa 1fff999e5e enable compilation of external modules. 2014-10-07 09:59:23 +01:00
Vítor Santos Costa da61f1c31f gcc-3.4 was being confused with OSX 13.4. 2014-10-07 09:21:52 +01:00
Vítor Santos Costa b25b6db772 forgot absf 2014-10-07 01:38:31 +01:00
Vítor Santos Costa a54af395cf multifiles are discontiguus by def. 2014-10-07 01:37:42 +01:00
Vítor Santos Costa 0ba024a7b0 activate style checking from day 1. 2014-10-07 01:37:13 +01:00
Vítor Santos Costa e9cc545f68 big cleanup: cpmpile under style checker.
fix broken module stuff.
2014-10-07 01:35:41 +01:00
Vítor Santos Costa 092303f837 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-10-06 00:01:42 +01:00
Vítor Santos Costa 0c4f846c0e move modules to as early as possible 2014-10-06 00:01:25 +01:00
Vítor Santos Costa 8c87eabb22 fix typos 2014-10-06 00:00:42 +01:00
Vítor Santos Costa 800a019a16 fix typos 2014-10-05 23:59:34 +01:00
Vítor Santos Costa 028c036757 fix typos 2014-10-05 23:59:21 +01:00
Vítor Santos Costa 3b5a093983 fix message display time 2014-10-05 23:58:19 +01:00
Vítor Santos Costa 733bb5ddc4 module stuff 2014-10-05 23:54:51 +01:00
Vítor Santos Costa 427c3ecf54 fix operators. 2014-10-05 23:53:47 +01:00
Vítor Santos Costa 9f00389e52 keep three modules, just for imported stuff. 2014-10-05 23:53:05 +01:00
Vítor Santos Costa 64e7e7e663 make writeln a C built-in. 2014-10-05 23:51:43 +01:00
Vítor Santos Costa a7b4667e6c looking at operators. 2014-10-05 23:51:06 +01:00
Vitor Santos Costa 821bde8603 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-10-05 23:49:44 +01:00
Vítor Santos Costa d1242028d2 fixes for notrace predicates. 2014-10-05 10:24:44 +01:00
Vítor Santos Costa 98a471b9d7 fix unrelated comment. 2014-10-05 10:23:21 +01:00
Vítor Santos Costa b30d0bbdaf fix bad formatting. 2014-10-05 10:22:03 +01:00
Vítor Santos Costa 8345bf3e24 ensure loading is recognised. 2014-10-05 10:20:36 +01:00
Vítor Santos Costa 11b957f5fe protect from tracing. 2014-10-05 10:19:42 +01:00
Vítor Santos Costa d29fb0fd57 fix source mode. 2014-10-05 10:18:54 +01:00
Vitor Santos Costa af180958b6 fixes in javadoc 2014-10-03 16:56:23 +01:00
Vítor Santos Costa ad2ee8225d fix modularized grammar.yap. 2014-10-03 08:54:41 +01:00
Vítor Santos Costa 510c7cdeee respect source mode indications. 2014-10-03 08:50:15 +01:00
Vítor Santos Costa dddc9fbb85 fix listing/0 to avoid going into every system predicate. 2014-10-03 08:49:14 +01:00
Vitor Santos Costa d2527528fa Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-10-02 23:25:06 +01:00
Vitor Santos Costa 2c599d99f8 improvements in packages 2014-10-02 23:24:31 +01:00
Vitor Santos Costa 56a1e11656 Carlos: fix catalogues. 2014-10-02 23:24:04 +01:00
Vitor Santos Costa 70fa990223 make hcli installable in win32. 2014-10-02 23:22:19 +01:00
Vítor Santos Costa 80faee6824 qload/qsave implementation. 2014-10-02 14:57:50 +01:00
Vítor Santos Costa ef479f00dc make grammar a module. 2014-10-02 14:55:47 +01:00
Vítor Santos Costa a306d0b0ee improve messages for cosulting. 2014-10-02 14:52:54 +01:00
Vítor Santos Costa 1cbc0705c6 syntax changes. 2014-10-02 14:50:19 +01:00
Vítor Santos Costa 2e43165a68 fix debugging message. 2014-10-02 14:48:47 +01:00
Vítor Santos Costa 5a40f834f1 push directives to as early as possible. 2014-10-02 14:41:41 +01:00
Vítor Santos Costa fe0e12b030 store loaded files state. 2014-10-02 14:40:45 +01:00
Vítor Santos Costa 5bae8321d7 move gramar preprocessing here. 2014-10-02 14:39:45 +01:00
Vítor Santos Costa b1a6f092fd fix compiltion of binary tests to use a long instruction. 2014-10-02 14:38:23 +01:00
Vítor Santos Costa b793ffb71a remove debugging stuff. 2014-10-02 14:37:12 +01:00
Vítor Santos Costa b8f1ee4a75 extend nb_setarag/3 to call a default case at initialization, ie,
nb_getval(a, X, X=start).
and just that.
2014-10-02 14:35:38 +01:00
Vítor Santos Costa 2960f81e04 just say cmp preds are binary. 2014-10-02 14:34:51 +01:00
Vítor Santos Costa 48b1cf5d45 store away all directives we find. 2014-10-02 14:34:03 +01:00
Vítor Santos Costa 4f77281827 move docs around. 2014-10-02 14:33:22 +01:00
Vítor Santos Costa a1022f8237 always deref arguments to built-ins. 2014-10-02 14:32:26 +01:00
Vítor Santos Costa 74c136b986 reorganise code to avoid duplicate goal_expansion. 2014-10-02 14:31:14 +01:00
Vítor Santos Costa 3ab27ad588 allow application to set source file, useful in saved states. 2014-10-02 14:29:48 +01:00
Vítor Santos Costa 61ffaf5720 avoid int 2014-10-02 14:26:50 +01:00
Vítor Santos Costa 2d5f8f136d SWI functors is now dynamic 2014-10-02 14:25:11 +01:00
Vítor Santos Costa 4fdd501bbb qly is not a source file. 2014-10-02 14:24:12 +01:00
Vítor Santos Costa 17617e8d20 allow setting file ownership, and make sure preds created by aux
programs have an owner file.
2014-10-02 14:21:43 +01:00
Vítor Santos Costa 28c10dbefc fix meta decl to agree with new name. 2014-10-02 14:20:28 +01:00
Vítor Santos Costa e22b2febf4 update too change in library(lineutils). 2014-10-02 14:19:53 +01:00
Vítor Santos Costa 81440607f1 support outputting strings for debugging. 2014-10-02 14:17:26 +01:00
Vítor Santos Costa 37a49f2135 synchronize compiler oops with their descriptions
computils; allocate N instruction blocks.
2014-10-02 14:15:17 +01:00
Vítor Santos Costa f415e16b79 typo 2014-09-25 09:48:00 +01:00
Vítor Santos Costa e4306ba28e fix qsave_module 2014-09-25 09:47:38 +01:00
Vítor Santos Costa 52cf634e33 real 2014-09-25 09:47:20 +01:00
Vítor Santos Costa 95245932f8 typo 2014-09-25 09:46:48 +01:00
Vítor Santos Costa dc4748147e real 2014-09-25 09:45:56 +01:00
Vítor Santos Costa 5bd42984b9 fix qsave_module 2014-09-25 09:45:25 +01:00
Vítor Santos Costa 077570314d don't source system predicates 2014-09-25 09:44:34 +01:00
Vítor Santos Costa e4603ffe22 beautify code 2014-09-25 09:43:50 +01:00
Vítor Santos Costa 7f952c8b74 avoid backtracking 2014-09-25 09:42:51 +01:00
Vítor Santos Costa 1783528ea8 updates 2014-09-25 08:57:41 +01:00
Vítor Santos Costa 78967d6eb2 fix typo 2014-09-25 08:50:26 +01:00
Vítor Santos Costa 7c32ac6080 disable ground optimization: it is not supported by restore 2014-09-24 00:23:11 +01:00
Vitor Santos Costa 66a95e96c0 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3
Conflicts:
	library/matrix.yap
	pl/qly.yap
2014-09-23 22:46:19 +01:00
Vitor Santos Costa 2bc55d868d formatting changes 2014-09-23 22:40:40 +01:00
Vitor Santos Costa ed3f0a8b74 use of as part of the phrase, not as main operatorSr 2014-09-23 22:39:20 +01:00
Vitor Santos Costa 429e87404f avoid empty hash tables 2014-09-23 22:37:08 +01:00
Vitor Santos Costa fcc0c51ce7 avoid int 2014-09-23 22:35:01 +01:00
Vitor Santos Costa 9101de3014 handl weird cases in writing [] 2014-09-23 22:33:31 +01:00
Vítor Santos Costa 3e255ec4a1 qload 2014-09-22 18:13:35 +01:00
Vítor Santos Costa f29e017c63 documentation update. 2014-09-22 18:12:57 +01:00
Vítor Santos Costa 5cfe70420f fix reset in qload 2014-09-22 18:10:51 +01:00
Vítor Santos Costa 9254103f45 $pred_owner: file where source was. 2014-09-22 18:09:23 +01:00
Vítor Santos Costa 7a577a72ff stdbool. 2014-09-22 18:08:39 +01:00
Vítor Santos Costa 349f2898df small fixes 2014-09-22 18:07:07 +01:00
Vítor Santos Costa 9929946de2 fix typo 2014-09-19 14:25:10 -05:00
Vitor Santos Costa e06bcd659e more C++/Android fixes 2014-09-19 14:20:22 -05:00
Vitor Santos Costa 1caf68972f missing file 2014-09-18 00:58:50 -05:00
Vitor Santos Costa 04eb38ff10 Why stay at 1.4 in java compat? 2014-09-17 16:58:05 -05:00
Vitor Santos Costa 6b0d99e2fe fix debugging-left-over 2014-09-17 16:55:19 -05:00
Vitor Santos Costa 00d87ca661 Improve Makefile for android compilation and bring back Application.mk 2014-09-17 16:54:21 -05:00
Vitor Santos Costa 8461026303 fixes for win64 compilation. 2014-09-16 19:15:56 +01:00
Vitor Santos Costa 0ad92137a9 WIN32 compilation 2014-09-16 19:13:09 +01:00
Vítor Santos Costa dbec254586 doc updates 2014-09-16 04:02:05 -05:00
Vítor Santos Costa 797e0c6be7 don't dump stack, for now 2014-09-16 04:01:37 -05:00
Vítor Santos Costa 3168b2cfc8 fix int/Int in save; add debugging (obs from Gong Su 2014-09-16 04:00:31 -05:00
Vítor Santos Costa 91946626b0 causes do not have cps for a while 2014-09-16 03:58:35 -05:00
Vítor Santos Costa df0ec5bc96 more doxygen fixes 2014-09-15 14:57:46 -05:00
Vítor Santos Costa 6453ca395c more doc changes 2014-09-15 13:42:35 -05:00
Vítor Santos Costa 637ca503cc remove debugging msg 2014-09-15 13:42:14 -05:00
Vítor Santos Costa 0a353815a3 fix argunebt handling 2014-09-15 13:41:44 -05:00
Vítor Santos Costa aeb54ebc61 more doc udates 2014-09-15 13:10:49 -05:00
Vítor Santos Costa d5fc0a1920 doxygen support 2014-09-15 13:09:48 -05:00
Vítor Santos Costa 7e1c6a6f5f doxygen support 2014-09-15 13:07:53 -05:00
Vítor Santos Costa 8eec3113be improve docs 2014-09-15 03:13:50 -05:00
Vítor Santos Costa 582efcf6eb try again t fix readline paths in config 2014-09-15 03:13:21 -05:00
Vítor Santos Costa 050ce4fce6 "moredocupdates" 2014-09-13 00:53:56 -05:00
Vítor Santos Costa 3bcf9a3f85 docs 2014-09-13 00:45:43 -05:00
Vitor Santos Costa 4f294140ce doc changes 2014-09-13 00:34:57 -05:00
Vitor Santos Costa cf0f8d2447 doc changes 2014-09-13 00:33:25 -05:00
Vitor Santos Costa b7ae9cb45e documentation improvemeents 2014-09-13 00:26:46 -05:00
Vítor Santos Costa 882eaca30c updates to documentation 2014-09-12 18:50:04 -05:00
Vítor Santos Costa 57ecd61b95 update docs 2014-09-11 14:07:16 -05:00
Vítor Santos Costa 3009987985 update docs 2014-09-11 14:06:57 -05:00
Vítor Santos Costa 19c247accd doc work 2014-09-10 00:39:38 -05:00
Vítor Santos Costa 4745401b2a use stdbool 2014-09-10 00:38:31 -05:00
Vítor Santos Costa 0ed6fe43b2 cleanup 2014-09-10 00:36:20 -05:00
Vítor Santos Costa 9e7257978c cleanup 2014-09-09 23:55:47 -05:00
Vítor Santos Costa 87e36bcfe2 cleanup 2014-09-09 23:55:13 -05:00
Vítor Santos Costa b26b5b1b7d small fixes 2014-09-09 23:53:41 -05:00
Vítor Santos Costa 3fd07064da use stdbool 2014-09-09 23:53:10 -05:00
Vítor Santos Costa 1dd3ff800e use stdbool 2014-09-09 23:51:44 -05:00
Vítor Santos Costa 3c0a65218b use stdbool 2014-09-09 23:50:43 -05:00
Vítor Santos Costa 9b5c4ea710 missing library calls 2014-09-09 09:38:10 -05:00
Vítor Santos Costa 0f239213d1 missing library calls 2014-09-09 09:37:20 -05:00
Vítor Santos Costa 62d4624080 fix compilation warnings 2014-09-09 09:35:14 -05:00
Vítor Santos Costa d29f876ae6 use stdbool 2014-09-09 09:27:29 -05:00
Vítor Santos Costa 14e4f1d9f2 use stdbool 2014-09-09 09:25:33 -05:00
Vítor Santos Costa 92e620abf2 missing library calls 2014-09-09 09:15:55 -05:00
Vítor Santos Costa df1e161e6c fix library and stdbool 2014-09-09 09:13:03 -05:00
Vítor Santos Costa cd8dd56b9e write comment handling 2014-09-08 17:16:49 -05:00
Vítor Santos Costa 53a49bb3c3 call ypp from the console 2014-09-08 17:16:00 -05:00
Vítor Santos Costa f9438806ee creep should be the last signal to be processed? 2014-09-08 17:14:58 -05:00
Vítor Santos Costa 337839b8ea remove used cruft 2014-09-08 17:14:02 -05:00
Vítor Santos Costa d39423c1f0 handle EXIT_SIGNAL with exit 2014-09-08 17:13:39 -05:00
Vítor Santos Costa 0a64e9f062 fix creep handling 2014-09-08 17:12:05 -05:00
Vítor Santos Costa 87a0a7af74 define unnecessary lock 2014-09-08 17:11:26 -05:00
Vítor Santos Costa aa82206330 fixes: compilation 2014-09-03 11:11:44 -05:00
Vítor Santos Costa f291c37dfc fixes: checking sigs & no threads 2014-09-03 11:02:28 -05:00
Vítor Santos Costa b942c1ef13 fixes for signal handling 2014-09-02 22:24:01 -05:00
Vítor Santos Costa 99713d81a6 replace locks by critical sections in interrupt handling 2014-09-02 14:19:23 -05:00
Vítor Santos Costa 863a4c53fc use ffsl and ffsll 2014-09-02 14:18:26 -05:00
Vítor Santos Costa 19d0f56f2d fix arena initialization 2014-08-23 14:47:40 -05:00
Vítor Santos Costa 495ab155f9 analysis support 2014-08-21 10:32:50 -05:00
Vítor Santos Costa f68b32770b analysis changes 2014-08-21 10:32:23 -05:00
Vítor Santos Costa 109597ab91 small cleaning. 2014-08-20 09:58:33 -05:00
Vítor Santos Costa 0f1b47f860 keep on working. 2014-08-20 09:58:06 -05:00
Vítor Santos Costa 69d2cc3e49 fix beautified recorded. 2014-08-20 09:13:19 -05:00
Vítor Santos Costa 3b5cd95d22 get rid of write_depth
fix at_end_of_line.
2014-08-20 09:12:40 -05:00
Vítor Santos Costa 5721ce5e7d fix bad call to use_module. 2014-08-20 09:09:20 -05:00
Vítor Santos Costa 8a4590f3ce put mod_scan back. 2014-08-20 08:08:21 -05:00
Vítor Santos Costa 86a363d3bd remove dead code. 2014-08-20 08:03:27 -05:00
Vítor Santos Costa 373d488974 erase_source is not used any longer: source is packaed with code. 2014-08-20 08:01:20 -05:00
Vítor Santos Costa 6efb3176f7 format_to_chars is not supported any longer. 2014-08-20 07:57:58 -05:00
Vítor Santos Costa be6947d74c fix typo and needs maplist. 2014-08-20 07:57:12 -05:00
Vítor Santos Costa 5aad8e380b enable analysis. 2014-08-20 07:56:33 -05:00
Vítor Santos Costa b7d97bf4f6 needs maplist library. 2014-08-20 07:55:44 -05:00
Vítor Santos Costa 4573afa70b fix frozen/2. 2014-08-20 07:55:05 -05:00
Vítor Santos Costa 6f88083d38 fix inityaamregs not to destroy global structures. 2014-08-18 01:25:55 -05:00
Vítor Santos Costa 55910b4610 stuff 2014-08-17 15:33:57 -05:00
Vítor Santos Costa ffda6c291e fix macro stuff. 2014-08-17 15:33:11 -05:00
Vítor Santos Costa 952986ef1c small fixes in packages 2014-08-16 09:15:02 -05:00
Vítor Santos Costa ca4e9c39cb Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-08-15 19:35:03 -05:00
Vítor Santos Costa f9a7741781 fix overflow handling in meta-calls. 2014-08-15 19:34:20 -05:00
Vitor Santos Costa 7f3dc7e5ab Merge branch 'master' of https://github.com/vscosta/yap-6.3
Conflicts:
	CXX/yapi.hh
2014-08-11 00:28:25 +01:00
Vitor Santos Costa 9902364ea2 fix cache_regs 2014-08-10 00:27:55 +01:00
Vítor Santos Costa f09e115106 progress with sysgraph. 2014-08-07 20:36:55 -05:00
Vitor Santos Costa 3d0f7e2582 fix loop 2014-08-06 20:03:13 -05:00
Vitor Santos Costa 2aa8ad0fd3 fix \c in quoted strings 2014-08-06 20:02:28 -05:00
Vítor Santos Costa ef3a5754e6 syntax errors 2014-08-06 10:26:03 -05:00
Vítor Santos Costa 125e676b64 men at work 2014-08-06 10:25:30 -05:00
Vítor Santos Costa ed608db282 make goal expansion more readable 2014-08-06 10:25:08 -05:00
Vítor Santos Costa d9d4cdca79 fix syntax error in YAP 2014-08-05 09:10:06 -05:00
Vítor Santos Costa e431aa14fc more fixes, not quite there 2014-08-05 09:07:05 -05:00
Vítor Santos Costa 45c0671fa2 support open as script option, to avoid spurious warning message 2014-08-05 09:06:35 -05:00
Vítor Santos Costa 01bd6fa446 stub 2014-08-04 22:39:44 -05:00
Vítor Santos Costa f59e1f92cd stub 2014-08-04 22:38:40 -05:00
Vítor Santos Costa cc1f9dbf67 copy SWI missing library 2014-08-04 22:36:18 -05:00
Vítor Santos Costa 60aeb34457 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-08-04 22:30:26 -05:00
Vítor Santos Costa f8784fb658 updates 2014-08-04 22:30:08 -05:00
Vitor Santos Costa 070c976868 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2014-08-04 21:58:55 -05:00
Vitor Santos Costa 5e73c6cd84 stub for global analysis 2014-08-04 21:58:47 -05:00
Vitor Santos Costa 7f6ecc3f9a global analysis support. 2014-08-04 21:54:04 -05:00
Vítor Santos Costa 706784a61d fix findFun failure handling to avoid longjmp (copied from https://stat.ethz.ch/pipermail/r-devel/2007-July/046261.html) 2014-08-04 21:45:24 -05:00
Vitor Santos Costa c6652c0ef6 module system 2014-08-04 21:31:32 -05:00
Vitor Santos Costa 63d2f0f57e small fixes. 2014-08-04 21:30:41 -05:00
Vitor Santos Costa a8e301c486 the old R ibrary has been removed from the system. 2014-08-04 21:29:41 -05:00
Vitor Santos Costa 7a01daf8dd try fixing \c handling. 2014-08-04 21:28:45 -05:00
Vítor Santos Costa bc16bf83ec small fixes 2014-08-04 09:47:03 -05:00
Vítor Santos Costa a70da52e1f make sysgraph better 2014-08-04 09:46:21 -05:00
Vítor Santos Costa 823175f50a fix small bugs from changing style_check 2014-08-04 09:45:30 -05:00
Vitor Santos Costa 5c9468983f fix typo 2014-07-27 22:42:48 -05:00
Vitor Santos Costa f0f4fcbc94 get pred defs close to use as built-ins. 2014-07-27 22:41:40 -05:00
Vitor Santos Costa 9684352f1d fix complaints about mixing term, term_t and yapterm. 2014-07-27 22:39:33 -05:00
Vitor Santos Costa db029a478d more fixes 2014-07-27 22:35:06 -05:00
Vitor Santos Costa 0ef90c9b6a Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3
Conflicts:
	pl/modules.yap
2014-07-26 19:45:16 -05:00
Vitor Santos Costa 9179e4780b avoid operators 2014-07-26 19:43:16 -05:00
Vítor Santos Costa 325c819f79 intermediate steo in improving doc system to doxygeb 2014-07-26 19:14:15 -05:00
Paulo Moura 4183cd3d10 Fix typo in `aggregate` module name 2014-07-24 09:46:47 +01:00
Vítor Santos Costa ce8a4b6958 module fixes plus add better docs 2014-07-17 12:19:38 -05:00
Vítor Santos Costa dbff20343a small fixes to listing 2014-07-16 12:59:03 -05:00
Vítor Santos Costa 2becb15578 more android support changes. 2014-07-16 11:56:09 -05:00
Vítor Santos Costa f37806d7cc improve listing, make it more generous and SWi-like. 2014-07-16 11:55:16 -05:00
Vítor Santos Costa 1b57bdc2eb try to be really sicstus compatible 2014-07-16 11:54:59 -05:00
Vítor Santos Costa e918226918 SQLite for android 2014-07-15 18:57:48 -05:00
Vítor Santos Costa 369c64d3d3 Nicos sqlite interface 2014-07-15 18:57:09 -05:00
Vítor Santos Costa 3268920dc8 Nicos sqlite interface 2014-07-15 18:56:45 -05:00
Vítor Santos Costa 4d7b270ce4 fix bad handling of choice-points in backtrackable predicates (SWI code
does not clean frames on exit )
2014-07-15 18:40:15 -05:00
Vítor Santos Costa 6ba88f8cc0 fix paths and introduce exceptions in SWIG and android yap 2014-07-15 00:54:45 -05:00
Vítor Santos Costa e1fc397cc1 Merge branch 'master' of github.com:vscosta/yap-6.3 2014-07-14 00:05:00 -05:00
Vítor Santos Costa e6775d497c jit fixes 2014-07-14 00:04:02 -05:00
Vítor Santos Costa a1ea514c65 jit fixes 2014-07-14 00:03:29 -05:00
Vítor Santos Costa 0e79c53d1e swig error handling fixes 2014-07-14 00:03:08 -05:00
Vitor Santos Costa 0be1e7def1 improve script portability 2014-07-13 23:47:30 -05:00
Vitor Santos Costa da985b999b reset 2014-07-13 23:45:13 -05:00
Vitor Santos Costa 38355b5240 cleanups & avoid cd, it can lead to infinite loops; use make -C instead 2014-07-13 23:43:18 -05:00
Vitor Santos Costa e929db7543 handle -fpic flags for c++ 2014-07-13 23:42:02 -05:00
Vitor Santos Costa f960c404aa separate c++ from c error handling 2014-07-13 23:40:39 -05:00
Vítor Santos Costa 0738fe0bd2 New JIt system, developed by George Oliveira and Anderson Faustino. 2014-07-12 23:30:14 -05:00
Vítor Santos Costa 95bbdc8a17 more cleanups on maildrop 2014-07-10 09:09:08 -05:00
Vítor Santos Costa d8ecd6a202 start work on exception handling 2014-07-10 09:07:55 -05:00
Vítor Santos Costa 6c7a84a942 fix MYDDAS compilation 2014-07-10 09:07:24 -05:00
Vítor Santos Costa 04092424bf rename android compilation 2014-07-09 23:28:10 -05:00
Vitor Santos Costa 1097ee9b8d back to new version of real 2014-07-09 13:45:35 -05:00
Vitor Santos Costa f9b948f4c3 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2014-07-09 13:35:51 -05:00
Vítor Santos Costa 7fb9da901a more config fixes, this time use SHLIB flags 2014-07-09 13:35:17 -05:00
Vitor Santos Costa c9abfc28d7 merge with Nicos version 2014-07-09 13:14:22 -05:00
Vítor Santos Costa e167cdfa4c more config fixes, this time check again for mysql, but in the rifht place. 2014-07-09 12:52:55 -05:00
Vítor Santos Costa fcf5309653 flag fixing 2014-07-09 12:43:32 -05:00
Vítor Santos Costa 4decf015c5 Fixas myddas on the mysql/no odbc configurations 2014-07-09 12:29:48 -05:00
Vítor Santos Costa 219c07ed27 Fixas myddas on the mysql/no odbc configurations 2014-07-09 12:29:25 -05:00
Vítor Santos Costa 93f9753c3d end attempt to support pldoc 2014-07-08 15:19:43 +01:00
Vítor Santos Costa 8ad0cba7fe fix single name passing 2014-07-08 15:01:42 +01:00
Vítor Santos Costa 77c51f476f support doxy step 1 2014-07-08 15:00:58 +01:00
Vítor Santos Costa 2405ab23a5 improve error handling. 2014-07-03 13:58:00 +01:00
Vítor Santos Costa 597f5e93f7 fix names and paths. 2014-07-03 13:57:21 +01:00
Vítor Santos Costa 58038a199e support for doxygen. 2014-07-03 13:56:08 +01:00
Vítor Santos Costa db2d6a0ebd Start handling Prolog exceptions 2014-06-30 14:34:58 +01:00
Vítor Santos Costa 5b19ccf6a8 swig fixes for Android compatibility 2014-06-22 17:35:05 +01:00
Vitor Santos Costa 1f301ded89 fixes for Android compilation 2014-06-20 20:01:56 +01:00
Vítor Santos Costa 8994abfada bootstrap android script 2014-06-20 15:19:26 +01:00
Vítor Santos Costa d894bf23d0 android compilation script 2014-06-20 11:15:44 +01:00
Vítor Santos Costa 74a65633d8 fix duplicated system predicate + android related cleanups 2014-06-20 11:13:39 +01:00
Vítor Santos Costa d0f2f50a8e integrate maildrop config in main config 2014-06-20 11:11:07 +01:00
Vítor Santos Costa 5d4cc16789 fix dependency on gmp path 2014-06-19 15:10:11 +01:00
Vítor Santos Costa d4bffbaefd fix warnings 2014-06-19 15:09:44 +01:00
Vítor Santos Costa b111ed13f8 fix dynamic lib naming 2014-06-19 15:08:54 +01:00
Vítor Santos Costa 10a1a00b78 fix sysroot 2014-06-19 15:07:54 +01:00
Vítor Santos Costa b88c8e6b82 improve docs and method names 2014-06-19 15:06:15 +01:00
Vítor Santos Costa 6a9e496bde fix warnings 2014-06-19 15:05:46 +01:00
Vítor Santos Costa 32a4ea3a94 patch by J santos to make ORP work again. 2014-06-19 15:04:48 +01:00
Vítor Santos Costa 7463a9d31d fix readline configuration: if readline not found autoconf should still
go on.
2014-06-18 10:24:02 +01:00
Vítor Santos Costa 50dea76186 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-06-17 16:59:08 +01:00
Vitor Santos Costa af2194b21d Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-06-17 16:58:33 +01:00
Vitor Santos Costa 410b2c6c28 fix example install 2014-06-17 16:58:17 +01:00
Vítor Santos Costa fea65ba68d clean-up: use No Spy and No Trace predicate flags. 2014-06-17 16:24:40 +01:00
Vítor Santos Costa 80af72f2e6 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-06-17 15:47:05 +01:00
Vitor Santos Costa 87d7c90171 adtdefs.c: add debugging code to verify when a specific predicate is added.
modules.* implemente module_property/2:class(_)
prism: comment unneeded labels.
2014-06-17 15:44:46 +01:00
Vitor Santos Costa 92f0a91f85 add debugging code to verify when a specific predicate is added. 2014-06-17 15:06:23 +01:00
Vitor Santos Costa e8f2c37000 fix syntax error in using time. 2014-06-16 17:00:09 +01:00
Vitor Santos Costa e1e095d033 fix locking macro to actually lock. 2014-06-16 16:46:05 +01:00
Vítor Santos Costa 6ba0d44a01 fix compilation problem. 2014-06-16 15:57:04 +01:00
Vítor Santos Costa ff2a7a364f mod prperty step 1 2014-06-16 15:00:04 +01:00
Vítor Santos Costa 0a1b7de414 get rid of warings 2014-06-16 14:59:06 +01:00
Vítor Santos Costa ef59cdc50c swi is no longer a module, so needs no windows init code 2014-06-16 14:58:28 +01:00
Vítor Santos Costa 07c9aa5bca fix typo 2014-06-16 14:57:12 +01:00
Vítor Santos Costa 0b569a374e fix call of android_log_print to make sure it plays well with the remaining code.
Signed-off-by: Vítor Santos Costa <vsc@dcc.fc.up.pt>
2014-06-16 14:43:18 +01:00
Vítor Santos Costa 8da6fb70e1 handle_t type name causes conflict with WIN32, replace by yhandle_t 2014-06-16 14:41:54 +01:00
Vítor Santos Costa f00a6d5a40 small bugfixes and leaks, patch by João Silva 2014-06-14 10:27:39 +01:00
Vítor Santos Costa 6286de06be warnings and configuration issues 2014-06-14 10:19:44 +01:00
Vítor Santos Costa ed04954b3f fix module expansion inside arguments. 2014-06-13 10:16:18 +01:00
Vítor Santos Costa 8f5c9e1681 fix nissing #if 2014-06-12 11:03:35 +01:00
Vítor Santos Costa aefb7b3668 more Android debugging. 2014-06-12 01:49:03 +01:00
Vítor Santos Costa 3929fc9009 fix compilation with swiwg for now 2014-06-12 01:48:36 +01:00
Vítor Santos Costa daae1df152 g++ coplaints (llvm) 2014-06-12 01:25:50 +01:00
Vítor Santos Costa ba6d46578b fix deadlock 2014-06-12 01:24:10 +01:00
Vítor Santos Costa d73793de63 remove debugging info. 2014-06-12 01:22:56 +01:00
Vitor Santos Costa 489bb27a7e Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-06-11 19:45:21 +01:00
Vitor Santos Costa ec881b8e13 improve functor locking. 2014-06-11 19:44:01 +01:00
Vítor Santos Costa 059884bc03 Android 2014-06-11 19:36:50 +01:00
Vítor Santos Costa 6de73e6469 introudce handle_t and arity_t
Android: /assets and debugging
2014-06-11 19:35:45 +01:00
Vítor Santos Costa aef189ece2 Android /assets/ support (still not quite working) 2014-06-11 19:33:18 +01:00
Vítor Santos Costa 2d2eb70842 improve Android support 2014-06-11 19:31:24 +01:00
Vítor Santos Costa ab06b04a09 fix non locale code 2014-06-11 19:30:44 +01:00
Vítor Santos Costa 0241151599 support for init, callbacks 2014-06-11 19:27:54 +01:00
Vítor Santos Costa 2455a1d83c Android /assets support 2014-06-11 19:26:50 +01:00
Vítor Santos Costa 71b40e0438 changes to support eclipse compat
support of Android assets as /assets files.
2014-06-04 22:08:37 +01:00
Vítor Santos Costa 3087d51b18 more swig upddates. 2014-06-04 22:07:37 +01:00
Vítor Santos Costa a76b6d23dc Fix: eclipse >u. into >y_u. 2014-05-30 01:06:09 +01:00
Vítor Santos Costa e3674e1223 fix: warningss 2014-05-30 01:01:58 +01:00
Vítor Santos Costa 37e8fcc353 Fix: bad implementation of with_mutex/2 2014-05-30 01:00:57 +01:00
Vítor Santos Costa 21fe137d27 FIX: warnings 2014-05-30 00:59:42 +01:00
Vítor Santos Costa 2400911db9 FIX: readline 6.3 type changes 2014-05-29 11:40:29 +01:00
Vítor Santos Costa cb8b05d516 FIX: skipped one Bind 2014-05-29 11:37:50 +01:00
Andreas Becker dc37d76e8b Merge branch 'github.com/master'
Conflicts:
	Makefile.in
2014-05-29 12:19:45 +02:00
Andreas Becker 3339d9cfa5 Fix: Make Windows installation scripts that install in user space. 2014-05-29 11:41:39 +02:00
Andreas Becker f01de36c23 Fix: Don't need to define LOCK just use PL_LOCK from SWI headers. 2014-05-29 11:40:33 +02:00
Andreas Becker daaaf52338 Fix: Windows likes .exe executables. 2014-05-29 11:39:00 +02:00
Andreas Becker d5358ab932 Fix: Removed debugging message. 2014-05-29 11:34:26 +02:00
Andreas Becker c3fd689865 Fix: Make make work in Windows.
Debugging: Add install_startup for slower machines.
2014-05-29 11:33:56 +02:00
Andreas Becker 72b9ec59b7 Fix: Win32 defines Bind, so change Bind to YapBind. 2014-05-29 11:32:28 +02:00
Andreas Becker 4ff9b80846 Fix: Improve signal handling in threaded windows. 2014-05-29 11:30:09 +02:00
Vitor Santos Costa e7e9dab151 allow memory recovery 2014-05-28 01:54:28 +01:00
Vítor Santos Costa 800ddd23a6 oops 2014-05-28 01:40:03 +01:00
Vítor Santos Costa f9c6be85c7 oops 2014-05-28 01:23:42 +01:00
Vítor Santos Costa 3c0f910906 more random 2014-05-28 01:12:51 +01:00
Vítor Santos Costa 1e08a7ce05 more readline breakage. 2014-05-28 00:35:50 +01:00
Vítor Santos Costa fa75599e7f docs 2014-05-28 00:12:36 +01:00
Vítor Santos Costa 41606bdc44 improve android compilation and fix readline 6.3 2014-05-28 00:11:47 +01:00
Vítor Santos Costa edb4c3fbec Android stuff 2014-05-28 00:11:00 +01:00
Vítor Santos Costa fa27e045a3 try compiling without STL :( 2014-05-28 00:09:36 +01:00
Vítor Santos Costa 0d52c2d730 android compilation framework: a simple example. 2014-05-28 00:07:50 +01:00
Vítor Santos Costa 042b3e4343 improve android compilation and fix readline 6.3 2014-05-28 00:07:08 +01:00
Vítor Santos Costa 0b2dff96d3 maplist: move docs to doxygen; add doxygen. 2014-05-27 22:44:03 +01:00
Vitor Santos Costa 3a21922e37 fix 32 bit operations 2014-05-25 23:49:01 +01:00
Vítor Santos Costa b2d34d016f get rid of debugging msg 2014-05-25 21:44:32 +01:00
Vítor Santos Costa 5f72d8c332 purge duplicated content. 2014-05-25 20:53:24 +01:00
Vítor Santos Costa ec2e1c21b0 fix docs 2014-05-25 20:52:45 +01:00
Vítor Santos Costa 2c7e62ad71 handle :-use_module on non module.
improve handling of redefinitions.
2014-05-25 20:51:42 +01:00
Vítor Santos Costa eaef6aba9a fix small EClipse complaints 2014-05-25 20:50:43 +01:00
Vítor Santos Costa dee3774bbc fix small EClipse complaints 2014-05-25 20:50:07 +01:00
Vítor Santos Costa 99ab3fb748 no need to use PROTO. 2014-05-25 20:48:44 +01:00
Vítor Santos Costa 0ebea4ec26 synch interface with implementation. 2014-05-25 20:48:06 +01:00
Vítor Santos Costa ba40cc3b39 use const wherever possible 2014-05-25 20:47:35 +01:00
Vítor Santos Costa 692e2358b1 fix missing instruction. 2014-05-25 20:46:39 +01:00
Vítor Santos Costa 4172f4efd5 use const wherever possible 2014-05-25 20:46:04 +01:00
Vítor Santos Costa 6b409a55a6 use const wherever possible 2014-05-25 20:44:57 +01:00
Vítor Santos Costa a719c19d03 fix interrupt handling, especially for ! and ;
avoid using S.
2014-05-25 20:43:52 +01:00
Vítor Santos Costa 279a057d80 use mktemp instead of tmpname 2014-05-25 10:21:28 +01:00
Vítor Santos Costa 8e798db830 fix bad use of interface. 2014-05-25 09:57:17 +01:00
Vítor Santos Costa b7c05b49e2 support debugging of compiler-level instructions. 2014-05-22 21:57:54 +01:00
Vítor Santos Costa 3310a904c4 ensure that if we load a file that does not define a module, it is reconaulted per every different module 2014-05-18 14:47:23 +01:00
Vítor Santos Costa 791702e4ec fix warnings 2014-05-18 10:33:24 +01:00
Vítor Santos Costa e0c3c2d444 avoid warnings and fix collisions with eclipse. 2014-05-17 22:56:23 +01:00
Vitor Santos Costa 0aa91d7c00 fix bad handle recovery properly. 2014-05-15 01:11:26 +01:00
Vitor Santos Costa 7c8e2bbd16 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2014-05-15 01:10:56 +01:00
Vítor Santos Costa 13bc66f89c Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3
Conflicts:
	packages/zlib
2014-05-15 01:00:11 +01:00
Vitor Santos Costa b532fbd0b9 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3
Conflicts:
	C/write.c
2014-05-14 18:00:25 +01:00
Vitor Santos Costa e0d0543e52 fix removeSlots and more documnetation. 2014-05-14 17:59:08 +01:00
Vitor Santos Costa e90fda2d5f interface work. 2014-05-14 17:58:15 +01:00
Vitor Santos Costa 94032de135 fix recover slots. 2014-05-14 17:57:41 +01:00
Vítor Santos Costa 596768a56b documenetation . 2014-05-14 10:01:11 +01:00
Vítor Santos Costa 503b2b93f9 indenting and fix bad usage of recover slots. 2014-05-14 10:00:40 +01:00
Vítor Santos Costa 24b90ae6bd doc changes 2014-05-12 17:49:11 +01:00
Vitor Santos Costa a35521b52c bad merge 2014-05-12 16:52:40 +01:00
Vitor Santos Costa 5ebb0d2d74 new version of module 2014-05-12 16:52:11 +01:00
Vitor Santos Costa da48f3a877 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3
Conflicts:
	H/eval.h
2014-05-12 16:41:13 +01:00
Vitor Santos Costa eb8f4cebcc idocumentation updates. 2014-05-12 16:39:13 +01:00
Vitor Santos Costa ee2d1f1332 add documentation. 2014-05-12 16:36:41 +01:00
Vítor Santos Costa aaed6ded8d fix lists without arguments. 2014-05-07 17:15:12 +01:00
Vítor Santos Costa 323386e34b another try for use_module/3. 2014-05-07 15:04:17 +01:00
Vítor Santos Costa cd5f44f762 makefile stuff. 2014-05-07 09:43:14 +01:00
Vítor Santos Costa 4f1a0d985c more docs 2014-05-07 09:38:56 +01:00
Vítor Santos Costa 0acfbceab2 fix dead code. 2014-05-07 09:37:15 +01:00
Vítor Santos Costa a54a101fb0 emacs typo :( 2014-05-07 09:36:40 +01:00
Vítor Santos Costa 98daf1ebdd bad call to style_checker. 2014-05-07 09:35:57 +01:00
Vítor Santos Costa 06e29a4978 bad makefile 2014-05-07 09:35:19 +01:00
Vítor Santos Costa 410efd577c fix comment mess
add some more documentation (slowly).
2014-05-06 23:01:04 +01:00
Vítor Santos Costa 5e701460f2 fix CXX mess-up.
fix cplint configuration.
2014-05-06 23:00:17 +01:00
Vítor Santos Costa f2ee773f55 fix broken comment. 2014-05-06 22:32:18 +01:00
Vítor Santos Costa f0d17d0210 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3
Conflicts:
	docs/doxygen.rc
2014-05-06 13:59:28 +01:00
Vítor Santos Costa 2dc4d66bb9 doc 2014-05-06 13:58:08 +01:00
Vitor Santos Costa b370404432 C++ flags 2014-05-06 09:55:40 +01:00
Vitor Santos Costa 73ff8676ca file systems without case 2014-05-06 09:39:04 +01:00
Vitor Santos Costa 4ebe56aad9 C++ flags 2014-05-06 09:38:22 +01:00
Vitor Santos Costa df1dfc821a eclipse 2014-05-06 09:37:32 +01:00
Vitor Santos Costa d6aa3ed8f0 use_module/3 wasn't working. 2014-05-06 09:34:25 +01:00
Vitor Santos Costa 2ec6d6588d do not compile pldoc for now 2014-05-06 09:32:49 +01:00
Vitor Santos Costa e981973d56 fix disappearing syntax error 2014-05-05 16:27:54 +01:00
Vítor Santos Costa 451a37d708 Merge branch 'master' of ssh://git@git.dcc.fc.up.pt/yap-6.3 2014-05-05 14:13:08 +01:00
Vítor Santos Costa e9672e9820 android project 2014-05-05 14:12:52 +01:00
Vitor Santos Costa 549b4dd834 add header 2014-05-05 14:01:21 +01:00
Vitor Santos Costa f1b88583e4 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3
Conflicts:
	library/listing.yap
2014-05-05 13:59:58 +01:00
Vitor Santos Costa 426d952894 add listing.yap 2014-05-05 13:53:39 +01:00
Vítor Santos Costa bbad94e5dd psckage compilation stuff. 2014-05-04 23:15:39 +01:00
Vítor Santos Costa 7393dd1405 :dummy library, for now. 2014-05-04 23:15:10 +01:00
Vítor Santos Costa 462bb216f7 patch from Denis Duchier: compilation issues. 2014-05-04 23:14:18 +01:00
Vítor Santos Costa 3c99f0b055 more progress 2014-05-04 23:02:28 +01:00
Vítor Santos Costa bda0c4694a swig stuff. 2014-05-04 22:33:13 +01:00
Vítor Santos Costa bf357212af fix typo. 2014-05-04 22:32:41 +01:00
Vítor Santos Costa ba523a7910 eclipse stuff. 2014-05-04 22:32:18 +01:00
Vítor Santos Costa a2e141482c keep working on C++ interface. 2014-05-04 22:31:22 +01:00
Vítor Santos Costa 53bb9928eb fix documenttion (small stuff). 2014-05-04 22:30:33 +01:00
Vítor Santos Costa f8ab2d093e work-around android bug. 2014-05-04 22:29:23 +01:00
Vítor Santos Costa 6738682c26 handle int64 in 32 bits no gmp as floats.. 2014-05-04 22:26:53 +01:00
Vítor Santos Costa cf39051162 fix gcc complaint. 2014-05-02 01:44:07 +01:00
Vitor Santos Costa df7425922a compile. 2014-04-29 18:43:17 +01:00
Vitor Santos Costa 156501d27d cannot use setup.py. don't know why 2014-04-29 18:25:06 +01:00
Vitor Santos Costa 8c6aa05b17 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2014-04-29 18:19:07 +01:00
Vitor Santos Costa fa31fb1468 make sure we use the defined C++. 2014-04-29 18:18:42 +01:00
Vitor Santos Costa d58dcdc3e6 portability. 2014-04-29 18:17:23 +01:00
Vitor Santos Costa 4b3e9691ef C++ for a nicer progrmming style. 2014-04-29 11:49:09 +01:00
Vitor Santos Costa 592ad902a0 improve interface 2014-04-29 11:45:19 +01:00
Vítor Santos Costa 23561d086b support for SWIG. 2014-04-28 11:57:09 +01:00
Vítor Santos Costa 3efe5df28e C++ compatibility. 2014-04-28 11:54:47 +01:00
Vítor Santos Costa 785e404de4 C++ compatibility. 2014-04-28 11:48:24 +01:00
Vítor Santos Costa 6bcda04a52 deadlock avoidance. 2014-04-28 11:47:53 +01:00
Vítor Santos Costa 2f852223ec new C++ interface 2014-04-28 11:47:09 +01:00
Vitor Santos Costa ed0910fe94 fix thread_local decls. 2014-04-24 14:25:21 +01:00
Vitor Santos Costa 58336add23 fix module export. 2014-04-24 14:24:50 +01:00
Vitor Santos Costa 4867563b09 fix multifile handling. 2014-04-24 14:24:27 +01:00
Vitor Santos Costa 05ac1dc920 small fixes:
- fix consult as reconsult
- declaring P twice as thread_local confused yap
- missing UNLOCK.
2014-04-24 12:54:08 +01:00
Vítor Santos Costa 1db83cc30d make consult reconsult the original file, so that
[x]. [x].
is more like
[x]. [-x].
2014-04-24 11:40:35 +01:00
Vítor Santos Costa d8f4a77f47 fix style_check to be called at parse-time and not cause eexcution overheads. 2014-04-24 08:26:31 +01:00
Vitor Santos Costa 6591b5429c Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2014-04-23 22:42:03 +01:00
Vitor Santos Costa aba5f3d88b handle locking more carefully (especially protect gc and stack shifting). 2014-04-23 22:41:12 +01:00
Vítor Santos Costa f1951777b7 fix checker to use read for singleton variables, instead of always computing
them.
2014-04-23 21:39:32 +01:00
Vítor Santos Costa 605e68c80d fix prolog:messages 2014-04-21 11:29:05 +01:00
Vítor Santos Costa 0625f1d7ad doc support 2014-04-21 11:20:00 +01:00
Vítor Santos Costa 137f69ed22 doc support 2014-04-21 11:14:18 +01:00
Vitor Santos Costa 83ec7d9072 fix indent 2014-04-11 02:27:10 +01:00
Vítor Santos Costa 295be2d5be doc fixes 2014-04-10 11:59:30 +01:00
Vitor Santos Costa d199c64de6 fix conversion to markdown 2014-04-09 14:00:54 +01:00
Vítor Santos Costa ca0c646793 doc updates 2014-04-09 12:50:27 +01:00
Vítor Santos Costa 250099cfe8 doc updates 2014-04-09 12:49:23 +01:00
Vítor Santos Costa 3396c1ca18 doc updates 2014-04-09 12:44:26 +01:00
Vítor Santos Costa c629ae9283 doc updates 2014-04-09 12:39:52 +01:00
Vítor Santos Costa a8c77d2609 fix string_concat/2 2014-04-09 12:39:29 +01:00
Vitor Santos Costa 8b9da05d66 check system files 2014-04-06 17:07:36 +01:00
Vitor Santos Costa f39ed68fe8 check for mistypes 2014-04-06 17:06:19 +01:00
Vitor Santos Costa cc84cd8cb5 check for mistypes 2014-04-06 17:05:17 +01:00
Vítor Santos Costa a6c115b248 fix deadlock 2014-03-27 15:35:18 +00:00
Vítor Santos Costa f7283f6b70 fix xminor bugs in manual 2014-03-27 15:34:25 +00:00
Vítor Santos Costa 683b5989ae fix sub_string and friends 2014-03-27 15:31:03 +00:00
Vítor Santos Costa 3b2944511e improve debugger warnings 2014-03-27 15:30:17 +00:00
Vitor Santos Costa ce0715e75a fix IOSTREAM 2014-03-20 16:23:07 +00:00
Vitor Santos Costa 141b8ac4cb fix warnings. 2014-03-20 15:41:17 +00:00
Vitor Santos Costa 37c018d4b5 add proto for WriteAtom 2014-03-20 15:40:56 +00:00
Vitor Santos Costa ace56c730b Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2014-03-20 13:34:59 +00:00
Vitor Santos Costa 506ac57509 enable debugging to start by default. 2014-03-20 13:33:47 +00:00
Vitor Santos Costa 41e1980f83 fix memory leaks 2014-03-20 13:33:17 +00:00
Vitor Santos Costa 8dd1ddbca3 ensure things get locked when enterng dynamic code. 2014-03-20 13:32:35 +00:00
Vítor Santos Costa 028f30850f get rid of warnings 2014-03-20 12:32:51 +00:00
Vitor Santos Costa e337d6aba0 avoid using min 2014-03-20 12:19:38 +00:00
Vitor Santos Costa e6fbba4030 fix bad copy to S 2014-03-18 19:32:10 +00:00
Vitor Santos Costa 2c5d6ad488 follow .in 2014-03-18 17:29:42 +00:00
Vítor Santos Costa f3597f3d02 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2014-03-18 17:28:14 +00:00
Vítor Santos Costa f0d8ee91d0 fix foldl2 2014-03-18 17:27:56 +00:00
Vítor Santos Costa 0e1b1dd4bc remove debugging 2014-03-18 17:27:12 +00:00
Vítor Santos Costa 39498868fb support detection of signals. 2014-03-18 17:26:01 +00:00
Vítor Santos Costa 875546e36a don't optimise sub-args, as it may introduce new variables. 2014-03-18 17:24:20 +00:00
Vitor Santos Costa d3692b087f fix make depend 2014-03-18 15:41:54 +00:00
Vitor Santos Costa 5a83e7c7a6 fix text handling for wide strinbgs with max length. 2014-03-18 15:40:50 +00:00
Vítor Santos Costa a6cb6f6a25 paths are hard 2014-03-16 18:59:54 +00:00
Vitor Santos Costa 6462a09e59 win32: unicode and small fixes 2014-03-16 00:52:43 +00:00
Vitor Santos Costa b932008946 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2014-03-16 00:15:34 +00:00
Vítor Santos Costa 79763e9ea1 fix signal handling 2014-03-15 23:47:29 +00:00
Vitor Santos Costa 39d237de04 more humnan interface 2014-03-15 23:02:09 +00:00
Vitor Santos Costa 5a73c525e9 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2014-03-15 22:48:12 +00:00
Vítor Santos Costa 242f872b5d Merge /Users/vsc/git/yap-6.3 2014-03-15 22:29:08 +00:00
Vítor Santos Costa 5491abdeeb clean up and support missing locale 2014-03-15 22:29:04 +00:00
Vítor Santos Costa 9c008ac769 use TRUE for booleans 2014-03-15 22:24:02 +00:00
Vítor Santos Costa cd5423a8bf new commits 2014-03-15 22:22:54 +00:00
Vítor Santos Costa 4bc537a37b new commits 2014-03-15 22:22:43 +00:00
Vítor Santos Costa 801c4cb369 catch warnings 2014-03-15 22:22:11 +00:00
Vítor Santos Costa e9eb030bb6 catch warnings 2014-03-15 22:21:54 +00:00
Vítor Santos Costa 6d2e2597b1 C++ incompatibilities. 2014-03-14 23:03:22 +00:00
Vítor Santos Costa e843d8f536 receent updates. 2014-03-14 23:03:05 +00:00
Vitor Santos Costa 228bc76a35 Eclipse Support 2014-03-13 16:57:21 +00:00
Vítor Santos Costa 4591e1baaf Eclipse stuff 2014-03-13 12:54:06 +00:00
Vítor Santos Costa 242f585484 Eclipse stuff 2014-03-13 12:52:08 +00:00
Vítor Santos Costa c3d0504a54 Avoid using repeated fiels names ( u -> ut ). 2014-03-12 15:47:53 +00:00
Vitor Santos Costa 0602031bd9 win64 2014-03-11 15:36:02 +00:00
Vitor Santos Costa 2c82906714 fix paths 2014-03-11 15:34:26 +00:00
Vitor Santos Costa d0adb0b910 fix slot handling 2014-03-11 15:33:38 +00:00
Vítor Santos Costa b815e64740 README -> add TXT file. 2014-03-11 11:24:10 +00:00
Vítor Santos Costa 2812ad5704 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-03-11 10:43:24 +00:00
Vítor Santos Costa 6bb4475182 Ulrich Clarification for variable_names/1 in read_term/3. 2014-03-11 10:32:20 +00:00
Vítor Santos Costa 8cf9e44a57 fix CHARESCAPE mess (Ulrich #292) 2014-03-11 10:24:44 +00:00
Vítor Santos Costa 4160562e45 string for lines and files 2014-03-10 15:51:49 +00:00
Vitor Santos Costa e97bac6548 fix compilation in win:32 and 64 bits 2014-03-10 07:12:15 +00:00
Vítor Santos Costa 265bc20f90 simplify absf 2014-03-09 12:26:07 +00:00
Vítor Santos Costa 9408c8a866 simplify absf 2014-03-09 12:26:03 +00:00
Vítor Santos Costa f163ca8ea0 fix last patch fix 2014-03-09 00:21:19 +00:00
Vítor Santos Costa 6a75bc3a38 fix last patch 2014-03-09 00:13:59 +00:00
Vitor Santos Costa 3d0bb05ef0 João Silva patch for yapor copy+tabling 2014-03-08 11:50:20 +00:00
Vítor Santos Costa 233c4ee903 fix bad initialization in signals 2014-03-08 00:03:58 +00:00
Vítor Santos Costa 7e85bfd4a4 yapor support by João Silva 2014-03-07 23:07:46 +00:00
Vítor Santos Costa 06d99506cf osx patches 2014-03-06 15:39:56 +00:00
Vitor Santos Costa f257efc2ef without threads 2014-03-06 14:07:33 +00:00
Vitor Santos Costa 47d436fc13 WIN32 with threads 2014-03-06 13:34:35 +00:00
Vitor Santos Costa 386e15c425 more updates 2014-03-06 12:32:41 +00:00
Vitor Santos Costa e2c44e492f fix paths 2014-03-06 02:20:58 +00:00
Vitor Santos Costa 0dc40370dc merge 2014-03-06 02:18:02 +00:00
Vitor Santos Costa 2c89aadb11 WIN64 support (sill needs improvement) 2014-03-06 02:09:48 +00:00
Vitor Santos Costa 49d643d98f script for compilation 2014-03-06 02:04:21 +00:00
Vitor Santos Costa 23a7a52841 update to SWI's latest 2014-03-06 02:03:10 +00:00
Vitor Santos Costa aba6d5741e imrove support for yap-win 2014-03-06 02:02:34 +00:00
U-vsc-PC\vsc b7fbd08f7a signal handling 2014-03-04 12:03:14 +00:00
U-vsc-PC\vsc 77f3de2fbe directory, new signal interface 2014-03-04 12:02:26 +00:00
U-vsc-PC\vsc ec8f12d38b improve executable search. 2014-03-04 12:00:13 +00:00
U-vsc-PC\vsc f8f2376394 use iuse executable to handle cases hwere we may have different versions of YAP around. 2014-03-04 11:58:48 +00:00
Vitor Santos Costa 0ab280ad25 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3
Conflicts:
	configure
	configure.in
2014-02-27 16:33:25 +00:00
Vitor Santos Costa e9fce51e92 ndk support 2014-02-27 16:31:20 +00:00
U-vsc-PC\vsc eff7a5afcc Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2014-02-26 23:34:09 +00:00
Vítor Santos Costa fda1c534d4 win32 2014-02-26 23:33:30 +00:00
U-vsc-PC\vsc 50eb140deb Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2014-02-26 22:16:54 +00:00
U-vsc-PC\vsc 93c84b4ace remember how to compile under win 2014-02-26 22:16:52 +00:00
U-vsc-PC\vsc d4b6bc58d5 initial icons 2014-02-26 22:16:28 +00:00
U-vsc-PC\vsc 77b50d9058 first icon 2014-02-26 22:15:32 +00:00
U-vsc-PC\vsc 4dbe41262a first icon 2014-02-26 22:15:07 +00:00
U-vsc-PC\vsc a289c05d3a new file. 2014-02-26 22:13:54 +00:00
Vítor Santos Costa 2d3d9441ef update to latest swi console code 2014-02-26 22:10:17 +00:00
Vitor Santos Costa d9fce3935b Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2014-02-22 22:57:01 +00:00
Vitor Santos Costa 9464c9f85c win32 fixes 2014-02-22 22:56:41 +00:00
Vítor Santos Costa 3da5cc5977 check libpthread in win32 2014-02-22 22:48:29 +00:00
Vítor Santos Costa 87d6a6cc31 fix paths 2014-02-20 16:20:14 +00:00
Vítor Santos Costa f21823ea00 Merge /Users/vsc/git/yap-6.3 2014-02-20 10:39:14 +00:00
Vítor Santos Costa f264859483 - versioning in macos
- fixes to input/output to improve interaction with eclipse console.
-
2014-02-20 10:38:18 +00:00
Vítor Santos Costa 178af282ab Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2014-02-19 22:31:49 +00:00
Vítor Santos Costa 4cd981c275 fix tags & depend 2014-02-19 22:31:41 +00:00
Vitor Santos Costa 42ec115e75 Support dynamic lib versionin in Linux. 2014-02-19 17:45:46 +00:00
Vítor Santos Costa d3b3a45dde improve handling of meta-call in setof and debugging 2014-02-19 00:04:26 +00:00
Vítor Santos Costa 2ba405389b fix share dir mess up in configure. 2014-02-18 13:27:24 +00:00
Vítor Santos Costa 6bde2d2cd7 avoid unions called u: they confuse eclipse. 2014-02-18 09:44:01 +00:00
Vitor Santos Costa 964b15d107 keep on simplifying configure. 2014-02-18 07:59:47 +00:00
Vitor Santos Costa b3f3a3e1bb fix path for mime 2014-02-17 09:06:49 +00:00
Vítor Santos Costa 891420c367 fix Makefile 2014-02-16 15:20:33 +00:00
Vítor Santos Costa 6522eb2e5a fix Makefile 2014-02-16 15:20:07 +00:00
Vítor Santos Costa 6a1302221c change to support autoheaders 2014-02-16 13:03:09 +00:00
Vítor Santos Costa 9214f50eb5 absolute path 2014-02-16 13:02:39 +00:00
Vítor Santos Costa 362345d995 use VPATH 2014-02-16 12:57:50 +00:00
Vítor Santos Costa 786d6abeda fix changes in variable names 2014-02-16 12:57:00 +00:00
Vítor Santos Costa e81f473802 fix eclipse warnings 2014-02-16 12:56:22 +00:00
Vítor Santos Costa 7b69d48afb fix undefined CP and user:rl_add_history is a built-in. 2014-02-16 12:52:18 +00:00
Vítor Santos Costa 1bd528198a more configuration fixes 2014-02-15 01:24:07 +00:00
Vítor Santos Costa e52d8f7d7e don't complain big int in arg/3 2014-02-14 22:47:16 +00:00
Vítor Santos Costa 625c66015d avoid factorized trouble 2014-02-14 22:44:55 +00:00
Vítor Santos Costa 12364bb89a cleanup modules and fix loading swi emulation 2014-02-14 20:26:09 +00:00
Vitor Santos Costa 294131b1b6 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2014-02-13 11:57:59 +00:00
Vitor Santos Costa d0efa26d8b Merge branch 'rtries' of git.dcc.fc.up.pt:yap-6.3
Conflicts:
	OPTYap/tab.insts.i
	OPTYap/tab.tries.c
	OPTYap/tab.tries.i
2014-02-13 11:57:46 +00:00
João Santos bb061f9db8 remove GLOBAL_executing_workers 2014-02-13 10:13:45 +00:00
Vítor Santos Costa 2c24fb7a83 typo 2014-02-13 02:10:37 +00:00
Vítor Santos Costa 4e5a2e3a20 typo 2014-02-13 02:09:36 +00:00
Vítor Santos Costa 0953ecc5d7 typo 2014-02-13 02:08:16 +00:00
Vítor Santos Costa d6f4707caf typo 2014-02-13 02:05:52 +00:00
Vítor Santos Costa 2cdeb3f1c1 typo 2014-02-13 02:02:51 +00:00
Vítor Santos Costa 1d27d22ef0 big makefile cleanup 2014-02-13 01:58:48 +00:00
Vítor Santos Costa 0420169bd0 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-02-12 23:38:58 +00:00
Vítor Santos Costa d28f065454 distclean should call clean 2014-02-12 23:38:46 +00:00
Vitor Santos Costa 0664e1f647 configuration issues 2014-02-12 23:35:00 +00:00
Vitor Santos Costa 984415b807 use abs path 2014-02-12 01:05:37 +00:00
Vítor Santos Costa 89789d6828 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3
Conflicts:
	configure
	packages/clib
	packages/real
2014-02-12 00:44:34 +00:00
Vítor Santos Costa 46179c4eca Merge branch 'master' of /Users/vsc/Yap/yap-6.3
Conflicts:
	configure
2014-02-12 00:36:03 +00:00
Vítor Santos Costa e2bd922f8b fix warning 2014-02-12 00:34:40 +00:00
Vítor Santos Costa df0986eb45 clib 2014-02-12 00:33:50 +00:00
David Vaz 3cad9c37b1 removed unnecessary cut_c macros (always on) 2014-02-11 07:15:39 -08:00
Vitor Santos Costa 1d7407ba4d fix horus 2014-02-11 13:56:40 +00:00
Vitor Santos Costa 6110ecb95d update submodules 2014-02-11 13:44:17 +00:00
Vitor Santos Costa 88c2839b36 Merge /home/vsc/git/yap-6.3 2014-02-11 13:32:18 +00:00
Vitor Santos Costa 365dcd5bca fix missing packages 2014-02-11 13:31:53 +00:00
Vitor Santos Costa 9b00f3700c fix missing packages 2014-02-11 13:27:26 +00:00
Vítor Santos Costa 78596fe951 fix configure 2014-02-11 00:14:00 +00:00
Vítor Santos Costa 17d1f11b5c Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2014-02-10 23:57:30 +00:00
Vítor Santos Costa ab40f20a2b Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3
Conflicts:
	configure
2014-02-10 23:57:18 +00:00
Vitor Santos Costa 8d624cda6b Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2014-02-10 23:56:09 +00:00
Vitor Santos Costa bfc94cbbe5 fix matlab autoconf 2014-02-10 23:55:35 +00:00
Vitor Santos Costa bcde1666fb package updates 2014-02-10 23:46:22 +00:00
Vitor Santos Costa 9a46cdac9b clean up makefile 2014-02-10 23:31:33 +00:00
Vitor Santos Costa 00f0d449ec clean up makefile 2014-02-10 23:30:21 +00:00
Vitor Santos Costa 231290bad3 clean up makefile 2014-02-10 23:30:21 +00:00
Vitor Santos Costa 89e2c86a0b clean up makefile 2014-02-10 23:30:21 +00:00
Vitor Santos Costa 5bf0a5de61 clean up makefile 2014-02-10 23:30:21 +00:00
Vitor Santos Costa 2bb21e9e1b clean up makefile 2014-02-10 23:30:21 +00:00
Theo 260a29f4e7 Added examples for ICLP2014 submission 2014-02-10 15:35:37 +00:00
Vítor Santos Costa 034878ab88 fix raptor trouble 2014-02-09 22:17:36 +00:00
Vitor Santos Costa a012017635 don't crash strip_module 2014-02-09 18:07:17 +00:00
Vitor Santos Costa e0642dbaa3 reexport again 2014-02-09 18:06:37 +00:00
Vitor Santos Costa 93859706e3 fix source file for predicates 2014-02-09 11:00:11 +00:00
Vitor Santos Costa 043c97157f fix source file for predicates 2014-02-09 11:00:01 +00:00
Vitor Santos Costa ca0c43ba8d module expansion, again 2014-02-09 10:47:44 +00:00
Vitor Santos Costa 8d8a4104b9 strip_module should try to always return a valid module 2014-02-09 10:46:43 +00:00
Vitor Santos Costa f26cb133b9 fix left-over slots 2014-02-09 10:44:43 +00:00
Vitor Santos Costa 2c12c7917b c-stuff 2014-02-06 21:57:51 +00:00
Vitor Santos Costa 72a8d49926 support 2014-02-06 21:57:32 +00:00
Vitor Santos Costa d85dc3fd5c factorized answer 2014-02-06 21:56:43 +00:00
Vitor Santos Costa f11b0518a8 string support 2014-02-06 21:55:35 +00:00
Vitor Santos Costa b3aa3e37c6 fix small bugs and declare format_time to be a meta-predicate 2014-02-06 21:55:01 +00:00
Vitor Santos Costa 6c7e5e3cd2 patch for OPTYap from João Silva 2014-02-05 16:21:21 +00:00
Vitor Santos Costa ce6bc98f30 fix extra return 2014-02-03 23:28:50 +00:00
Vitor Santos Costa 91989ad13a support utf-8 2014-02-03 23:27:06 +00:00
Vitor Santos Costa 9dacb84c99 fix string comparison 2014-02-03 23:26:36 +00:00
Vitor Santos Costa 819f7ab4a5 good sw practice 2014-02-03 17:03:23 +00:00
Vitor Santos Costa ed6524470a realclean -> distclean 2014-02-03 16:38:21 +00:00
Vitor Santos Costa 1e88998375 realclean support 2014-02-03 16:34:13 +00:00
Vitor Santos Costa 159613ab56 ECLIPSE SHELL? 2014-02-03 15:32:14 +00:00
Vítor Santos Costa 9e2a2b75b9 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3
Conflicts:
	library/dialect/swi/fli/swi.c
	packages/real
2014-02-02 21:52:14 +00:00
Vítor Santos Costa ae0ab6fa86 improve SWI 2014-02-02 21:46:33 +00:00
Vítor Santos Costa 9d2795b62a term_factorized/3 2014-02-02 21:45:47 +00:00
Vitor Santos Costa 0dac1e9e7d raptor support 2014-01-30 18:00:56 +00:00
Vitor Santos Costa b57867c983 threads 2014-01-30 18:00:37 +00:00
Vitor Santos Costa 598267ca23 fix encoding for strings: it's utf-8 2014-01-28 14:15:40 +00:00
Vitor Santos Costa 327c1216e4 fixes to SWI interface 2014-01-28 13:01:27 +00:00
Vitor Santos Costa d648375412 make MYDDAS into its own module. 2014-01-24 19:59:42 +00:00
Vitor Santos Costa a613099e1f cross-compilation support 2014-01-23 09:31:35 +00:00
Vitor Santos Costa 0391988788 support cross-compilation for windows 2014-01-23 01:46:16 +00:00
Vitor Santos Costa fe6142ca69 win32 support 2014-01-22 18:13:43 +00:00
Vitor Santos Costa 253735a293 win32 support 2014-01-22 18:12:58 +00:00
Vítor Santos Costa 464d6cd125 get rid of doxygen stuff 2014-01-22 09:52:02 +00:00
Vitor Santos Costa 39a6b31f7b Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2014-01-22 09:47:26 +00:00
Vitor Santos Costa b47aeb461b support python3 2014-01-22 09:44:42 +00:00
Vitor Santos Costa a8eda03305 4.2.1 support 2014-01-22 09:41:47 +00:00
Vítor Santos Costa 7adad485de more H->HR 2014-01-19 21:57:02 +00:00
Vitor Santos Costa 6b2e1973ab Windows fixes, mainly H -> HB 2014-01-19 21:15:05 +00:00
Vítor Santos Costa e1201fc468 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2014-01-17 09:39:49 +00:00
Vítor Santos Costa ccccf71ae1 support for tabling of bignums and strings 2014-01-17 09:39:29 +00:00
Vitor Santos Costa 2c8fcc6698 fix typo 2014-01-10 15:34:02 +00:00
Vitor Santos Costa bcc1757989 fixes to message handling 2014-01-07 01:10:48 +00:00
Vitor Santos Costa 26c80b0624 use singletons option of read_term to implement singleton test 2014-01-06 22:17:42 +00:00
Vitor Santos Costa 411b7700e5 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2014-01-06 18:28:45 +00:00
Vitor Santos Costa 52525a5319 do reexport even when file has already been loaded 2014-01-06 18:28:22 +00:00
Vítor Santos Costa f3e5639439 fix sign problems with arrays 2014-01-02 21:59:02 +00:00
Vítor Santos Costa 233829ec52 fix array expansion to use realloc and fix arrays to separate static/dynamic and malloced 2014-01-02 19:11:06 +00:00
Theo e105130a8b Tabling with coinductive mode for predicate 2013-12-20 14:56:13 +00:00
Vítor Santos Costa 7589b57e4b Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-12-20 00:34:44 +00:00
Vítor Santos Costa 4612a7cc57 ISO 2013-12-20 00:34:15 +00:00
Theo ffa0823e57 Same as before... 2013-12-19 18:18:01 +00:00
Theo fdd96e96cf Same as before... 2013-12-19 17:08:55 +00:00
Theo b4506cf793 CoInductive tabling 2013-12-19 16:56:55 +00:00
Theo 1f0f9968df Adding rational term support for tabling tries 2013-12-19 10:56:52 +00:00
Vitor Santos Costa 493b591b66 slots again: make sure they're bound after resetting the stack and when calling InitForeign 2013-12-18 19:34:15 +00:00
Vitor Santos Costa c6351abe25 remove debugging msg 2013-12-18 19:09:21 +00:00
Vitor Santos Costa 30828eba98 fix input sz: should only matter with NCHARS 2013-12-18 16:42:05 +00:00
Vitor Santos Costa 86a71e9232 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-12-18 15:23:06 +00:00
Vitor Santos Costa fe2411b046 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-12-18 15:09:01 +00:00
Theofrastos Mantadelis b0fdf9263c Restored the [] as the default value for tabling_mode yap flag 2013-12-18 15:01:02 +00:00
Theo 65eb3b8e4d Still undoing... sorry 2013-12-17 18:15:34 +00:00
Theofrastos Mantadelis 5a8017156a undid the last changes... 2013-12-17 18:03:46 +00:00
Theofrastos Mantadelis 35a332f23a rational tries support for yap tabling 2013-12-17 16:55:39 +00:00
João Santos bc99b42228 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-12-17 15:57:41 +00:00
João Santos 2e3f99d89a fix YAPOR_THREADS (prof. Vitor Costa) 2013-12-17 15:57:24 +00:00
Vítor Santos Costa 993a9272d1 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-12-16 21:47:53 +00:00
Vítor Santos Costa 1aafb30360 instantiation error 2013-12-16 21:47:46 +00:00
Vítor Santos Costa 7a6d36ff16 ensure real version to be YAP compatible 2013-12-16 21:46:33 +00:00
joao da0f807abf fix YAPOR_THREADS memory macros 2013-12-16 16:51:00 +00:00
Vitor Santos Costa 52b863eab4 compile without gmp 2013-12-16 15:35:34 +00:00
Vitor Santos Costa 51535a86ce allow reconsult of tabled predicates 2013-12-16 15:11:30 +00:00
Vitor Santos Costa e4fbd39cab avoid weird messages in debugging 2013-12-16 15:10:53 +00:00
Vitor Santos Costa 83ae86dba3 fix SIG_FAIL and SIG_INT 2013-12-16 13:05:08 +00:00
Vitor Santos Costa a4b130ff1b do wake up before \! 2013-12-16 12:34:41 +00:00
Vítor Santos Costa 7d6d369e63 avaoid local 2013-12-15 10:27:53 +00:00
Vítor Santos Costa f204776107 simplify 2013-12-15 10:27:33 +00:00
Vítor Santos Costa a8e1b91fd5 make length explicit in buffer conversion 2013-12-15 08:37:10 +00:00
Vítor Santos Costa e089563ce2 improve interrupt debugging 2013-12-15 08:35:44 +00:00
Vítor Santos Costa d73c88f307 handle running Prolog without top-level 2013-12-15 08:34:52 +00:00
Vítor Santos Costa 6402360691 fix S handling in new interrupt code 2013-12-14 12:35:18 +00:00
Vítor Santos Costa b65dee6b3a text files and other typed files cannot be directoried 2013-12-14 11:06:09 +00:00
Vítor Santos Costa b90685fe59 fix typo 2013-12-14 11:05:37 +00:00
Vitor Santos Costa cc5b90aafc fix deallocate 2013-12-13 10:56:08 +00:00
Vitor Santos Costa 2410cd3862 fixes to new signal handling/debugging code 2013-12-13 08:42:57 +00:00
Vitor Santos Costa 44d28aa0c9 cleanup on exception handling 2013-12-12 14:24:40 +00:00
Vítor Santos Costa fba3c34e50 trace fixes 2013-12-11 09:34:43 +00:00
Vítor Santos Costa 88e188bece fix excessive trail trimming in SWI call emulation 2013-12-11 09:04:59 +00:00
Vítor Santos Costa ba2c0ca2a0 support no trace predicates 2013-12-11 01:05:51 +00:00
Vítor Santos Costa 2f8c3d2d1b fix getting thread and sending it to format 2013-12-11 00:03:13 +00:00
Vítor Santos Costa e768a7e7be small improvements to debugger, prolog mode and meta-call (*->) 2013-12-10 22:58:02 +00:00
Vítor Santos Costa 795f01d125 fix error handling 2013-12-10 18:55:58 +00:00
Vítor Santos Costa 05bfe8a15b fix number_codes/2 typo 2013-12-09 22:14:17 +00:00
Vítor Santos Costa a430a1c349 fix source clauses 2013-12-09 18:43:32 +00:00
Vítor Santos Costa 29c0d55ad4 nth_clause cleanup with support for mega and exo clauses 2013-12-09 14:16:30 +00:00
Vítor Santos Costa df6ddfb8b6 is [] an atom first or a list first? 2013-12-09 14:15:30 +00:00
Vítor Santos Costa 09accc834c remove problog atom initialization 2013-12-08 23:16:22 +00:00
Vítor Santos Costa 61d624e416 fix comment handling 2013-12-08 22:56:48 +00:00
Vítor Santos Costa a654907fe1 fix empty lists 2013-12-08 22:56:20 +00:00
Vítor Santos Costa adea3bdb24 more string fixes and get_code 2013-12-08 19:12:24 +00:00
Vitor Santos Costa 62a6d96674 renaming patch 2013-12-06 23:26:28 +00:00
Vitor Santos Costa 863b796370 new string_code/3 plus some fixes 2013-12-06 23:24:01 +00:00
Vitor Santos Costa 342477f6e0 utf8 utilities 2013-12-06 23:22:42 +00:00
Vítor Santos Costa 35f6ecad66 more atom and string 2013-12-06 15:08:35 +00:00
Vitor Santos Costa 7e58cf7755 more atom/string manipulation fixes and SWI compatibility 2013-12-05 21:26:46 +00:00
Vitor Santos Costa 5ada26eab3 improve printing of quoted objects 2013-12-05 21:26:05 +00:00
Vitor Santos Costa c2e29efbc7 fix types 2013-12-05 21:25:06 +00:00
Vítor Santos Costa b3608c6a83 improve char conversion 2013-12-05 11:20:57 +00:00
Vítor Santos Costa ba07371328 support broken LC_CTYPE in OSX 2013-12-05 11:20:29 +00:00
Vitor Santos Costa 2665f71112 keep trying to fix atoms 2013-12-04 23:01:30 +00:00
Vítor Santos Costa 0d749059a4 new text conversion and string code (big changes, take care please) 2013-12-02 14:50:02 +00:00
Vítor Santos Costa d7397b43af new text conversion and string code (big changes, take care please) 2013-12-02 14:49:41 +00:00
Vítor Santos Costa 8b7fa9be36 reflection patches 2013-11-26 10:53:04 +01:00
Vítor Santos Costa 3edb01f5f7 more reflection updates 2013-11-26 10:40:00 +01:00
Vítor Santos Costa 0ea61e8f1a kdebugging stuff 2013-11-25 23:59:52 +01:00
Vítor Santos Costa ea99d42897 current_predicate and imports 2013-11-25 23:57:05 +01:00
Vítor Santos Costa 67b23a2ae4 cleanups 2013-11-25 23:09:03 +01:00
Vítor Santos Costa b46dd8d392 speed-up imports 2013-11-25 23:08:35 +01:00
Vítor Santos Costa 86ce2f49b0 update 2013-11-25 19:28:45 +01:00
Vítor Santos Costa d0c7ef121b give source property based on dynamic declarations 2013-11-25 19:19:44 +01:00
Vítor Santos Costa 82f4d71567 debugging stuff 2013-11-25 18:32:51 +01:00
Vítor Santos Costa 2343494f1e fix high arity and nth clause 2013-11-25 18:32:11 +01:00
Vítor Santos Costa fae3da8659 fix high arity and nth clause 2013-11-25 18:31:33 +01:00
Vítor Santos Costa 7a3a4ab32b module_property 2013-11-25 16:52:08 +01:00
Vítor Santos Costa b3ee389d5e module_property 2013-11-25 16:50:57 +01:00
Vítor Santos Costa def97602e2 nth_clause 2013-11-25 16:03:25 +01:00
Vítor Santos Costa 99a5fa55de Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-11-25 14:10:17 +01:00
Vítor Santos Costa acea59a82a avoid \! 2013-11-25 12:16:36 +01:00
Vítor Santos Costa 42d3ca6459 avoid \! 2013-11-25 12:16:10 +01:00
Vítor Santos Costa cbd0fa14e8 small fixes and code moving around 2013-11-25 12:15:25 +01:00
Vítor Santos Costa ed2ecb29e7 exten support and small fixes 2013-11-25 12:15:03 +01:00
Vítor Santos Costa 0b881c0569 fix compilation 2013-11-25 11:34:50 +01:00
Vítor Santos Costa af4e9b4bbc for number free flag setting 2013-11-25 11:26:42 +01:00
Vítor Santos Costa 4e7e9b0273 use *m in Yap_strip_module, not CurrentModule 2013-11-25 11:25:56 +01:00
Vítor Santos Costa 5ecf7a79ff quasi quote 2013-11-25 11:24:13 +01:00
Vítor Santos Costa 75737f6d56 quasi quote 2013-11-25 11:23:28 +01:00
Vítor Santos Costa 3c16cd1627 fix missing YapHeap 2013-11-25 11:22:44 +01:00
Vítor Santos Costa 99469b9b1a use pl-shared and synch with SWI-Prolog.h 2013-11-25 11:22:07 +01:00
Paulo Moura 20b0d7050d Allow `threads/0` to list zombie threads 2013-11-25 00:35:29 +01:00
Vítor Santos Costa 80dc774a5f fix blob output 2013-11-23 15:19:54 +00:00
Vítor Santos Costa 03879aa778 fix isfinite 2013-11-23 14:51:56 +00:00
Vítor Santos Costa fd58cf10b2 fix output for floats 2013-11-23 14:51:33 +00:00
Vítor Santos Costa d447d80fdb improve locale support in scanner and write: basically, just hide current locale 2013-11-23 12:34:49 +00:00
Vitor Santos Costa 5013880fc5 get rid of locale for now 2013-11-22 17:19:26 +00:00
Vitor Santos Costa f6f183c0f6 remove some more duplicated code 2013-11-22 15:18:03 +00:00
Vitor Santos Costa de606255bb extend blob interface 2013-11-22 15:16:54 +00:00
Vítor Santos Costa cc03317bd0 user defined messages 2013-11-22 00:44:28 +00:00
Vítor Santos Costa 02526db2d1 fix singletons _ 2013-11-21 22:48:27 +00:00
Vitor Santos Costa 7c48eb8ff7 move call_structure where it cannot be messed up by stack shifter 2013-11-21 21:59:14 +00:00
Vitor Santos Costa 23df104638 restore slots on exit 2013-11-21 21:54:40 +00:00
Vitor Santos Costa 9017f5131f get rid of debugging msgs 2013-11-21 21:53:59 +00:00
David Vaz d1b634c9c3 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2013-11-21 11:45:57 +00:00
David Vaz 638ef10c84 Exo change to support external usage 2013-11-21 11:38:16 +00:00
Vitor Santos Costa 3dce3c0156 fix relative path in latex2html 2013-11-21 11:35:35 +00:00
Vitor Santos Costa c2219d0343 remove debugging stuff 2013-11-21 11:27:06 +00:00
Vítor Santos Costa 90dd0229d7 -f from Nicos 2013-11-21 00:34:40 +00:00
Vítor Santos Costa f1f64bf25c printwarning 2013-11-21 00:22:03 +00:00
Vitor Santos Costa 6d773a3189 use SWI opts for read 2013-11-20 22:30:49 +00:00
Vitor Santos Costa d75e6b56e5 handles in SWI and changes in exports 2013-11-20 22:29:51 +00:00
Vitor Santos Costa 61e78d9963 more handles and fix exit from a backtrackable user c-pred 2013-11-20 22:27:46 +00:00
Vitor Santos Costa 5f3ff4fc73 use SWI opts for read 2013-11-20 22:25:27 +00:00
Vitor Santos Costa 04f3fa4d9d bad LOCAL 2013-11-20 22:24:31 +00:00
Vitor Santos Costa 6ba13c7b88 yaam knows not about handles, and they do not know about the yaam 2013-11-20 22:23:29 +00:00
Vitor Santos Costa ee179f316a fix broken, complicated code for slots 2013-11-20 22:22:33 +00:00
Vitor Santos Costa 94f1b223f7 yaam knows not about handles, and they do not know about the yaam 2013-11-20 22:21:59 +00:00
Vitor Santos Costa 48bec6b247 fix broken, complicated code for slots 2013-11-20 22:20:51 +00:00
Vítor Santos Costa b76be1b33f support for quasi quotations, requires more integration with SWI code. 2013-11-18 12:57:09 +00:00
Vítor Santos Costa b167e62bc7 fix typo 2013-11-18 12:56:00 +00:00
Vítor Santos Costa cffef55b61 latex to html translator port from SWi. 2013-11-18 01:21:21 +00:00
Vítor Santos Costa f67c7c184b fix reexport adding to export list 2013-11-17 21:41:41 +00:00
Vítor Santos Costa 1f91ea2d02 fix tracer 2013-11-16 23:52:04 +00:00
Vítor Santos Costa 5dbaeedf08 fix bad pruning in meta-call 2013-11-16 23:08:17 +00:00
U-w7\vsc 3aa994313b fix threads 2013-11-16 18:51:32 +00:00
Vitor Santos Costa 1b5aa1a969 enable dlls 2013-11-16 17:26:31 +00:00
Vitor Santos Costa 1c51b61253 fix win64 2013-11-16 16:58:36 +00:00
Vitor Santos Costa 2a5f6535ae fix win64 2013-11-16 16:58:07 +00:00
Vítor Santos Costa 84bd55df0d continue cleanup 2013-11-16 00:27:02 +00:00
U-w7\vsc 9c5d7af938 win32 patches 2013-11-15 18:25:33 +00:00
Vitor Santos Costa bb650629d9 clean load library 2013-11-15 16:04:14 +00:00
Vitor Santos Costa 9eb07a8c8a more cleanups 2013-11-15 15:45:55 +00:00
Vítor Santos Costa 45f91c9d42 char_conversion 2013-11-15 12:17:48 +00:00
Vítor Santos Costa 3c7656b619 clang fixes 2013-11-15 10:38:00 +00:00
Vitor Santos Costa 6de15433aa upgrade to latest swi 2013-11-15 01:10:47 +00:00
Vitor Santos Costa 4e4f21e1dc upgrade to latest swi 2013-11-15 01:10:25 +00:00
Vítor Santos Costa 5b46b6bd1a latest swi flgs 2013-11-13 23:48:54 +00:00
Vítor Santos Costa 14747fd0bf more fixes 2013-11-13 22:52:36 +00:00
U-w7\vsc 7f8f80fdbe Windows Threaded Patches 2013-11-13 17:04:34 +00:00
Vitor Santos Costa 9a35d17861 fix DLL loading and C_SO suffix (remove an extra .) 2013-11-13 15:10:15 +00:00
Vitor Santos Costa 7930b4d648 fixes 2013-11-13 13:39:30 +00:00
Vitor Santos Costa 41c2d856a7 cleanup dead flags 2013-11-13 13:28:43 +00:00
Vitor Santos Costa b1c2fbd6bb iKeri patch 2013-11-13 13:24:37 +00:00
Vitor Santos Costa 9d34ac34ff clean up unbounded 2013-11-13 13:01:11 +00:00
Vitor Santos Costa 220970db6d more integration and cleanup work: allow irect access from YAP to swi global and local, to
check flags quickly.
2013-11-13 12:57:52 +00:00
Vitor Santos Costa 4fa9021a7b integration work:
- use SWI flags whenever possible
  - support by module unknown, escapes, strings
  - accesss thread info fom SWI
  - allow strings to be input as strings.
  - remove some unused flags.
2013-11-13 10:38:20 +00:00
Vítor Santos Costa 0d45ff8d37 unlock threads while in zombie mode, nad enusre that the GlobalLock is always asked before and let after locking a thread. 2013-11-12 08:43:45 +00:00
Vítor Santos Costa e813c75814 enable thread debugging 2013-11-12 08:34:26 +00:00
Paulo Moura 2314efdc6c Make `thread_property/2` deterministic when the second argument is instantiated 2013-11-11 17:11:53 +00:00
Paulo Moura 16e3bda666 Fix singleton variable that breaks expanding a relative file path 2013-11-11 16:38:04 +00:00
Vítor Santos Costa a2fc06df36 update 2013-11-11 12:32:03 +00:00
Vítor Santos Costa bf7fd9982b update 2013-11-11 12:31:11 +00:00
Vítor Santos Costa 85c0435f59 update 2013-11-11 12:30:32 +00:00
Vítor Santos Costa d6d437d12f update 2013-11-11 12:10:04 +00:00
Vítor Santos Costa 5c4cb1c43c update 2013-11-11 12:09:35 +00:00
Vítor Santos Costa 07bfa49691 update 2013-11-11 11:54:16 +00:00
Vítor Santos Costa 5a9b904fb4 update 2013-11-11 11:47:15 +00:00
Vítor Santos Costa 1efab018bd update 2013-11-11 11:47:04 +00:00
Vítor Santos Costa e92c3c6dbb mac and win support 2013-11-11 11:42:57 +00:00
Vítor Santos Costa 5ffbf8b1bb mac and win support 2013-11-11 11:42:33 +00:00
Vítor Santos Costa cab427537a warning 2013-11-11 11:42:13 +00:00
Vítor Santos Costa 2c224666aa warning 2013-11-11 11:41:42 +00:00
Vítor Santos Costa d98d888fd8 mac support. 2013-11-11 11:40:59 +00:00
U-vsc-PC\vsc 953befcb7d win 2013-11-11 10:35:50 +00:00
U-vsc-PC\vsc eea8d78ec5 improve search in boot 2013-11-11 10:34:55 +00:00
U-vsc-PC\vsc 30995ce506 improve win32 support 2013-11-11 10:32:55 +00:00
U-vsc-PC\vsc 80315e1be3 multiath & abs_file_name 2013-11-11 10:31:59 +00:00
U-vsc-PC\vsc 493f310b49 registry 2013-11-11 10:31:28 +00:00
U-vsc-PC\vsc a811f56d14 avoid dot 2013-11-11 10:28:45 +00:00
U-vsc-PC\vsc 5e6cc55713 win stuff 2013-11-11 10:27:04 +00:00
Vitor Santos Costa 7c716c4f2f change order 2013-11-11 00:52:50 +00:00
Vitor Santos Costa dcc5a4041e paths 2013-11-11 00:52:13 +00:00
Vitor Santos Costa 153794e14b support win32 2013-11-11 00:28:38 +00:00
Vítor Santos Costa bfee0cbea6 Attached is a small patch to fix a race when installing with parallel
make jobs. If we're performing an install where libYap is a shared
library then there's a race between installing libYap.so and calling the
yap executable; this can lead to yap not finding its required runtime
dependency:

(cd yap-6.3.3/packages/http ;
LD_LIBRARY_PATH=$DESTDIR/usr/share/Yap/http:$DESTDIR/usr/lib64/Yap:
YAPSHAREDIR=$DESTDIR/usr/share/Yap YAPLIBDIR=$DESTDIR/usr/lib64/Yap
$DESTDIR/usr/bin/yap $DESTDIR/usr/lib64/Yap/startup.yss -f none -g make
-t halt)

$DESTDIR/usr/bin/yap: error while loading shared libraries: libYap.so:
cannot open shared object file: No such file or directory
make[1]: *** [install] Error 127

Since @YAPLIB@ expands to either libYap.a or libYap.so depending on
whether we are building a static or shared libYap library, we can use that.

Keri Harris
2013-11-10 11:24:30 +00:00
Vítor Santos Costa 0205a222d9 Attached is a small patch to respect any LDFLAGS when building
library/lammpi or packages/CLPBN/horus.

Keri Harris
2013-11-10 11:22:54 +00:00
Vítor Santos Costa b5cc597ab8 handle empty sequence of clauses 2013-11-10 11:22:43 +00:00
Vítor Santos Costa bd5771eb59 handle empty sequence of clauses 2013-11-10 11:22:29 +00:00
Vítor Santos Costa f6f7f70b7f handle verbosity and autoload 2013-11-10 11:18:00 +00:00
Vítor Santos Costa 318199a47b fix first fail in autoload 2013-11-10 10:58:09 +00:00
Vitor Santos Costa 64575e37ee Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-11-08 23:50:11 +00:00
Vitor Santos Costa f5284000a6 doc some yap.tex opts 2013-11-08 23:50:04 +00:00
Vitor Santos Costa a69a2442c9 fix \% 2013-11-08 23:48:57 +00:00
Vitor Santos Costa ec2e70fc39 fix the case where we leave an empty index 2013-11-08 23:48:28 +00:00
Vítor Santos Costa 7065c4678e debugging 2013-11-08 12:43:28 +00:00
Vítor Santos Costa ea44e780b6 fix path 2013-11-08 12:43:07 +00:00
Paulo Moura b51af753aa Update documentation for the addition of the `.prolog` file extension 2013-11-08 11:15:41 +00:00
Vítor Santos Costa 7150bc1ef8 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-11-08 08:24:25 +00:00
Vítor Santos Costa 4085f268af fix reconsult non-mod file, fix cases where users call source, fix bad atom_concat 2013-11-08 08:24:06 +00:00
Paulo Moura 746aee16f7 Add support for using `.prolog` as a Prolog source file extension 2013-11-08 00:40:14 +00:00
Vitor Santos Costa 7e0bf7fbe8 fix operator issues 2013-11-08 00:13:04 +00:00
Vítor Santos Costa cbba7e93df clean up load_files and friends to reuse code 2013-11-08 00:02:38 +00:00
Vítor Santos Costa 08e5dcfbd1 fix functors for staticclause 2013-11-07 23:51:22 +00:00
Vítor Santos Costa 2badc98c75 get rid of old fashioned registers 2013-11-07 23:50:04 +00:00
Vítor Santos Costa 810a7faf4e aggregates should know about with operator 2013-11-07 23:49:16 +00:00
Vítor Santos Costa a3c9684714 perform true goal expansion from top level goals 2013-11-05 22:29:28 +00:00
Vítor Santos Costa 917d5ad75b line numbers for clauses and clause properties 2013-11-05 17:59:19 +00:00
Vítor Santos Costa e06b160da2 update configure to latest 2013-11-05 17:58:24 +00:00
Vítor Santos Costa e5e71ee618 fix source 2013-11-05 17:57:17 +00:00
Vítor Santos Costa ddbed6f29b fix warning 2013-11-05 17:52:37 +00:00
Vítor Santos Costa 8c66979817 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-7.3 2013-11-05 17:15:09 +00:00
Vitor Santos Costa b2fe6099a0 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-11-05 17:13:10 +00:00
Vitor Santos Costa 519d22f5ad Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-11-05 17:12:53 +00:00
Vitor Santos Costa 1a8facffac fix compilation without threads, thanks Andrea 2013-11-05 17:12:31 +00:00
Vitor Santos Costa 72bc04e63d fix compilation without GMP 2013-11-05 17:12:05 +00:00
Vítor Santos Costa ad8b101233 fix warnings 2013-11-04 22:32:53 +00:00
Vítor Santos Costa 4818d28b0b handle alias 2013-11-04 22:32:03 +00:00
Vítor Santos Costa 98b4f64b40 syntax error 2013-11-04 22:31:43 +00:00
Vítor Santos Costa 0788a6c857 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-11-04 21:41:58 +00:00
Vítor Santos Costa 6793a1f83b fix thread-only compilation 2013-11-04 21:41:49 +00:00
Vítor Santos Costa 1a8b038b5b fix missing return 2013-11-04 21:41:26 +00:00
U-w7\vsc 029bf8359c improvements 2013-11-04 18:05:23 +00:00
U-w7\vsc f2b90a1bb0 improve thread signal support, still far from good 2013-11-04 15:31:26 +00:00
U-w7\vsc a9b025e6a1 BSD and __WINDOWS__ 2013-11-04 15:30:34 +00:00
Vitor Santos Costa d2ed850643 separate cplint and mpi interface. 2013-11-04 13:16:14 +00:00
Vitor Santos Costa dd6c66392a fix typo 2013-11-04 13:05:40 +00:00
Vitor Santos Costa 04164487c7 ifix jpl and other leftovers 2013-11-04 13:05:05 +00:00
Vitor Santos Costa 101a54e6ff ifix debug option 2013-11-04 13:04:19 +00:00
Vitor Santos Costa 1d8f96fd74 use proper place for verbose flag. 2013-11-04 13:02:18 +00:00
Vitor Santos Costa e07a60887b new version 2013-11-04 13:01:43 +00:00
Vitor Santos Costa f397cbe0b6 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3
Conflicts:
	pl/boot.yap
	pl/control.yap
	pl/debug.yap
2013-11-04 11:03:27 +00:00
Vitor Santos Costa 52fcf2c7ab configuration for gecode 2013-11-04 10:00:32 +00:00
Vitor Santos Costa 415a6a3a71 configuration for clib 2013-11-04 09:59:42 +00:00
Vítor Santos Costa f44c2b1488 missing new files 2013-11-04 09:39:14 +00:00
Vítor Santos Costa a2842ef9ce missing new files 2013-11-04 08:16:52 +00:00
Vítor Santos Costa 57760e3dc9 more files for maildrop configure 2013-11-04 08:04:37 +00:00
Vítor Santos Costa 6c9d7d120f distribute configure 2013-11-04 07:42:14 +00:00
Vítor Santos Costa a069d8b5f6 fix in DESTDIR 2013-11-04 07:26:16 +00:00
Vítor Santos Costa 48d51e460a handle unknown arch, from Keri Harris 2013-11-04 07:22:13 +00:00
Vítor Santos Costa c9780cb3ad updates 2013-11-04 01:47:50 +00:00
Vítor Santos Costa e630d63d9e updates 2013-11-04 01:39:20 +00:00
Vítor Santos Costa 1cd029197b updates 2013-11-04 01:36:15 +00:00
Vítor Santos Costa 5090a08f5c updates 2013-11-04 01:34:31 +00:00
Vítor Santos Costa 4ce1479da5 distributed commit 2013-11-04 01:18:43 +00:00
Vítor Santos Costa b7be50ee1f distributed commit 2013-11-04 01:16:08 +00:00
Vítor Santos Costa ad0ff98f1a use swi flags whenever possible 2013-11-04 01:14:48 +00:00
Vítor Santos Costa 0f62de3744 fix source_location 2013-11-04 01:13:29 +00:00
Vítor Santos Costa d945f01f53 A not a for Atom (unused anyway) 2013-11-04 01:12:04 +00:00
Vítor Santos Costa 5561b80796 A not a for Atom (unused anyway) 2013-11-04 01:10:15 +00:00
Vítor Santos Costa 3977ceee60 fix excessive inlining 2013-11-04 01:07:44 +00:00
Vítor Santos Costa 7be8130d05 distributed commit 2013-11-04 01:06:18 +00:00
Vítor Santos Costa 0d038e4528 fix llvm variable size warning 2013-11-04 01:04:52 +00:00
Vítor Santos Costa c6b471d725 fix YAP_RunGoalOnce warning 2013-11-04 01:03:57 +00:00
Vítor Santos Costa c1a3bfce42 add source location *after* initial comment 2013-11-04 00:05:29 +00:00
Vítor Santos Costa b3a4666fc2 useful debugging code 2013-11-04 00:04:09 +00:00
Vítor Santos Costa a86b79928d fix llvm sign warnings 2013-11-04 00:03:05 +00:00
Vítor Santos Costa 1ede2112c6 distributed configure 2013-11-03 23:55:09 +00:00
Vítor Santos Costa 1967e0c434 distributed config file 2013-11-03 14:13:08 +00:00
Vítor Santos Costa e423fc28e5 distributed config && float library 2013-11-03 14:12:38 +00:00
Vítor Santos Costa e84540b4f0 C++ does not allow variable length arrays: quick fix 2013-11-03 13:35:54 +00:00
Vítor Santos Costa 6f9b8bfca8 fix bad instruction format 2013-11-01 08:26:06 +00:00
Vitor Santos Costa 8ea594c104 use flag for debugging 2013-10-31 13:16:27 +00:00
Vítor Santos Costa 4b64eafc3d autoconf 2013-10-30 23:08:27 +00:00
Vítor Santos Costa 3bbc867611 fix sun jdk in darwin 2013-10-30 22:12:34 +00:00
U-w7\vsc 4260c37245 remove debugging output from thread close 2013-10-30 16:27:12 +00:00
Vitor Santos Costa ab5c24cb87 init state should be shared by threads 2013-10-30 14:12:54 +00:00
U-w7\vsc 360e8a9269 WIN32 support 2013-10-30 13:56:35 +00:00
U-w7\vsc 07504e79b3 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2013-10-30 12:59:23 +00:00
Vitor Santos Costa 699edafa2c try to improve jpl and zlib makefiles 2013-10-30 12:57:46 +00:00
Vitor Santos Costa 27d92de39a fix nb_getval 2013-10-30 12:57:33 +00:00
U-w7\vsc f378b0aa64 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2013-10-30 10:56:21 +00:00
Vitor Santos Costa 149ef50865 new version for jpl 2013-10-30 10:56:01 +00:00
U-w7\vsc 013b21e527 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2013-10-30 10:35:39 +00:00
Vítor Santos Costa d7c13b53d8 new version 2013-10-30 10:00:41 +00:00
Vítor Santos Costa ddf624d351 new swi code 2013-10-30 09:57:59 +00:00
Vítor Santos Costa 990dfbecbf fix flags upgrade 2013-10-30 09:41:45 +00:00
Vítor Santos Costa d77de70868 extra protection 2013-10-30 09:41:15 +00:00
Vítor Santos Costa 0f43a319c5 fix library path and revert nvidia 32 bits patch 2013-10-30 09:40:29 +00:00
Vítor Santos Costa 7ebd169a62 support for nvcc -m32 2013-10-30 07:23:56 +00:00
Vítor Santos Costa 007a2aa87e Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-10-30 07:23:37 +00:00
Vítor Santos Costa bbd523a73a support for nvcc -m32 2013-10-30 07:23:31 +00:00
U-w7\vsc 1391dabd04 remove debugging info 2013-10-29 16:28:30 +00:00
Vitor Santos Costa 65f5a3d364 more mpi fixes 2013-10-29 16:25:38 +00:00
Vitor Santos Costa fe154e87a5 lam_mpi configuration (again). 2013-10-29 16:17:16 +00:00
Vitor Santos Costa 4dd7afa07d Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-10-29 12:43:53 +00:00
Vitor Santos Costa 1cbe82da1e SWI flags compat 2013-10-29 12:43:31 +00:00
Vitor Santos Costa 35b7f040d5 fix compilation without P 2013-10-29 12:42:55 +00:00
Vitor Santos Costa 96611027f3 SWI likes nth/4 2013-10-29 12:41:56 +00:00
Vitor Santos Costa ab9d2da775 improve LOCK init 2013-10-29 12:41:28 +00:00
Vitor Santos Costa 80cb87c41c no MPI means no MPI/LAM/MPICH 2013-10-29 12:39:21 +00:00
Vítor Santos Costa 8921889002 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-10-17 00:45:25 +01:00
Vítor Santos Costa 2669240c4f debug memory allocations 2013-10-17 00:44:24 +01:00
Vítor Santos Costa bd541bc57f eliminate leak and fix memory tracking 2013-10-16 17:33:49 +01:00
Vítor Santos Costa 5ad10a1057 profiling 2013-10-16 16:19:03 +01:00
Vítor Santos Costa 94cb9b7563 allow debugging of memory allocation 2013-10-16 14:52:54 +01:00
Vítor Santos Costa b50305a100 fix fix 2013-10-16 11:24:23 +01:00
Vítor Santos Costa 3fa1f856f6 fix alaises in cuda 2013-10-16 11:15:26 +01:00
Vitor Santos Costa 83695cc8c8 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-10-16 10:40:12 +01:00
Vítor Santos Costa a01b319032 fix cuda multijoin (Carlos) 2013-10-16 09:52:41 +01:00
Vitor Santos Costa e19a910152 use private memory for yapor's alloc 2013-10-16 09:44:34 +01:00
Vítor Santos Costa 8623131b31 support -m32 osx 2013-10-15 13:09:36 +01:00
Vítor Santos Costa 797c063785 debug bad exit 2013-10-14 08:04:24 +01:00
Vítor Santos Costa 691e977a68 cuda fixes by Carlos and other diverse (fact init, configure). 2013-10-12 12:46:01 +01:00
Vítor Santos Costa 0dc78f106b more cuda checking 2013-10-12 01:11:21 +01:00
Vítor Santos Costa 36087849f0 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-10-10 19:30:08 +01:00
Paulo Moura 0e2402b27e Fix message_queue_property/2 to accept integers as valid queue indentifiers 2013-10-10 11:44:52 +01:00
Paulo Moura c412f6de2f Fix built-in predicate threads/0 2013-10-10 11:00:36 +01:00
Vítor Santos Costa d02842c9ff missing file 2013-10-09 14:59:57 +01:00
Vitor Santos Costa e41851e9d9 cuda 2013-10-09 14:59:03 +01:00
Vitor Santos Costa e8b07224f4 cuda 2013-10-09 14:57:10 +01:00
Vitor Santos Costa 9229460310 cuda 2013-10-09 14:56:23 +01:00
Vitor Santos Costa 3648e98a17 cuda 2013-10-09 14:47:52 +01:00
Vítor Santos Costa a165d3e4c2 missing heder 2013-10-09 14:41:53 +01:00
Vitor Santos Costa 23aaa8c792 cuda 2013-10-09 14:41:03 +01:00
Vitor Santos Costa 9531d2a359 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-10-09 14:40:19 +01:00
Vitor Santos Costa b43cb37c9a cuda 2013-10-09 14:39:49 +01:00
Vítor Santos Costa ffd9bb7a19 missing headers 2013-10-09 13:33:10 +01:00
Vítor Santos Costa f6bc5ab918 more fixes; get coverage quickly 2013-10-09 11:23:45 +01:00
Vítor Santos Costa 6ec98fbcbd make safe for overflow 2013-10-08 13:05:08 +01:00
Vítor Santos Costa 70d864b13d fix limit on atoms to ints 2013-10-08 13:04:30 +01:00
Vítor Santos Costa c757e51cb0 fixes, small improvements in functionality 2013-10-08 12:46:06 +01:00
Vítor Santos Costa 490b7cd40a small fixes 2013-10-07 18:34:29 +01:00
Vítor Santos Costa fbf6648433 more CUDA fixes 2013-10-07 13:48:19 +01:00
Vítor Santos Costa 1593ee4918 fix interface 2013-10-07 12:38:08 +01:00
Vítor Santos Costa 9800753a1b learn from true by default 2013-10-07 12:21:39 +01:00
Vítor Santos Costa ff2acca219 fix operators 2013-10-07 12:20:52 +01:00
Vítor Santos Costa 726d7ca1cc cuda package from Carlos 2013-10-07 12:20:00 +01:00
Vitor Santos Costa fcaabd2c0b export API 2013-10-04 18:19:33 +01:00
Vitor Santos Costa f3cefdf895 yapor stuff 2013-10-04 18:18:57 +01:00
Vitor Santos Costa 30b567ae66 fix reexport issues and duplicated definitions 2013-10-04 18:18:04 +01:00
Vitor Santos Costa 74a6a79960 interface to cuda datalog package 2013-10-04 14:42:18 +01:00
Vitor Santos Costa 43163a190f Atom Translations and CUDA stub 2013-10-04 13:22:00 +01:00
Vitor Santos Costa 860a5dcd02 make error codes available to C-interface 2013-10-04 13:14:35 +01:00
Vitor Santos Costa d46276edbe include wid when inittiing yapor regs 2013-10-03 15:48:15 +01:00
Vitor Santos Costa 1c9167a6c5 small fixes 2013-10-03 11:28:09 +01:00
Vitor Santos Costa 94619d2a32 allow yser code error handling 2013-10-03 11:25:56 +01:00
Vitor Santos Costa 609f6fc440 allow yser code error handling 2013-10-03 11:24:59 +01:00
Vitor Santos Costa 710915e001 LDFLAGS 2013-10-03 11:24:17 +01:00
Vitor Santos Costa bf77381744 alloc K * Size 2013-10-01 16:42:12 +01:00
Vitor Santos Costa 1ebd0f1a13 document BDD package 2013-09-30 15:45:14 +01:00
Vitor Santos Costa 448e2c88e1 document BDD package 2013-09-30 15:45:01 +01:00
Vítor Santos Costa bb6ae90019 doc fixes 2013-09-30 00:26:00 +01:00
Vítor Santos Costa 937077d51b booleans and more fixes 2013-09-30 00:20:00 +01:00
Vítor Santos Costa 1ee58c5922 use attributed variables 2013-09-29 17:41:02 +01:00
Vítor Santos Costa 7cf1b68c3a documentation and small fixes; also call for foreach 2013-09-29 11:31:18 +01:00
Vítor Santos Costa bef9cec46a fix startup module on new thread to be user module 2013-09-28 23:20:39 +01:00
Vítor Santos Costa 577b99367d don't make mega-clauses always source 2013-09-28 18:20:04 +01:00
Vítor Santos Costa 048c00a7a6 fix writing [](_,_) 2013-09-28 12:12:09 +01:00
Vítor Santos Costa 72fe7e84c0 opaques are not integers 2013-09-28 12:06:01 +01:00
Vítor Santos Costa 5b6a3bffc1 iteration support 2013-09-28 12:04:52 +01:00
Vítor Santos Costa e19b58cf53 use new matrix functionality 2013-09-28 11:11:42 +01:00
Vítor Santos Costa b64965f22c new mapargs 2013-09-28 11:10:55 +01:00
Vítor Santos Costa 8c9025cdb4 improve and document matrix package 2013-09-28 11:09:57 +01:00
Vítor Santos Costa 3d863b1058 improve and document matrix package 2013-09-28 11:09:32 +01:00
Vítor Santos Costa dd17f5a3aa include mapargs as separate support 2013-09-28 11:08:34 +01:00
Vítor Santos Costa efddaab558 sudoku and for 2013-09-21 23:23:42 +01:00
Vítor Santos Costa 6033eba372 missing unlock. 2013-09-21 23:19:21 +01:00
Vítor Santos Costa e7477d9888 foreach + fold (idea from BProlog) 2013-09-20 01:42:50 +01:00
Vítor Santos Costa 0f45b3dc42 foreach on matrices (idea from BProlog) 2013-09-20 01:16:25 +01:00
Vitor Santos Costa 28ff95f8de progress with matrix package 2013-09-19 17:59:37 +01:00
Vítor Santos Costa ab4a6c0ae3 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-09-19 14:35:46 +01:00
Vítor Santos Costa 285c61b87f development commit 2013-09-19 14:35:31 +01:00
Vítor Santos Costa b2dcbe961c development commit 2013-09-19 14:34:44 +01:00
Vitor Santos Costa fc0a260b4e Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-09-19 14:23:52 +01:00
Vitor Santos Costa 448380c715 isupport opaque type testing. 2013-09-19 14:23:10 +01:00
Fabrizio Riguzzi 3659f9036c testing output 2013-09-17 14:10:08 +02:00
Fabrizio Riguzzi b9d4868e37 Merge branch 'master' of git@git.dcc.fc.up.pt:yap-6.3 2013-09-17 13:04:44 +02:00
Fabrizio Riguzzi faf7726452 test program 2013-09-17 13:04:22 +02:00
Vitor Santos Costa ad9a973a26 fix opaque variables & threads 2013-09-17 09:54:02 +01:00
Vítor Santos Costa 1eab4bc936 fix case new thread is created from thread that never had a thread installed 2013-09-17 00:26:37 +01:00
Vítor Santos Costa 5ea258f885 thread support 2013-09-13 15:02:00 +01:00
Vitor Santos Costa 2cfa0081ad make syntax extensions SWI compatible 2013-09-13 11:44:26 +01:00
Vitor Santos Costa e1208fc7ad fix () extension 2013-09-13 10:52:52 +01:00
Vitor Santos Costa 5cd9720593 DFA and TupleSet 2013-09-12 10:17:59 +01:00
Vitor Santos Costa 9d4c7a5c8c include min and max of lists 2013-09-11 22:01:18 +01:00
Vitor Santos Costa 23b860a977 scalar_product and a fix 2013-09-11 14:53:43 +01:00
Vitor Santos Costa b30f0eafdf fixes to clpbn interface 2013-09-11 13:04:39 +01:00
Vitor Santos Costa 12d1e17dd3 first cut at supporting TupleSets 2013-09-11 12:31:07 +01:00
Vitor Santos Costa 99ab8e541b improve CLP support 2013-09-11 12:30:31 +01:00
Vitor Santos Costa 52c0d8a8de first cut at supporting TupleSets 2013-09-11 12:29:49 +01:00
Vitor Santos Costa 46c3c4546f examples 2013-09-10 09:57:26 +01:00
Vítor Santos Costa 77e1d9425b improve clpfd emulation 2013-09-10 00:53:54 +01:00
Vitor Santos Costa 8d14c15f3c merge 2013-09-09 23:49:41 +01:00
Vitor Santos Costa eadfdbd646 clp like interface to gecode 2013-09-09 23:48:44 +01:00
Vitor Santos Costa cda2e3bffe clp like interface to gecode 2013-09-09 23:48:02 +01:00
Vítor Santos Costa a685b265b9 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-09-09 22:11:39 +01:00
Vítor Santos Costa fde44acdf3 ensure global environment when consulting 2013-09-09 22:11:12 +01:00
Fabrizio Riguzzi 50287c268b Merge branch 'master' of git@git.dcc.fc.up.pt:yap-6.3 2013-09-09 12:42:08 +02:00
Fabrizio Riguzzi 700cd2d9dc CLL->Score 2013-09-09 12:41:42 +02:00
Vítor Santos Costa 299816428c Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-09-08 22:24:48 +01:00
Vítor Santos Costa 8d92fa9369 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-09-08 22:24:24 +01:00
Vítor Santos Costa 6966d23195 fix P details when creating execution environment: we should save the old one 2013-09-08 22:24:09 +01:00
Fabrizio Riguzzi 52caac6548 aucpr as a score 2013-09-08 22:11:11 +02:00
Fabrizio Riguzzi 0eefb3c0b8 Merge branch 'master' of git@git.dcc.fc.up.pt:yap-6.3 2013-09-08 17:47:15 +02:00
Fabrizio Riguzzi b00a5bf7fc em/8 returns the list of updated probabilities of examples 2013-09-08 17:46:36 +02:00
Fabrizio Riguzzi cbf31fcd50 fixed test predicates 2013-09-08 16:06:18 +02:00
Paulo Moura 7da733d394 vsc is not yet an internet protocol :-) 2013-09-07 14:43:54 +01:00
Vítor Santos Costa 4c148cc0d3 fix bad setup of goal (SWI emulatin for JPL, Sergio Castro) 2013-09-07 01:03:27 +01:00
Vítor Santos Costa d1ff57b178 no GMP compilation 2013-09-06 23:03:24 +01:00
Vítor Santos Costa 11282b44d7 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 into HEAD 2013-09-05 00:48:51 +01:00
Vítor Santos Costa 2028730eac check NULL 2013-09-05 00:48:00 +01:00
Vítor Santos Costa a1b5764527 gecode: clone by default (oops) 2013-09-05 00:47:37 +01:00
Vítor Santos Costa 9932aff5c4 gecode: clone by default 2013-09-05 00:46:00 +01:00
Vítor Santos Costa ef82f25594 control changes for gecode 2013-09-05 00:26:54 +01:00
Fabrizio Riguzzi b06e1f8bb0 var depth 2013-09-04 21:34:04 +02:00
Fabrizio Riguzzi c671d8aa29 slipcover manual 2013-09-04 21:12:09 +02:00
Fabrizio Riguzzi 842b7f25ab Merge branch 'master' of git@git.dcc.fc.up.pt:yap-6.3 2013-09-04 19:11:28 +02:00
Fabrizio Riguzzi 1f3f9bfb1f inference_sl.pl equal to slipcase 2013-09-04 19:10:31 +02:00
Fabrizio Riguzzi d53857db21 dos2unix inference_sl.pl 2013-09-04 19:09:36 +02:00
Fabrizio Riguzzi cb304e781c slipcover 2013-09-04 18:58:00 +02:00
Vítor Santos Costa 90c70459be fix FloatVar code 2013-09-04 17:11:22 +01:00
Vítor Santos Costa 614e7ab856 initialize FloatVar 2013-09-04 17:01:37 +01:00
vsc c21b5bef3c fix PRISM xompiltaion in 32 bits 2013-09-04 05:05:01 -05:00
vsc 6ab396ee85 support for gecode 4, reification, initial floats 2013-09-04 04:50:32 -05:00
Vitor Santos Costa 76ca8c31df Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-08-12 11:23:12 -05:00
Vitor Santos Costa 5022db1ca7 update submodules 2013-08-12 11:22:51 -05:00
Vítor Santos Costa 3b29acea56 fix compilation in OSX 2013-08-09 19:46:04 -05:00
Vítor Santos Costa 0fd06d8cf1 fix quoting of \ 2013-08-09 18:36:45 -05:00
Vitor Santos Costa d575ca8391 ISO patches 2013-08-08 15:04:36 -05:00
Vitor Santos Costa 2829696db7 fix bug in term_variables/3 with difference lists 2013-08-08 14:12:29 -05:00
Vitor Santos Costa 2c769767a4 fix bug in sub_atom when substring is largwer than string 2013-08-08 14:11:45 -05:00
Vitor Santos Costa 5f741122fa more user udi fixes 2013-08-05 15:07:51 -05:00
Vitor Santos Costa 24de22eeb5 MLN generative learning 2013-07-29 17:56:32 -05:00
Vitor Santos Costa bfb4cef8f9 fixes 2013-07-29 17:55:51 -05:00
Vitor Santos Costa 3bb50ce3af handle possible stack expansion or gc 2013-07-25 10:21:17 -05:00
Vitor Santos Costa cc6e33bff0 support logsum, very useful in probability computatiion 2013-07-25 10:20:33 -05:00
Vitor Santos Costa 1c2e17f86a fix break/1 2013-07-22 10:52:49 -05:00
Vitor Santos Costa 38a804db1e fix indexing of long instructions 2013-07-22 10:43:38 -05:00
Vitor Santos Costa 0639f86980 fix error handling 2013-07-22 10:42:50 -05:00
Vitor Santos Costa ab372b03af improve error handling 2013-07-22 10:40:47 -05:00
Vitor Santos Costa 45bf92fbed tabling gc fixes: TrNode_child may be NULL and solutions forthcoming 2013-07-18 10:57:21 -05:00
Vitor Santos Costa 08cfc527bb Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-07-17 11:43:25 -05:00
Vitor Santos Costa 7d67d6108e Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3
Conflicts:
	C/exo_udi.c
2013-07-16 22:35:02 -05:00
Vitor Santos Costa 5284a77bbf fix tex doc 2013-07-16 22:30:41 -05:00
Vitor Santos Costa 07c2ca8324 use boolean. 2013-07-16 22:29:32 -05:00
Vitor Santos Costa 4245a04ed0 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-07-16 10:00:51 -05:00
Vitor Santos Costa dde4830ceb Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-07-16 10:00:05 -05:00
Vitor Santos Costa 55a440cf0c add isinf and isnan. 2013-07-16 09:58:57 -05:00
Fabrizio Riguzzi a405ee4bb0 update manual 2013-07-16 15:57:18 +02:00
Vítor Santos Costa f79f93bccd small updates 2013-07-16 08:01:01 -05:00
Vítor Santos Costa 5e80c3ca86 learning 2013-07-16 08:00:16 -05:00
Vítor Santos Costa bc992f552f use new notation 2013-07-16 07:59:38 -05:00
Fabrizio Riguzzi 2e309201ab slipcase examples 2013-07-16 13:55:22 +02:00
Fabrizio Riguzzi dff6925a66 remved unnecessary gloabl vars from bddem.c 2013-07-16 12:43:50 +02:00
Fabrizio Riguzzi d87bb830cd simplecudd link 2013-07-12 15:03:37 +02:00
Fabrizio Riguzzi 69b1f51a4e fixed hrefs in cplint manual 2013-07-12 14:59:20 +02:00
Vitor Santos Costa 1f47d33579 improve gc of some tabling instructions 2013-07-09 22:48:19 +01:00
Vítor Santos Costa 493161f6d8 ciao style arrays, (...) 2013-07-07 16:15:25 -05:00
Vítor Santos Costa c5554a343d fix doc text 2013-07-07 16:14:08 -05:00
Vitor Santos Costa 459ab89d7d more ezo stuff 2013-06-28 21:15:03 -05:00
Vitor Santos Costa ec5f7ebb28 Chaange semantics for min and max 2013-06-25 22:53:23 -05:00
Vitor Santos Costa a1632ff3e7 fix 32 bit offsets 2013-06-22 20:09:20 -05:00
Vitor Santos Costa b257218ece fix bad alignment 2013-06-22 00:27:31 -05:00
Vitor Santos Costa e50f62ba3f accumulator first try 2013-06-22 00:26:43 -05:00
Vitor Santos Costa 44ac5c6eac accumulator first try 2013-06-22 00:26:14 -05:00
Vitor Santos Costa b2fda6c653 more exo fixes 2013-06-22 00:25:37 -05:00
Vitor Santos Costa 4f8fad43df make sure BITS32 and 16 are what they say they are 2013-06-22 00:24:53 -05:00
Vitor Santos Costa 84c1803102 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-06-20 18:17:53 -05:00
Vitor Santos Costa ddee3df5f8 fix order 2013-06-20 18:09:30 -05:00
Vitor Santos Costa 1a0532f178 doc fixes 2013-06-20 18:08:29 -05:00
Vitor Santos Costa 5c870c11f7 don't even try to compile unsupported gprof 2013-06-20 18:07:57 -05:00
Vítor Santos Costa 44dccc00bb fix exception passing from SWI 2013-06-20 12:11:29 -05:00
Vítor Santos Costa 0726597812 error handling 2013-06-20 10:48:00 -05:00
Vítor Santos Costa 5a57611749 copyright changes 2013-06-20 10:47:44 -05:00
Vitor Santos Costa cc73f426d9 MLN stuff 2013-06-19 21:38:43 -05:00
Vitor Santos Costa 24714dbd01 small fixes to l-bfgs 2013-06-19 21:36:18 -05:00
Vítor Santos Costa f4ef6702e1 upgrade version 2013-06-19 21:34:30 -05:00
Vitor Santos Costa 7e1f3009e6 Bernd Gutmann's lbfgs interface 2013-06-13 17:57:55 -05:00
Vitor Santos Costa f1cbc7f3be improved mln stuff 2013-06-07 18:22:42 -05:00
Vitor Santos Costa c60e1046a7 use int64 fr file_time 2013-06-07 18:00:27 +01:00
Vítor Santos Costa fef0538157 Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3 2013-06-07 09:27:32 -05:00
Vítor Santos Costa 5b4f355ee0 avoid creating new index in retractall 2013-06-07 09:26:50 -05:00
Vítor Santos Costa 5303f2f479 simple check for all var arguments 2013-06-07 09:26:21 -05:00
Vítor Santos Costa b6b44c655f unnecessary lock-pred 2013-06-07 09:25:40 -05:00
Vitor Santos Costa 23a787bcb3 mlns in PFL 2013-06-06 19:22:22 -05:00
Vitor Santos Costa 6b31d08633 mlns in PFL 2013-06-06 19:18:46 -05:00
Vitor Santos Costa e96750b476 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2013-06-05 23:01:10 +01:00
Vitor Santos Costa 4826d92709 exo updates 2013-06-05 23:00:57 +01:00
Vítor Santos Costa dce491ef95 thread fixes 2013-06-03 22:03:59 -05:00
Vitor Santos Costa 889279cd81 fix prototype 2013-06-03 23:46:09 +01:00
Vitor Santos Costa dd43ee5e27 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-06-03 17:39:17 -05:00
Vitor Santos Costa 8245bae2e4 Merge branch 'master' of git://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-06-03 17:36:02 -05:00
Vitor Santos Costa b6b6b12c6f Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-06-03 16:40:12 -05:00
Vitor Santos Costa 933ee11985 add a second selectlist 2013-06-03 16:39:48 -05:00
Vitor Santos Costa 639247b4c3 sub_atom/5 in C. 2013-05-15 17:12:01 -05:00
Vitor Santos Costa 3b2b4b03c8 split atom stuff to its own file 2013-05-09 18:00:41 -05:00
Vitor Santos Costa cb48d1c47e fix paths 2013-05-02 14:07:44 +01:00
Vítor Santos Costa 6af394a35e fix PASS_REGS 2013-05-01 19:27:09 -05:00
Vítor Santos Costa 17cd9ab3c1 add debugging code 2013-05-01 19:27:00 -05:00
Vitor Santos Costa 75d607aaec Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2013-05-01 11:54:51 -05:00
Vitor Santos Costa 34bf9bb311 more exo stuff. 2013-05-01 11:34:55 -05:00
Vitor Santos Costa d644ea494d Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2013-05-01 11:34:01 -05:00
Vitor Santos Costa 923be33404 speedup between
more exo stuff.
2013-04-30 15:23:01 -05:00
Vitor Santos Costa 64a61e2479 make between/3 a C-builtin. 2013-04-29 18:22:53 -05:00
Vitor Santos Costa c04f04d078 more exo fixes. 2013-04-29 16:19:43 -05:00
Vitor Santos Costa 72cc5bc317 generalise interval handling 2013-04-29 11:58:05 -05:00
Vitor Santos Costa edbc21dcb0 fix typo 2013-04-26 18:23:17 -05:00
Vitor Santos Costa 6480f75b23 compile conditionally on HAVE_MPI_H. 2013-04-26 18:12:23 -05:00
Vitor Santos Costa f0bc4fb458 cut point should be initialised when bootrapping a new goal 2013-04-26 16:38:54 -05:00
Vitor Santos Costa 743c9c69fb get rid of PROTO 2013-04-25 17:15:04 -05:00
Vitor Santos Costa 24a75525c0 fix compilation 2013-04-25 14:21:41 -05:00
Vítor Santos Costa 2c49edb975 more exo stuff 2013-04-25 09:48:06 -05:00
Vitor Santos Costa 52253e3e9e fix bugs in exo clause 2013-04-20 20:29:08 -05:00
Vitor Santos Costa fba909cf46 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2013-04-19 16:40:30 -05:00
Vítor Santos Costa 210dacfe5a exo-compilation fixes for threads. 2013-04-16 21:49:37 -05:00
Vítor Santos Costa ea3f25c378 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-04-16 21:26:41 -05:00
Vitor Santos Costa 90abff4f2f Exo compilation, the range example. 2013-04-16 20:04:53 -05:00
Vitor Santos Costa bd9e840e8b Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3
Conflicts:
	packages/CLPBN/horus/LiftedWCNF.h
	packages/CLPBN/horus/ParfactorList.cpp
2013-04-16 15:19:42 -05:00
Vitor Santos Costa cb08a542e2 get rid of comments 2013-04-16 21:14:05 +01:00
Vitor Santos Costa 1c9cc469d5 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-04-16 21:11:51 +01:00
Vitor Santos Costa 9b4b33bb3c Merge branch 'master' of https://github.com/tacgomes/yap6.3 2013-04-16 21:09:58 +01:00
Tiago Gomes 9e57b32431 Fix compilation with older versions of GCC 2013-04-16 21:07:03 +01:00
Vitor Santos Costa 6d16dcf991 fix message 2013-04-16 14:38:01 -05:00
Vitor Santos Costa 8e33cebd4d Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2013-04-16 13:32:24 -05:00
Vitor Santos Costa cf7e904e9e version level patch 2013-04-16 09:44:29 -05:00
Vítor Santos Costa e5d5352268 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-04-16 07:53:01 -05:00
Vitor Santos Costa 78410ade1a ensure evidence does not go away, make sure YAP compiles 2013-04-15 19:12:53 -05:00
Vitor Santos Costa eeb53aef71 Merge branch 'master' of https://github.com/tacgomes/yap6.3 2013-04-16 00:18:07 +01:00
Vitor Santos Costa a5095a921a fix messages with single atom 2013-04-14 21:37:43 +01:00
Tiago Gomes 9e9ad24c90 Small updates to latex docs 2013-04-13 12:43:52 +01:00
Tiago Gomes 761406fa46 Small updates to html docs 2013-04-13 12:33:48 +01:00
Tiago Gomes 745a034d43 Reduce the size of the section labels 2013-04-13 00:49:59 +01:00
Tiago Gomes cb6715664b Create a HTML version of the manual 2013-04-12 23:49:12 +01:00
Tiago Gomes 3405a8895b Small updates to manual 2013-04-12 23:48:25 +01:00
Tiago Gomes fc2530fbe2 It appears that 'make install' on top level calls 'make all' on the horus makefile 2013-04-11 23:16:51 +01:00
Tiago Gomes 7ecfb999d5 Style change 2013-04-11 23:06:13 +01:00
Tiago Gomes de6d7981fb Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-04-11 22:28:41 +01:00
Vítor Santos Costa d22ddc6e02 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-04-10 21:36:22 -05:00
Vitor Santos Costa 66af6f7642 fix quotes 2013-04-08 17:51:55 -05:00
Vitor Santos Costa 439b7e293f use --showme in lammpi. 2013-04-08 17:20:13 -05:00
Vítor Santos Costa 23d2f7b8e5 more cleanups. 2013-04-07 10:40:42 -05:00
Vítor Santos Costa 4a95575fe1 should always lookup who generates the parameters (not supported in learning). 2013-04-07 09:51:20 -05:00
Vítor Santos Costa 30cc02e4ee Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-04-07 08:18:54 -05:00
Vítor Santos Costa 4ab4f1cab1 allow integer parameters. 2013-04-07 08:18:13 -05:00
Vitor Santos Costa c90f637852 io desc 0 is ok if all inp/out is closed 2013-04-07 02:13:29 +01:00
Vitor Santos Costa 230debfb44 enable compiling, but needs fixing YAP_Write 2013-04-07 00:01:46 +01:00
Vitor Santos Costa 12799589a8 thread fixes 2013-04-07 00:00:41 +01:00
Vitor Santos Costa 537efbc341 disable MPI library, use LAM only 2013-04-07 00:00:02 +01:00
Tiago Gomes b13a8b73a1 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-04-04 16:20:18 +01:00
Vitor Santos Costa 633a56647e thread stuff should be thread efficient :) 2013-03-26 16:11:19 -05:00
Vitor Santos Costa f7980f941b avoid unnecessary CACHE_REGS in inlines. 2013-03-26 16:10:03 -05:00
Vitor Santos Costa d163cadda1 pass regs when constructing long ints and floats.
fix small gcc complaints.
2013-03-26 15:01:52 -05:00
Vitor Santos Costa a599699f0c new dgraph path predicate 2013-03-24 09:12:55 -05:00
Tiago Gomes a2e54a235a Factor: improve factor multiplication
Pass the argument as reference-to-const and also allow chaining of multiplications.
2013-03-21 21:49:12 +00:00
Tiago Gomes 6da2580c8f Fix c550139c8b 2013-03-21 21:43:27 +00:00
Tiago Gomes e2ca97c8de Factor: use the default copy constructor 2013-03-21 21:20:28 +00:00
Tiago Gomes 389daab83f Oops 2013-03-21 19:29:24 +00:00
Vitor Santos Costa bda5d56bdf memory recovery 2013-03-19 21:26:22 -05:00
Vitor Santos Costa c364fccda8 fix memory allocation 2013-03-19 21:25:46 -05:00
Vitor Santos Costa 0ea010f3b2 remove debugging message 2013-03-19 21:25:24 -05:00
Vitor Santos Costa 6404c2d827 fix error 2013-03-19 21:23:55 -05:00
Tiago Gomes da88ffcc78 Watch out for undefined behaviour. 2013-03-18 16:18:47 +00:00
Tiago Gomes c550139c8b Add more assertations to Factor class.
SumOutFirstVariable and SumOutLastVariable will only are correctly defined if the variable is binary.
2013-03-18 15:57:10 +00:00
Tiago Gomes 4ca17b9e9b Turn off debug by default 2013-03-18 15:08:06 +00:00
Tiago Gomes acf83dd0a1 Add some unit tests 2013-03-18 14:42:54 +00:00
Tiago Gomes 403695a7ba Ouch! We were deleting the same links twice 2013-03-18 12:56:36 +00:00
Tiago Gomes 07dba92406 Add a more complex example to be used by unit tests 2013-03-18 11:33:27 +00:00
Vitor Santos Costa 4dac867fb8 new more compact/better hashing version of exo.c 2013-03-15 14:56:18 -05:00
Tiago Gomes bc04d28092 Use a static method to create a FactorGraph 2013-03-14 16:57:34 +00:00
Tiago Gomes 2ef1651c6a Add more 2 digits of precision 2013-03-14 16:55:20 +00:00
Vitor Santos Costa 3f68f424ce fix static compilation of some libs 2013-03-13 18:52:00 -05:00
Tiago Gomes b5d72f751e We need to reverse the ranges too 2013-03-13 23:22:38 +00:00
Tiago Gomes d3663d9370 Forgot to call exit 2013-03-13 22:37:04 +00:00
Tiago Gomes 23469e6f94 Initial infrastructure to support CppUnit 2013-03-13 14:47:14 +00:00
Tiago Gomes 5e5feb5674 Improve Makefile 2013-03-12 21:11:43 +00:00
Vítor Santos Costa b88dcb86ab fix tid lookup 2013-03-10 16:44:46 -05:00
Vítor Santos Costa 7f910c694d fix paths 2013-03-10 15:21:42 -05:00
Vitor Santos Costa d0858c0d0c remove debugging 2013-03-10 17:24:47 +00:00
Vitor Santos Costa 6397cc9ff7 merge 2013-03-10 17:17:58 +00:00
Vitor Santos Costa e7146c9a46 new version, thread only. 2013-03-10 17:13:09 +00:00
Vitor Santos Costa 7f758cf103 SWI expects thread IDs to be like addresses 2013-03-10 16:39:54 +00:00
Vitor Santos Costa 46d447b385 JAVACFLAGS 2013-03-10 16:39:03 +00:00
Vitor Santos Costa 562372bb5a fix instance on database 2013-03-10 16:38:01 +00:00
Vitor Santos Costa 504ad22f92 more on slot management 2013-03-10 16:37:27 +00:00
Vitor Santos Costa b0b74fd0f8 update 2013-03-10 15:49:37 +00:00
Vitor Santos Costa f62ea7686a fixes and update 2013-03-10 15:44:23 +00:00
Tiago Gomes 21c401c0dd Move CTNode class to sourcef file 2013-03-09 19:41:17 +00:00
Tiago Gomes 2da7249247 Trivial 2013-03-09 17:14:00 +00:00
Tiago Gomes a300b27764 BeliefProp: move some members to private section 2013-03-09 16:46:42 +00:00
Tiago Gomes 95539226ea Kill SPNodeInfo class 2013-03-09 16:41:53 +00:00
Tiago Gomes d563fce952 Var: replace struct by a pair 2013-03-09 16:18:13 +00:00
Tiago Gomes 532654baba Use enum class instead of old enum.
As we are relying on c++11x for other stuff too.
2013-03-09 15:39:39 +00:00
Vitor Santos Costa 5568236479 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-03-05 19:06:44 -06:00
Vítor Santos Costa 17709a9669 fix UN #280 2013-03-05 19:05:37 -06:00
Vitor Santos Costa a5000dab32 change SWI stuff to swi directory. 2013-03-05 15:50:38 -06:00
Vitor Santos Costa 263a1a548c fix meta-call handling 2013-03-05 15:50:03 -06:00
Vitor Santos Costa a64c6e523a fix meta-call handling 2013-03-05 15:47:00 -06:00
Vitor Santos Costa d59afea65e fix determinacy 2013-03-05 15:46:40 -06:00
Tiago Gomes 7193d2238d Move template definitions to source file and use explicite template instantiation. 2013-03-04 17:58:32 +00:00
Tiago Gomes 063f3ff6e3 Forgot to add these two in the previous commit 2013-03-04 17:57:56 +00:00
Tiago Gomes 93fa793683 Separate TFactor and Factor classes.
Rename TFactor to GenericFactor. GenericFactor.cpp is empty for now.
2013-03-04 15:47:47 +00:00
Vítor Santos Costa e600a9c6aa fix typo (UN) 2013-03-04 09:16:02 -06:00
Vítor Santos Costa ab01bb0124 do not wake up constraints in write_term (UN) 2013-03-04 09:14:43 -06:00
Tiago Gomes 98efd54da7 Remove unused member function 2013-03-04 15:10:51 +00:00
Vítor Santos Costa 4fcba3691a just ignore SIGHUP 2013-03-03 20:29:02 -06:00
Vítor Santos Costa 0a0b3cf6ac re-enable arit compilation 2013-03-03 20:27:20 -06:00
Vítor Santos Costa 874fc97970 leave system mode 2013-03-03 20:26:48 -06:00
Vítor Santos Costa 725617cedd optimise trace in body 2013-03-03 20:26:20 -06:00
Vitor Santos Costa 1c12d456ae ensure failure after throw from user code. 2013-03-03 08:54:46 -06:00
Vitor Santos Costa acf565d91b new version. 2013-03-03 08:54:09 -06:00
Tiago Gomes 902624f557 f(void) vs f()
"In fact, the f(void) style has been called an "abomination" by Bjarne Stroustrup, the creator of C++, Dennis Ritchie, the co-creator of C, and Doug McIlroy, head of the research department where Unix was born."
2013-02-28 19:45:37 +00:00
Vitor Santos Costa b49e9b908b gradient is more complex to compute 2013-02-26 09:39:56 -06:00
Vitor Santos Costa 59d97f83b4 handle negation in tries and add debugging hooks 2013-02-26 09:39:18 -06:00
Vitor Santos Costa dbd4c7f50f Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-02-26 09:33:46 -06:00
Vitor Santos Costa 6e7742ce8b suport /u/vitor/linux/bin:/u/vitor/bin:/usr/bin:/bin:/sbin:/usr/sbin:/ua/vitor/linux/bin:/usr/X11R6/bin:.:/usr/openwin/bin:/usr/local/bin:/ua/vitor/bin:/usr/bin:/bin:/ua/vitor/sw/bin:/opt/condor/bin:/s/bin in paths 2013-02-26 09:33:02 -06:00
Vitor Santos Costa ddb14f97aa strengthen error handling from top-level 2013-02-26 09:32:39 -06:00
Tiago Gomes c8b639f495 Define sortByParams as a local class 2013-02-22 12:35:14 +00:00
Tiago Gomes 0991a84793 Move sortByParams to source file 2013-02-21 00:13:11 +00:00
Tiago Gomes 59c6f5c243 DISALLOW_COPY_AND_ASSIGN should be in the end 2013-02-21 00:06:34 +00:00
Tiago Gomes f0572e3cfb Move BpLink to inside of BeliefProp 2013-02-20 23:59:03 +00:00
Tiago Gomes 6b0e125e3b Move MsgSchedule enum to inside class BeliefProp.
Move also SPNodeInfo to inside BeliefProp. Improve also some using of enums.
2013-02-20 23:34:03 +00:00
Tiago Gomes ce8152d7a0 Add a comment explaining why we are inlining functions with loops in ElimGraph 2013-02-20 23:08:12 +00:00
Vítor Santos Costa 6f6f578578 fix not handling 2013-02-20 13:10:20 -06:00
Tiago Gomes 1d54a78601 BayesBall: improve encapsulation 2013-02-20 14:13:37 +00:00
Tiago Gomes 9a68d95c18 Turn EGNode to be a nested class inside ElimGraph 2013-02-20 13:49:01 +00:00
Tiago Gomes 8ca379c74a Move ElimHeuristic enum to inside of ElimGraph class 2013-02-20 12:52:55 +00:00
Tiago Gomes 8de22f4f0b Counting Bp: move internal classes to source file 2013-02-20 12:42:05 +00:00
Tiago Gomes 8c2468c28b Improve encapsulation in HorusYap and perform other small refactorings 2013-02-20 11:52:42 +00:00
Tiago Gomes 77dfe50acb LiftedVe: move internal classes to source file 2013-02-20 00:21:01 +00:00
Tiago Gomes 7edfe44576 WeightedBp: remove unnecessary include 2013-02-20 00:13:15 +00:00
Tiago Gomes 74a9eda09d HorusCli: put internal functions in an anonymous namespace 2013-02-20 00:05:45 +00:00
Tiago Gomes e3439af0a0 LiftedKc: improve header include 2013-02-19 23:59:05 +00:00
Tiago Gomes e434e87cc8 LiftedKc: remove unnecessary data members 2013-02-19 23:57:22 +00:00
Tiago Gomes c9543514c5 LiftedKc: move some internal classes to source file 2013-02-19 23:47:46 +00:00
Vítor Santos Costa 9e250c3d0a fix profiler reset on OSX. 2013-02-17 08:05:20 -06:00
Vítor Santos Costa 638bee41cd fix compilation issues & up-to-date to recente SWI. 2013-02-17 07:32:55 -06:00
Vítor Santos Costa f1273132b5 Merge branch 'debugger' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-02-17 07:04:55 -06:00
Vítor Santos Costa 8cadc14ed4 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3
Conflicts:
	C/exec.c
2013-02-17 07:03:38 -06:00
Vítor Santos Costa 4dc28bc48a add missing predicate. 2013-02-17 07:02:03 -06:00
Tiago Gomes b6ee7b4460 Don't extend explicity the life time of returned temporaries.
That sort of optimization is compiler's work.
2013-02-16 18:58:22 +00:00
Tiago Gomes ea49b517e8 Some renamings in ElimGraph 2013-02-16 17:03:12 +00:00
Tiago Gomes ba79d2e422 Add a source file for Indexer class
- Move some non-performance critical methods to the source file
- Fix some implicit declarions of members in iomanip
- Fix declaration order in Makefile.in
2013-02-16 16:42:08 +00:00
Tiago Gomes 0852c4fe22 Clean ups 2013-02-16 16:17:14 +00:00
Tiago Gomes d0f5d0f9ab Change LiftedOperations to be a namespace instead of class with static member functions 2013-02-16 16:00:53 +00:00
Tiago Gomes be24ff5160 Fix typos 2013-02-16 15:30:44 +00:00
Tiago Gomes acb4bf610f Clean HorusYap a bit 2013-02-16 01:54:11 +00:00
Vitor Santos Costa 19c16176d4 get rid of 2013-02-15 13:40:05 -06:00
Vitor Santos Costa e98be4f69d Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-02-15 13:29:37 -06:00
Vítor Santos Costa 918a973019 creepy fixes 2013-02-15 10:31:49 -06:00
Vítor Santos Costa fdd05abd38 fix save_cp 2013-02-15 10:30:53 -06:00
Vítor Santos Costa 9372231bcf Merge branch 'master' into debugger 2013-02-14 20:43:05 -06:00
Vítor Santos Costa e27ceac1aa fix extra cp 2013-02-14 20:42:23 -06:00
Vítor Santos Costa e2acdf72cf don't leave system mode for hooks 2013-02-14 20:40:11 -06:00
Tiago Gomes bf1ba17855 Fix typos detected by cppcheck 2013-02-13 23:47:00 +00:00
Tiago Gomes 57f46e7c0d Fix printed string showed when file opening fails 2013-02-13 19:18:55 +00:00
Tiago Gomes ab7f4c8113 Fix namespace name 2013-02-13 19:09:11 +00:00
Tiago Gomes ef4ebb4d7f Use camel case for constants and enumerators.
All capitals case should be reserved for macros and besides there is no big need to emphasize constness in general.
2013-02-13 18:54:15 +00:00
Tiago Gomes afd26ed9b4 Trivial 2013-02-13 15:25:55 +00:00
Vítor Santos Costa f431142ef4 Merge branch 'master' into debugger
Conflicts:
	pl/boot.yap
2013-02-13 09:08:58 -06:00
Vítor Santos Costa ec7158eb99 debugger progress 2013-02-13 09:06:06 -06:00
Tiago Gomes bd70033c06 Disallow copy and assign for Var too 2013-02-13 14:42:24 +00:00
Tiago Gomes 2bc123d72c Update class, struct and enum bracket style 2013-02-13 14:26:47 +00:00
Vitor Santos Costa 60969b9601 rem and mod used code from div :( (Robrto Bagnara) 2013-02-12 16:45:03 -06:00
Vitor Santos Costa 9fb63762dc delete_file should be SICStus compatible 2013-02-12 16:21:26 -06:00
Vitor Santos Costa 268bca2330 use current LD_LIBRARY_PATH 2013-02-12 12:50:01 -06:00
Vitor Santos Costa 8590ab8b8a Merge branch 'master' of git://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-02-12 12:49:06 -06:00
Costa Vitor da79af201b top-level more SWI style. 2013-02-12 12:47:30 -06:00
Vitor Santos Costa a6f6226fdb Merge branch 'debugger' of ssh://git.dcc.fc.up.pt/yap-6.3 into debugger 2013-02-09 15:09:52 +00:00
Vítor Santos Costa 67208c8157 signals 2013-02-09 08:51:33 -06:00
Tiago Gomes e178c1af04 Change namespace name to be in Pascal case 2013-02-08 21:12:46 +00:00
Tiago Gomes 6a1a209ee3 Revert "Improve namespace names"
This reverts commit 973df43fe0.

On a second thought, namespaces are close to classes in the sense that both encapsulate data, so they should both use Pascal case notation.
2013-02-08 21:01:53 +00:00
Vitor Santos Costa 76f5696328 Merge branch 'master' into debugger 2013-02-08 20:39:00 +00:00
Vitor Santos Costa 19863f08f2 fix gprof undder a single running thread 2013-02-08 20:38:04 +00:00
Vítor Santos Costa 046cb5f8d6 debugging 2013-02-08 10:36:45 -06:00
Vítor Santos Costa d18c67aa2a try to reset stack 2013-02-08 10:35:40 -06:00
Tiago Gomes 264ef7a067 Clean a bit LiftedWCNF class 2013-02-08 12:12:45 +00:00
Tiago Gomes bff56c75ca Trivial 2013-02-08 01:11:18 +00:00
Tiago Gomes 98842dca74 Trivial 2013-02-08 00:56:42 +00:00
Tiago Gomes c41b6d80b6 Trivial 2013-02-08 00:28:32 +00:00
Tiago Gomes cd8a25162e Trivial 2013-02-08 00:22:51 +00:00
Tiago Gomes 206cf0a9c7 Trivial 2013-02-08 00:20:01 +00:00
Tiago Gomes 973df43fe0 Improve namespace names 2013-02-08 00:15:41 +00:00
Tiago Gomes 6f83ceb6f5 Put the code inside a horus namespace 2013-02-07 23:53:13 +00:00
Tiago Gomes 4267465f53 Trivial 2013-02-07 22:41:04 +00:00
Tiago Gomes 3738d0b2c6 Move some things around. No functional changes 2013-02-07 22:37:45 +00:00
Tiago Gomes 2992f9e3cf Trivial 2013-02-07 20:54:59 +00:00
Tiago Gomes 5c84a2f532 Improve includes 2013-02-07 20:09:10 +00:00
Tiago Gomes 544d0aa39e Improve header guards (again) 2013-02-07 17:50:33 +00:00
Tiago Gomes bb7a530da3 Avoid importing the std namespace 2013-02-07 13:37:15 +00:00
Tiago Gomes 7b60e88545 Improve Header guards 2013-02-06 22:58:42 +00:00
Tiago Gomes 80452bf75d Small improvements 2013-02-06 00:29:29 +00:00
Tiago Gomes 42a5bc493a Move methods with more than two lines to outside of class definition 2013-02-06 00:29:03 +00:00
Vitor Santos Costa 9f49512497 make SWI exec safer 2013-02-06 00:17:09 +00:00
Vitor Santos Costa b34be4360b do not reset cintext before cut 2013-02-06 00:16:30 +00:00
Vitor Santos Costa f873074961 update. 2013-02-05 14:34:55 +00:00
Vitor Santos Costa 33da88be5b fix SWI exec issues and try to clean up the code a bit 2013-02-05 14:22:17 +00:00
Vitor Santos Costa cf3c62f4b4 names are now atoms, not sequences of codes 2013-02-04 22:55:34 +00:00
Vítor Santos Costa 2cb0f298a8 fix style_checking flags and especially variables. 2013-02-04 11:22:42 -06:00
Vitor Santos Costa 798038ad38 avoid PL_error 2013-01-31 10:18:07 +00:00
Vitor Santos Costa 0e9641fe20 sub_string hack 2013-01-31 10:17:48 +00:00
Vitor Santos Costa 9ce268915d imprive error handling. 2013-01-29 10:50:04 +00:00
Vitor Santos Costa 14d4386e5a inf depth limit 2013-01-28 23:21:54 +00:00
Vitor Santos Costa deba351b87 UDI fixes 2013-01-28 11:18:38 +00:00
Vítor Santos Costa 02a9709431 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-01-28 09:32:22 +00:00
Vítor Santos Costa 5e243a6fbc use SWI's version data 2013-01-28 09:31:58 +00:00
Vítor Santos Costa 56a22473ea update swi. 2013-01-28 09:31:06 +00:00
Tiago Gomes 0d9d59f5fe Trivial 2013-01-25 13:58:30 +00:00
Tiago Gomes 31bff4dc84 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-01-25 13:50:09 +00:00
Tiago Gomes bef65dac57 Fix a compilation error with older versions of GCC 2013-01-25 13:47:20 +00:00
Tiago Gomes 9dfedafe98 PFL manual: small improvements 2013-01-25 13:45:35 +00:00
Vitor Santos Costa 8e427074d8 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-01-25 09:35:30 +00:00
Vítor Santos Costa bbaf1f13d4 upstream 2013-01-25 09:32:48 +00:00
Vítor Santos Costa c758d23ab4 upstream swi code 2013-01-25 09:32:17 +00:00
Vítor Santos Costa ab302e985b fix warning 2013-01-25 09:31:44 +00:00
Vitor Santos Costa 829c3ec8c4 update to latest swi. 2013-01-24 13:14:07 +00:00
Vitor Santos Costa 3d24a458fb add field for statistics to exo_index 2013-01-23 10:43:32 +00:00
Vítor Santos Costa 3c021a41cf statistics info 2013-01-23 09:58:02 +00:00
Vitor Santos Costa 2de1a678e4 fix atom_statistics 2013-01-23 09:55:11 +00:00
Vitor Santos Costa 8774fed9ff use uninstalled YAP with appropriated libs 2013-01-22 22:22:30 +00:00
Vitor Santos Costa d2a47ca4c0 protect exo compilation from atom gc 2013-01-22 22:21:44 +00:00
Vitor Santos Costa 504c2f3000 fix loop in restore 2013-01-22 16:01:37 +00:00
Vitor Santos Costa ff5bf53d38 UDI support 2013-01-22 15:37:50 +00:00
Vítor Santos Costa 1abd5dce90 fix init order to have terms when setting up Prolog flags 2013-01-21 10:07:46 +00:00
Vítor Santos Costa 0898c52e6f fix init order to have terms when setting up Prolog flags 2013-01-21 09:37:55 +00:00
Vítor Santos Costa 9a71f20caa sysError 2013-01-21 09:37:32 +00:00
Vítor Santos Costa b9f1885f0a use version from swi 2013-01-21 09:36:50 +00:00
Vítor Santos Costa 0e89a9c2ff fix init order to have terms when setting up Prolog flags 2013-01-21 09:36:08 +00:00
Vítor Santos Costa abe9f20a85 depth limit cn go to infinity 2013-01-20 23:15:09 +00:00
Vítor Santos Costa b24c91eeb3 install chr in bootstrap 2013-01-20 22:55:19 +00:00
Vítor Santos Costa 8971f37232 start 6.3.4. 2013-01-20 19:28:33 +00:00
Vítor Santos Costa 0734b9fd33 msw went away 2013-01-20 17:17:51 +00:00
Vítor Santos Costa 4c34528e90 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-01-20 17:16:49 +00:00
Vítor Santos Costa 1bd2224377 update version 2013-01-20 17:16:34 +00:00
Vitor Santos Costa 00c47e0ecc fix compatibility with swi: _PL_unify_atomic 2013-01-20 16:46:11 +00:00
Vitor Santos Costa 0865235c48 swi stuff 2013-01-19 23:06:38 +00:00
Vitor Santos Costa 5880420db9 swi stuff 2013-01-19 22:15:57 +00:00
Vítor Santos Costa 014a0ec5bc CurSlot maintenance 2013-01-19 22:13:43 +00:00
Vítor Santos Costa eea91f782f more swi win fixes 2013-01-19 14:40:08 +00:00
Vítor Santos Costa 5023da7893 Windows SWI upgrades 2013-01-19 14:35:11 +00:00
Vítor Santos Costa 290e58e262 SWI update 2013-01-19 14:19:01 +00:00
Vítor Santos Costa b7c230217a update to recent SWI. 2013-01-19 14:15:48 +00:00
Vítor Santos Costa a1e599ebe4 windows stuff 2013-01-19 11:48:36 +00:00
Vitor Santos Costa 05f9a935e1 windows stuff 2013-01-19 11:47:14 +00:00
Vítor Santos Costa 0e262df2ee fix readline interrupts. 2013-01-19 09:59:31 +00:00
Vitor Santos Costa c03b5095a3 fix bad define (mei). 2013-01-18 15:23:59 +00:00
Vitor Santos Costa b25e1fb7e8 update 2013-01-18 14:34:15 +00:00
Vitor Santos Costa 4791a18c5b don't rset RO flags 2013-01-18 14:33:41 +00:00
Vitor Santos Costa 20398352e3 who will you check? 2013-01-18 14:32:13 +00:00
Vitor Santos Costa bd83674168 new from SWI 2013-01-18 14:31:48 +00:00
Vitor Santos Costa 4f5a3469d6 new from SWI 2013-01-18 14:31:15 +00:00
Vitor Santos Costa 85acf5c4ea slots and recover ENV in failure 2013-01-18 14:30:35 +00:00
Vitor Santos Costa 8758b6de5a improve error handling for qload 2013-01-18 14:30:10 +00:00
Vitor Santos Costa 7e3db0f75c improve error handling for qload 2013-01-18 14:29:41 +00:00
Vitor Santos Costa fa470556f2 obey types 2013-01-18 14:27:46 +00:00
Vitor Santos Costa 0f362ae77f term and goal expansion should actually call the goal 2013-01-18 14:27:06 +00:00
Vitor Santos Costa e87a4f4f56 handle exec flags 2013-01-18 14:26:24 +00:00
Vitor Santos Costa f98a2d5e01 fix unbound throw (obs from Paualo Moura). 2013-01-17 14:00:12 +00:00
Vitor Santos Costa e7da973009 FreeBSD support by mei 2013-01-17 12:59:52 +00:00
Vitor Santos Costa 33714b14b9 atom completion in readline 2013-01-17 12:43:01 +00:00
Vitor Santos Costa 098608700c fix history 2013-01-17 10:12:08 +00:00
Vítor Santos Costa e22e3d74a0 thread support 2013-01-17 09:09:46 +00:00
Vitor Santos Costa 7407ecb60c SWI extension including write variable_names 2013-01-17 00:17:02 +00:00
Vitor Santos Costa 4b5ef10caf SWI portability 2013-01-16 12:33:06 +00:00
Vitor Santos Costa 7cf4e9442c SWI portability 2013-01-16 12:28:37 +00:00
Vitor Santos Costa 1bba29c646 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-01-16 11:32:08 +00:00
Vítor Santos Costa b10d95393e SWI update 2013-01-16 11:31:37 +00:00
Vitor Santos Costa 298fb62f0c Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-01-16 11:29:38 +00:00
Vítor Santos Costa abe6621495 SWI update 2013-01-16 11:28:58 +00:00
Tiago Gomes 5683258187 PFL manual: fix typo 2013-01-16 08:53:09 +00:00
Vítor Santos Costa 0eacb68907 SWI update 2013-01-16 00:19:07 +00:00
Vitor Santos Costa 9550393e66 check for enough head space 2013-01-15 22:58:34 +00:00
Vitor Santos Costa 5a6f6c09ce iupdate buffer. 2013-01-15 17:13:41 +00:00
Vitor Santos Costa e85e76cd57 update to newer pl-file.c and pl-write.c. 2013-01-15 16:51:55 +00:00
Tiago Gomes 6cad8969c6 Put solver always as the first argument 2013-01-15 12:27:21 +00:00
Vitor Santos Costa 5ae2ccc416 exo 2013-01-15 11:18:44 +00:00
Vitor Santos Costa 8c8392b5da exo support 2013-01-15 11:18:09 +00:00
Vitor Santos Costa 1207205493 fix setof bugs 2013-01-15 11:17:56 +00:00
Vitor Santos Costa a0cd8070c9 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-01-14 23:10:56 +00:00
Vitor Santos Costa be5208f281 fix search for free variables in bagof. 2013-01-14 22:46:06 +00:00
Vitor Santos Costa be668f1558 debugging stuff 2013-01-14 22:45:58 +00:00
Tiago Gomes cac748d41a Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-01-14 16:43:46 +00:00
Vítor Santos Costa 0c9342466b handle random on big ints (jan burse) 2013-01-14 09:56:25 +00:00
Vítor Santos Costa 48ea1f5ec5 exo clause support 2013-01-14 09:48:05 +00:00
Vítor Santos Costa 798afc81c4 fix argv[0] discovery. 2013-01-13 17:55:13 +00:00
Vítor Santos Costa ec37045ca3 new versions. 2013-01-13 11:53:58 +00:00
Vítor Santos Costa e054db052d fix hashing function. 2013-01-13 11:49:12 +00:00
Vítor Santos Costa 480e9aea69 fix bad ints (obs from Mei). 2013-01-13 11:48:31 +00:00
Tiago Gomes 83ccb31665 PFL manual: rework the parameter learning section 2013-01-12 12:30:34 +00:00
Tiago Gomes 90614d3594 PFL manual: minor tweaks 2013-01-12 12:30:14 +00:00
Tiago Gomes 3ecc65b816 PFL manual: fix typo, is sprinkler not sprinker 2013-01-11 21:15:01 +00:00
Tiago Gomes 509491cd0f PFL manual: improve the way we present the solver options 2013-01-11 19:39:27 +00:00
Vítor Santos Costa 8f2766cbf3 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-01-11 19:26:11 +00:00
Vitor Santos Costa e9d04ef9f5 save/restore exo 2013-01-11 18:36:34 +00:00
Vitor Santos Costa a913523d6a Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-01-11 16:58:43 +00:00
Vitor Santos Costa f83379648c fix use of exo preds. 2013-01-11 16:45:14 +00:00
Tiago Gomes 8c8e2b034f Improve a bit the learning examples 2013-01-11 00:16:56 +00:00
Tiago Gomes 8285b8e1e4 Cuttify\! 2013-01-10 23:38:46 +00:00
Vítor Santos Costa d078a2b2c4 thread support 2013-01-10 23:22:11 +00:00
Tiago Gomes 8f9b11cc7c Comment set_em_solver so that hve becomes that default 2013-01-10 23:04:17 +00:00
Tiago Gomes 4aa4cb50b0 Switch solver order in examples 2013-01-10 23:02:34 +00:00
Tiago Gomes f3bd8ad414 Use the word option instead of key. Key reminds me of hashes 2013-01-10 22:59:12 +00:00
Tiago Gomes f7fcfec8ce PFL manual: some rewording 2013-01-10 22:42:23 +00:00
Tiago Gomes d3e2abd677 Don't use the name horus in documentation.
It is just an internal code name.
2013-01-10 22:39:46 +00:00
Tiago Gomes fdeca2852a Use only one interface for options.
set_pfl_flag/2 now can be called for setting options for solvers written in Prolog and for solvers in Horus.
2013-01-10 22:10:22 +00:00
Tiago Gomes e5e224d89b Fix typo 2013-01-10 21:51:45 +00:00
Tiago Gomes bd84949f09 Trivial 2013-01-10 17:23:09 +00:00
Tiago Gomes 1bb1138b3a Fix EM typos 2013-01-10 13:45:24 +00:00
Tiago Gomes 29b2d4f3df Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2013-01-09 18:51:11 +00:00
Tiago Gomes 6060899773 Merge branch 'master' of github.com:tacgomes/yap6.3 2013-01-09 18:50:40 +00:00
Vitor Santos Costa b7ef6576a6 add keys within learning 2013-01-09 18:34:19 +00:00
Vitor Santos Costa 033f33ad96 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2013-01-09 18:22:41 +00:00
Vitor Santos Costa 6cee85bd60 fix cases where you get repeated keys or a(X,X) keys in PFL. 2013-01-09 18:22:01 +00:00
Vitor Santos Costa 46fbc539bf handle repeated query vars with evidence 2013-01-09 17:49:07 +00:00
Vitor Santos Costa 37243187ec handle no Judy 2013-01-09 17:02:41 +00:00
Vitor Santos Costa ff953eb20a Merge branch 'master' of https://github.com/tacgomes/yap6.3 2013-01-09 16:48:16 +00:00
tacgomes 2feac46e54 PFL manual: several improvements 2013-01-09 16:45:01 +00:00
Vitor Santos Costa 649fae4294 more fixes to exo compilation. 2013-01-09 16:38:39 +00:00
tacgomes 7f452d2397 Refactor the benchmarks 2013-01-09 15:25:14 +00:00
tagomes@fc.up.pt 7fabfcf4c9 Trivial 2013-01-09 11:43:40 +00:00
Tiago Gomes 91e8bcd4d7 Merge branch 'master' of github.com:tacgomes/yap6.3 2013-01-09 11:12:41 +00:00
Vitor Santos Costa 6cd778f70b exo stuff 2013-01-09 09:21:07 +00:00
Vitor Santos Costa e14703b990 flags patch by Petr Pisaf 2013-01-09 09:20:41 +00:00
Tiago Gomes 24271157ce Clean unecessary latex documents 2013-01-08 22:55:27 +00:00
Tiago Gomes 59ae52623c PFL manual: several improvements 2013-01-08 22:51:44 +00:00
Vitor Santos Costa 1043d037e9 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2013-01-08 22:06:26 +00:00
Vitor Santos Costa 8ce30976ce count collisions 2013-01-08 22:06:22 +00:00
Tiago Gomes 6755e50525 PFL manual: small improvements 2013-01-08 22:00:31 +00:00
Tiago Gomes ea054468bc Improve hcli usage string 2013-01-08 21:17:56 +00:00
Tiago Gomes dc536fabc2 Beautify setHorusFlag 2013-01-08 21:13:58 +00:00
Tiago Gomes 2738d83302 Remove some alias for hve 2013-01-08 20:48:46 +00:00
Tiago Gomes dfd7360291 Allow the use of solver as an alias of ground_solver 2013-01-08 20:47:12 +00:00
Tiago Gomes dbd35a20a2 PFL manual: improve introduction section 2013-01-08 19:40:20 +00:00
Tiago Gomes 9c8fd804df PFL manual: add a further information section 2013-01-08 19:39:39 +00:00
Tiago Gomes f94032d06c PFL manual: add an installation section 2013-01-08 19:39:03 +00:00
David Vaz c9a01455b5 Merge branch 'udi_new' into yap 2013-01-08 18:45:39 +00:00
Tiago Gomes 1b9c4e96e7 Prefix with bp_ some bp flags 2013-01-08 17:06:40 +00:00
Tiago Gomes da0514a779 Add support for more infernce keys.
Add support for export_libdai, export_uai, export_gv and print_fg.
Document these keys.
2013-01-08 17:01:03 +00:00
Tiago Gomes 4220069d90 PFL manual: use the Unix end-of-line marker 2013-01-08 15:34:56 +00:00
Tiago Gomes 75b652b0c9 PFL manual: improve title page and reword a sentence 2013-01-08 15:33:55 +00:00
Tiago Gomes 6375d05a93 PFL manual: add section for horus cli 2013-01-08 15:31:52 +00:00
Tiago Gomes 182429252e Update the usage string for hcli 2013-01-08 14:47:21 +00:00
Vitor Santos Costa f7adcf9b44 fix unnecessary dereferencing. 2013-01-08 13:09:31 +00:00
Vitor Santos Costa 2a44a0205b support backtracking with uninst args 2013-01-08 12:35:18 +00:00
Vitor Santos Costa d98862f5ea debugging exo 2013-01-08 00:40:51 +00:00
Tiago Gomes c92b7c3e7e Install hcli to the bin directory 2013-01-08 00:33:01 +00:00
Tiago Gomes f598881cc5 Explain better the potential value order 2013-01-07 22:21:52 +00:00
Tiago Gomes 9bb43360a2 Rearrange the probabilities to do a clean diff against the exported model 2013-01-07 22:18:50 +00:00
Tiago Gomes ba32ebc5f5 Add support for bayesian networks defined in an UAI file format 2013-01-07 22:17:05 +00:00
Tiago Gomes 82a4cc508b Change burglary-alarm.uai to be bayes instead of markov 2013-01-07 22:01:49 +00:00
David Vaz 5c83be965a Added eclipse to ignore 2013-01-07 16:41:51 +00:00
David Vaz 38fcc19d55 Merge branch 'udi_new' of github.com:davidvaz/yap-udi into udi_new 2013-01-07 16:33:21 +00:00
Tiago Gomes bafd7320a5 Rework a bit the examples 2013-01-07 14:59:51 +00:00
Tiago Gomes 91dbd60ad4 Allow calling set_horus_flag/2 without loading clpbn_horus 2013-01-07 14:05:56 +00:00
Tiago Gomes 96f4e7ea1b Fix typo 2013-01-07 14:04:44 +00:00
Vítor Santos Costa 8e8046db73 get rid of osx warnings 2013-01-07 09:47:52 +00:00
Vítor Santos Costa f063a2bd52 exo first step. 2013-01-07 09:47:14 +00:00
David Vaz cdc15e8cd8 merge with yap-6.3 2013-01-06 20:09:48 +00:00
Tiago Gomes ec2d9e0967 Trivial 2013-01-05 12:04:43 +00:00
Tiago Gomes f0768e76f2 Improve Makefile 2013-01-05 01:02:19 +00:00
Tiago Gomes f55ccdef33 Add a manual for PFL written in Latex 2013-01-05 00:49:39 +00:00
Tiago Gomes c5a390460d Chanse use_logarithms default to true.
Reasoning:
- In small networks, the use of logarithms is not noticed in terms of performance.
- In large networks, the chance to have a division by 0 is too high when not using logarithms.
2013-01-04 19:48:31 +00:00
Tiago Gomes f2682374fb Forgot to update the Makefile in the previous commit 2013-01-04 15:42:03 +00:00
Tiago Gomes 3347f0e676 Rename two examples 2013-01-03 23:44:30 +00:00
Tiago Gomes d4d11cd4b4 Fix sprinkler probability order 2013-01-03 18:48:15 +00:00
Tiago Gomes ea5dbe2bca Trivial 2013-01-03 18:26:12 +00:00
David Vaz a9cacc7b33 Changes to autoconfigure libjudy in udi 2013-01-02 12:10:11 +00:00
David Vaz 58962f2595 UDI: some code refactor, simple code when no index intersection is needed 2013-01-02 11:23:54 +00:00
David Vaz bae26c618b UDI: Added Judy1 with support for integer set intersection 2012-12-28 17:46:11 +00:00
Tiago Gomes d293c5e5a9 Trivial 2012-12-28 15:40:32 +00:00
Tiago Gomes 3363019c93 Remove unnecessary methods 2012-12-28 01:35:59 +00:00
Tiago Gomes 7d9af75c35 Improve solver flags 2012-12-27 23:21:32 +00:00
Tiago Gomes d36b63ece3 Trivial 2012-12-27 22:29:20 +00:00
Tiago Gomes c96496720b Trivial 2012-12-27 22:28:19 +00:00
Tiago Gomes 485c3e34b2 Use more DISALLOW_COPY_AND_ASSIGN 2012-12-27 22:25:45 +00:00
Tiago Gomes 7b7f663ac6 Don't use public members for solver flags 2012-12-27 15:44:40 +00:00
Tiago Gomes b996436b24 Reorganize 2012-12-27 15:05:40 +00:00
Tiago Gomes de0a118ae5 Move belief propagation stuff out from Horus.h 2012-12-27 15:00:30 +00:00
Tiago Gomes cbea630fbf Cosmetic fixes 2012-12-27 12:54:58 +00:00
David Vaz e6c2fa30ee Added uthash to store indexed predicates info 2012-12-27 12:11:14 +00:00
Tiago Gomes 8bdcb65907 Improve variable elimination 2012-12-26 22:55:48 +00:00
Tiago Gomes 188f359496 Fix a warning about a unitialized var 2012-12-26 21:48:05 +00:00
Tiago Gomes d8c5725b2e This shouldn't be on the repository 2012-12-21 15:20:28 +00:00
Tiago Gomes 4b901d26d7 Improve error messages 2012-12-20 23:34:53 +00:00
Tiago Gomes 01d8f8e178 More whitespace cleanups 2012-12-20 23:19:10 +00:00
Vítor Santos Costa 3565a01f1e upstream 2012-12-20 21:41:06 +00:00
Vítor Santos Costa 14b67dc76d fix threads 2012-12-20 21:33:20 +00:00
Tiago Gomes 421d6f72ee Place the constructor on the right place 2012-12-20 21:32:40 +00:00
Vítor Santos Costa 0ac9f6f436 propagate changes 2012-12-20 21:17:23 +00:00
Vitor Santos Costa ebb239b233 uninst error 2012-12-20 21:15:26 +00:00
Vitor Santos Costa 4098b9b964 fix compilation MT in win32 2012-12-20 21:15:01 +00:00
Vitor Santos Costa cb37e7714a fix warnings 2012-12-20 21:13:51 +00:00
Vitor Santos Costa a309f47794 MT support in win32 2012-12-20 21:13:20 +00:00
Vitor Santos Costa fe4218be19 improve java support 2012-12-20 21:12:30 +00:00
Tiago Gomes 57339760b9 Merge LiftedKc and LiftedCircuit in one file 2012-12-20 21:11:51 +00:00
Tiago Gomes b44ed7db39 Improve the error messages 2012-12-20 18:07:50 +00:00
Tiago Gomes 685f46dc27 Fix 2012-12-20 17:41:52 +00:00
Tiago Gomes 053fa31bb2 Exit is better than abort.
Also use a macro instead of integer to indicate failure.
2012-12-20 17:37:59 +00:00
David Vaz 4efa594f0a UDI: more work 2012-12-20 17:13:30 +00:00
Tiago Gomes 2ca31ca14a Don't abort if opening a file to export to graphviz fails 2012-12-20 17:11:11 +00:00
Tiago Gomes af8497af6e Sort the logical vars of the constraint tree when exporting to graphviz 2012-12-20 16:20:38 +00:00
David Vaz a655c0bb51 Rtree working as a plugin in UDI 2012-12-20 10:21:55 +00:00
Tiago Gomes 046af409ba Change the default solver to be hve 2012-12-19 18:25:47 +00:00
Tiago Gomes c407594146 Whitespace clean 2012-12-19 18:22:47 +00:00
Tiago Gomes 60ff9daafd Remove old example 2012-12-19 18:13:47 +00:00
Tiago Gomes 48254ba7d7 Lkc: fix some memory leaks 2012-12-19 17:45:53 +00:00
Vitor Santos Costa a7307f3faa add SWI PL_uninstantiatin_error 2012-12-19 00:52:29 +00:00
U-vsc-PC\vsc 4d9d22530f fix compilation on sequential win32 2012-12-19 00:48:43 +00:00
Tiago Gomes 2d1f5edc91 There is no more to do 2012-12-18 23:52:56 +00:00
Tiago Gomes 691188d5c9 Handle better formulas like f(X,X) 2012-12-18 23:51:51 +00:00
Tiago Gomes 0a661b0462 More cleanups 2012-12-18 22:47:43 +00:00
David Vaz 43e459b8f8 Changes Rtree so almost working 2012-12-18 18:26:59 +00:00
Tiago Gomes 4b0acbf8c1 Cleanups 2012-12-18 12:11:45 +00:00
Tiago Gomes c7a4adcefb Fix finalizing horus ground solvers on EM 2012-12-17 23:59:52 +00:00
Tiago Gomes 5fa5dda579 Remove BP from clpbn interface to EM 2012-12-17 23:29:21 +00:00
Tiago Gomes e1c862ebbe Refactor the way we set the inference solver 2012-12-17 23:14:54 +00:00
Tiago Gomes f1499f99f3 Introduce set_em_solver and use it 2012-12-17 21:19:47 +00:00
Tiago Gomes 40a72a0a63 Improve error handling for choosing EM solver 2012-12-17 21:03:13 +00:00
David Vaz 8511e87e32 packages udi as module 2012-12-17 20:29:59 +00:00
David Vaz bd25c61fbf New work on UDI 2012-12-17 20:23:03 +00:00
Tiago Gomes 9861f4aadb Is the EM solver that we want 2012-12-17 18:50:36 +00:00
Tiago Gomes 3eb6b76ddd Whitespace clean 2012-12-17 18:39:42 +00:00
Tiago Gomes 2f2f88e571 Several whitespace fixes 2012-12-17 17:57:00 +00:00
Vitor Santos Costa 06cf326885 avoi calls to inityaamregs. 2012-12-17 16:27:15 +00:00
Vitor Santos Costa f47a7bb999 add debugging hooks to gc 2012-12-17 16:25:27 +00:00
Tiago Gomes 409a230826 Use the same convetion for module import and export 2012-12-17 14:50:12 +00:00
Tiago Gomes 2738c0fb56 Use tabs instead of spaces for consistency 2012-12-17 12:13:08 +00:00
Tiago Gomes d03ea1509e Trivial 2012-12-17 11:56:15 +00:00
Tiago Gomes e35cf51476 Reorders and some reindentation 2012-12-17 11:53:57 +00:00
Tiago Gomes 9ff9be2f49 Don't pass around the Solver for EM 2012-12-15 16:11:03 +00:00
Tiago Gomes 81ac6f1913 Don't pass around the Solver in run_horus_ground_solver 2012-12-15 15:56:05 +00:00
Tiago Gomes ea931f2f93 Comment 2012-12-15 00:41:00 +00:00
Vítor Santos Costa 45b6263f85 have a separator cell not to confuse the gc. 2012-12-15 00:40:11 +00:00
Tiago Gomes 55292ab745 Clean ups and don't forget cbp 2012-12-15 00:29:03 +00:00
Vitor Santos Costa 6e94d6b37e remove debugging support 2012-12-15 00:16:59 +00:00
Tiago Gomes 1174486576 VE??? 2012-12-15 00:16:06 +00:00
Tiago Gomes 2996a0b8b3 Comment does not apply 2012-12-15 00:14:45 +00:00
Tiago Gomes e5479ff17c CLPBNs first, PFLs next 2012-12-15 00:13:53 +00:00
Vítor Santos Costa 7811a697b8 fix swi falgs and set_prolog_flag/2. 2012-12-14 23:31:13 +00:00
Vítor Santos Costa 4d35c1f70a fix call to undefined halt/1. 2012-12-14 23:30:48 +00:00
Vítor Santos Costa 7c0c795518 fix compilation of prism+odbc. 2012-12-14 23:29:07 +00:00
Vitor Santos Costa f329b5f06b fix compilation without threads 2012-12-14 22:54:00 +00:00
Vitor Santos Costa e648d197a8 fix worker_id assignment in threads 2012-12-14 19:58:07 +00:00
Vitor Santos Costa a1db3dba0b document load_db 2012-12-14 19:38:09 +00:00
Vitor Santos Costa 2e6360738c itry to use size_t
fix overflow handling bugs.
2012-12-14 19:35:26 +00:00
Tiago Gomes 6c95c50eb4 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-12-14 14:05:22 +00:00
Vitor Santos Costa 84b0529060 improve prism compatibility (fix asia). 2012-12-14 08:26:56 +00:00
Tiago Gomes 971b8b7487 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-12-13 23:48:16 +00:00
Vitor Santos Costa 524edecdd3 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-12-13 23:08:00 +00:00
Tiago Gomes d7ebdf1289 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-12-13 19:24:13 +00:00
Tiago Gomes eea7ce2885 Fix file names 2012-12-13 19:02:04 +00:00
Vitor Santos Costa 9107af2e3d improve thread startup 2012-12-13 18:12:50 +00:00
Tiago Gomes 0594d43539 Cosmetic fixes 2012-12-13 17:51:43 +00:00
Tiago Gomes 05e53eaf37 Merge sch32 and school32_data and rename to school_32 2012-12-13 17:08:54 +00:00
Tiago Gomes 6b8301d9c4 CLP(BN) is dead. Long live the PFL 2012-12-13 17:04:14 +00:00
Tiago Gomes d78baa48a1 Don't special case the tables in city.pfl
Its hard to make them work in lifted networks
:
2012-12-13 16:50:39 +00:00
Vitor Santos Costa c4448d066a allow backtracking over possible values of constraints.a 2012-12-13 15:53:01 +00:00
Tiago Gomes 8b996c5dc9 Lkc: show that we exported the circuit to graphviz when debugging 2012-12-13 14:21:16 +00:00
Tiago Gomes 48413deae7 Ops: deleted this by accident in the previous commit 2012-12-13 14:08:16 +00:00
Tiago Gomes dd8a92aaf3 Merge with upstream code 2012-12-13 12:55:55 +00:00
Tiago Gomes 11e688ffd7 Lkc: use utility function 2012-12-12 21:19:22 +00:00
Tiago Gomes f2173d001e Lkc: fix bug when adding weights 2012-12-12 21:16:36 +00:00
Tiago Gomes c7588c9361 Trivial 2012-12-12 17:03:11 +00:00
Tiago Gomes 4683d30d8e Trivial 2012-12-12 17:01:30 +00:00
Tiago Gomes 39bf95fe2b trivial 2012-12-12 16:28:18 +00:00
Tiago Gomes 8eb657aec2 Change extension of school parschema to pfl 2012-12-12 16:00:21 +00:00
Tiago Gomes 0f46c97481 Trivial 2012-12-12 15:47:09 +00:00
Tiago Gomes e66ff6777c Be consistent: constraint is always on top 2012-12-12 15:41:41 +00:00
Tiago Gomes 66cd58655b Place the debug_school predicate into a different file 2012-12-12 15:36:38 +00:00
Tiago Gomes 01dfc5e2be Change extension of school_params
school_params does not define any pfl network, so it shouldn't have pfl as the extension
2012-12-12 15:26:49 +00:00
Tiago Gomes 108e310a0f Rework the learning examples 2012-12-12 15:16:30 +00:00
Tiago Gomes f128b6de7a school_32 should use clp(bn) 2012-12-12 00:27:32 +00:00
Tiago Gomes 27a235f65b Remove text explaning pfl.
The text is badly written and explanaing pfl shouldn't be in *.pfl files, but rather in paper or README file
2012-12-11 23:36:10 +00:00
Tiago Gomes 4310e42562 rework examples 2012-12-11 23:06:09 +00:00
Vitor Santos Costa 547ba48f9f fix CUT_C=1 not being exported to sub-makefiles. 2012-12-11 23:02:05 +00:00
Vitor Santos Costa eb63cf748c small sequential fixes 2012-12-11 22:15:02 +00:00
Vitor Santos Costa 63a5daa295 read only flag to emulate debug_on_exception SWI flag. 2012-12-11 22:07:44 +00:00
Vitor Santos Costa e41f821d67 improve multi-threading support from C-interface. Still not quite there. 2012-12-11 22:07:10 +00:00
Tiago Gomes ccba2d4177 update Makefile to reflect the change of extension to .pfl 2012-12-11 21:02:26 +00:00
Tiago Gomes 1641d1fa30 Remove files that souldn't be in the repository 2012-12-11 16:22:38 +00:00
Tiago Gomes 47bc8f22fc Examples: sprinker was converted from clpbn to pfl 2012-12-11 16:20:55 +00:00
Tiago Gomes d8a7b7aad6 Examples: change extension to pfl 2012-12-11 16:19:59 +00:00
Tiago Gomes a59c152962 Lkc: Fix smoothing in atom counting nodes 2012-12-11 16:02:48 +00:00
Tiago Gomes bb68afe91d Fix an error caused by a temporary being out of scope 2012-12-11 15:52:20 +00:00
Tiago Gomes 1d732594e2 smooth circuit
Smooth the circuit independent of the verbosity level, but don't smooth it when the compilation has fail.
2012-12-10 19:39:09 +00:00
Tiago Gomes 8371e395dd fix typo 2012-12-10 19:37:41 +00:00
Tiago Gomes a25f4584c8 support printing LitLvTypes objects 2012-12-10 18:48:54 +00:00
Vitor Santos Costa ac74c9e3de remove debugging messages. 2012-12-10 14:28:04 +00:00
Vitor Santos Costa 87e811028c ifix indenting 2012-12-10 12:48:02 +00:00
Vitor Santos Costa 7b579b810f fix printing of opaque terms. 2012-12-10 12:47:01 +00:00
Vitor Santos Costa b34c8b1b2c try to improve slot allocation. 2012-12-10 12:14:24 +00:00
Vitor Santos Costa 9e63e83f1f worker_id may not be initialised if we start from C-level. 2012-12-10 12:13:31 +00:00
Vitor Santos Costa 62aa6df644 fix bad register initialization. 2012-12-10 12:12:54 +00:00
Tiago Gomes 9c8827c309 always copy clauses for backup 2012-12-09 22:57:39 +00:00
Tiago Gomes 90736156ae some clean ups 2012-12-09 22:13:58 +00:00
Tiago Gomes e46d2177b7 rework a bit the test infrastructure for lkc 2012-12-09 22:04:33 +00:00
Tiago Gomes 907144db32 don't use a stack for atom counting operator 2012-12-09 19:46:14 +00:00
Tiago Gomes 57a31c2c36 fix showing the weights on edge labels when there is a SetOrNode ancestor 2012-12-09 17:33:36 +00:00
Tiago Gomes 59f653aabd move implementation of copyClauses to another file 2012-12-08 19:32:19 +00:00
Tiago Gomes 4edbcf86b8 Use pointers to refer to clauses for better performance 2012-12-08 19:17:19 +00:00
Vitor Santos Costa ac62053c85 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-12-08 10:54:08 +00:00
Vítor Santos Costa 354dbbf802 follow pldoc 2012-12-08 10:52:39 +00:00
Vitor Santos Costa e05ee9670c unify indexing of dynamic and static clauses 2012-12-07 23:43:14 +00:00
Vitor Santos Costa f0b44b9b77 fix bad indexing (obs from Jos) 2012-12-07 23:43:00 +00:00
Tiago Gomes 73b3594c97 lifted kc: when not debuging don't keep track of the origin clauses 2012-12-07 11:47:50 +00:00
Vitor Santos Costa b98b09e7de improve utf-8 2012-12-07 08:10:21 +00:00
Vitor Santos Costa 556937195d avoid meta-call in system; improve goal/pred expansion 2012-12-07 08:08:32 +00:00
Vitor Santos Costa 7fe1f20200 indenting 2012-12-07 08:07:30 +00:00
Vitor Santos Costa c52d7a182c fix memory leak in foreign code handling 2012-12-07 08:06:45 +00:00
Vitor Santos Costa a813a13412 mysqldb interface vs Prolog 2012-12-04 14:49:29 +00:00
Vitor Santos Costa 36ae500118 fixes 2012-12-03 12:39:25 +00:00
Vítor Santos Costa d9d954abe1 fix handling of methods and classes with named objects: just use PyObject_Call() 2012-12-02 13:19:10 +00:00
Vítor Santos Costa 2cbf3439ac introduce at_halt/1.
fix bug in naming variables in suspended goals.
2012-12-02 13:18:29 +00:00
Vitor Santos Costa 3c0e16030c imprive python interface 2012-12-01 14:28:25 +00:00
Tiago Gomes ee1b7dcd21 abort when compilation failed 2012-11-27 16:54:02 +00:00
Vitor Santos Costa 683032432c more examples 2012-11-27 13:50:18 +00:00
Vítor Santos Costa e529e79582 more progress 2012-11-27 12:10:41 +00:00
Vítor Santos Costa 6e3f01e0b3 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-11-27 08:38:41 +00:00
Vítor Santos Costa 3e2a1a9678 fix --enable-clpbn-bp flag 2012-11-27 08:37:53 +00:00
Vitor Santos Costa f1874ecec0 inprove python interface. 2012-11-27 00:16:34 +00:00
Vitor Santos Costa 46cec46fa8 always accpet --enable-clpbn-bp 2012-11-26 16:20:36 +00:00
Tiago Gomes 610e55a4a2 Improve debbuging for lifted knowledge compilation 2012-11-26 14:46:45 +00:00
Tiago Gomes 1f1d194326 remove unnecessary std set 2012-11-26 14:46:00 +00:00
Tiago Gomes a2429a1eec Merge branch 'master' of github.com:tacgomes/yap6.3 2012-11-26 11:48:24 +00:00
Vítor Santos Costa 095cd68cac prevent failure in listing X 2012-11-26 09:23:25 +00:00
Vítor Santos Costa 57ac65c83b new swi version. 2012-11-25 23:48:41 +00:00
Vítor Santos Costa 99dded628f document stash_predicate and fix to absolute_file_name 2012-11-25 23:38:14 +00:00
Vítor Santos Costa e470dfcdc7 more python stuff. 2012-11-25 23:37:28 +00:00
Vítor Santos Costa 2607e59a16 add stash_predicate and fix hide_predicate. 2012-11-25 23:36:43 +00:00
Vítor Santos Costa feb70d0146 fix absolute_file_name with empty arguments. 2012-11-25 23:35:59 +00:00
Vitor Santos Costa d5b97ac15e quoting. 2012-11-24 12:23:00 +00:00
Tiago Gomes e09c25bd59 remove grounding stub form lifted knowledge compilation. its hard to implement 2012-11-22 16:34:24 +00:00
Tiago Gomes 4afe6c8161 refactor horus_ground and horus_lifted 2012-11-22 16:33:22 +00:00
Tiago Gomes 992d06656d refactor horus_ground.yap 2012-11-22 15:54:30 +00:00
Vitor Santos Costa 027632456a Merge branch 'master' of https://github.com/tacgomes/yap6.3 2012-11-22 12:29:37 +00:00
Vitor Santos Costa bb4d75f428 avoid messing up lifted solvers 2012-11-22 12:27:33 +00:00
Tiago Gomes 85db763d9c small improvement in HorusYap 2012-11-16 22:38:14 +00:00
Tiago Gomes 51eef45b2d refactor HorusYap 2012-11-16 17:10:04 +00:00
Tiago Gomes 59fd21bf33 use only 1 lifted solver instance 2012-11-16 16:50:19 +00:00
Tiago Gomes c2791748d2 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-11-16 00:57:41 +00:00
Vitor Santos Costa 114a6732f0 add_factor should succeed if Constraints are satisfied 2012-11-15 17:28:57 +00:00
Tiago Gomes 51fd48cd46 Ouchgit statusgit status! forgot to add these to index 2012-11-14 23:17:39 +00:00
Tiago Gomes 4522850cd6 one step close to use one solver instatiation to solve several queries 2012-11-14 23:13:46 +00:00
Tiago Gomes b673dfd462 fix type in an example 2012-11-14 23:12:03 +00:00
Tiago Gomes 64a27847cc Introduce a lifted solver class 2012-11-14 21:55:51 +00:00
Tiago Gomes 6e7d0d1d0a remove old TODOs 2012-11-14 21:17:04 +00:00
Tiago Gomes cad22da9f5 fixes & cleanups 2012-11-14 21:05:55 +00:00
Tiago Gomes d9e48e6290 log domain calculations fixes for lifted knowledge compilation 2012-11-14 18:40:03 +00:00
Vitor Santos Costa 740dd0ce99 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-11-14 16:01:43 +00:00
Vitor Santos Costa 416b407faa fixes i r..eal 2012-11-14 16:00:35 +00:00
Tiago Gomes 9202e286f8 IncExc: check if log vars are count normalized 2012-11-14 14:43:56 +00:00
Tiago Gomes f5c85ffcc9 shatter agains the query in lifted knowledge compilation 2012-11-12 15:20:42 +00:00
Tiago Gomes 4776817603 move more code around 2012-11-10 00:18:20 +00:00
Tiago Gomes 07bcc89a76 factor out some lifted operations in a new class 2012-11-09 23:52:35 +00:00
Tiago Gomes 8ab622e0aa more work to support inference with lifted knowledge compilation 2012-11-09 18:42:21 +00:00
Tiago Gomes c53220aa61 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-11-09 16:29:24 +00:00
Vítor Santos Costa a402001475 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-11-08 23:20:52 +00:00
Vítor Santos Costa bd53531c5a better module lookup 2012-11-08 23:20:24 +00:00
Tiago Gomes 6a200760ca initial code to support calling a lifted knowledge compilation solver 2012-11-08 21:54:47 +00:00
Tiago Gomes 0ed89d3eeb add flag to lifted knowledge compilation and s/fove/lve 2012-11-08 15:05:48 +00:00
Vitor Santos Costa 72746bf6e4 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-11-08 14:10:06 +00:00
Vitor Santos Costa 81a2420747 hide hidden predicates. 2012-11-08 14:07:55 +00:00
Tiago Gomes a8c4f4fc52 fix one more TODO 2012-11-08 14:02:18 +00:00
Vítor Santos Costa f371fca6c5 check if defined 2012-11-08 00:19:48 +00:00
Tiago Gomes f7db522c6c InxExc: improve the code 2012-11-07 23:45:43 +00:00
Tiago Gomes 6db4d37684 Independence: consider also counted log vars 2012-11-07 21:21:42 +00:00
Tiago Gomes d2ae171bb5 Improve Clause constructor 2012-11-07 18:43:13 +00:00
Tiago Gomes 278f8f77f5 Improve independence 2012-11-07 18:42:11 +00:00
Tiago Gomes 07c6509a79 cleanups, refactorings & renamings 2012-11-07 15:28:33 +00:00
Vítor Santos Costa f74164c642 correct support for goal expansion (bug report from Paulo Moura) 2012-11-07 13:49:54 +00:00
Tiago Gomes 83c1e58674 clean ups 2012-11-07 12:37:22 +00:00
Tiago Gomes b599b45bc6 AC: only allow one counting node per branch 2012-11-06 23:56:52 +00:00
Tiago Gomes 829f2248ee use utility method 2012-11-06 23:39:18 +00:00
Tiago Gomes 06a59ad659 IPG: verify that the root log vars appear in the same positions 2012-11-06 23:35:14 +00:00
Tiago Gomes 1e38743462 fix ipgCandidates 2012-11-06 16:24:59 +00:00
Tiago Gomes 869d513c1a remove and add some TODOs 2012-11-06 15:57:54 +00:00
Tiago Gomes 5e1547ba78 add missing method to TinySet 2012-11-06 15:15:55 +00:00
Tiago Gomes ab334f82b2 fix weighted model counting in atom counting nodes 2012-11-06 14:16:04 +00:00
Vítor Santos Costa 2a737fe22b small speedups 2012-11-05 13:49:49 +00:00
Vítor Santos Costa 06b915d568 more functionality 2012-11-05 13:49:15 +00:00
Tiago Gomes 4518a3db5d support smoothing on atom counting nodes (beta) 2012-11-04 18:02:40 +00:00
Vítor Santos Costa eb63f30ab2 update version 2012-11-03 13:58:20 +00:00
Vítor Santos Costa bf956ca639 python interface as a separate package 2012-11-02 22:37:27 +00:00
Vítor Santos Costa 37e4d242ad range predicates. 2012-11-02 22:36:33 +00:00
Vítor Santos Costa 3b44ed0660 fix warning 2012-11-02 22:35:51 +00:00
Tiago Gomes b8cef8798a fix warning produced by new version of gcc 2012-11-01 22:54:14 +00:00
Tiago Gomes a1d0deb638 support model counting on atom couting nodes - still untested 2012-11-01 22:34:28 +00:00
Tiago Gomes d4912ea219 some reorders 2012-11-01 13:56:12 +00:00
Vitor Santos Costa afc0c4c5a2 new version 2012-11-01 08:31:58 +00:00
Tiago Gomes bfa9648067 clean up 2012-10-31 23:58:07 +00:00
Tiago Gomes 6877be897e first stab for atom counting 2012-10-31 23:43:39 +00:00
Tiago Gomes e762d6be22 tweak colors 2012-10-30 16:00:20 +00:00
Tiago Gomes 77ef7b87cd support smoothing in inclusion-exclusion nodes 2012-10-30 15:48:19 +00:00
Tiago Gomes b31a047635 refactor exportToGraphViz 2012-10-30 14:31:52 +00:00
Tiago Gomes a75799b34f small improvements 2012-10-30 12:41:00 +00:00
Tiago Gomes 864f764391 support model counting in inc-exc nodes 2012-10-30 01:51:10 +00:00
Tiago Gomes 8b77b93a3b add support for inclusion-exclusion 2012-10-30 00:21:10 +00:00
Tiago Gomes b6df8a66b1 add assignement operator to ConstraintTree 2012-10-30 00:15:40 +00:00
Tiago Gomes d07ea73050 add projectedCopy 2012-10-29 21:37:58 +00:00
Tiago Gomes 324ea1a96c make independent partial ground suck less 2012-10-29 20:49:21 +00:00
Tiago Gomes c2b1434969 show weights in dot file and add support for smoothing set-and nodes 2012-10-29 15:39:56 +00:00
Tiago Gomes fbc44ba17d improments in exportToGraphViz 2012-10-29 13:49:11 +00:00
Vitor Santos Costa f7493e0de6 fix comparsion with wide/unwide characters 2012-10-29 09:43:05 +00:00
Vitor Santos Costa 68547e1abf imake sure we use current encoding when opening pipes... 2012-10-28 22:27:27 +00:00
Vitor Santos Costa eb79049bdb more improvements to interface 2012-10-28 18:22:09 +00:00
Vitor Santos Costa 06051f05fb fix swi interface. 2012-10-28 18:21:11 +00:00
Tiago Gomes d074ca9a8f add initial independent partial grounding support 2012-10-27 00:13:11 +01:00
Vitor Santos Costa f33fe61ada more support. 2012-10-26 00:24:07 +01:00
Tiago Gomes 68ef63207f initial support for weighted model countign 2012-10-25 12:22:52 +01:00
Vítor Santos Costa ea3f2f13e9 improve python interface 2012-10-25 00:33:02 +01:00
Tiago Gomes eac6b954a8 add inital smoothing of the circuit 2012-10-24 21:22:49 +01:00
Tiago Gomes 0cfc64d068 update TODO 2012-10-24 16:24:49 +01:00
Vitor Santos Costa 3e696eb831 fix bad index removal 2012-10-23 18:22:16 +01:00
Vitor Santos Costa 8126381e8d range and fix locals. 2012-10-23 14:55:44 +01:00
Vitor Santos Costa 139b06115e range builtins 2012-10-23 14:55:17 +01:00
Vítor Santos Costa d2da55463f more python fixes. 2012-10-23 10:18:24 +01:00
Vítor Santos Costa 0caac30c11 support lists 2012-10-23 10:16:32 +01:00
Vitor Santos Costa 84a5f518bf fix Makefile trouble 2012-10-23 09:06:38 +01:00
Vítor Santos Costa b272205707 odbc and archive 2012-10-23 00:45:13 +01:00
Tiago Gomes a8926fe38b inital code for lifted knowledge compilation 2012-10-22 23:01:13 +01:00
Vitor Santos Costa f189784510 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-10-22 22:04:38 +01:00
Vitor Santos Costa 0f8a3de8b6 support for odbc driver 2012-10-22 22:04:11 +01:00
Vítor Santos Costa 6bfd5bbe54 new version. 2012-10-22 21:39:45 +01:00
Vítor Santos Costa db39b48410 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-10-22 21:38:59 +01:00
Vítor Santos Costa ad4b767661 python support. 2012-10-22 21:38:04 +01:00
Vítor Santos Costa 135027fe20 python support. 2012-10-22 21:37:17 +01:00
Vitor Santos Costa 32a01a5bf6 :new SWI modules. 2012-10-22 18:16:52 +01:00
Vitor Santos Costa 43c3c89f30 export patch from Paulo Moura 2012-10-22 15:04:52 +01:00
Vítor Santos Costa 7fa7c8b92a patch module code (by Paulo Moura) 2012-10-22 10:18:26 +01:00
Vítor Santos Costa 14796f5d90 patch syntax error (by Paulo Moura) 2012-10-22 10:18:01 +01:00
Vítor Santos Costa 7f41b36378 fix typo 2012-10-20 10:48:42 +01:00
Vitor Santos Costa 04bba4f1de fix A option. 2012-10-19 18:13:48 +01:00
Vitor Santos Costa e92b8791c5 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-10-19 18:12:06 +01:00
Vitor Santos Costa 83480fe8a7 change the way predicates are hidden 2012-10-19 18:11:20 +01:00
Vitor Santos Costa 88f2dc7730 change the way predicates are hidden 2012-10-19 18:10:48 +01:00
Vitor Santos Costa 7d7a59ae28 outdated 2012-10-19 16:24:06 +01:00
Vítor Santos Costa 27737c31bd fix debug messages 2012-10-19 09:28:13 +01:00
Vítor Santos Costa 140a19ba7c make thread_exit follow protocol 2012-10-19 09:27:19 +01:00
Vitor Santos Costa 2de3917e4a socket testing 2012-10-17 17:30:51 +01:00
Vitor Santos Costa 4da6733194 fix bad initialization of mqs 2012-10-17 17:25:35 +01:00
Vitor Santos Costa e596cce6f5 fix compilation under threads. 2012-10-17 17:24:14 +01:00
Vitor Santos Costa 3917a19ab9 bad ref counting with trust_log/threads 2012-10-17 17:23:47 +01:00
Vitor Santos Costa 474c088baf ifix thread compilation. 2012-10-17 17:22:43 +01:00
Vítor Santos Costa fb2a17addf improve interface 2012-10-17 10:56:44 +01:00
Vitor Santos Costa f753bce4fe fix syntax error: tokens might be overwritten by Yap_unify( 2012-10-16 17:24:39 +01:00
Vitor Santos Costa 4b35fd8271 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-10-16 08:46:28 +01:00
Vitor Santos Costa 503bdcc8b3 check for overflow in big strings 2012-10-16 08:44:49 +01:00
Vitor Santos Costa 610ca06883 check for overflow in big strings 2012-10-16 08:44:26 +01:00
Vitor Santos Costa ba866a36e2 check for memory overflow; avoid possible misalignments 2012-10-16 08:43:29 +01:00
Vitor Santos Costa fcb59e5c74 fix buffer overflow 2012-10-16 08:41:15 +01:00
Vitor Santos Costa bb71204a11 small tests for MPI interface 2012-10-11 13:47:29 +01:00
Vítor Santos Costa d6b3fc4325 new version. 2012-10-09 20:10:02 +01:00
Vitor Santos Costa 965b48f017 inew version. 2012-10-09 17:29:15 +01:00
Vitor Santos Costa 474b7a19e7 fix read_term to handle new notation. 2012-10-09 17:19:39 +01:00
Vitor Santos Costa 48f07ad338 fix parsing of input strings. 2012-10-09 16:31:43 +01:00
Vitor Santos Costa 7c178d2644 newer version 2012-10-09 16:31:09 +01:00
Vitor Santos Costa 3f6e56eb82 fix overflow in SWI interface code. 2012-10-09 16:30:18 +01:00
Vítor Santos Costa ecf5ac655f fun with python 2012-10-08 23:58:22 +01:00
Vitor Santos Costa c4da6a9c68 update to newer version 2012-10-08 18:27:05 +01:00
Vitor Santos Costa b0ddda1fde fix PL_is_list 2012-10-08 18:26:40 +01:00
Vitor Santos Costa daf9f589b9 cleanup now in system 2012-10-08 18:26:05 +01:00
Vitor Santos Costa a4acb6a806 try to make sure we always have slots 2012-10-08 18:25:42 +01:00
Vitor Santos Costa 26b5173a33 use standard way to dump arguments 2012-10-08 18:25:17 +01:00
Vítor Santos Costa b24922fd38 fix bdd with em 2012-10-04 00:15:18 +01:00
Vítor Santos Costa 2d373a28a6 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-10-03 21:54:13 +01:00
Vítor Santos Costa 1089aaf585 fix error messages (patch by Ulrich Neumerkel). 2012-10-03 21:52:18 +01:00
Vitor Santos Costa 4e43aff605 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-10-03 17:17:24 +01:00
Vitor Santos Costa 93f13c9c8d Merge branch 'master' of https://github.com/tacgomes/yap6.3 2012-10-03 17:15:49 +01:00
Vítor Santos Costa ab14365a30 try to make bdds work with EM. 2012-10-03 10:23:27 +01:00
Vitor Santos Costa 01e1a14160 improve indirect evidence handling in PFL queries (obs from Andrea) 2012-10-03 09:50:50 +01:00
Vítor Santos Costa ce7adaa632 text ARG2 first (obs from Ulrich Neumerkel) 2012-10-03 09:22:27 +01:00
Vítor Santos Costa e60b485134 fix cyclic_term mess up from yesterday. 2012-10-03 09:11:37 +01:00
Vítor Santos Costa a3757ddbd7 more examples. 2012-10-02 15:16:30 +01:00
Vítor Santos Costa 237976cf30 documment new builtins. 2012-10-02 15:15:16 +01:00
Vítor Santos Costa 4de83f5f52 include cyclic_term and friends. 2012-10-02 15:14:41 +01:00
Vítor Santos Costa 8eede3eb73 fix ground cyclic terms (thanks to Paulo). 2012-10-02 15:13:52 +01:00
Vítor Santos Costa e6fb32d9ca fix problem with conditional_probability/3 and evidence (obs from Andrea Sterbini). 2012-10-02 14:26:42 +01:00
Vítor Santos Costa 20080c0a24 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-10-02 08:49:47 +01:00
Vítor Santos Costa 85e9da1332 hve with em works now. 2012-10-02 08:49:16 +01:00
Vítor Santos Costa c30e71fe68 add missing interface. 2012-10-02 08:48:35 +01:00
Vítor Santos Costa c8468f6391 add foldl4 2012-10-02 08:47:27 +01:00
Tiago Gomes 559b3e3b54 watch out for division by 0 in message calculation for BP 2012-09-30 22:04:44 +01:00
Vítor Santos Costa 793907f710 more EM stuff 2012-09-29 11:50:00 +01:00
Tiago Gomes fec0bd44b4 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-09-28 22:42:08 +01:00
Vítor Santos Costa 78a08e1b87 fix length/2 error handling. 2012-09-27 22:32:50 +01:00
Vítor Santos Costa 169339d5be fix atom_length/2 ISO. 2012-09-27 22:32:12 +01:00
Vitor Santos Costa d688ee0295 fix -lm 2012-09-27 11:48:58 +01:00
Vítor Santos Costa 76088ca8b3 support binaries. 2012-09-26 23:10:22 +01:00
Vítor Santos Costa 5249d02107 debug routine. 2012-09-26 23:08:01 +01:00
Vítor Santos Costa 74fd98832a upgrade compilation flags. 2012-09-26 22:59:22 +01:00
Vitor Santos Costa 710be1a5e8 add slots after new stack extension. 2012-09-26 22:08:17 +01:00
Vitor Santos Costa 55f28a75ab be a bit more careful saving state. 2012-09-26 22:07:47 +01:00
Vitor Santos Costa 20d31b8207 "-nosignals" option (used by JPL) 2012-09-26 22:06:59 +01:00
Vitor Santos Costa 01f8731f97 add -nosignals option. 2012-09-26 14:50:06 +01:00
Vitor Santos Costa 7424a7376c fix reverse linking with yap from target library. 2012-09-26 14:49:21 +01:00
Vitor Santos Costa 0e2055d359 use both lib64 and lib 2012-09-26 13:53:50 +01:00
Vitor Santos Costa 9597d1e75f fix library access order. 2012-09-26 13:50:25 +01:00
Vítor Santos Costa 83c5c7e7af more PFL support. 2012-09-26 00:04:58 +01:00
Tiago Gomes 265766277f Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-09-24 22:23:48 +01:00
Vítor Santos Costa 83418f8f27 bdd and pfl integration work (partial patch). 2012-09-24 14:36:30 +01:00
Vítor Santos Costa ac863833ff PFL machinery 2012-09-23 13:25:15 +01:00
Vítor Santos Costa 309dfaa813 aggregates in PFL: exa,ple 2012-09-23 13:24:49 +01:00
Vítor Santos Costa 34dc03d43b new version of ve 2012-09-23 13:23:53 +01:00
Vítor Santos Costa 2603f18a10 support factors 2012-09-23 13:23:37 +01:00
Vítor Santos Costa d73b2ac673 convert keys to numbers. 2012-09-23 13:23:05 +01:00
Vítor Santos Costa 709843717f latest swi repo 2012-09-21 13:11:46 +01:00
Vítor Santos Costa 2673c56982 new version. 2012-09-21 13:08:25 +01:00
Vítor Santos Costa a3435f5a7b SWI compatibility additions 2012-09-21 13:07:10 +01:00
Vítor Santos Costa 19e565a1c7 jpl support: swi sharing updates 2012-09-21 12:58:51 +01:00
Vítor Santos Costa f38e80f659 jpl support: swi sharing updates 2012-09-21 11:50:55 +01:00
Vítor Santos Costa d5bf100b71 make full init even before entering Prolog top-level 2012-09-21 11:49:59 +01:00
Vítor Santos Costa ceb5785120 new commits. 2012-09-18 23:13:07 +01:00
Vítor Santos Costa 419bd2b219 Fix WriteBuffer and add WriteDynamicBuffer 2012-09-18 23:07:32 +01:00
VITOR SANTOS COSTA 89030ce97d Fix WriteBuffer and add WriteDynamicBuffer 2012-09-18 23:06:26 +01:00
Tiago Gomes 10b15f606a fix counting bp calculation of joint distribution 2012-09-18 17:24:22 +01:00
Tiago Gomes 701911ef09 forgot this 2012-09-11 18:48:54 +01:00
Tiago Gomes febb17d753 fix factor joint 2012-09-11 18:48:16 +01:00
Tiago Gomes 86b57e961e fix memory leak 2012-09-11 18:40:41 +01:00
VITOR SANTOS COSTA a6c91c99c7 more cleanups. 2012-09-11 14:22:18 +01:00
VITOR SANTOS COSTA 2c0fd47e56 fix ReadFromBuffer 2012-09-11 14:21:55 +01:00
VITOR SANTOS COSTA c5bbbd9f93 support archive package 2012-09-11 14:21:09 +01:00
Vítor Santos Costa 8d779f68ea fix writebuffer interface 2012-09-08 00:12:38 +02:00
Vítor Santos Costa fa2c5ee114 more foldl2 2012-09-07 07:42:16 +02:00
Vítor Santos Costa 9019a1a7b7 RTLD_NOLOAD may not always be loaded
dlopen should always have a matching dlclose.
2012-09-07 07:40:18 +02:00
Vitor Santos Costa dcc5b57016 remove broken meta-call optimisation. 2012-09-07 00:21:57 -05:00
Costa Vitor f4e965c02f more small fixes. 2012-08-29 16:36:46 -05:00
Costa Vitor 62ab5b3dcb new ve 2012-08-28 20:21:14 -05:00
Costa Vitor fcfc0e52d7 fold operations 2012-08-28 20:19:46 -05:00
Costa Vitor 5a3cb76378 fold operation on tree 2012-08-28 20:19:22 -05:00
Costa Vitor 5c70b295bd fold operation on tree 2012-08-28 20:19:10 -05:00
Costa Vitor 38a2bee3ab Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2012-08-24 15:19:44 -05:00
Costa Vitor cb53d087b2 add rb_fold/4. 2012-08-24 15:19:15 -05:00
Vítor Santos Costa d871b8dd2a scanl and foldl. 2012-08-24 10:39:14 -05:00
Vitor Santos Costa 495d852879 fix indenting. 2012-08-23 21:02:41 +01:00
Vitor Santos Costa f85a2112c9 make sure we can use clause. 2012-08-23 21:02:15 +01:00
Vitor Santos Costa 198fc03bae xirestore: predicates need timestamps inorder to find out which clauses are alive. 2012-08-23 21:01:32 +01:00
Vitor Santos Costa 1be424fe57 imprive speed of ql 2012-08-23 09:04:58 -05:00
Vitor Santos Costa 81743361a6 fix warning 2012-08-23 09:03:42 -05:00
Vitor Santos Costa e2fb330575 avoid fixed sized hash tables. 2012-08-22 18:57:13 -05:00
Vitor Santos Costa 55267cac34 fix no threads case. 2012-08-22 15:29:28 -05:00
Vítor Santos Costa 475face871 fix thread startup aftre restore. 2012-08-22 11:32:05 -05:00
Vítor Santos Costa 05d3266671 fix lib64 issues 2012-08-22 10:07:33 -05:00
Vitor Santos Costa 9353d28c2e fix meta-call
optimise deterministic (a,b,c).
2012-08-22 09:41:09 -05:00
Costa Vitor a76f4f34d5 make EM work with PFL and BP. 2012-08-15 16:01:45 -05:00
Costa Vitor 020692635b fix extra message. 2012-08-14 16:08:03 -05:00
Costa Vitor 72c650cda0 be careful how you call macros. 2012-08-14 16:07:26 -05:00
Costa Vitor bf4d37eb0d simplify meta-call handling. 2012-08-13 23:35:37 -05:00
Vítor Santos Costa 7e8cac9fb1 a step forward. 2012-08-13 09:23:36 -05:00
Costa Vitor 4756948967 fix processing of pfl ground networks. 2012-08-08 22:16:37 -05:00
Costa Vitor 652073caa4 Merge branch 'master' of git://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-08-08 11:17:50 -05:00
Vitor Santos Costa ad609e39da Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2012-08-08 04:00:06 +01:00
Vitor Santos Costa d5ed379068 recognise weird trie. 2012-08-08 03:59:37 +01:00
Vitor Santos Costa 15bcaf97fc speedup. 2012-08-08 03:59:06 +01:00
Vítor Santos Costa 2b2cedc2b6 remove some comments and improve em interface. 2012-08-07 21:53:10 -05:00
Vítor Santos Costa c159894c29 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-08-07 18:37:02 -05:00
Costa Vitor 98f68edd34 PFL files should have the PFL suffiv 2012-08-07 18:35:44 -05:00
Costa Vitor e2fa3a3b8a fix call to ground solvers, both using clpbn style and horus style. 2012-08-07 18:33:51 -05:00
Costa Vitor 51b47d14da if/3 didn't work. 2012-08-07 18:32:45 -05:00
Vítor Santos Costa a4ae6acbb6 check for Rinterface.h 2012-08-02 19:53:43 -05:00
Vitor Santos Costa a8f0beb64b close streams on exit, so that we can flush the buffers 2012-08-02 09:59:57 -05:00
Vítor Santos Costa adef8d4737 fix nil name class in Snow Leopard (obs from Paulo Moura). 2012-08-02 09:41:14 -05:00
Vítor Santos Costa d6773df815 fix current_stream/3. 2012-08-02 09:36:37 -05:00
Vitor Santos Costa 7458d8ee74 update to newer releases. 2012-08-01 19:48:29 +01:00
Vítor Santos Costa ccb67cec96 ISO-patch, thanks to Ulrich Neumerkel. 2012-07-31 08:33:46 -05:00
Vítor Santos Costa 21e7f359dc emulate old socket interface: correct docs. 2012-07-26 16:18:16 -04:00
Vítor Santos Costa e7551b106a emulate old yap socket (thanks to Jan code). 2012-07-26 16:16:26 -04:00
Vítor Santos Costa 9d48e0ed79 fix compatibility with unix library. 2012-07-25 22:36:19 -04:00
Vítor Santos Costa a69a509b11 check if strlwr exists 2012-07-24 21:51:30 -04:00
Vítor Santos Costa 5e78479fb2 fix typo. 2012-07-18 17:58:09 -05:00
Vítor Santos Costa 2852f82b72 updaate. 2012-07-18 17:57:39 -05:00
Costa Vitor 2019c218f1 make cuud detection more robust. 2012-07-18 17:56:04 -05:00
Costa Vitor 53b694edd0 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2012-07-18 17:36:10 -05:00
Costa Vitor c8ef4dbdb4 we cannot trust that just having on reference will protect a clause. Several references may go in a single operation! 2012-07-18 14:32:53 -05:00
Costa Vitor efc857b3e1 small fixes. 2012-07-16 14:10:22 -05:00
Costa Vitor 82d6640fea fix bad counting. 2012-07-16 14:09:56 -05:00
Costa Vitor 8ba1de7250 fixes for external CUDD compatibility. 2012-07-16 11:58:21 -05:00
Vítor Santos Costa a99412c48f fix gall to gc. 2012-07-16 10:20:56 -05:00
Vítor Santos Costa 61439cdd12 iimprove dbusage debugging module. 2012-07-16 10:19:15 -05:00
Vítor Santos Costa 1fc641b7d1 add module aware versions of pred interface. 2012-07-13 14:57:12 -05:00
Vítor Santos Costa ec0437664c fix loop in db_dynamic. 2012-07-13 14:56:50 -05:00
Vitor Santos Costa d78a55ca83 fix cudd support. 2012-07-08 07:45:16 -05:00
Vítor Santos Costa bc8c9a423a Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3
Conflicts:
	packages/jpl
2012-07-07 09:54:27 -05:00
Vítor Santos Costa 1e1d49e112 allow installing examples by defult. 2012-07-07 09:43:07 -05:00
Vítor Santos Costa d9decfe003 fix example path in meld. 2012-07-06 18:58:35 -05:00
Vítor Santos Costa 8a22258fdf use standard paths for installing examples. 2012-07-06 18:56:05 -05:00
Vítor Santos Costa 50a7acdae0 install chr examples by default. 2012-07-06 18:50:50 -05:00
Vítor Santos Costa f166b8bfb6 make sure library_path is initialised at boot time, so that people get no
surprises.
2012-07-06 18:49:02 -05:00
Vitor Santos Costa c67edd877a learning is debugging 2012-07-03 19:48:13 +01:00
Vitor Santos Costa b4b1e68c35 Merge branch 'master' of https://github.com/tacgomes/yap6.3 2012-07-03 16:03:27 +01:00
Tiago Gomes 4af5a90b8b re-enable all elimination heuristics 2012-07-02 22:53:44 +01:00
Vitor Santos Costa 79b4c6cb25 new version. 2012-07-02 20:04:02 +01:00
Vitor Santos Costa 5fb55b2535 inline fixes. 2012-07-02 20:03:46 +01:00
Vitor Santos Costa 51c8142cb1 Merge branch 'master' of https://github.com/denys-duchier/yap-6.3
Conflicts:
	H/yapio.h
2012-07-02 19:58:04 +01:00
Miguel Areias bc21735ff1 fixed compilation bug (Prof. Vitor Costa) 2012-07-02 19:48:58 +01:00
Denys Duchier 97163fa150 place INLINE_ONLY at front of extern inline declarations AND definitions. gcc and clang then behave the same. 2012-06-30 20:42:14 +02:00
Tiago Gomes 7a3d39551b improve the way we compute hashs for counting bp 2012-06-30 19:25:29 +01:00
Denys Duchier a34b45bcc0 distinguish gcc and clang for INLINE_ONLY 2012-06-30 17:51:47 +02:00
Vítor Santos Costa fab462b002 Merge branch 'master' of https://github.com/denys-duchier/yap-6.3 2012-06-29 22:45:47 +01:00
Vítor Santos Costa 70bde4d38f inline extern patch by Denys Duchier 2012-06-29 22:44:08 +01:00
Vítor Santos Costa 20b60649e5 new updates to jpl. 2012-06-29 22:42:08 +01:00
Vítor Santos Costa e938c17748 fix clang compilation (Denys Duchier). 2012-06-29 22:24:12 +01:00
Vítor Santos Costa 0ed4e15925 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-06-29 21:40:10 +01:00
Vitor Santos Costa e66cea25bc MT support in console. 2012-06-29 15:39:12 -05:00
Vitor Santos Costa 5989af937b MT support in mingw win32. 2012-06-29 15:38:49 -05:00
Vitor Santos Costa 2d71a96d54 support mingw emulation. 2012-06-29 15:37:31 -05:00
Vitor Santos Costa 1a4c1a393b MT support. 2012-06-29 15:37:11 -05:00
Vitor Santos Costa 19a3796978 first attempt at locking and MT support with signals. 2012-06-29 15:36:31 -05:00
Vitor Santos Costa ab9fd00096 MT support. 2012-06-29 15:35:52 -05:00
Vitor Santos Costa 47d6cd795e explictely check for shell32 dll
make thw way jpl handles white spaces more SWI like.
2012-06-29 15:33:27 -05:00
Denys Duchier 3d28c7939e Merge branch 'master' of git://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-06-28 14:05:38 +02:00
Denys Duchier 8b57ca1cef copy-and-paste bug in dimensioning a dynamic array 2012-06-28 14:04:41 +02:00
Vítor Santos Costa 4230515792 fix inconsistent usage for extern/EXTERN. 2012-06-26 22:30:15 +01:00
Tiago Gomes 5e2d9acc4f update comment 2012-06-26 19:44:27 +01:00
Vitor Santos Costa 051936ca50 fix thread bootup (with mutex/2). 2012-06-26 13:02:44 +01:00
Vítor Santos Costa 0228bfbb30 qsave_program/2. 2012-06-26 10:09:10 +01:00
Vitor Santos Costa fe2f99e49d update package version. 2012-06-22 19:00:45 +01:00
Vitor Santos Costa 87e0b67e76 start with pfl learning. 2012-06-22 19:00:12 +01:00
Vitor Santos Costa 5fe052a3ef Merge branch 'master' of https://github.com/tacgomes/yap6.3 2012-06-22 14:51:58 +01:00
Vitor Santos Costa 637f5420aa get rid of debugger message. 2012-06-22 14:32:06 +01:00
Vitor Santos Costa 1ec498d720 argument processing. 2012-06-22 04:01:32 -05:00
Vitor Santos Costa 6eed0e30e3 fix names. 2012-06-22 04:00:00 -05:00
Vitor Santos Costa a9d1bd788e improve SWI console 2012-06-22 03:56:01 -05:00
Vitor Santos Costa b15c9f5655 support INT handler. 2012-06-22 03:55:01 -05:00
Vítor Santos Costa 4d21a8c062 fix cxxflags typo (obs from Denys Duchier). 2012-06-21 22:40:28 +01:00
Vitor Santos Costa c64d22311d call UDI at abolish. 2012-06-21 16:47:19 +01:00
Vitor Santos Costa 71eeda081c fix *-> (thanks to ulrich). 2012-06-21 15:41:35 +01:00
Vitor Santos Costa 7b6239c73f Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-06-21 03:10:45 -05:00
Vitor Santos Costa 92f7c970b0 fix access to 64 bit registry 2012-06-21 03:09:49 -05:00
Vitor Santos Costa 0ee26c6df9 fix search in registry. 2012-06-21 03:08:48 -05:00
Tiago Gomes 3e56cf5e42 update burglary-alarm 2012-06-19 21:19:02 +01:00
Tiago Gomes 25e87a5ddc whitespace fixes 2012-06-19 15:30:55 +01:00
Tiago Gomes 57edd6adb9 minor improvements 2012-06-19 15:29:09 +01:00
Tiago Gomes ee5b8e693a re-activate bayes ball 2012-06-19 15:10:57 +01:00
Tiago Gomes 9a8464d0f0 some renamings 2012-06-19 14:32:12 +01:00
Tiago Gomes 942bc8041e update burglary-alarm 2012-06-18 23:10:18 +01:00
Tiago Gomes 63739c6e31 minor updates 2012-06-18 23:08:37 +01:00
Tiago Gomes b16b0b6a3f add a README file 2012-06-18 21:38:40 +01:00
Tiago Gomes b4d2e7af20 remove unecessary call 2012-06-18 14:40:44 +01:00
Vítor Santos Costa 3ee64c50a2 include blobs. 2012-06-16 21:06:10 +01:00
Vítor Santos Costa 8d65561494 configure detection. 2012-06-16 21:05:29 +01:00
Vitor Santos Costa edb982cfff fix library search in window. 2012-06-16 12:22:59 -05:00
Vitor Santos Costa a1d8e46ee4 fix missing line. 2012-06-14 17:21:46 -05:00
Tiago Gomes 05b3daf5bb trivial fix 2012-06-14 12:19:51 +01:00
Tiago Gomes 384c108e62 fix joint calculation with lifted bp 2012-06-14 11:57:00 +01:00
Tiago Gomes 0e83a75b60 improve calculation of joint dist in counting bp 2012-06-13 12:47:41 +01:00
Tiago Gomes b43e3316b3 forgot destructor 2012-06-13 12:17:49 +01:00
Tiago Gomes 89725dffbb rename some enums 2012-06-12 21:27:17 +01:00
Tiago Gomes af11dbb445 reorder entries in the Makefile and drop some objects not required to build hcli 2012-06-12 16:55:32 +01:00
Tiago Gomes d4f63b3942 drop Solver suffix and rename some files and classes 2012-06-12 16:29:57 +01:00
Vitor Santos Costa a997f5647c fix save & restore in 6.3. 2012-06-12 14:50:36 +01:00
Vitor Santos Costa 7db18d5ce2 fix bad use of current_predicate. 2012-06-12 14:50:07 +01:00
Vitor Santos Costa 7ce65dcfa3 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-06-11 22:11:57 +01:00
Vitor Santos Costa f6de18cb09 6.2 fix to load_foreign atom. 2012-06-11 22:11:30 +01:00
Vítor Santos Costa 34679fc774 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-06-11 09:23:52 +01:00
Vítor Santos Costa 3458efd335 saved state fixes. 2012-06-11 09:22:53 +01:00
Vitor Santos Costa c6ececc21a Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-06-08 14:18:16 +01:00
Tiago Gomes 919116763f add a run all tests script 2012-06-08 14:11:54 +01:00
Tiago Gomes 4cc869a164 update scripts 2012-06-08 14:11:11 +01:00
Tiago Gomes f8e714dcc3 add social domain benchmark with evidence 2012-06-08 14:08:14 +01:00
Tiago Gomes 51c279d24c increase the cost of the grounding operator 2012-06-08 13:35:00 +01:00
Vítor Santos Costa e55d143e8d fix extra CP. 2012-06-08 13:26:11 +01:00
Vitor Santos Costa 58c3445d82 win console. 2012-06-08 06:55:23 -05:00
Vitor Santos Costa 31b8cb6440 windows support. 2012-06-08 06:54:03 -05:00
Vitor Santos Costa 6566445b06 windows stuff. 2012-06-08 06:52:48 -05:00
Vitor Santos Costa ca9c748692 make win crash on interrupt, for now 2012-06-08 06:52:21 -05:00
Vitor Santos Costa dba0a81b1c fix cudd finder. 2012-06-07 10:30:08 -05:00
Vitor Santos Costa 71bd1d9d1f fix missing cygwin header:w::wq 2012-06-07 10:29:17 -05:00
Vitor Santos Costa 2f434ff48b complain if we have no valid float configureation. 2012-06-07 10:28:30 -05:00
U-WIN-UA9ACS5GS9N\vitor 76d7a1d5e5 don't trust that X+200 is > X 2012-06-07 10:27:33 -05:00
Ricardo Rocha f0c0913490 fix multithreading with mode-directed tabling 2012-06-06 15:19:38 +01:00
Tiago Gomes 5785260644 fix warning 2012-06-06 15:04:28 +01:00
Vítor Santos Costa 3a212944fb fix bad compare in checking pt 2012-06-06 00:09:14 +01:00
Tiago Gomes 111de4c86a Merge branch 'master' of github.com:tacgomes/yap6.3 2012-06-05 15:33:49 +01:00
Tiago Gomes 568bb27a66 forgot this 2012-06-05 15:33:24 +01:00
Tiago Gomes 6cd33f92c2 Merge branch 'master' of github.com:tacgomes/yap6.3 2012-06-05 15:25:16 +01:00
Tiago Gomes 2cf6a2a33d add benchmark tests for lbp 2012-06-05 15:23:41 +01:00
Vítor Santos Costa c4bd913e34 fix stupid indesing of very long terms. 2012-06-05 08:04:22 +01:00
Vítor Santos Costa d1d01ddc2a Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-06-05 00:13:22 +01:00
Vítor Santos Costa 47a4b902e0 fix stupid indexing on sub-terms.; 2012-06-05 00:12:13 +01:00
Ricardo Rocha 7e667c1038 fix multithreading with mode-directed tabling 2012-06-04 19:47:45 +01:00
Ricardo Rocha d540354c30 adding sum mode operator + fix multithreading compatibility 2012-06-04 19:27:31 +01:00
Vitor Santos Costa 67d52d3560 fix depth calculation. 2012-06-04 18:21:34 +01:00
Vitor Santos Costa 3669cb894f Merge branch 'master' of https://github.com/tacgomes/yap6.3
Conflicts:
	packages/CLPBN/clpbn/horus.yap
2012-06-04 16:29:56 +01:00
Tiago Gomes 31fde92a36 Merge branch 'master' of github.com:tacgomes/yap6.3 2012-06-04 14:57:42 +01:00
Tiago Gomes eec4b1452b print all lifted bp flags 2012-06-01 19:31:07 +01:00
Tiago Gomes 8fa8fff9f1 minor improvements 2012-06-01 19:29:57 +01:00
Tiago Gomes 25ccfa2f54 only allow joint dists on cliques 2012-06-01 19:29:23 +01:00
Vitor Santos Costa 1fbd5c268b extend WorkSpace 2012-06-01 16:39:06 +01:00
Tiago Gomes 4708685ed4 fix bug in Factor::contains 2012-06-01 14:03:39 +01:00
Vitor Santos Costa 71a62307f4 CLP(BN) stuff. 2012-06-01 13:17:39 +01:00
Vitor Santos Costa 39f392be9c allow finer control over indexing sub-terms.
improve flag code a bit.
2012-06-01 13:16:29 +01:00
Tiago Gomes ecde9649a8 fix header guard 2012-06-01 12:35:44 +01:00
Tiago Gomes b5369db214 use only solveQuery 2012-05-31 23:06:53 +01:00
Tiago Gomes f91e543d9d workaround c++ bad design: don't allow creating a factor graph from some pointer 2012-05-31 22:42:38 +01:00
Tiago Gomes 3f0f41c8a9 cleanup 2012-05-31 21:24:40 +01:00
Tiago Gomes e11ed1a226 forgot these two 2012-05-31 21:24:15 +01:00
Tiago Gomes 22d8876d33 add support to (real) lifted belief propagation 2012-05-31 21:12:46 +01:00
Tiago Gomes 22780c4559 handle empty vectors in TinySet 2012-05-31 14:57:53 +01:00
Tiago Gomes 7429a39b48 fix a bug on absorving lifted evidence 2012-05-31 14:09:50 +01:00
Tiago Gomes c2297c3f70 add lbp flag 2012-05-31 12:45:09 +01:00
Tiago Gomes d00eb05624 use bind2nd instead of bind1st 2012-05-31 12:19:13 +01:00
Tiago Gomes 6668ee6381 add initial skeleton for lifted bp 2012-05-30 19:23:41 +01:00
Tiago Gomes 8d14593c3e add an enum for lifted solvers and do some renamings 2012-05-30 17:17:39 +01:00
Tiago Gomes ac38e9e6a6 minor improvement 2012-05-29 17:19:49 +01:00
Tiago Gomes 651051484b update TODO 2012-05-29 17:14:29 +01:00
Tiago Gomes 02395daed3 add a sequential elimination heuristic 2012-05-29 17:14:01 +01:00
Tiago Gomes 0315cd51a3 remove repeated elements in TinySet 2012-05-29 17:09:45 +01:00
Tiago Gomes 6feb746412 use STL to calculate L1 distance and max norm 2012-05-29 13:48:08 +01:00
Tiago Gomes 3ac854b2ff use more Util::sizeExpected 2012-05-28 21:27:52 +01:00
Tiago Gomes 54ae29ae02 replace Util::add and Util::multiply by Util::apply_n_times 2012-05-28 21:09:56 +01:00
Tiago Gomes f489a59194 use std::accumulate to calc the msg size 2012-05-28 20:59:39 +01:00
Vítor Santos Costa 2def937080 don't index velow depth 20. 2012-05-28 20:40:12 +01:00
Tiago Gomes 57e32267fe remove unecessary code 2012-05-28 19:47:20 +01:00
Tiago Gomes 62283f353c some renamings 2012-05-28 19:41:24 +01:00
Tiago Gomes 64b53e8180 minor improvements 2012-05-28 19:10:29 +01:00
Tiago Gomes 004e6c0c5f minor improvements 2012-05-28 18:26:15 +01:00
Tiago Gomes 0cee50496e fix compilation in older gcc 2012-05-28 17:57:45 +01:00
Tiago Gomes fb5edf6051 Merge branch 'master' of github.com:tacgomes/yap6.3 2012-05-28 17:47:31 +01:00
Tiago Gomes d5c2e6833d use convenient function 2012-05-28 17:43:48 +01:00
Tiago Gomes 978ad635b7 update configure 2012-05-28 17:02:51 +01:00
Tiago Gomes 0ad8f5fb4a remove whitespace 2012-05-28 17:01:07 +01:00
Tiago Gomes 149f3dab26 fix a bug in exporting to uai format 2012-05-28 17:00:46 +01:00
Tiago Gomes 3ee176c65b fix header guard 2012-05-28 16:59:41 +01:00
Tiago Gomes f3ca7b2dfc add elementsToString and move things around a bit 2012-05-28 16:57:45 +01:00
Tiago Gomes 1352a526c3 refactor the way we export to libDAI 2012-05-28 14:42:20 +01:00
Tiago Gomes 250d122fc8 prefix is better than postfix 2012-05-28 14:12:18 +01:00
Tiago Gomes a9c369aac1 size_t invasion, part II 2012-05-28 14:01:05 +01:00
Tiago Gomes 4a02997484 be consistent: s/copy/backup 2012-05-28 12:34:39 +01:00
Tiago Gomes 3986012e56 rename CutIndexer to MapIndexer 2012-05-28 12:32:15 +01:00
Tiago Gomes 3290834dfe be consistent with other functions 2012-05-28 12:24:10 +01:00
Tiago Gomes fb9bb5c8b5 remove unused method 2012-05-28 12:18:39 +01:00
Tiago Gomes 6034f7a264 refactor the function to reorder arguments 2012-05-28 12:17:47 +01:00
Tiago Gomes 1239832c21 refactor the way we calculate the product of two factors 2012-05-26 20:58:56 +01:00
Tiago Gomes bc2da47804 add a new handy constructor to CutIndexer class 2012-05-26 20:56:41 +01:00
Tiago Gomes 918666d7f6 add a randomize function 2012-05-26 20:44:39 +01:00
Tiago Gomes c1bd230e61 small improvement 2012-05-25 21:26:40 +01:00
Tiago Gomes 4b2ffee015 minor renaming 2012-05-25 21:22:48 +01:00
Tiago Gomes 2efca0c85a refactor indexer classes and receive te ranges as a constant reference 2012-05-25 21:16:08 +01:00
Tiago Gomes 5ff161b10f refactor functions for summing out 2012-05-25 20:15:05 +01:00
Tiago Gomes df8a3c5fdc fix a recent bug in StatesIndexer.h 2012-05-25 14:36:52 +01:00
Tiago Gomes a56bccf5e5 delete unused method 2012-05-24 23:39:38 +01:00
Tiago Gomes 18d4777d9a use PrvGroup 2012-05-24 23:38:44 +01:00
Tiago Gomes af6601837c size_t invasion 2012-05-24 22:55:20 +01:00
Tiago Gomes 5124098b6c delete unused code 2012-05-24 16:21:41 +01:00
Tiago Gomes acc5ab056a some refactorings 2012-05-24 16:14:13 +01:00
Tiago Gomes 444eaacc63 add operators to manipulate vectors of parameters 2012-05-24 14:55:30 +01:00
Tiago Gomes 7426dfb056 Merge branch 'master' of github.com:tacgomes/yap6.3 2012-05-24 11:59:29 +01:00
Tiago Gomes 6cb718942a some renamings 2012-05-23 21:23:03 +01:00
Tiago Gomes d91e91b97e prefix calls to c++ functions with cpp_ 2012-05-23 20:34:57 +01:00
Tiago Gomes 2b896aecb4 add examples to the Makefile 2012-05-23 19:59:40 +01:00
Tiago Gomes 9f236dccdd rename bp.yap and fove.yap 2012-05-23 19:15:23 +01:00
Tiago Gomes cf929b6f13 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-05-23 17:59:26 +01:00
Tiago Gomes 2848ceb1f4 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-05-23 17:50:35 +01:00
Tiago Gomes c04082dc2e move benchmarks one level up 2012-05-23 17:27:21 +01:00
Tiago Gomes 3890aafc1a update examples 2012-05-23 17:17:50 +01:00
Tiago Gomes bdef49bb20 remove city old example 2012-05-23 15:57:00 +01:00
Tiago Gomes efec94adff remove two unnecessary files 2012-05-23 15:55:39 +01:00
Tiago Gomes 584e363aa1 move graphical model examples 2012-05-23 15:48:03 +01:00
Tiago Gomes 5b38891c21 third try ... 2012-05-23 14:58:26 +01:00
Tiago Gomes 6c77afb3ae ok, second try 2012-05-23 14:56:01 +01:00
Tiago Gomes 3388917aa5 change location and directory name of c++ probabilistic inference algorithms 2012-05-23 14:45:02 +01:00
Tiago Gomes a4d181eb97 update benchmarks 2012-05-23 12:40:34 +01:00
Tiago Gomes 7c3e4ed3ab improve log information 2012-05-23 12:26:14 +01:00
Vítor Santos Costa 01749939fa Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-05-22 16:22:06 +01:00
Vítor Santos Costa 95a33cd56d remove error message. 2012-05-22 16:20:56 +01:00
Ricardo Rocha 5b074e894a Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2012-05-22 14:47:52 +01:00
Ricardo Rocha 26e6281bb7 fix PgEnt_strs_in_use counter 2012-05-22 14:47:47 +01:00
Vitor Santos Costa 5e915955e3 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-05-21 17:25:38 +01:00
Vitor Santos Costa 9e3d16022a fix YAP_AttOfVar
beautify get atts
2012-05-21 17:24:40 +01:00
Ricardo Rocha 02447ac372 minor fixes 2012-05-21 15:55:14 +01:00
Vitor Santos Costa f261a3fd2f fix writing att vars. 2012-05-18 13:03:22 +01:00
Tiago Gomes 16cb48fea4 decrease the time required to find an elimination order 2012-05-17 17:29:31 +01:00
Vítor Santos Costa d68ef3f5a1 fix empty tries. 2012-05-17 09:56:49 +01:00
Tiago Gomes cf9a7f1413 show the maximum memory used in the benchmarks 2012-05-16 12:31:58 +01:00
Tiago Gomes 5934d9efe9 update TODO 2012-05-16 00:44:59 +01:00
Tiago Gomes 23b180b6f0 merge TinySet and SortedVector classes 2012-05-16 00:41:01 +01:00
Tiago Gomes 354071c261 update scripts 2012-05-15 20:14:13 +01:00
Tiago Gomes f7ba86d3ed kill Util::abort, s/vectorIndex/indexOf and s/isCarteesianProduct/isCartesianProduct 2012-05-15 19:41:14 +01:00
Tiago Gomes db0d2c9772 refactor and increase the scope of parfactor multiplication 2012-05-15 19:05:39 +01:00
Tiago Gomes f4bca3ceea factor overflow will not happen with bp 2012-05-15 19:02:40 +01:00
Tiago Gomes 7ec4887e77 refactor printing of a parfactor 2012-05-15 16:57:50 +01:00
Tiago Gomes 346b70145f improvements on shattering 2012-05-15 16:52:21 +01:00
Tiago Gomes 90e139f8f3 refactor ProbFormula comparation operator 2012-05-15 16:49:34 +01:00
Tiago Gomes 03f9df7dc3 fix a bug when checking of a set of log vars form a cartesian product 2012-05-15 16:46:21 +01:00
Tiago Gomes 1380adcfb5 support getting tuples of repeated log vars 2012-05-15 16:45:24 +01:00
Tiago Gomes 2061eefda2 add a way to copy a log var 2012-05-15 16:43:32 +01:00
Vitor Santos Costa 06cd0c7414 fix overflow handling. 2012-05-15 16:03:41 +01:00
Vítor Santos Costa 5c459a1201 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-05-14 22:44:34 +01:00
Vítor Santos Costa 448bc7e7de Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-05-14 22:42:42 +01:00
Ricardo Rocha 1dcc8bd393 adptation of the memory allocator based on pages to work with threads 2012-05-14 19:11:58 +01:00
Vitor Santos Costa 10d5a38e92 fix compilation under threads. 2012-05-14 18:05:16 +01:00
Vitor Santos Costa f3f9c75cf7 oops : 2012-05-14 16:22:53 +01:00
Vitor Santos Costa 6c36a8ccd3 make it easier for outside packages to link with YAP innards. 2012-05-14 15:06:18 +01:00
Vitor Santos Costa 682db0aad4 support term_subsumer. 2012-05-14 15:04:19 +01:00
Vitor Santos Costa b36e607cb4 protect heapgc.c 2012-05-13 15:58:28 +01:00
Vítor Santos Costa b985ea2fbc fix bug in stack overflow. 2012-05-13 10:17:30 +01:00
Vitor Santos Costa a05bad3bf0 fix bad offset in export_term. 2012-05-08 17:04:28 +01:00
Vitor Santos Costa 2423407b37 fix bug in detecting tabling on (Paulo Moura). 2012-05-08 14:55:37 +01:00
Vitor Santos Costa 916ca678ba Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-05-08 12:58:13 +01:00
Vitor Santos Costa 681d4e78a2 ifix C++ complaint. 2012-05-08 12:57:32 +01:00
Vitor Santos Costa 7488ef0539 ifix bug in checking for free space. 2012-05-08 12:55:34 +01:00
Tiago Gomes 4ade4945a0 improve Util::abort 2012-05-07 17:52:47 +01:00
Tiago Gomes aeb07d43a7 add two more utility functions 2012-05-07 17:48:15 +01:00
Vítor Santos Costa 63616b94a7 fix bad init of unsafe asm pred. 2012-05-07 06:53:27 +01:00
Tiago Gomes 9d5801ef7f ony summout a group of rand vars if they not appear in another position on the parfactor 2012-05-05 23:11:32 +01:00
Tiago Gomes 8e75ef3073 shatter parfactors also against themselves 2012-05-05 21:06:27 +01:00
Tiago Gomes 660e15e2ac update the overflow check in factors, still needs more work tbd 2012-05-04 14:28:07 +01:00
Tiago Gomes 0e01a51929 remove commented code and fix a warning 2012-05-04 14:10:00 +01:00
Vitor Santos Costa 4945e390f1 detect C++ flags and compile horus accordingly 2012-05-03 15:40:33 +01:00
Tiago Gomes 35d0804f9a update TODO 2012-05-03 13:15:33 +01:00
Tiago Gomes 10ac7720f7 update smokers examples 2012-05-03 11:38:49 +01:00
Tiago Gomes 2bef3f6866 minor updates 2012-05-03 00:56:19 +01:00
Vítor Santos Costa e1f6187395 make syntax error standard. 2012-05-03 00:16:11 +01:00
Vítor Santos Costa c3e3b0b50f fix term_to_atom/2. 2012-05-02 23:38:04 +01:00
Vítor Santos Costa 9b0b6ec649 fix stop_low_level_trace.
P Moura request for (?).
2012-05-02 10:09:26 +01:00
Tiago Gomes 92d8c7dcbe add more asserts 2012-04-30 17:49:07 +01:00
Tiago Gomes ad50166bd0 fix bug in benchmarks script 2012-04-30 16:26:33 +01:00
Vítor Santos Costa 0efe86f3ba fix bad fix on modules, hope this one works. 2012-04-30 15:35:17 +01:00
Tiago Gomes 9971736a45 kill DEBUG constant, its not used any more 2012-04-30 14:50:14 +01:00
Tiago Gomes 7cf8c68e15 fix error message 2012-04-30 14:12:00 +01:00
Tiago Gomes d6e11ca84d delete order vars flag 2012-04-30 13:02:53 +01:00
Tiago Gomes fa8ff6d5b6 abort if the factor will become to bigger 2012-04-30 12:48:30 +01:00
Tiago Gomes 85fc4ae50a add missing files 2012-04-30 11:59:59 +01:00
Tiago Gomes a90bfb7a86 update benchmarks 2012-04-30 11:24:04 +01:00
Tiago Gomes 2fa06da3c9 disable bayes ball for now 2012-04-30 11:20:02 +01:00
Tiago Gomes 185cbe9c73 update examples 2012-04-30 11:16:11 +01:00
Tiago Gomes 56475cacbc revamp debugging plataform 2012-04-29 20:07:09 +01:00
Tiago Gomes d86e2c8386 don't raise counting log vars before multiplication 2012-04-28 01:10:04 +01:00
Tiago Gomes 1173b4c25b when expanding a counting formula, check if the expanded log vars are still counting log vars 2012-04-28 01:01:23 +01:00
Tiago Gomes 52f4aa0340 sort the parfactors by their parameters when printing 2012-04-27 19:10:22 +01:00
Vítor Santos Costa 2bfc88db98 fix module dereferencing. 2012-04-27 16:30:23 +01:00
Vítor Santos Costa 067d6d3f4f fix problog experiment. 2012-04-27 16:30:02 +01:00
Vítor Santos Costa 5ee39c6f08 back to original version. 2012-04-27 16:20:40 +01:00
Vítor Santos Costa 9e36576951 fix implicit import 2012-04-27 15:52:03 +01:00
Vítor Santos Costa 6bb4db125d fix names. 2012-04-27 15:33:32 +01:00
Vítor Santos Costa 60184e230d new lbdd stuff. 2012-04-27 15:32:57 +01:00
Vítor Santos Costa ceb0c1f5ac new support file. 2012-04-27 15:32:17 +01:00
Vítor Santos Costa 823066f9da use library for learning. 2012-04-27 15:30:39 +01:00
Vítor Santos Costa fd4bf21ece fix file names. 2012-04-27 15:26:44 +01:00
Tiago Gomes 20fc2c8dd1 add debug information to variable elimination 2012-04-27 14:48:48 +01:00
Tiago Gomes 9e1a649262 raising the paramaters to some power should happen after summing out, not before 2012-04-27 14:47:30 +01:00
Tiago Gomes 7599ccd5a1 don't print the paramaters if they are more than 32 2012-04-27 01:19:28 +01:00
Tiago Gomes af063dcda8 be more precise when calculating the cost of grounding a log var in a formula 2012-04-27 01:18:54 +01:00
Tiago Gomes 995a11be83 improvements in the way we align logical variables 2012-04-26 18:00:06 +01:00
Vítor Santos Costa fd755f0b7e allow ProbLog to use lbdd. 2012-04-26 13:52:09 +01:00
Tiago Gomes cc09e77707 remove unnecessary variable 2012-04-26 00:58:06 +01:00
Tiago Gomes 689244a0d8 improve cbp by supporting factors connected to a single var two or more times 2012-04-26 00:54:06 +01:00
Tiago Gomes ad24a360ce Add a way to summout a dimension given a index instead of a variable id.
This is required for counting belief propagation.
2012-04-25 22:59:01 +01:00
Vítor Santos Costa c3eb3db4ed call gc if we set dead mega clauses. 2012-04-23 23:28:41 +01:00
Vítor Santos Costa 5b443bdc46 fix marking of dead mega clauses */ 2012-04-23 23:24:35 +01:00
Tiago Gomes fc362fe123 reorder the parameters instead of reordering variables 2012-04-23 22:57:04 +01:00
Tiago Gomes 0ebd6d6e06 improve constructor of VarNode 2012-04-23 22:40:36 +01:00
Tiago Gomes 3397f694fe sort the variable ids when printing all posterioris 2012-04-23 22:12:04 +01:00
Ricardo Rocha cd5e1211c5 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2012-04-23 18:57:14 +01:00
Ricardo Rocha 42631bcc71 missing cache regs 2012-04-23 18:57:10 +01:00
Vítor Santos Costa d7c7ef1c01 ifix signdeness stuff. 2012-04-23 17:26:49 +01:00
Vítor Santos Costa fe82747031 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-04-23 15:51:05 +01:00
Vítor Santos Costa 24d09ffde5 fix trailing issues in numbervars. 2012-04-23 15:50:01 +01:00
Ricardo Rocha a6ff7528d1 missing variable declaration 2012-04-23 15:39:49 +01:00
Vitor Santos Costa f24bf2e2cd full school 2012-04-23 07:13:58 -05:00
Vitor Santos Costa 32a905bc8b ddnnf support 2012-04-23 07:13:25 -05:00
Vitor Santos Costa 040c1c7fa7 more ddnnf stuff 2012-04-23 07:13:01 -05:00
Tiago Gomes d90fcd532b minor update 2012-04-21 17:21:54 +01:00
Tiago Gomes 8c689665a0 support setting flags in horus cli and fix a bug when ordering the variables 2012-04-21 17:14:19 +01:00
Vítor Santos Costa a9434aed37 more gc changes. 2012-04-20 23:45:16 +02:00
Vitor Santos Costa 3aee05ae9e Merge branch 'master' of /home/vitor/yap-6.3 2012-04-20 16:44:27 -05:00
Vitor Santos Costa 22f702f8e4 ddnnfs. 2012-04-20 16:43:30 -05:00
Vitor Santos Costa 220f7e6efc support mtbdds. 2012-04-20 16:42:59 -05:00
Tiago Gomes 085ebe1e96 check for overflows when performing expansion
case the factor size after expansion be bigger than an unsigned integer, abort the program
2012-04-20 17:16:10 +01:00
Tiago Gomes 0ffa409a80 fix a bug when expanding potential 2012-04-20 14:50:14 +01:00
Vitor Santos Costa 178ad27db8 better understanding of ddnnf. 2012-04-20 07:07:19 -05:00
Vítor Santos Costa e11d8bbda1 fix module generating detection and messages. 2012-04-20 12:29:10 +02:00
Vítor Santos Costa 753170bf7c fix synatx error. 2012-04-20 12:28:42 +02:00
Tiago Gomes 09697b8461 heuristic to improve results with fove 2012-04-19 18:37:15 +01:00
Tiago Gomes 2b7da4bc23 refactor the way we calculate the grounding cost 2012-04-19 17:59:45 +01:00
Tiago Gomes 661ce08961 check if the factor is not zero when choosing the elimination order 2012-04-19 12:08:27 +01:00
Vitor Santos Costa c3da25227f Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2012-04-19 01:01:11 -05:00
Vitor Santos Costa 49b936db67 avoid read-only flags. 2012-04-19 01:00:29 -05:00
U-WIN-UA9ACS5GS9N\vitor 19807d46f7 WIN32 and CYGWIN fixes. 2012-04-18 14:14:56 -05:00
Tiago Gomes cd1e157019 sort the colors in the signature receveied from a factor (add std namespace) 2012-04-18 19:29:43 +01:00
Tiago Gomes 7c100c96bc sort the colors in the signature receveied from a factor 2012-04-18 19:29:11 +01:00
Tiago Gomes 862e90a36b fix bug in joining constraint trees 2012-04-18 18:14:15 +01:00
Tiago Gomes 61ee95d92a use logarithms to calculate the cost of each fove operator 2012-04-18 16:40:12 +01:00
Tiago Gomes 406276b62b add missing scripts 2012-04-18 13:53:34 +01:00
Tiago Gomes a7f57bea99 several optimizations on ConstraintTree 2012-04-18 03:05:01 +01:00
Tiago Gomes cd720497f8 update groups when shattering 2012-04-18 03:04:06 +01:00
Tiago Gomes bb5d02dbc0 minor updates 2012-04-18 03:03:29 +01:00
Tiago Gomes dacf6b4e57 update examples 2012-04-18 02:57:24 +01:00
Tiago Gomes d22b5a97fd add missing scripts 2012-04-18 02:52:31 +01:00
Tiago Gomes b7e9245f26 refactor and add more benchmarks scripts 2012-04-18 02:49:33 +01:00
Tiago Gomes d8e757f9ab improvements in the way factorials are computed 2012-04-18 02:46:38 +01:00
Vítor Santos Costa 81be229e22 fix SWI error handling. 2012-04-18 01:09:23 +02:00
Vítor Santos Costa fac8af303d fix call to gc. 2012-04-18 00:57:43 +02:00
Tiago Gomes cd8714460e add a way of calculate factorials of large numbers 2012-04-17 20:24:40 +01:00
Tiago Gomes f02d0fb798 add more api to sorted vector implementation 2012-04-17 19:02:56 +01:00
Vítor Santos Costa b26d266ed6 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-04-17 00:22:15 +01:00
Vítor Santos Costa 2cfb744b07 fix bad frame pointer. 2012-04-17 00:21:08 +01:00
Vítor Santos Costa a660082b45 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-04-16 23:48:31 +01:00
Vítor Santos Costa 40ce9feb76 bdd experiments 2012-04-16 23:47:36 +01:00
Tiago Gomes 5e88510a7d use convenience function 2012-04-16 21:48:13 +01:00
Tiago Gomes 6ab5a4668b change align of some functions 2012-04-16 21:47:06 +01:00
Tiago Gomes dd0ae564ef adapt to changes in CFactorGraph 2012-04-16 21:45:52 +01:00
Tiago Gomes 779f4ea2ce fix debuging information and s/ds/range 2012-04-16 21:44:04 +01:00
Tiago Gomes 66353e67ec some refactorings 2012-04-16 21:42:14 +01:00
Tiago Gomes 0d5888e238 assign evidence to the pruned factor graph 2012-04-16 21:40:28 +01:00
Denys Duchier c484053210 added a README file for gecode bindings 2012-04-16 22:28:35 +02:00
Denys Duchier 638bcfb242 added support for gecode 3.7.3 2012-04-16 22:14:34 +02:00
Denys Duchier 82ced70a33 maybe import customize_compiler from new distutils 2012-04-16 22:02:53 +02:00
Denys Duchier 347b28f69d removed -q option because of new g++ 2012-04-16 21:59:11 +02:00
Denys Duchier b66b261972 Merge branch 'master' of git://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-04-16 21:51:54 +02:00
Tiago Gomes b27500e93f add nrVarNodes and nrFacNodes 2012-04-16 19:29:55 +01:00
Vítor Santos Costa 8894645017 fix bug in trail expansion (should recover numbers) 2012-04-15 22:40:00 +01:00
Tiago Gomes 6f7d2af718 add another sorted vector implementation 2012-04-15 21:51:12 +01:00
Tiago Gomes c32ad3de0a use a sorted vector to store the node childs 2012-04-15 21:44:27 +01:00
Tiago Gomes 5e7b660f44 use iterators instead off indices 2012-04-15 03:19:15 +01:00
Vítor Santos Costa c385dc13a8 fix syntax 2012-04-15 00:02:37 +01:00
Vítor Santos Costa cdd1af567e if commit is called from C-code we can't trust getval not to send exceptions. 2012-04-15 00:01:26 +01:00
Vítor Santos Costa 34ccb95dd3 fix problem with catching handling. 2012-04-15 00:01:02 +01:00
Tiago Gomes 62fedf014b workaround garbage collector error 2012-04-14 18:00:12 +01:00
Tiago Gomes f1d2889eaa fix warning about uninitialized var 2012-04-14 17:59:04 +01:00
Tiago Gomes 401ad145a5 improve the way the factor graph is constructed from a set from factors 2012-04-14 17:57:24 +01:00
Tiago Gomes f6e3bb4481 don't assert when suming numbers with negative infinity 2012-04-13 23:12:12 +01:00
Tiago Gomes 24a5fe9c23 add typedef 2012-04-13 15:56:37 +01:00
Tiago Gomes 05ef8610f4 fix warning 2012-04-13 15:47:41 +01:00
Tiago Gomes 00faccd940 implement a printSolverParameters in ground solvers 2012-04-13 15:22:24 +01:00
Tiago Gomes f3be68a552 add a way to print bool vars 2012-04-13 15:21:11 +01:00
Vítor Santos Costa 683377b520 buffer output when exiting absmi. 2012-04-12 23:52:25 +01:00
Vítor Santos Costa af7510a67b fix handling of repeated calls to YAP_Init. 2012-04-12 23:25:04 +01:00
Tiago Gomes 15c8f3abc6 ops 2012-04-12 18:46:21 +01:00
Tiago Gomes 5348c4a989 comment debug information in some prolog files 2012-04-12 18:35:29 +01:00
Vítor Santos Costa 5a8cc421d2 small pfl fixes. 2012-04-12 18:11:29 +01:00
Vítor Santos Costa c5f42cd7eb more pfl changes. 2012-04-12 17:24:39 +01:00
Vítor Santos Costa 8c2dd1f847 fix bad call for parameters. 2012-04-12 17:17:21 +01:00
Vítor Santos Costa 28ce2da3dc Merge branch 'master' of https://github.com/tacgomes/yap6.3 2012-04-12 17:07:19 +01:00
Tiago Gomes 9def6c2b15 tempary hack to fix cbp and clean in benchs.sh 2012-04-12 00:42:55 +01:00
Tiago Gomes 564958ef8d improvements on benchmarkings 2012-04-11 23:48:59 +01:00
Vítor Santos Costa 27dc66a5f4 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-04-11 22:09:15 +01:00
Vítor Santos Costa c08178a57c fix thread compilation. 2012-04-11 22:08:02 +01:00
Tiago Gomes 03013960d3 refactor the city benchmarks and introduce set_solver/1 2012-04-11 19:15:52 +01:00
Tiago Gomes f2fbbf29d8 rework the examples and erase the city network in the old format 2012-04-11 15:36:50 +01:00
Tiago Gomes 8697fcd2b4 refactorings 2012-04-10 20:43:08 +01:00
Tiago Gomes 78e86a6330 refactor ground solver interface 2012-04-10 15:00:18 +01:00
Tiago Gomes 46e6a10625 convert city dataset to new format 2012-04-10 12:56:14 +01:00
Tiago Gomes b52dc99914 refactorings 2012-04-10 12:53:52 +01:00
Tiago Gomes aa1b2e40ea some renamings 2012-04-10 11:51:56 +01:00
Tiago Gomes 6986e8c0d7 Improvements
Factor nodes now contain a factor object instead of a pointer. Refactor the way .fg and .uai formats are readed.
2012-04-09 15:40:51 +01:00
Tiago Gomes f1d52c0389 add missing files 2012-04-05 23:04:27 +01:00
Tiago Gomes d1b25f0864 renamings and delete bn_bp stuff 2012-04-05 23:00:48 +01:00
Vítor Santos Costa 7085008193 fix compilation without gmp. 2012-04-05 20:50:27 +01:00
Tiago Gomes b28ee8fb3a drop bayesian network representation 2012-04-05 20:08:54 +01:00
Tiago Gomes abb0410d07 drop suport for Pearl belief propagation 2012-04-05 19:34:37 +01:00
Tiago Gomes 0d23591058 Add support to markov networks 2012-04-05 18:38:56 +01:00
Vítor Santos Costa bc2364c5dc small fixes 2012-04-04 08:29:20 +01:00
Tiago Gomes 6c3add2ebd first steps in adapting horus ground solvers to pfl 2012-04-03 19:53:27 +01:00
Vítor Santos Costa 2bdec8f725 more PFL fixes. 2012-04-03 17:12:58 +01:00
Vítor Santos Costa 9ab7ab0a5e fix possible error in modules. 2012-04-03 16:24:14 +01:00
Vítor Santos Costa 14d142aa10 new example. 2012-04-03 16:23:26 +01:00
Vítor Santos Costa 65e0c3b2a2 more PFL changes. 2012-04-03 16:22:40 +01:00
Vítor Santos Costa 6ccd458ea5 Merge branch 'master' of https://github.com/tacgomes/yap6.3
Conflicts:
	packages/CLPBN/clpbn/bp.yap
	packages/CLPBN/clpbn/fove.yap
	packages/CLPBN/clpbn/horus.yap
2012-04-03 15:07:22 +01:00
Vítor Santos Costa 44cb6abcb6 PFL support. 2012-04-03 15:01:35 +01:00
Vítor Santos Costa e130c26c6d improve bdd support. 2012-04-03 15:01:14 +01:00
Vítor Santos Costa 3d216cf9db iextend bdd support. 2012-04-03 15:00:22 +01:00
Tiago Gomes 911b241ad6 fix align of logical variables 2012-04-03 11:58:21 +01:00
Tiago Gomes fd8980642b another test 2012-04-01 00:23:03 +01:00
tgomes c6128c51e8 this is a test 2012-03-31 23:59:05 +01:00
Tiago Gomes e9cc1a8be2 remove unnecessary files 2012-03-31 23:44:08 +01:00
Tiago Gomes 313f9a036a yay, my first commit 2012-03-31 23:27:37 +01:00
Vítor Santos Costa 88411f4b40 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-03-30 09:50:41 +01:00
Vítor Santos Costa 3563dcbf03 control for very large bdds. 2012-03-30 09:50:18 +01:00
Vítor Santos Costa edfb13c5e9 allow users to check for out of space conditions explicitly. 2012-03-30 09:49:36 +01:00
Vítor Santos Costa f8972365f8 fix phrase/3 2012-03-29 22:32:56 +01:00
tgomes 24b466db4e new version. 2012-03-29 12:24:29 +01:00
Vítor Santos Costa 32167b5465 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-03-28 17:55:06 +01:00
Vítor Santos Costa 7d3d9bcf41 fix module stuff. 2012-03-28 14:35:09 +01:00
Vítor Santos Costa 0a9076bf4a bdd 2012-03-28 10:59:26 +01:00
Vítor Santos Costa d149d041a3 hack around phrase 2012-03-28 10:58:53 +01:00
Vítor Santos Costa d3fd980474 another try at improving output of operators. 2012-03-27 16:44:11 +01:00
Vítor Santos Costa 9c685e71a7 fix - -2. 2012-03-27 15:19:07 +01:00
Vítor Santos Costa 9ff1399482 new versions of packages. 2012-03-27 14:59:22 +01:00
Vítor Santos Costa 295cf24f5c extend functionality. 2012-03-27 14:57:43 +01:00
Vítor Santos Costa cd45c64dcc allow optimisation and preserve ordering. 2012-03-27 14:57:12 +01:00
Vítor Santos Costa 49b9c8ea50 include support for HAS_GETHOSTNAME 2012-03-27 14:55:59 +01:00
Vítor Santos Costa 04e9a3a8ed nclude limits.h 2012-03-27 14:55:39 +01:00
Vítor Santos Costa 3cb9ca11ca include ieeefp.h in yap.c 2012-03-27 14:20:34 +01:00
Vítor Santos Costa a223c33e0b UN keysort/2 partial error checking and tiny speedup 2012-03-27 14:17:29 +01:00
Vítor Santos Costa dc43d26c8a Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-03-25 21:43:43 +01:00
Vítor Santos Costa 52e5fdb6aa fix typo and export extra 2012-03-25 21:42:49 +01:00
Vítor Santos Costa 7d6b2435e0 fix typo and export extra 2012-03-25 21:42:39 +01:00
Vítor Santos Costa a38177207d use safer method 2012-03-25 21:41:03 +01:00
Vítor Santos Costa b6d5b79789 force parent unification when binding two variables with same key 2012-03-25 21:40:29 +01:00
Vítor Santos Costa 7d6461a527 fix order. 2012-03-23 22:26:31 +00:00
Vítor Santos Costa 9c42dfa26c UW Experimental: Superfast phrase/3. This version is simply using call/3 2012-03-23 15:00:58 +00:00
Vítor Santos Costa 52f06f5f60 un: strict iso update 2012-03-23 14:42:26 +00:00
Vítor Santos Costa bdb855a57b make skip_list available to user code 2012-03-22 23:30:02 +00:00
Vítor Santos Costa 07335ce047 clp(bn) support 2012-03-22 23:24:09 +00:00
Vítor Santos Costa 372f3d795e fix bad use of skip_list. 2012-03-22 22:41:41 +00:00
Vítor Santos Costa 6b1574757e fix dist usage. 2012-03-22 22:32:50 +00:00
Vítor Santos Costa caf9b757f3 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-03-22 22:23:58 +00:00
Vítor Santos Costa f5f13541c6 old new syntax 2012-03-22 22:23:20 +00:00
Vítor Santos Costa 4c1602b74b old syntax example. 2012-03-22 22:22:16 +00:00
Vítor Santos Costa 573c11e8b2 patch by UN: Avoid writing quoted for bar. Conforms to 6.3.4.3 of ISO/IEC 13211-1:1995/Cor 2:2012 2012-03-22 22:15:07 +00:00
Vítor Santos Costa 65e61cfefd patch by UN: op/3 typo in error 2012-03-22 22:13:11 +00:00
Vítor Santos Costa 1e2abadd78 patch by UN: op/3 typo in error 2012-03-22 22:12:13 +00:00
Vítor Santos Costa 4d5c70b64b fix operator handling (by UN). 2012-03-22 22:10:23 +00:00
Vítor Santos Costa 756bba9bc5 fix by UN to do type checking on sort. 2012-03-22 22:09:08 +00:00
Vítor Santos Costa b1ee4dfb0d fix debugging info (use flags, not global variable).:: 2012-03-22 22:06:47 +00:00
Vítor Santos Costa 857ff4b895 get rid of portray_delays. 2012-03-22 21:59:04 +00:00
Vítor Santos Costa e6b48be445 avoid making choice-point. 2012-03-22 21:43:26 +00:00
Vítor Santos Costa 1698bb3c91 imessage for missing library. 2012-03-22 21:42:41 +00:00
Vítor Santos Costa 01b86d78cc support warning if matlab is not to be found. 2012-03-22 21:42:11 +00:00
Vítor Santos Costa a0d2e6f285 dgraph_leaves: all leaves in a directed graph (linear time). 2012-03-22 21:41:48 +00:00
Vítor Santos Costa 4484dec044 allow writing constraints, and small fix for writing after prefix ops. 2012-03-22 21:40:42 +00:00
Vítor Santos Costa 7b78832aa7 avoid strict float checking when building arrays.w 2012-03-22 21:38:22 +00:00
Vítor Santos Costa 8c6b68278c isupport compiling bdd package. 2012-03-22 21:37:20 +00:00
Vítor Santos Costa 6ad2c9b3a9 experimental BDD interface package. 2012-03-22 21:36:44 +00:00
Denys Duchier 05bd59a2fb better error messages. regenerated for all versions of gecode 2012-03-22 20:49:24 +01:00
Vítor Santos Costa a338b95d3f add more support for FOVE. 2012-03-22 19:10:15 +00:00
Vítor Santos Costa 7d4f83ca40 improve examples. 2012-03-22 19:09:31 +00:00
Vítor Santos Costa 172f59cee5 ifix interface to clp(bn) machinery. 2012-03-22 19:08:36 +00:00
Denys Duchier 8b16734e1c fix for setvars. also slightly better errors in generated code. 2012-03-22 16:10:59 +01:00
Denys Duchier 48cb3d6543 added support for gecode 3.7.2 2012-03-22 15:10:19 +01:00
Vítor Santos Costa 7b84608e5e ifix case where we lose hash table output. 2012-03-22 12:07:38 +00:00
Vitor Santos Costa c85e76f20f new fove version. 2012-03-22 11:40:24 +00:00
Vitor Santos Costa 6191dd210b new version 2012-03-22 11:35:54 +00:00
Vitor Santos Costa 21d317b223 new version of bp 2012-03-22 11:33:24 +00:00
Vitor Santos Costa 6e36498cac new version. 2012-03-22 11:29:46 +00:00
Vítor Santos Costa 3443fa1932 another try... 2012-03-19 09:31:15 +00:00
Vítor Santos Costa 0b8c998ae1 fix - and (. 2012-03-19 08:58:26 +00:00
Vítor Santos Costa 3cb8b99852 fix write -(-1) UN # 236 2012-03-18 00:08:10 +00:00
Vítor Santos Costa 5c6c034ec9 generate type error on second arg to term variables/2 (UN 198) 2012-03-18 00:07:06 +00:00
Vítor Santos Costa 06242879c0 fix hassle with write(-(1)). #UN 135. 2012-03-15 22:55:50 +00:00
Vítor Santos Costa 919fa40464 fix overflow handling in loop checking for unify_occurs_check (UN #232) 2012-03-15 22:37:13 +00:00
Vítor Santos Costa 0c1eb1d642 fix write_canonical of $VAR(_). 2012-03-15 22:19:48 +00:00
Vítor Santos Costa f2782cc274 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2012-03-14 22:11:35 +00:00
Vítor Santos Costa cc8521c9d5 fix bad handling of singletons with write_canonical. 2012-03-14 22:10:21 +00:00
Vítor Santos Costa 74d7ad2704 extend interface to copy fast lists of integers or floats. 2012-03-14 11:08:28 +00:00
Vítor Santos Costa 0f374aaff1 icleanup. 2012-03-14 11:08:04 +00:00
Vítor Santos Costa b01261eed5 fix handling for execute_cpred. 2012-03-09 12:06:43 +00:00
Vítor Santos Costa 36acb5f897 fix profiling support. 2012-03-09 11:46:34 +00:00
Vítor Santos Costa 44737a5d0f Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-03-08 11:29:25 +00:00
Vítor Santos Costa a95666c977 fix dereferences when saving terms. 2012-03-08 11:28:59 +00:00
Vítor Santos Costa 89183a143a portray_delays only works in debugging mode. 2012-03-08 08:15:13 +00:00
Vítor Santos Costa 3e4a2c6767 improve handling of recursive writes, catch exceptions. 2012-03-07 23:52:15 +00:00
Vítor Santos Costa 020323d633 list_or_partial_list support. 2012-03-06 14:41:23 +00:00
Vítor Santos Costa 9a57a51f40 keep looking for perfect cudd detection. 2012-03-06 14:40:56 +00:00
Vítor Santos Costa fd0cf6ee14 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-03-06 14:12:39 +00:00
Vítor Santos Costa 6075bde029 partial_list 2012-03-06 14:12:25 +00:00
Vítor Santos Costa bf15197e49 cudd is a nightmare. 2012-03-05 16:40:32 +00:00
Vítor Santos Costa bb4b7b6d0e fix paths, disable R by default. 2012-03-05 16:00:47 +00:00
Vítor Santos Costa b02d34e400 drop comment levels. 2012-03-04 15:28:04 +00:00
Vítor Santos Costa fbe846e74a fix is_list to fail on infinite lists. 2012-03-04 10:45:32 +00:00
Vítor Santos Costa 5a472616e7 fix recent regressions on :- if, etc. 2012-03-04 10:22:40 +00:00
Vítor Santos Costa 0f10f4332e improve ˆC handling (still needs work). 2012-03-03 21:46:07 +00:00
Vítor Santos Costa 45baf800dd fix stream is not an atom (Ulrich). 2012-03-01 22:03:41 +00:00
Vítor Santos Costa 67cd8b303e improve finding cuddd. 2012-03-01 08:42:19 +00:00
João Santos 78fb13e651 parallel_findfirst/3 2012-02-27 18:31:57 +00:00
João Santos 430147f310 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2012-02-27 17:22:37 +00:00
João Santos 553fbc505f fix cut predicate in YapOr and ThOr 2012-02-27 17:18:01 +00:00
Vítor Santos Costa 04ef859158 fix thread compilation. 2012-02-27 17:09:04 +00:00
Vítor Santos Costa ddcf1f003b make sure we can consult from external code directly. 2012-02-27 16:37:31 +00:00
Vítor Santos Costa e38c850361 fix yap_flag(user_* (obs from Nicos). 2012-02-27 14:20:34 +00:00
Vítor Santos Costa 665d426e13 fix writing streams by write.c 2012-02-27 08:53:18 +00:00
Vítor Santos Costa 5d65c49292 fix user defined directives. 2012-02-26 23:26:08 +00:00
Vítor Santos Costa 1531002f26 avoid unnecessrily using slots in Input/Output calls or just because I need a stream. This can lead to hard to
catch stack bugs.
2012-02-18 11:01:06 +00:00
Vítor Santos Costa d777ff863a fix warning on unused variables. 2012-02-17 15:04:25 +00:00
Vitor Santos Costa 4135553063 fix write to be thread-safe (wrputf was also unsafe *) 2012-02-17 13:41:05 +00:00
Vitor Santos Costa fd88bae93d no lam by default, 2012-02-17 11:40:35 +00:00
Vítor Santos Costa 8ba0bee7ab updates to packages. 2012-02-17 11:31:55 +00:00
Vítor Santos Costa d8452fd3b1 fix warning. 2012-02-17 11:31:46 +00:00
Vítor Santos Costa c602140953 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-02-14 18:58:29 +00:00
Vítor Santos Costa 48cbed8b20 update to latest release. 2012-02-14 18:58:12 +00:00
Vítor Santos Costa b2378bf34f fix bug in nth_clause/3.
fix compiler warning.
2012-02-14 18:57:39 +00:00
Miguel Areias 1de3affa99 Multi-threaded tabling - No Sharing support 2012-02-14 15:00:31 +00:00
Miguel Areias 952ef65a2e CACHE REGS 2012-02-14 14:32:24 +00:00
Vítor Santos Costa 8c556f21ba include XMLPL package. 2012-02-14 12:41:12 +00:00
Vítor Santos Costa 6c16f4e953 iadd export functionality. 2012-02-14 09:54:56 +00:00
Vítor Santos Costa 935fd0d647 skip env. 2012-02-14 09:54:38 +00:00
Vitor Santos Costa 6403b4793a small write fixes. 2012-02-14 09:10:07 +00:00
Vitor Santos Costa 8d9c5617eb fix clash. 2012-02-14 07:46:55 +00:00
Vitor Santos Costa b454383e30 more write updates. 2012-02-14 07:46:37 +00:00
Vitor Santos Costa 98b2cf70c2 fix write '$VAR'('_A'). 2012-02-14 06:54:32 +00:00
Vitor Santos Costa 247aa54046 back to using YAP writer. 2012-02-13 23:07:31 +00:00
Vítor Santos Costa fc4edc3ad1 update version. 2012-02-13 19:30:00 +00:00
Vítor Santos Costa 70b41fbdb7 iupdate packages. 2012-02-13 11:26:23 +00:00
Vítor Santos Costa fb04195314 first version for occurs_check flag. 2012-02-13 11:26:05 +00:00
Vítor Santos Costa 9dc5992109 fix uid support. 2012-02-13 11:23:51 +00:00
Vítor Santos Costa 8a5413c2fb follow SWI. 2012-02-13 11:23:30 +00:00
Vítor Santos Costa dd762fe664 new versions. 2012-02-13 10:35:05 +00:00
Vítor Santos Costa 32d953809e update packages. 2012-02-13 09:43:50 +00:00
Vítor Santos Costa 8af7ad47bf add more SWI files. 2012-02-13 09:42:57 +00:00
Vítor Santos Costa 7c2ba414a3 support predicate flagas and declaration support. 2012-02-13 09:41:37 +00:00
Vítor Santos Costa 64319f622f better SWI support. 2012-02-13 09:41:22 +00:00
Vítor Santos Costa d5bfd78b64 $length1 was broken. 2012-02-13 09:40:57 +00:00
Vítor Santos Costa db35eb4b3c call SWI's predicate option expansion. 2012-02-13 09:39:57 +00:00
Vítor Santos Costa a128d1d78d allow calling directives with VL and Line Number. 2012-02-13 09:39:29 +00:00
Vítor Santos Costa 88cc8a0bdb predicate options. 2012-02-13 09:39:09 +00:00
Vítor Santos Costa b6ca945ef0 seriously out of date. 2012-02-13 09:38:15 +00:00
Vítor Santos Costa 12bd3d6a5b more SWI files. 2012-02-13 09:38:02 +00:00
Vítor Santos Costa f583bb93ee allow comments within [ ] and { } . 2012-02-13 09:37:33 +00:00
Vítor Santos Costa c63709f310 make xor an operator. 2012-02-13 09:37:16 +00:00
Vítor Santos Costa c8787a29f2 allow weird use of atom_file_name
exists_source/1.
2012-02-13 09:36:44 +00:00
Vítor Santos Costa 67b4b6126c fix error messages. 2012-02-13 09:36:05 +00:00
Vítor Santos Costa 795a958090 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2012-02-12 12:29:00 +00:00
Vítor Santos Costa ea18699602 JPL support patches. 2012-02-12 12:28:37 +00:00
João Santos 21522ce151 CACHE_REGS 2012-02-07 15:18:43 +00:00
Vitor Santos Costa 3648c562fa more lammpi compilation fixes. 2012-02-06 17:35:32 +00:00
Vitor Santos Costa e032d5faf7 configure fixes for LAM MPI. 2012-02-06 16:44:33 +00:00
Vítor Santos Costa c98e42f545 fix global variable on compiler (move it to LOCALS). 2012-02-06 15:11:50 +00:00
Vítor Santos Costa 597a63cc12 fix messup on WIN64. 2012-02-06 15:11:38 +00:00
Vítor Santos Costa 3b3f631e93 allow extra space to avoid mess up in bignums on WIN64. 2012-02-06 15:10:48 +00:00
Vítor Santos Costa 2f17b25885 improve error handling. 2012-02-06 11:41:58 +00:00
Vítor Santos Costa 5e68d5e7e8 more TARGET fixes. 2012-02-06 11:21:14 +00:00
Vítor Santos Costa 3618bffcca fix comment 2012-02-06 11:12:55 +00:00
Vítor Santos Costa cb592d1ddc fix configure for win64. 2012-02-06 11:11:50 +00:00
Vítor Santos Costa 73b1a8d6f8 change R configuration. 2012-02-06 11:01:10 +00:00
Vítor Santos Costa 6040696637 fix previous fix. 2012-02-06 10:46:44 +00:00
Vítor Santos Costa ebec10b1d3 clib needs LIBS to have ws2_32. 2012-02-06 10:36:44 +00:00
Vítor Santos Costa 6364c79bd5 ws2_32 in path 2012-02-06 10:27:21 +00:00
Vítor Santos Costa 5c701eb286 oops 2012-02-06 10:17:22 +00:00
Vítor Santos Costa 5aaca7b279 oops 2012-02-06 10:16:54 +00:00
Vítor Santos Costa 42b576dd59 fix MPI_CC default case. 2012-02-06 10:05:57 +00:00
Vítor Santos Costa 123ef47171 fix longjmp RestartEnv to be performed by a single function. 2012-02-05 12:04:29 +00:00
Vítor Santos Costa 0b1c98d3f6 allow MPI to compute term size. 2012-02-05 11:57:03 +00:00
Vítor Santos Costa bd677152e7 more MPI fixes. 2012-02-05 11:20:30 +00:00
Vítor Santos Costa 6c98e37e18 make sure to save absmi registers before longjmp. 2012-02-05 10:51:40 +00:00
Vítor Santos Costa e6fb330f58 fix warnings. 2012-02-03 20:55:35 +00:00
Vítor Santos Costa 5e85dcbd8e an example. 2012-02-03 20:53:59 +00:00
Vítor Santos Costa a2c86643b0 ismall fixes to MPI interface. 2012-02-03 16:31:49 +00:00
Vítor Santos Costa ab33cacf7b LAM MPI interface support. 2012-02-02 23:25:31 +00:00
Vítor Santos Costa 6eea1fe1ea fixes for export_term and friends. 2012-02-02 23:25:09 +00:00
Vítor Santos Costa c60514f89b add some MPI tests. 2012-02-02 10:00:17 +00:00
Vítor Santos Costa 4e6cc28cd3 lam support. 2012-02-02 09:58:05 +00:00
Vítor Santos Costa dddf5bce80 update 2012-02-01 21:01:24 +00:00
Vítor Santos Costa 539f553133 merge 2012-02-01 20:59:43 +00:00
Vítor Santos Costa c4ee7ee0c3 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3
Conflicts:
	.gitmodules
	configure
	packages/real
2012-02-01 20:57:42 +00:00
Vítor Santos Costa ad9e1d8ea4 update to latest SWI. 2012-02-01 20:52:13 +00:00
Vítor Santos Costa 616ae30138 new SWI file. 2012-02-01 20:51:24 +00:00
Vítor Santos Costa 4c6164034e real stuff. 2012-02-01 20:50:57 +00:00
Vítor Santos Costa 7e73c781b0 configure fixes for lam-mpi. 2012-02-01 19:26:58 +00:00
Vítor Santos Costa 8f728962a5 YAP_ExportTerm and YAP_ImportTerm from buffer (first cut).w 2012-02-01 19:26:28 +00:00
Vítor Santos Costa 7a99e4f974 fix openmpi/lam detection under Linux/UBUNTU
fix -I in R interface.
2012-02-01 10:26:04 +00:00
Vítor Santos Costa d106c08f8c :make sure we get rid of YapR 2012-02-01 08:58:20 +00:00
Vítor Santos Costa fa9842083b fixes for OpenMP. 2012-02-01 08:57:26 +00:00
Vítor Santos Costa 7fc23ea139 update latest r..eal 2012-02-01 08:49:06 +00:00
Vítor Santos Costa c6a8f68e67 update to recent real. 2012-01-31 15:15:07 +00:00
Vítor Santos Costa e4bfd98830 use real package shared with swi. 2012-01-31 15:11:39 +00:00
Vítor Santos Costa 045e6fe65c fix dynamic compilation in darwin. 2012-01-27 12:08:04 -06:00
Vítor Santos Costa ead2f5c736 update license. 2012-01-25 22:32:16 -06:00
Vítor Santos Costa 54faa59eb1 upgrade to latest SWI. 2012-01-25 22:31:34 -06:00
Vítor Santos Costa 20de9c3090 fix codelist to latest SWI and pl-codelist.h from old directory. 2012-01-25 22:15:53 -06:00
Vítor Santos Costa 0b0ffc0ef1 include aliaisning info (from SWI). 2012-01-25 22:15:30 -06:00
Vítor Santos Costa 8d404a41cf update to latest SWI. 2012-01-25 22:15:01 -06:00
Vítor Santos Costa 163ef9e5d0 make sure hash table is initialized to empty. 2012-01-21 18:20:20 +00:00
Vítor Santos Costa 58d7f85417 fix empty instruction confusing garbage collector. 2012-01-21 18:19:57 +00:00
Vitor Santos Costa db619fa81f protect atoms in SWI interface. 2012-01-17 12:37:29 +00:00
Vítor Santos Costa f2dc53a53e atoms passed through the SWI interface must always have a hold. 2012-01-15 11:21:38 -06:00
Vítor Santos Costa 037597ce2f fix qly to load .yaprc before -l starts. 2012-01-13 23:23:18 +00:00
Vítor Santos Costa ed0d3f6cae Latest ProbLog 2012-01-11 14:44:59 +00:00
Vítor Santos Costa 1a9244bce2 fix bug in infinite lists. 2012-01-11 13:27:25 +00:00
Vítor Santos Costa 2e2e2deb91 new version 2012-01-10 18:50:24 +00:00
Vítor Santos Costa 37b79f663f module stuff. 2012-01-10 18:50:04 +00:00
Vítor Santos Costa 5ce80cfe8a fix matrix row removal. 2012-01-10 18:49:16 +00:00
Vítor Santos Costa a25c97c295 fove initial skeleton.w 2012-01-10 17:01:06 +00:00
Vitor Santos Costa aef7555e02 fix new version of length/2. 2012-01-10 09:33:10 +00:00
Vitor Santos Costa 805ad7f958 update length to use skip_list/3. 2012-01-09 23:46:17 +00:00
Vitor Santos Costa 3f97a3f24a new version 2012-01-09 23:31:30 +00:00
Vitor Santos Costa b185db9909 skip_list is now built-in 2012-01-09 23:29:55 +00:00
Vitor Santos Costa d3c7800ab4 support PL_skip_list and PL_unify_bool. 2012-01-09 23:29:31 +00:00
Vitor Santos Costa 91cada2661 include correct implementation of skip_list as built-in. 2012-01-09 23:28:31 +00:00
Vitor Santos Costa 110c78b309 add dereferencing macro. 2012-01-09 23:27:47 +00:00
Vitor Santos Costa f632bc72bc comment out debugging codes. 2012-01-09 23:27:22 +00:00
Vitor Santos Costa 73fe640af3 improve error message. 2012-01-09 23:26:57 +00:00
Vitor Santos Costa 66eb2d71b5 improve search for cudd. 2012-01-09 23:26:16 +00:00
Ricardo Rocha 1fe86ba2b3 fix parallel_findall/3 2012-01-05 16:04:32 +00:00
Ricardo Rocha 72f79b8c4f fix compilation errors for multi-threaded tabling 2012-01-05 11:41:46 +00:00
Ricardo Rocha 3218e922ce Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2012-01-03 16:28:36 +00:00
Vítor Santos Costa 00b5edd8da allow copying a chunk of floats to a list in a single operation. Also
improve performance of sum out operation on arrays.
2011-12-30 16:04:16 +00:00
Vítor Santos Costa 5d3d20f723 ifix warning. 2011-12-30 16:02:59 +00:00
Vítor Santos Costa 22a4dcf9bd fix tp warning. 2011-12-30 16:02:45 +00:00
Vítor Santos Costa 957b850931 fix warnings. 2011-12-30 16:02:28 +00:00
Vítor Santos Costa 9348513d12 fix unused variable. 2011-12-30 15:51:01 +00:00
Vítor Santos Costa b1651fcdf0 fix stupid handling of atom expansion. 2011-12-28 12:46:48 +00:00
Vítor Santos Costa bf12f320fe fix CPT handling in aggregates. 2011-12-27 22:08:21 +00:00
Vítor Santos Costa 8f3eabef1d support parfactors, first step. 2011-12-27 22:07:42 +00:00
Ricardo Rocha 77b93e2cda Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2011-12-22 16:50:27 +00:00
Ricardo Rocha c594d321ef Miguel's support for multi-threaded tabling 2011-12-22 16:50:20 +00:00
Vítor Santos Costa 8c7d0af032 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-12-22 11:44:48 +00:00
Vítor Santos Costa 39b035a309 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2011-12-22 11:43:44 +00:00
Vítor Santos Costa d01eec1dbe iupdate changes. 2011-12-22 11:43:30 +00:00
Vítor Santos Costa 1fde83d278 fix overflows 2011-12-22 11:42:26 +00:00
Vítor Santos Costa 551df1c70a handle blob overflows. 2011-12-22 10:27:56 +00:00
Ricardo Rocha dc36b1cf65 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2011-12-14 10:33:42 +00:00
Ricardo Rocha f11e435db6 fix TRIE_LOCK_AT_WRITE_LEVEL scheme 2011-12-14 10:33:18 +00:00
Vítor Santos Costa 18190a4633 fix types for return absmi and friends. 2011-12-13 23:09:05 +00:00
Vítor Santos Costa 32ebfe00fd use module in RunOnce. 2011-12-13 22:20:28 +00:00
Denys Duchier 17c3a16d35 rename rellocate -> relocate 2011-12-13 19:14:33 +01:00
Denys Duchier fc1f622e7e Merge branch 'master' of git://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-12-13 14:51:48 +01:00
Vítor Santos Costa 98c849c087 should have been easy. 2011-12-13 12:16:42 +00:00
Vítor Santos Costa 707a3b9925 call opaque handlers from agc and stack shifter 2011-12-13 10:41:05 +00:00
Vítor Santos Costa 85c4d6673d Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2011-12-13 10:02:03 +00:00
Vítor Santos Costa aab98180c5 garbage collection support for opaque variables 2011-12-13 10:01:51 +00:00
Denys Duchier 213c0780d3 Merge branch 'master' of git://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-12-12 18:38:14 +01:00
Ricardo Rocha 5f6fd7daea Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2011-12-12 17:25:02 +00:00
Ricardo Rocha ab32e8f14e fix expand hash tables with TRIE_LOCK_AT_WRITE_LEVEL schemes 2011-12-12 17:24:58 +00:00
Vítor Santos Costa 093e63e476 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2011-12-12 15:32:18 +00:00
Vítor Santos Costa 7df0fd90f5 Changes by Tiago 2011-12-12 15:30:24 +00:00
Vítor Santos Costa 33bf0bc0f5 new release from Tiago 2011-12-12 15:29:51 +00:00
Vítor Santos Costa 03391e3feb New Version From Tiago 2011-12-10 23:12:10 +00:00
Vítor Santos Costa dbcb6e530c New Version From Tiago 2011-12-10 22:58:43 +00:00
Ricardo Rocha 6bb26f4764 fix support for local pages with threads 2011-12-09 16:06:17 +00:00
Denys Duchier 7b8819073e Merge branch 'master' of git://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-12-08 22:29:29 +01:00
Vítor Santos Costa 2ab4ce503e fix bad declaration. 2011-12-07 22:26:22 +00:00
Denys Duchier 26aa6d139a Merge branch 'master' of git://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-12-07 20:23:52 +01:00
Vitor Santos Costa dcbf8b0522 fix configure to handle or-parallelism correctly and to remove random from clib. 2011-12-07 09:04:46 -08:00
Vitor Santos Costa 65c7b4250a iensure we have LD. 2011-12-07 08:39:56 -08:00
Ubuntu32 c74cc23940 ifix bad prototype. 2011-12-07 08:36:10 -08:00
Ubuntu32 291486af3d Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2011-12-07 06:40:48 -08:00
Ricardo Rocha d33829205e support for local pages with threads 2011-12-07 13:53:20 +00:00
Denys Duchier 9bf2cdec35 Merge branch 'master' of git://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-12-07 14:39:30 +01:00
Vítor Santos Costa 51e49d6660 Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2011-12-05 21:05:12 +00:00
Vítor Santos Costa ad618c5bcb fix bad typing for 64 bits (fix from Bernd). 2011-12-05 21:04:31 +00:00
Denys Duchier 4d80c7c610 missing @item for YAP_RestartGoal 2011-12-05 19:51:57 +01:00
Ricardo Rocha 67b9ad1fa2 __LD version 2011-12-05 17:03:54 +00:00
Ricardo Rocha ea337366fe fix compilation for or-parallelism 2011-12-05 17:02:06 +00:00
Ricardo Rocha 038c1854d0 fix compilation for tabling with threads 2011-12-05 16:54:22 +00:00
Denys Duchier d75cf3118a fix GECODE_EXTRALIBS assignment 2011-12-04 16:40:43 +01:00
Denys Duchier 0eb760e68f doc for kept vars 2011-12-03 23:35:44 +01:00
Denys Duchier 8aa813d342 initial support for 'keep' 2011-12-03 23:31:28 +01:00
Denys Duchier 696e0e91e7 Merge branch 'master' of git://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-12-03 22:05:22 +01:00
Denys Duchier 9a78735aaf added support for search options 2011-12-03 22:04:04 +01:00
Vítor Santos Costa 514189e097 gecode compatibility. 2011-12-02 23:09:25 +00:00
Vítor Santos Costa 1a4e31e7a0 fix MKINDEX call 2011-12-02 23:09:04 +00:00
Vítor Santos Costa 18b982bd25 __LD version 2011-12-02 23:08:08 +00:00
Denys Duchier 9ebcae23ea add -framework gecode if necessary 2011-12-02 14:30:55 +01:00
Denys Duchier 7c78f52a89 support search options, added 'restart' 2011-12-01 22:48:28 +01:00
Denys Duchier d9ce468a03 move to a leaner install procedure 2011-12-01 21:54:39 +01:00
Vítor Santos Costa 84b017e5fd fix small problems in thread package. 2011-12-01 11:05:27 +00:00
Ricardo Rocha 4db885e3c3 fix compilation for threads 2011-11-30 15:32:35 +00:00
Ricardo Rocha 7aa77faf2a fix compilation for or-parallelism 2011-11-30 15:19:37 +00:00
Vítor Santos Costa 829f207307 ifixes for compilation under threads (no table sharing). 2011-11-30 13:37:59 +00:00
Vítor Santos Costa 79d1bf5eec Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3
Conflicts:
	OPTYap/opt.config.h
	OPTYap/opt.structs.h
2011-11-30 13:24:12 +00:00
Vítor Santos Costa ee4ad9ffd0 ifix warnings. 2011-11-30 13:05:44 +00:00
Vítor Santos Costa fec7019a79 fix some warnings
improve thread support.
2011-11-30 13:05:21 +00:00
Vítor Santos Costa e06560eff4 support for threads. 2011-11-30 13:05:06 +00:00
Vítor Santos Costa 7f6084b3b7 isupport for threads aanda malloc 2011-11-30 13:04:49 +00:00
Vítor Santos Costa 48482ff422 isupport for threads. 2011-11-30 13:04:29 +00:00
Vítor Santos Costa 2f6ec5ff59 improve learning for CLP(BN). 2011-11-30 13:04:13 +00:00
Vítor Santos Costa 0b81d99803 initialise thread local prredicates. 2011-11-30 13:03:22 +00:00
Vítor Santos Costa dcfdb5e614 don't try to release null pointer. 2011-11-30 13:02:44 +00:00
Vítor Santos Costa 7da303450f fix while. 2011-11-30 13:02:20 +00:00
Ricardo Rocha 455b1606aa Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-11-22 17:09:46 +00:00
Ricardo Rocha 65b73a8a09 data structures for multithreading tabling 2011-11-22 17:09:29 +00:00
Ubuntu32 2d699b0c04 Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2011-11-18 14:35:43 -08:00
Vítor Santos Costa 6c1cf7ea39 update to OSX support. 2011-11-18 22:24:46 +00:00
Vítor Santos Costa 749a5103a1 fix empty slots in unnumbervars. 2011-11-18 22:16:33 +00:00
Vítor Santos Costa e33712403f fix prism compilation and PRISM overflow handling. 2011-11-18 18:33:22 +00:00
Vítor Santos Costa b3045ae38b Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-11-18 17:06:36 +00:00
Vítor Santos Costa 244cb3d17c compile prism. 2011-11-18 17:02:09 +00:00
Ricardo Rocha 42211448c5 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-11-18 16:35:52 +00:00
Vítor Santos Costa ae29efec0c iupdate version. 2011-11-18 16:26:41 +00:00
Vítor Santos Costa 0409449a23 expand interface to create list from array of terms. 2011-11-18 16:26:11 +00:00
Ricardo Rocha afe85a771b Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-11-18 16:22:56 +00:00
Ricardo Rocha eea9c0d165 merge similar ALLOC macros 2011-11-18 16:22:31 +00:00
Vítor Santos Costa 0334632e6e improvements to YapR. 2011-11-17 12:58:22 +00:00
Ricardo Rocha 6aae4eb948 adjust ALLOC macros 2011-11-17 12:56:31 +00:00
Ricardo Rocha 0dab76c185 redefine ALLOC macros 2011-11-17 11:40:53 +00:00
Vítor Santos Costa 7b6d26b014 fix thread stuff. 2011-11-16 15:20:21 +00:00
Vítor Santos Costa cadb0fe4ae ifix bad call to unnumbervars. 2011-11-16 14:59:28 +00:00
Vítor Santos Costa 95b6f3a8c8 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-11-16 14:56:00 +00:00
Vítor Santos Costa a09b7c5bb8 fix >> 2011-11-16 14:55:13 +00:00
Ricardo Rocha a88fcec0c2 fix mode directed tabling with yapor 2011-11-16 12:47:43 +00:00
Ricardo Rocha f554fc308c Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-11-16 11:42:47 +00:00
Ricardo Rocha e993c2473b the trie locking data structure (node field or global lock array) is now defined explicitly 2011-11-16 11:42:04 +00:00
Vítor Santos Costa 67820baee0 fix overflow in << and >> 2011-11-16 07:36:34 +00:00
Vítor Santos Costa c2504af4fb fix rounding on negative number shifting
avoid allocating unnecessary space.
2011-11-16 07:34:58 +00:00
Ricardo Rocha ec0fa8a2a3 tries locking scheme is now independent for the answer, subgoal and global trie 2011-11-15 16:57:51 +00:00
Vitor Santos Costa fedf37ee35 update yapr 2011-11-15 12:59:00 +00:00
Vítor Santos Costa 946887d3b8 update ! 2011-11-15 12:46:03 +00:00
Vítor Santos Costa df949efdb3 fix god knows what. 2011-11-15 12:40:55 +00:00
U-WIN7\Vitor a2917e4e9e support R in WIN32. 2011-11-15 04:37:21 -08:00
Vítor Santos Costa 79bcde0869 fix variable that belongs to Makefile.in 2011-11-15 11:18:16 +00:00
Vítor Santos Costa b7d9e63c17 ifix clib Makefile.in 2011-11-15 11:17:00 +00:00
Vítor Santos Costa c469b0061a Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-11-15 10:24:13 +00:00
Vítor Santos Costa d2f6683538 more aggressive defaults (tabling and memory allocation from system on). 2011-11-15 10:23:41 +00:00
Vitor Santos Costa 71bedb75f2 fix configuration script to better recognsie R. 2011-11-15 10:22:03 +00:00
Vítor Santos Costa ca43587f27 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-11-14 14:37:22 +00:00
Vítor Santos Costa 42cb27c973 ifix typo. 2011-11-14 14:36:24 +00:00
Vítor Santos Costa 6a7dc31a3b fix header files. 2011-11-12 12:22:19 +00:00
Vítor Santos Costa 449da99843 fix fix. 2011-11-12 12:20:03 +00:00
Vítor Santos Costa 074a9a754f fix path for config.h 2011-11-12 12:18:57 +00:00
Ricardo Rocha 8f7983b6c4 minor changes for mode directed tabling 2011-11-11 19:17:55 +00:00
Ricardo Rocha 5c5fa5af55 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-11-11 18:06:46 +00:00
Ricardo Rocha e85854c1bb fix invalid answers for mode directed tabling 2011-11-11 18:05:24 +00:00
Vítor Santos Costa c637863616 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-11-10 12:31:35 +00:00
Vítor Santos Costa cfc13a0d61 improve term expansion: avoid duplicated calls and handle throws gracefully. 2011-11-10 12:27:36 +00:00
Vítor Santos Costa 02a8b35e36 improve action rules compilation. 2011-11-10 12:27:07 +00:00
Vítor Santos Costa 3ac8e3914f improve C-interface to cope with prism. 2011-11-10 12:26:23 +00:00
Vítor Santos Costa e865248dce prism logical probabilistic system. 2011-11-10 12:24:47 +00:00
Ricardo Rocha f06489ffe5 show_table support for mode directed tabling 2011-11-09 15:13:22 +00:00
Ricardo Rocha 2905fc8114 fix mode directed tabling 2011-11-09 14:24:08 +00:00
Joao 1e7fc1afce fix mode directed tabling. 2011-11-09 12:03:09 +00:00
Ricardo Rocha dab7c00e60 extra space in macro definition 2011-11-09 11:02:05 +00:00
Ricardo Rocha 88760aa0b1 mode directed tabling 2011-11-09 11:00:31 +00:00
Ricardo Rocha d063989dff add tabled pred flag to undefined built-in 2011-11-09 10:24:39 +00:00
Vítor Santos Costa d971219b7e just add a comment. 2011-11-08 15:48:55 +00:00
Vítor Santos Costa a90eaa4937 fix syntax error handling. 2011-11-08 15:30:06 +00:00
Ubuntu32 e1b132325e Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3 2011-11-08 00:17:54 -08:00
Vítor Santos Costa 64dded4a53 iunnumbervars may be copying terms from outside the stacks, so don't share
unless we know we share.
2011-11-04 09:28:33 +00:00
Vítor Santos Costa 4af0f47b7f add this file to repository. 2011-11-04 09:28:09 +00:00
Vítor Santos Costa fc8b265b66 ifix buildops 2011-11-04 02:51:52 +00:00
Vítor Santos Costa 3dbae0cb94 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-11-04 02:48:28 +00:00
Vítor Santos Costa 83f0903f6a Merge branch 'master' of ssh://git.dcc.fc.up.pt/yap-6.3 2011-11-04 02:47:31 +00:00
Vítor Santos Costa e283f6406a fix Yap_compare_terms for 64 bit code. 2011-11-04 11:41:35 +09:00
Vítor Santos Costa f8e3c7d347 for external code needing access to YAP internals. 2011-11-03 07:56:52 +09:00
Vítor Santos Costa 2ee9981a11 new Makefiles and prototypes. 2011-11-03 07:55:56 +09:00
Vítor Santos Costa 9397c9336d make this callable from foeign code. 2011-11-03 07:55:42 +09:00
Vítor Santos Costa 1d2de81e86 update bprolog emulation stuff. 2011-11-03 07:54:51 +09:00
Vítor Santos Costa 5ce8d637ef fix AtomLength clash 2011-11-03 07:54:18 +09:00
Vítor Santos Costa b85f9d1d54 use new interface code. 2011-11-03 07:53:49 +09:00
Vítor Santos Costa 0141113583 fix bug. 2011-11-03 07:53:21 +09:00
Vítor Santos Costa 9f2b0c7e70 extend C-interface to support b-prolog like stuff 2011-11-03 07:52:52 +09:00
Vítor Santos Costa fc2a50b67e use C-code. 2011-11-03 07:51:58 +09:00
Vítor Santos Costa c322722d5b add code to call external function by name, it maay come handy one day. 2011-11-03 07:51:34 +09:00
Vítor Santos Costa 780a5ba83e use numbervars. 2011-11-03 07:51:13 +09:00
Vítor Santos Costa 0154db015e beautification. 2011-11-03 07:50:34 +09:00
Vítor Santos Costa 98de122687 UserCCode shouldn't be allowed to look up hidden atoms. 2011-11-03 07:49:41 +09:00
Vítor Santos Costa d690ffdb18 make ground.yap use new C-code. 2011-11-03 07:49:06 +09:00
Vítor Santos Costa d2c50b72c6 should be in main H directory. 2011-11-03 07:48:37 +09:00
Vítor Santos Costa 836a6ee6a4 make it possible to access Regs and Tag codes from external sources. 2011-11-03 07:46:52 +09:00
Vítor Santos Costa 51bcb1f5a3 handle PL_unify_int64 without bigint when number is small enough. 2011-11-03 07:45:51 +09:00
Vítor Santos Costa 3966822bff Setting YREG in cut_t seems buggy. 2011-11-03 07:45:02 +09:00
Vítor Santos Costa 73e3359d4f enumerate bhashes and fix bug in haash expansion. 2011-11-03 07:44:38 +09:00
Vítor Santos Costa 6ed7736c28 C implementation of numbervars 2011-11-03 07:44:08 +09:00
Vítor Santos Costa 02e39ee78a beautify code. 2011-11-02 21:21:28 +09:00
Ubuntu32 29dc250a66 fix big int indexing 2011-11-01 17:25:59 -07:00
fabrizio 016cd42226 no copy of learning algorithms subdirectories 2011-10-31 14:26:18 +01:00
Vítor Santos Costa 1769fc7313 bprolog support 2011-10-27 12:38:22 +02:00
Vítor Santos Costa 20a1362bf8 bprolog support 2011-10-27 12:38:11 +02:00
Vítor Santos Costa fa9d8008a4 bug fixes. 2011-10-27 12:37:41 +02:00
Vítor Santos Costa 0ea25a8908 bprolog support 2011-10-27 12:37:26 +02:00
Vítor Santos Costa 1ddd61314c support for X^[A,B] and X^length in arithmetic expressions. 2011-10-27 12:36:48 +02:00
Vítor Santos Costa 1cc3280fea Yap_unifiable 2011-10-27 12:36:03 +02:00
Vítor Santos Costa 8785108e66 Yap_unifiable and TagOfTerm 2011-10-27 12:35:40 +02:00
Vítor Santos Costa 980c79359f Yap_unifiable and YAP_Unifiable. 2011-10-27 12:35:07 +02:00
Vítor Santos Costa c57fbf40e6 extend support for hash tables. 2011-10-24 22:49:42 +01:00
Vítor Santos Costa 73dd81478f B-Prolog suppoty. 2011-10-24 22:47:42 +01:00
Vítor Santos Costa 384ddd84ad extend interface with IsTermNIl() 2011-10-24 22:46:16 +01:00
Vítor Santos Costa f6cc9578ae first cut at emulation for BP C-interface. 2011-10-24 22:44:41 +01:00
Vítor Santos Costa 22b0bcac14 mode directed tabling. 2011-10-22 16:49:13 +01:00
Fabrizio Riguzzi be449b3aef updated cplint 2011-10-22 16:33:04 +02:00
Vítor Santos Costa 48bfaa1ce1 move to 6.3.1 2011-10-22 10:25:04 +01:00
Vítor Santos Costa 11252cd061 Merge branch 'master' of ssh://yap.git.sourceforge.net/gitroot/yap/yap-6.3 2011-10-22 10:22:44 +01:00
U-WIN-U2045GN0RNQ\Vítor Santos Costa 90f8be5f0b fix compilation of plyap and install. 2011-10-22 00:38:07 +01:00
U-WIN-U2045GN0RNQ\Vítor Santos Costa 067ff9828d windows Makefile. 2011-10-22 00:19:48 +01:00
Vítor Santos Costa 5d0eed5eb1 make sure SWI atom constants are typed as atom_t 2011-10-21 23:06:17 +01:00
Vítor Santos Costa 8d4c9160eb add compile_predicates/1. 2011-10-21 23:02:07 +01:00
Vítor Santos Costa c052b195e5 fix interface dependencies. 2011-10-21 22:06:13 +01:00
Vítor Santos Costa df05859cb4 fix maximum limit for expanding area. 2011-10-21 22:05:28 +01:00
Vítor Santos Costa 5cd157147f fix CurrentTrailTop 2011-10-21 22:04:58 +01:00
3056 changed files with 1829505 additions and 242322 deletions

203
#.gitignore# Normal file
View File

@ -0,0 +1,203 @@
*~
*.itf
*.po
*.qlf
*.xwam
*.wam
*.ma
*.s
*.o
*.so
*.dylib
*.dll
docs/yap.info*
.build
tags
TGSautom4te.cache
cscope.*
GPATH
m32
GRTAGS
GTAGS
tmtags*
.autotools
.Rhistory
.zedstate
config.h
Yap.h
YapConfig.h
YapTermConfig.h
.graffiti
.#*#
*/#*#
*bak
*rej
*.db
groups
*.ede
.??*
*ggtags*
.atom-build.josn
.autotools
.cproject
.dir-locals.el
.DS_store
.kateproject
.project
.pydevproject
.Rhistory
.zedstate
.graffiti
.kateproject
autom4te.cache
*rej
#*
#*#
config.h
*.html
packages/gecode/dev
JIT/HPP/bkp
cmake_install.cmake
cmake_clean.cmake
*.build
C/myabsmi.c
*.ctags#
*.hs
CMakeFiles
*.make
C/new_iop.c
*.pdf
*.log
*.orig
JIT/HPP/#JIT_In#
*.text
yap
*startup.yss
*cmake_files
C/pl-yap.c
GitSHA1.c
.vscode
CMakeLists.txt.*
FindPackageLog.txt
GitSHA1.c
clang
cmake-build-debug
os/YapIOConfig.h
CodeBlocks
os/readterm.c.cpp
os/readterm.c.cpp
packages/ProbLog/problog_examples/output/,_query_1_cluster_1.dot
packages/ProbLog/#problog_lbdd.yap#
packages/ProbLog/problog_examples/output/,_query_1_cluster_1.dot
packages/ProbLog/problog_examples/output/out.dat
packages/ProbLog/problog_examples/outputvalues.pl
packages/ProbLog/problogbdd
packages/raptor/raptor_config.h
packages/real/rconfig.h
packages/ProbLog/problog/#completion.yap#
packages/ProbLog/problog_examples/output
packages/ProbLog/problog_examples/queries
packages/swig/java/*.java
packages/swig/java/*.class
packages/swig/java/*.jar
packages/swig/java/*wrap*
*jnilib
*.jar
*LOG
packages/cplint/approx/simplecuddLPADs/LPADBDD
packages/swi-minisat2/˜:ilp
packages/swig/android/app
packages/cplint/L
packages/CLPBN/horus/hcli
tmp
Eclipse
packages/bdd/simplecudd/problogbdd
trace
packages/bdd/cudd_config.h
Makefile
build
Debug
debug
Release
Build
xcode
Threads
droid
mxe
mxe32
msys2
caret
codelite
configure
Qt
cmake/cmake-android
sublime
yap-6.3.workspace
yap-6.3.geany
YAP.project
CBlocks
yPQ
*.tmp
YAP.sublime*
yap32
Eclipse
codeblocks
yap-6.3.tags
android
yap.prj
yap.VITORs-MBP.vsc.pui
vc
packages/myddas/pl/myddas_odbc.yap
packages/myddas/pl/myddas_postgres.yap
packages/myddas/pl/myddas_sqlite3.ypp
packages/myddas/pl/#myddas_postgres.ypp#
packages/myddas/hh
packages/myddas/DaysInHospital_Y3.csv
packages/myddas/agile.csv
*.pyc
*.cmake#
*.tex
*.c#
packages/swig/yap_wrap.cxx
packages/swig/yap_wrap.h
packages/swig/yap_wrap.cpp
packages/swig/yap.py
*.ipynb
yap
packages/python/yap_kernel/x/__init__.py
x
packages/python/yap_kernel/x/__main__.py
*.gch
mxe
build

2
#GitSHA1.c.in# Normal file
View File

@ -0,0 +1,2 @@
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee#define GIT_SHA1 "@GIT_SHA1@"
const char g_GIT_SHA1[] = GIT_SHA1;

26
.configure-custom.sh Normal file
View File

@ -0,0 +1,26 @@
ENABLE_VARS="brew|yes|WITH_BREW\
clpbn|yes|WITH_CLPBN \
cplint|yes|WITH_CPLINT \
horus|yes|WITH_HORUS \
clpr|yes|WITH_CLPR \
macports|yes|WITH_MACPORTS\
problog|yes|WITH_PROBLOG \
jit|no|WITH_JIT \
chr|no|WITH_CHR \
threads|no|WITH_THREADS"
WITH_VARS="swig|yes|WITH_SWIG \
mpi|yes|WITH_MPI \
gecode|yes|WITH_GECODE \
docs|yes|WITH_DOCS \
r|yes|WITH_R \
myddas|yes|WITH_MYDDAS \
cudd|yes|WITH_CUDD \
xml2|yes|WITH_XML2 \
raptor|yes|WITH_RAPTOR \
python|yes|WITH_PYTHON \
openssl|yes|WITH_OPENSSL\
java|yes|WITH_JAVA
lbfgs|yes|WITH_LBFGS
extensions|yes|WITH_EXTENSIONS
readline|yes|WITH_READLINE \
gmp|yes|WITH_GMP"

30
.ctags Normal file
View File

@ -0,0 +1,30 @@
--langdef=Prolog
--langmap=Prolog:.pl.yap.ypp.prolog.pro
--regex-Prolog=/^([a-z][A-Za-z0-9_]*:)?([a-z][A-Za-z0-9_]*)\(.*\)[ \t]*(:-|-->)[ \t]*.*/\2/p,predicate,predicate definition/
--regex-Prolog=/^([a-z][A-Za-z0-9_]*:)?\'(.*)\'\(.*\)[ \t]*(:-|-->)[ \t]*.*/\2/p,predicate,predicate definition/
--regex-Prolog=/^([a-z][A-Za-z0-9_]*:)?([a-z][A-Za-z0-9_]*)\(.*\)\.[ \t]*.*/\2/p,predicate,predicate definition/
--regex-Prolog=/^([a-z][A-Za-z0-9_]*:)?\'(.*)\'\(.*\)\.[ \t]*.*/\2/p,predicate,predicate definition/
--regex-Prolog=/^:-[ \t]+(discontiguous|dynamic|multifile|table|thread_local)[ \t]+([a-z][_a-zA-Z0-9]*:)?([a-z0-9_][_a-zA-Z0-9]*)/\1/p,predicate,predicate metadata/
--regex-Prolog=/^[ \t]*Yap_InitCPred[ \t]*\"(\$?[A-Za-z0-9_]*)\"([ \t]*).*/\1/p,predicate,predicate definition/
--langmap=C:+.(h.cmake).(h.config)
--exclude=\._*
--exclude=*\.bak
--exclude=\.svn
--exclude=\.git
--exclude=CVS
--exclude=Debug
--exclude=Release
--exclude=Threads
--exclude=.*tags.*
--exclude=.*TAGS.*
--exclude=\.\#.*
--exclude=_darcs
--exclude=*~
--exclude=\#.*
--exclude=(.)\#*
--exclude=*.dylib
--exclude=docs
--exclude=build
--exclude=cmake-build-debug
--exclude=clang

205
.gitignore vendored
View File

@ -9,5 +9,210 @@
*.o
*.so
*.dylib
*.dll
docs/yap.info*
.build
build
tags
TGSautom4te.cache
cscope.*
GPATH
m32
GRTAGS
GTAGS
tmtags*
.autotools
.Rhistory
.zedstate
config.h
YapConfig.h
YapTermConfig.h
.graffiti
.#*#
*/#*#
*bak
*rej
*.db
groups
*.ede
.??*
*ggtags*
.atom-build.josn
.autotools
.cproject
.dir-locals.el
.DS_store
.project
.pydevproject
.Rhistory
.zedstate
.graffiti
.kateproject
autom4te.cache
*rej
#*
#*#
config.h
*.html
packages/gecode/dev
JIT/HPP/bkp
cmake_install.cmake
cmake_clean.cmake
*.build
C/myabsmi.c
*.ctags#
*.hs
CMakeFiles
*.make
C/new_iop.c
*.pdf
*.log
*.orig
JIT/HPP/#JIT_In#
*.text
yap
*startup.yss
*cmake_files
C/pl-yap.c
GitSHA1.c
.vscode
CMakeLists.txt.*
FindPackageLog.txt
GitSHA1.c
clang
cmake-build-debug
os/YapIOConfig.h
CodeBlocks
x
os/readterm.c.cpp
os/readterm.c.cpp
packages/ProbLog/problog_examples/output/,_query_1_cluster_1.dot
packages/ProbLog/#problog_lbdd.yap#
packages/ProbLog/problog_examples/output/,_query_1_cluster_1.dot
packages/ProbLog/problog_examples/output/out.dat
packages/ProbLog/problog_examples/outputvalues.pl
packages/ProbLog/problogbdd
packages/raptor/raptor_config.h
packages/real/rconfig.h
packages/ProbLog/problog/#completion.yap#
packages/ProbLog/problog_examples/output
packages/ProbLog/problog_examples/queries
packages/swig/java/*.java
packages/swig/java/*.class
packages/swig/java/*.jar
packages/swig/java/*wrap*
*jnilib
*.jar
*LOG
packages/cplint/approx/simplecuddLPADs/LPADBDD
packages/swi-minisat2/˜:ilp
packages/swig/android/app
packages/cplint/L
packages/CLPBN/horus/hcli
tmp
Eclipse
packages/bdd/simplecudd/problogbdd
trace
packages/bdd/cudd_config.h
Makefile
build
Debug
debug
Release
Build
xcode
Threads
droid
mxe
mxe32
msys2
caret
codelite
configure
Qt
cmake/cmake-android
sublime
yap-6.3.workspace
yap-6.3.geany
YAP.project
CBlocks
yPQ
*.tmp
YAP.sublime*
yap32
Eclipse
codeblocks
yap-6.3.tags
android
yap.prj
yap.VITORs-MBP.vsc.pui
vc
packages/myddas/pl/myddas_odbc.yap
packages/myddas/pl/myddas_postgres.yap
packages/myddas/pl/myddas_sqlite3.ypp
packages/myddas/pl/#myddas_postgres.ypp#
packages/myddas/hh
packages/myddas/DaysInHospital_Y3.csv
packages/myddas/agile.csv
*.pyc
*.cmake#
*.tex
*.c#
packages/swig/yap_wrap.cxx
packages/swig/yap_wrap.h
packages/swig/yap_wrap.cpp
packages/swig/yap.py
*.ipynb
packages/python/yap_kernel/x/__init__.py
packages/python/yap_kernel/x/__main__.py
*.gch
mxe
build
library/system/#CMakeLists.txt#
*.txt#
cmake/CMakeCache.txt
C/compiling_error.txt
cmake/compile_commands.json
cmake/cudd_config.h
cmake/docs/Doxyfile
*.stackdump
*.gz
.Rproj.user

39
.gitmodules vendored
View File

@ -1,39 +0,0 @@
[submodule "packages/chr"]
path = packages/chr
url = git://yap.git.sourceforge.net/gitroot/yap/chr
[submodule "packages/clpqr"]
path = packages/clpqr
url = git://yap.git.sourceforge.net/gitroot/yap/clpqr
[submodule "packages/jpl"]
path = packages/jpl
url = git://yap.git.sourceforge.net/gitroot/yap/jpl
[submodule "packages/zlib"]
path = packages/zlib
url = git://yap.git.sourceforge.net/gitroot/yap/zlib
[submodule "packages/http"]
path = packages/http
url = git://yap.git.sourceforge.net/gitroot/yap/http
[submodule "packages/clib"]
path = packages/clib
url = git://yap.git.sourceforge.net/gitroot/yap/clib
[submodule "packages/sgml"]
path = packages/sgml
url = git://yap.git.sourceforge.net/gitroot/yap/sgml
[submodule "packages/RDF"]
path = packages/RDF
url = git://yap.git.sourceforge.net/gitroot/yap/RDF
[submodule "packages/semweb"]
path = packages/semweb
url = git://yap.git.sourceforge.net/gitroot/yap/semweb
[submodule "packages/plunit"]
path = packages/plunit
url = git://yap.git.sourceforge.net/gitroot/yap/plunit
[submodule "packages/R"]
path = packages/R
url = git://yap.git.sourceforge.net/gitroot/yap/R
[submodule "packages/YapR"]
path = packages/YapR
url = git://yap.git.sourceforge.net/gitroot/yap/YapR
[submodule "packages/pldoc"]
path = packages/pldoc
url = git://yap.git.sourceforge.net/gitroot/yap/pldoc

View File

@ -140,7 +140,7 @@ int showTime(void);
struct AND_BOX *choose_leftmost(void);
extern Cell BEAM_is(void);
extern void do_eam_indexing(struct Predicates *);
extern void Yap_plwrite(Term, int (*mywrite) (int, int), int, int);
extern void Yap_plwrite(Term, struct stream_desc *, int, int);
#if Debug_Dump_State
void dump_eam_state(void);
@ -1428,6 +1428,7 @@ static void *OpAddress[]= {
&&p_db_ref,
&&p_primitive,
&&p_cut_by,
&&p_save_by,
&&p_succ,
&&p_predc,
&&p_plus,
@ -2511,7 +2512,7 @@ break_debug(contador);
#endif
#ifdef DEBUG
Yap_plwrite ((Term) beam_X[1], Yap_DebugPutc, 0, 1200);
Yap_plwrite ((Term) beam_X[1], NULL, 0, GLOBAL_MaxPriority);
#else
extern int beam_write (void);
beam_write();
@ -3536,6 +3537,7 @@ break_debug(contador);
p_db_ref:
p_primitive:
p_cut_by:
p_save_by:
p_succ:
p_predc:
p_plus:

View File

@ -12,8 +12,8 @@
#ifdef BEAM
#include "Yap.h"
#include "compile.h"
#include "clause.h"
#include "YapCompile.h"
#include "clause.h"
#include "eam.h"
#include "eamamasm.h"
#include <stdio.h>
@ -85,7 +85,7 @@ int X_Var(Ventry *ve)
int var;
if (ve->KindOfVE == PermVar || ve->KindOfVE == VoidVar ) {
printf("Erro no tipo de variavel X ->eamamas.c \n");
printf("Erro no tipo de variavel X ->eamamas.c \n");
exit(1);
}
var = ((ve->NoOfVE) & MaskVarAdrs);
@ -99,7 +99,7 @@ int Y_Var(Ventry *ve)
{
int var;
if (ve->KindOfVE != PermVar) {
printf("Erro no tipo de variavel Y ->eamamas.c \n");
printf("Erro no tipo de variavel Y ->eamamas.c \n");
exit(1);
}
var = ((ve->NoOfVE) & MaskVarAdrs);
@ -119,7 +119,7 @@ void eam_pass(CInstr *ppc)
{
int alloc_found=0;
int body=0;
while (ppc) {
switch ((int) ppc->op) {
@ -184,7 +184,7 @@ void eam_pass(CInstr *ppc)
} else {
emit_inst(_unify_val_Y_op);
emit_par(Y_Var((Ventry *) ppc->new4));
}
} else { emit_inst(_unify_void_op); }
break;
@ -268,7 +268,7 @@ void eam_pass(CInstr *ppc)
case put_atom_op:
emit_inst(_put_atom_op);
emit_par(ppc->new1);
emit_par(ppc->new4);
emit_par(ppc->new4);
break;
case put_list_op:
emit_inst(_put_list_op);
@ -349,7 +349,7 @@ void eam_pass(CInstr *ppc)
case cut_op:
emit_inst(_cut_op);
break;
break;
case commit_op:
emit_inst(_commit_op);
break;
@ -402,7 +402,7 @@ void eam_pass(CInstr *ppc)
}
emit_par(ppc->new4);
break;
case direct_safe_call_op:
if (ppc->new1==1) {
emit_inst(_direct_safe_call_unary_op);
@ -434,8 +434,8 @@ void eam_pass(CInstr *ppc)
if (a==NULL) a=Yap_LookupAtom("\n");
emit_inst(_put_atom_op);
emit_par(1);
emit_par((Cell) MkAtomTerm(a));
}
emit_par((Cell) MkAtomTerm(a));
}
emit_inst(_write_call);
break;
case is_op:
@ -468,50 +468,50 @@ void eam_pass(CInstr *ppc)
case remove_box_op:
case remove_last_box_op:
break;
case jump_op:
emit_inst(_jump_op);
emit_upar((Cell) Code_Start+ (Cell) labels[ppc->new4]);
break;
case label_op:
if (pass==0) labels[ppc->new4] = get_addr();
if (pass==0) labels[ppc->new4] = get_addr();
break;
case run_op:
/* se ficar vazio, retirar no eam_am.c o +5 das linhas pc=clause->code+5 no only_1_clause e no call */
emit_inst(_try_me_op);
emit_par(0);
emit_par(0);
emit_par(0);
emit_par(0);
emit_par(0);
emit_par(0);
break;
case only_1_clause_op:
emit_inst(_only_1_clause_op);
emit_par(ppc->new4);
emit_par(((struct Clauses *)ppc->new4)->predi->arity);
emit_par(((struct Clauses *)ppc->new4)->nr_vars);
emit_par(((struct Clauses *)ppc->new4)->nr_vars);
emit_par(0); /* Nr da alternativa */
break;
case try_me_op:
emit_inst(_try_me_op);
emit_par(ppc->new4);
emit_par(ppc->new4);
emit_par(((struct Clauses *)ppc->new4)->predi->arity);
emit_par(((struct Clauses *)ppc->new4)->nr_vars);
emit_par(((struct Clauses *)ppc->new4)->nr_vars);
emit_par(0); /* Nr da alternativa */
break;
case retry_me_op:
emit_inst(_retry_me_op);
emit_par(ppc->new4);
emit_par(((struct Clauses *)ppc->new4)->predi->arity);
emit_par(((struct Clauses *)ppc->new4)->nr_vars);
emit_par(((struct Clauses *)ppc->new4)->nr_vars);
emit_par(ppc->new1);
break;
case trust_me_op:
emit_inst(_trust_me_op);
emit_par(ppc->new4);
emit_par(((struct Clauses *)ppc->new4)->predi->arity);
emit_par(((struct Clauses *)ppc->new4)->nr_vars);
emit_par(((struct Clauses *)ppc->new4)->nr_vars);
emit_par(ppc->new1);
break;
@ -529,18 +529,18 @@ void eam_pass(CInstr *ppc)
}
body=1;
break;
case prepare_tries:
emit_inst(_prepare_tries);
emit_par(ppc->new1);
emit_par(ppc->new4);
emit_par(ppc->new1);
emit_par(ppc->new4);
break;
case exit_op:
emit_inst(_exit_eam);
break;
case mark_initialised_pvars_op:
case mark_initialized_pvars_op:
break;
case fetch_args_for_bccall:
case bccall_op:
@ -559,7 +559,7 @@ void eam_pass(CInstr *ppc)
printf("[ please note that beam still does not support a lot of builtins ]\n");
}
emit_inst(_fail_op);
}
ppc = ppc->nextInst;
}

View File

@ -115,15 +115,16 @@
#define _p_db_ref (_std_base+8)
#define _p_primitive (_std_base+9)
#define _p_cut_by (_std_base+10)
#define _p_succ (_std_base+11)
#define _p_predc (_std_base+12)
#define _p_plus (_std_base+13)
#define _p_minus (_std_base+14)
#define _p_times (_std_base+15)
#define _p_div (_std_base+16)
#define _p_dif (_std_base+17)
#define _p_eq (_std_base+18)
#define _p_arg (_std_base+19)
#define _p_functor (_std_base+20)
#define _p_save_by (_std_base+11)
#define _p_succ (_std_base+12)
#define _p_predc (_std_base+13)
#define _p_plus (_std_base+14)
#define _p_minus (_std_base+15)
#define _p_times (_std_base+16)
#define _p_div (_std_base+17)
#define _p_dif (_std_base+18)
#define _p_eq (_std_base+19)
#define _p_arg (_std_base+20)
#define _p_functor (_std_base+21)

View File

@ -12,8 +12,8 @@
#ifdef BEAM
#include "Yap.h"
#include "compile.h"
#include "clause.h"
#include "YapCompile.h"
#include "clause.h"
#include "eam.h"
#include <stdio.h>
#include <stdlib.h>
@ -40,13 +40,13 @@ int exists_on_table(Cell a,struct HASH_TABLE **table, int i)
struct HASH_TABLE *t;
t=table[i];
while(t) {
if (t->value==a) return(1);
t=t->next;
}
return(0);
}
@ -61,20 +61,20 @@ Cell *gera_codigo_try(struct Predicates *predi) /* gerar os try's para o predic
emit_new(prepare_tries,predi->nr_alt,predi->arity);
if (predi->nr_alt==1) {
emit_new(only_1_clause_op,0,(unsigned long) c);
} else if (predi->nr_alt>1) {
emit_new(only_1_clause_op,0,(unsigned long) c);
} else if (predi->nr_alt>1) {
while(c!=NULL) {
if (nr+1==predi->nr_alt) emit_new(trust_me_op,nr,(unsigned long) c);
if (nr+1==predi->nr_alt) emit_new(trust_me_op,nr,(unsigned long) c);
else if (nr==0) emit_new(try_me_op,predi->nr_alt,(unsigned long) c);
else emit_new(retry_me_op,nr,(unsigned long) c);
c=c->next;
nr++;
}
} else {
} else {
emit_new(fail_op,0,0);
}
return(eam_assemble(StartCode));
}
@ -91,7 +91,7 @@ Cell *gera_codigo_try_list(struct Predicates *predi) /* gerar os try's para o p
c=predi->first;
emit_new(prepare_tries,nr_preds,predi->arity);
if (nr_preds>=1) {
if (nr_preds>=1) {
while(c!=NULL) {
if (c->predi==predi && (c->idx==Lista || c->idx==Variavel)) {
if (nr_preds==1) {
@ -108,20 +108,20 @@ Cell *gera_codigo_try_list(struct Predicates *predi) /* gerar os try's para o p
} else {
emit_new(fail_op,0,0);
}
return(eam_assemble(StartCode));
}
struct HASH_TABLE **gera_codigo_try_atom(struct Predicates *predi)
struct HASH_TABLE **gera_codigo_try_atom(struct Predicates *predi)
{
int j,nr_preds,nr_atoms;
struct HASH_TABLE **table;
struct HASH_TABLE *t;
struct Clauses *cla;
nr_atoms=predi->idx_atom;
nr_atoms=predi->idx_atom;
nr_preds=nr_atoms+predi->idx_var;
table=malloc(sizeof(struct HASH_TABLE *)*(nr_atoms+1));
for (j=0;j<=nr_atoms;j++) table[j]=NULL;
@ -132,7 +132,7 @@ struct Clauses *cla;
Cell a;
unsigned int index;
int nr;
a=cla->val;
if (a && nr_atoms) {
index=index_of_hash_table_atom(a,nr_atoms);
@ -187,18 +187,18 @@ struct HASH_TABLE **table;
struct HASH_TABLE *t;
struct Clauses *cla;
nr_appls=predi->idx_functor;
nr_appls=predi->idx_functor;
nr_preds=nr_appls+predi->idx_var;
table=malloc(sizeof(struct HASH_TABLE *)*(nr_appls+1));
for (j=0;j<=nr_appls;j++) table[j]=NULL;
cla=predi->first;
while(cla) {
if (cla->idx==Estrutura) {
Cell a;
long int index;
int nr;
a=cla->val;
if (a && nr_appls) {
index=index_of_hash_table_appl(a,nr_appls);
@ -257,7 +257,7 @@ Cell *gera_codigo_try_only_vars(struct Predicates *predi) /* gerar os try's de V
c=predi->first;
emit_new(prepare_tries,nr_preds,predi->arity);
if (nr_preds>=1) {
if (nr_preds>=1) {
while(c!=NULL) {
if (c->predi==predi && c->idx==Variavel) {
if (nr_preds==1) {
@ -274,7 +274,7 @@ Cell *gera_codigo_try_only_vars(struct Predicates *predi) /* gerar os try's de V
} else {
emit_new(fail_op,0,0);
}
return(eam_assemble(StartCode));
}
@ -292,7 +292,7 @@ void do_eam_indexing(struct Predicates *p)
p->idx=1;
}
if((Print_Code & 4) && (Print_Code & 8)) {
if((Print_Code & 4) && (Print_Code & 8)) {
printf("General Case :\n");
eam_showcode(p->code);
}
@ -309,10 +309,10 @@ void ver_predicados(struct Predicates *p)
c=p->first;
while(c!=NULL) {
printf("Clausula %d do tipo %d (%d locals %d args) (val=0x%X)\n",++i,c->idx,c->nr_vars,c->predi->arity, (unsigned )c->val);
printf("Clausula %d do tipo %d (%d locals %d args) (val=0x%X)\n",++i,c->idx,c->nr_vars,c->predi->arity, (unsigned )c->val);
c=c->next;
}
}

View File

@ -742,10 +742,10 @@ void ShowCode_new2(int op, int new1,CELL new4)
switch (ch = *f++)
{
case '1':
Yap_plwrite(MkIntTerm(new1), Yap_DebugPutc, 0, 1200);
Yap_plwrite(MkIntTerm(new1), NULL, 30, 0, GLOBAL_MaxPriority);
break;
case '4':
Yap_plwrite(MkIntTerm(new4), Yap_DebugPutc, 0, 1200);
Yap_plwrite(MkIntTerm(new4), NULL, 20, 0, GLOBAL_MaxPriority);
break;
default:
Yap_DebugPutc (LOCAL_c_error_stream,'%');

14578
C/absmi.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

88
C/absmi_insts.h Normal file
View File

@ -0,0 +1,88 @@
/*****************************************************************
* INSTRUCTIONS *
*****************************************************************/
#ifdef INDENT_CODE
{
{
{
#endif /* INDENT_CODE */
BOp(Ystop, l);
LOCAL_CBorder = 0;
SET_ASP(YREG, E_CB * sizeof(CELL));
/* make sure ASP is initialized */
saveregs();
#if PUSH_REGS
restore_absmi_regs(old_regs);
#endif
#if BP_FREE
P1REG = PCBACKUP;
#endif
LOCAL_CBorder = 0;
return 1;
ENDBOp();
BOp(Nstop, e);
SET_ASP(YREG, E_CB * sizeof(CELL));
saveregs();
#if PUSH_REGS
restore_absmi_regs(old_regs);
#endif
#if BP_FREE
P1REG = PCBACKUP;
#endif
return 0;
ENDBOp();
/************************************************************************\
* Native Code Execution *
\************************************************************************/
#if YAP_JIT
static void *OpAddress_JIT[] = {
#define OPCODE(OP, TYPE) &&_##OP
#include "YapOpcodes.h"
#undef OPCODE
};
/* native_me */
BOp(jit_handler, J);
if (!PREG->y_u.J.jh->fi.bcst.c)
PREG->y_u.J.jh->mf.isground = IsGround(PREG);
PREG->y_u.J.jh->fi.bcst.c++;
/* Did PREG reach threshold value to become critical? */
if (PREG->y_u.J.jh->fi.bcst.c ==
(COUNT)(ExpEnv.config_struc.frequency_bound *
(ExpEnv.config_struc.profiling_startp)) &&
!PREG->y_u.J.jh->mf.isground) {
#if YAP_DBG_PREDS
if (ExpEnv.debug_struc.pprint_me.criticals != 0 &&
ExpEnv.debug_struc.pprint_me.criticals != 0x1) {
fprintf(stderr, "%s:%d\n", __FILE__, __LINE__);
fprintf(stderr, "%s", (char *)ExpEnv.debug_struc.pprint_me.criticals);
}
#endif
traced_absmi();
}
#if YAP_DBG_PREDS
print_main_when_head(PREG, ON_INTERPRETER);
#endif
PREG = NEXTOP(PREG, J);
JMPNext();
ENDBOp();
#endif
#include "control_absmi_insts.h"
#include "cp_absmi_insts.h"
#include "fail_absmi_insts.h"
#include "fli_absmi_insts.h"
#include "index_absmi_insts.h"
#include "lu_absmi_insts.h"
#include "meta_absmi_insts.h"
#include "or_absmi_insts.h"
#include "prim_absmi_insts.h"
#include "type_absmi_insts.h"
#include "unify_absmi_insts.h"

12238
C/absmi_insts.i Normal file

File diff suppressed because it is too large Load Diff

2401
C/adtdefs.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

1268
C/adtdefs.c.new Executable file

File diff suppressed because it is too large Load Diff

158
C/agc.c Normal file → Executable file
View File

@ -32,8 +32,9 @@ static char SccsId[] = "@(#)agc.c 1.3 3/15/90";
#define errout GLOBAL_stderr
#endif
STATIC_PROTO(void RestoreEntries, (PropEntry *, int USES_REGS));
STATIC_PROTO(void CleanCode, (PredEntry * USES_REGS));
static void RestoreEntries(PropEntry *, int USES_REGS);
static void CleanCode(PredEntry * USES_REGS);
static void RestoreDBTerm(DBTerm *dbr, bool src, int attachments USES_REGS);
#define AtomMarkedBit 1
@ -148,7 +149,7 @@ AtomAdjust(Atom a)
#define DelayAddrAdjust(P) (P)
#define DelayAdjust(P) (P)
#define GlobalAdjust(P) (P)
#define DBRefAdjust(P) (P)
#define DBRefAdjust(P,REF) (P)
#define DBRefPAdjust(P) (P)
#define DBTermAdjust(P) (P)
#define LUIndexAdjust(P) (P)
@ -180,6 +181,7 @@ AtomAdjust(Atom a)
#define YAdjust(P) (P)
#define HoldEntryAdjust(P) (P)
#define CodeCharPAdjust(P) (P)
#define CodeConstCharPAdjust(P) (P)
#define CodeVoidPAdjust(P) (P)
#define HaltHookAdjust(P) (P)
@ -189,28 +191,37 @@ AtomAdjust(Atom a)
#define RestoreSWIHash()
static void
AdjustTermFlag(flag_term *tarr, UInt i)
{
CACHE_REGS
if (IsVarTerm(tarr[i].at)) {
RestoreDBTerm( tarr[i].DBT, false, 0 PASS_REGS );
} else if (IsAtomTerm( tarr[i].at ) )
tarr[i].at = AtomTermAdjust(tarr[i].at);
}
static void RestoreFlags( UInt NFlags )
{
CACHE_REGS
size_t i;
flag_term *tarr = GLOBAL_Flags;
if (worker_id == 0)
for (i=0; i<GLOBAL_flagCount; i++) {
AdjustTermFlag( tarr, i);
}
tarr = LOCAL_Flags;
for (i=0; i<LOCAL_flagCount; i++) {
AdjustTermFlag( tarr, i);
}
}
#include "rheap.h"
static void
RestoreHashPreds( USES_REGS1 )
{
UInt i;
for (i = 0; i < PredHashTableSize; i++) {
PredEntry *p = PredHash[i];
if (p)
p = PredEntryAdjust(p);
while (p) {
Prop nextp;
if (p->NextOfPE)
p->NextOfPE = PropAdjust(p->NextOfPE);
nextp = p->NextOfPE;
CleanCode(p PASS_REGS);
p = RepPredProp(nextp);
}
}
}
@ -220,7 +231,7 @@ static void init_reg_copies(USES_REGS1)
LOCAL_OldLCL0 = LCL0;
LOCAL_OldTR = TR;
LOCAL_OldGlobalBase = (CELL *)LOCAL_GlobalBase;
LOCAL_OldH = H;
LOCAL_OldH = HR;
LOCAL_OldH0 = H0;
LOCAL_OldTrailBase = LOCAL_TrailBase;
LOCAL_OldTrailTop = LOCAL_TrailTop;
@ -244,8 +255,6 @@ RestoreAtomList(Atom atm USES_REGS)
} while (!EndOfPAEntr(at));
}
static void
mark_trail(USES_REGS1)
{
@ -319,16 +328,42 @@ mark_global_cell(CELL *pt)
/* skip bitmaps */
switch(reg) {
case (CELL)FunctorDouble:
#if SIZEOF_DOUBLE == 2*SIZEOF_LONG_INT
#if SIZEOF_DOUBLE == 2*SIZEOF_INT_P
return pt + 4;
#else
return pt + 3;
#endif
case (CELL)FunctorString:
return pt + 3 + pt[1];
case (CELL)FunctorBigInt:
{
Int sz = 3 +
(sizeof(MP_INT)+
(((MP_INT *)(pt+2))->_mp_alloc*sizeof(mp_limb_t)))/sizeof(CELL);
YAP_Opaque_CallOnGCMark f;
YAP_Opaque_CallOnGCRelocate f2;
Term t = AbsAppl(pt);
if ( (f = Yap_blob_gc_mark_handler(t)) ) {
CELL ar[256];
Int i,n = (f)(Yap_BlobTag(t), Yap_BlobInfo(t), ar, 256);
if (n < 0) {
Yap_Error(RESOURCE_ERROR_HEAP,TermNil,"not enough space for slot internal variables in agc");
}
for (i = 0; i< n; i++) {
CELL *pt = ar+i;
CELL reg = *pt;
if (!IsVarTerm(reg) && IsAtomTerm(reg)) {
*pt = AtomTermAdjust(reg);
}
}
if ( (f2 = Yap_blob_gc_relocate_handler(t)) < 0 ) {
int out = (f2)(Yap_BlobTag(t), Yap_BlobInfo(t), ar, n);
if (out < 0)
Yap_Error(RESOURCE_ERROR_HEAP,TermNil,"bad restore of slot internal variables in agc");
}
}
return pt + sz;
}
case (CELL)FunctorLongInt:
@ -352,7 +387,7 @@ mark_global(USES_REGS1)
* the code
*/
pt = H0;
while (pt < H) {
while (pt < HR) {
pt = mark_global_cell(pt);
}
}
@ -374,22 +409,29 @@ clean_atom_list(AtomHashEntry *HashPtr)
while (atm != NIL) {
AtomEntry *at = RepAtom(atm);
if (AtomResetMark(at) ||
at->PropsOfAE != NIL ||
( at->PropsOfAE != NIL && !IsBlob(at) ) ||
(GLOBAL_AGCHook != NULL && !GLOBAL_AGCHook(atm))) {
patm = &(at->NextOfAE);
atm = at->NextOfAE;
} else {
NOfAtoms--;
if (IsWideAtom(atm)) {
#ifdef DEBUG_RESTORE3
fprintf(stderr, "Purged %p:%S\n", at, at->WStrOfAE);
#endif
GLOBAL_agc_collected += sizeof(AtomEntry)+wcslen(at->WStrOfAE);
} else {
if (IsBlob(atm)) {
YAP_BlobPropEntry *b = RepBlobProp(at->PropsOfAE);
if (b->NextOfPE != NIL) {
patm = &(at->NextOfAE);
atm = at->NextOfAE;
continue;
}
NOfAtoms++;
NOfBlobs--;
Yap_FreeCodeSpace((char *)b);
GLOBAL_agc_collected += sizeof(YAP_BlobPropEntry);
GLOBAL_agc_collected += sizeof(AtomEntry)+sizeof(size_t)+at->rep.blob->length;
} else {
#ifdef DEBUG_RESTORE3
fprintf(stderr, "Purged %p:%s patm=%p %p\n", at, at->StrOfAE, patm, at->NextOfAE);
#endif
GLOBAL_agc_collected += sizeof(AtomEntry)+strlen(at->StrOfAE);
GLOBAL_agc_collected += sizeof(AtomEntry)+strlen((const char *)at->StrOfAE);
}
*patm = atm = at->NextOfAE;
Yap_FreeCodeSpace((char *)at);
@ -412,15 +454,10 @@ clean_atoms(void)
clean_atom_list(HashPtr);
HashPtr++;
}
HashPtr = WideHashChain;
for (i = 0; i < WideAtomHashTableSize; ++i) {
clean_atom_list(HashPtr);
HashPtr++;
}
clean_atom_list(&INVISIBLECHAIN);
{
AtomHashEntry list;
list.Entry = SWI_Blobs;
list.Entry = Blobs;
clean_atom_list(&list);
}
}
@ -428,24 +465,25 @@ clean_atoms(void)
static void
atom_gc(USES_REGS1)
{
int gc_verbose = Yap_is_gc_verbose();
int gc_trace = 0;
bool gc_verbose = Yap_is_gc_verbose();
bool gc_trace = false;
UInt time_start, agc_time;
#if defined(YAPOR) || defined(THREADS)
return;
#endif
if (Yap_GetValue(AtomGcTrace) != TermNil)
gc_trace = 1;
gc_trace = true;
GLOBAL_agc_calls++;
GLOBAL_agc_collected = 0;
if (gc_trace) {
fprintf(GLOBAL_stderr, "%% agc:\n");
fprintf(stderr, "%% agc:\n");
} else if (gc_verbose) {
fprintf(GLOBAL_stderr, "%% Start of atom garbage collection %d:\n", GLOBAL_agc_calls);
fprintf(stderr, "%% Start of atom garbage collection %d:\n", GLOBAL_agc_calls);
}
time_start = Yap_cputime();
/* get the number of active registers */
@ -454,17 +492,18 @@ atom_gc(USES_REGS1)
mark_stacks(PASS_REGS1);
restore_codes();
clean_atoms();
NOfBlobsMax = NOfBlobs+(NOfBlobs/2+256< 1024 ? NOfBlobs/2+256 : 1024);
YAPLeaveCriticalSection();
agc_time = Yap_cputime()-time_start;
GLOBAL_tot_agc_time += agc_time;
GLOBAL_tot_agc_recovered += GLOBAL_agc_collected;
if (gc_verbose) {
#ifdef _WIN32
fprintf(GLOBAL_stderr, "%% Collected %I64d bytes.\n", GLOBAL_agc_collected);
fprintf(stderr, "%% Collected %I64d bytes.\n", GLOBAL_agc_collected);
#else
fprintf(GLOBAL_stderr, "%% Collected %lld bytes.\n", GLOBAL_agc_collected);
fprintf(stderr, "%% Collected %lld bytes.\n", GLOBAL_agc_collected);
#endif
fprintf(GLOBAL_stderr, "%% GC %d took %g sec, total of %g sec doing GC so far.\n", GLOBAL_agc_calls, (double)agc_time/1000, (double)GLOBAL_tot_agc_time/1000);
fprintf(stderr, "%% GC %d took %g sec, total of %g sec doing GC so far.\n", GLOBAL_agc_calls, (double)agc_time/1000, (double)GLOBAL_tot_agc_time/1000);
}
}
@ -496,31 +535,10 @@ p_inform_agc(USES_REGS1)
Yap_unify(ts, ARG3);
}
static Int
p_agc_threshold(USES_REGS1)
{
Term t = Deref(ARG1);
if (IsVarTerm(t)) {
return Yap_unify(ARG1, MkIntegerTerm(GLOBAL_AGcThreshold));
} else if (!IsIntegerTerm(t)) {
Yap_Error(TYPE_ERROR_INTEGER,t,"prolog_flag/2 agc_margin");
return FALSE;
} else {
Int i = IntegerOfTerm(t);
if (i<0) {
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO,t,"prolog_flag/2 agc_margin");
return FALSE;
} else {
GLOBAL_AGcThreshold = i;
return TRUE;
}
}
}
void
Yap_init_agc(void)
{
Yap_InitCPred("$atom_gc", 0, p_atom_gc, HiddenPredFlag);
Yap_InitCPred("$inform_agc", 3, p_inform_agc, HiddenPredFlag);
Yap_InitCPred("$agc_threshold", 1, p_agc_threshold, HiddenPredFlag|SafePredFlag);
Yap_InitCPred("$atom_gc", 0, p_atom_gc, 0);
Yap_InitCPred("$inform_agc", 3, p_inform_agc, 0);
}

1058
C/alloc.c

File diff suppressed because it is too large Load Diff

3585
C/amasm.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

View File

@ -31,9 +31,9 @@ static char SccsId[] = "%W% %G%";
STATIC_PROTO(Int p_reset_op_counters, (void));
STATIC_PROTO(Int p_show_op_counters, (void));
STATIC_PROTO(Int p_show_ops_by_group, (void));
static Int p_reset_op_counters(void);
static Int p_show_op_counters(void);
static Int p_show_ops_by_group(void);
static Int
p_reset_op_counters()
@ -852,10 +852,35 @@ p_show_sequences(void)
void
Yap_InitAnalystPreds(void)
{
Yap_InitCPred("wam_profile_reset_op_counters", 0, p_reset_op_counters, SafePredFlag |SyncPredFlag);
Yap_InitCPred("wam_profile_show_op_counters", 1, p_show_op_counters, SafePredFlag|SyncPredFlag);
Yap_InitCPred("wam_profile_show_ops_by_group", 1, p_show_ops_by_group, SafePredFlag |SyncPredFlag);
Yap_InitCPred("wam_profile_show_sequences", 1, p_show_sequences, SafePredFlag |SyncPredFlag);
Yap_InitCPred("wam_profiler_reset_op_counters", 0, p_reset_op_counters, SafePredFlag |SyncPredFlag);
/** @pred wam_profiler_reset_op_counters
Reinitialize all counters.
*/
Yap_InitCPred("wam_profiler_show_op_counters", 1, p_show_op_counters, SafePredFlag|SyncPredFlag);
/** @pred wam_profiler_show_op_counters(+ _A_)
Display the current value for the counters, using label _A_. The
label must be an atom.
*/
Yap_InitCPred("wam_profiler_show_ops_by_group", 1, p_show_ops_by_group, SafePredFlag |SyncPredFlag);
/** @pred wam_profiler_show_ops_by_group(+ _A_)
Display the current value for the counters, organized by groups, using
label _A_. The label must be an atom.
*/
Yap_InitCPred("wam_profiler_show_sequences", 1, p_show_sequences, SafePredFlag |SyncPredFlag);
}
#endif /* ANALYST */

219
C/args.c Normal file
View File

@ -0,0 +1,219 @@
#include "Yap.h"
#include "Yatom.h"
/**
* Scan a list of arguments and output results to a pre-processed vector.
*
* @param listl: input list
* @param def parameter definition
*
* @return all arguments, some of them set, some of them not.
*/
static xarg *matchKey(Atom key, xarg *e0, int n, const param_t *def) {
int i;
for (i = 0; i < n; i++) {
if (!strcmp((char *)def->name, (char *)RepAtom(key)->StrOfAE)) {
return e0;
}
def++;
e0++;
}
return NULL;
}
/**
* Returns the index of an argument key, or -1 if not found.
*
*/
int Yap_ArgKey(Atom key, const param_t *def, int n) {
int i;
for (i = 0; i < n; i++) {
if (!strcmp((char *)def->name, (char *)RepAtom(key)->StrOfAE)) {
return i;
}
def++;
}
return -1;
}
#define YAP_XARGINFO(Error, Message)
xarg *Yap_ArgListToVector__(const char *file, const char *function, int lineno,
Term listl, const param_t *def, int n,
yap_error_number err) {
CACHE_REGS
xarg *a;
listl = Deref(listl);
if (IsVarTerm(listl)) {
Yap_ThrowError__(file, function, lineno, INSTANTIATION_ERROR, listl,
"while opening listl = ArgOfTerm(2, listl ,k)");
}
a = calloc(n, sizeof(xarg));
if (!IsPairTerm(listl) && listl != TermNil) {
if (IsAtomTerm(listl)) {
xarg *na = matchKey(AtomOfTerm(listl), a, n, def);
if (!na) {
Yap_ThrowError__(file, function, lineno, TYPE_ERROR_LIST, listl, "match key");
}
} else if (IsApplTerm(listl)) {
Functor f = FunctorOfTerm(listl);
if (IsExtensionFunctor(f)) {
Yap_ThrowError__(file, function, lineno, TYPE_ERROR_LIST, listl, "callable");
}
arity_t arity = ArityOfFunctor(f);
if (arity != 1) {
Yap_ThrowError__(file, function, lineno, TYPE_ERROR_LIST, listl, "bad arity");
}
xarg *na = matchKey(NameOfFunctor(f), a, n, def);
if (!na) {
Yap_ThrowError__(file, function, lineno, err, listl, "no match");
}
na->used = true;
na->tvalue = ArgOfTerm(1, listl);
} else {
Yap_ThrowError__(file, function, lineno, TYPE_ERROR_ATOM, listl, "not atom");
}
listl = MkPairTerm(listl, TermNil);
}
while (IsPairTerm(listl)) {
Term hd = HeadOfTerm(listl);
listl = TailOfTerm(listl);
if (IsVarTerm(hd)) {
Yap_ThrowError__(file, function, lineno, INSTANTIATION_ERROR, hd, "sub-element");
}
if (IsVarTerm(listl)) {
Yap_ThrowError__(file, function, lineno, INSTANTIATION_ERROR, listl, "sub-list");
}
if (IsAtomTerm(hd)) {
xarg *na = matchKey(AtomOfTerm(hd), a, n, def);
if (!na)
Yap_ThrowError__(file, function, lineno, err, hd, "bad match in list");
na->used = true;
na->tvalue = TermNil;
continue;
} else if (IsApplTerm(hd)) {
Functor f = FunctorOfTerm(hd);
if (IsExtensionFunctor(f)) {
Yap_ThrowError__(file, function, lineno, err, hd, "bad compound");
}
arity_t arity = ArityOfFunctor(f);
if (arity != 1) {
Yap_ThrowError__(file, function, lineno, DOMAIN_ERROR_OUT_OF_RANGE, hd,
"high arity");
}
xarg *na = matchKey(NameOfFunctor(f), a, n, def);
if (!na) {
Yap_ThrowError__(file, function, lineno, err, hd, "no match");
}
na->used = true;
na->tvalue = ArgOfTerm(1, hd);
} else {
Yap_ThrowError__(file, function, lineno, err, hd, "bad type");
}
}
if (IsVarTerm(listl)) {
Yap_ThrowError__(file, function, lineno, INSTANTIATION_ERROR, listl, "unbound");
} else if (listl != TermNil) {
Yap_ThrowError__(file, function, lineno, TYPE_ERROR_LIST, listl, "bad list");
}
return a;
}
static xarg *matchKey2(Atom key, xarg *e0, int n, const param2_t *def) {
int i;
for (i = 0; i < n; i++) {
if (!strcmp((char *)def->name, (char *)RepAtom(key)->StrOfAE)) {
return e0;
}
def++;
e0++;
}
return NULL;
}
/// Yap_ArgList2ToVector is much the same as before,
/// but assumes parameters also have something called a
/// scope
xarg *Yap_ArgList2ToVector__(const char *file, const char *function, int lineno,Term listl, const param2_t *def, int n, yap_error_number err) {
CACHE_REGS
xarg *a = calloc(n, sizeof(xarg));
if (!IsPairTerm(listl) && listl != TermNil) {
if (IsVarTerm(listl)) {
Yap_ThrowError__(file, function, lineno, INSTANTIATION_ERROR, listl, "unbound");
}
if (IsAtomTerm(listl)) {
xarg *na = matchKey2(AtomOfTerm(listl), a, n, def);
if (!na) {
Yap_ThrowError__(file, function, lineno, err,
listl, "bad match");
}
}
if (IsApplTerm(listl)) {
Functor f = FunctorOfTerm(listl);
if (IsExtensionFunctor(f)) {
Yap_ThrowError__(file, function, lineno, TYPE_ERROR_PARAMETER, listl,
"bad compound");
}
arity_t arity = ArityOfFunctor(f);
if (arity != 1) {
Yap_ThrowError__(file, function, lineno, TYPE_ERROR_LIST, listl, "bad arity");
}
xarg *na = matchKey2(NameOfFunctor(f), a, n, def);
if (!na) {
Yap_ThrowError__(file, function, lineno, DOMAIN_ERROR_GENERIC_ARGUMENT,
listl, "bad match");
}
} else {
Yap_ThrowError__(file, function, lineno, TYPE_ERROR_LIST, listl, "");
}
listl = MkPairTerm(listl, TermNil);
}
while (IsPairTerm(listl)) {
Term hd = HeadOfTerm(listl);
if (IsVarTerm(hd)) {
Yap_ThrowError__(file, function, lineno, INSTANTIATION_ERROR, hd, "");
}
if (IsAtomTerm(hd)) {
xarg *na = matchKey2(AtomOfTerm(hd), a, n, def);
if (!na) {
Yap_ThrowError__(file, function, lineno, DOMAIN_ERROR_GENERIC_ARGUMENT,
hd, "bad match");
}
na->used = true;
na->tvalue = TermNil;
continue;
} else if (IsApplTerm(hd)) {
Functor f = FunctorOfTerm(hd);
if (IsExtensionFunctor(f)) {
Yap_ThrowError__(file, function, lineno, TYPE_ERROR_PARAMETER, hd, "bad compound");
}
arity_t arity = ArityOfFunctor(f);
if (arity != 1) {
Yap_ThrowError__(file, function, lineno, DOMAIN_ERROR_GENERIC_ARGUMENT,
hd, "bad arity");
}
xarg *na = matchKey2(NameOfFunctor(f), a, n, def);
if (na) {
na->used = 1;
na->tvalue = ArgOfTerm(1, hd);
} else {
Yap_ThrowError__(file, function, lineno, err,
hd, "bad key");
}
return a;
} else {
Yap_ThrowError__(file, function, lineno, INSTANTIATION_ERROR, hd, "unbound");
}
listl = TailOfTerm(listl);
}
if (IsVarTerm(listl)) {
Yap_ThrowError__(file, function, lineno, INSTANTIATION_ERROR, listl, "");
}
if (TermNil != listl) {
Yap_ThrowError__(file, function, lineno, TYPE_ERROR_LIST, listl, "");
}
return a;
}

View File

@ -18,41 +18,103 @@
static char SccsId[] = "%W% %G%";
#endif
/*
* This file implements arithmetic operations
/**
@file arith0.c
*/
//! @{
/**
@defgroup arithmetic_operators Arithmetic Functions
@ingroup arithmetic
YAP implements several arithmetic functions, they are defined as
fields in three enumerations, such that there is one enumeration
per each different arity:
- #arith0_op defines constants and arity 0 arithmetic functions
@copydoc #arith0_op
- #arith1_op defines single argument arithmetic functions
@copydoc #arith1_op
- #arith2_op defines binary arithmetic functions
@copydoc #arith2_op
Arithmetic expressions
in YAP may use the following operators:
- <b>pi [ISO]</b><p> @anchor pi_0
An approximation to the value of <em>pi</em>, that is, the ratio of a circle's circumference to its diameter.
- <b>e</b><p> @anchor e_0
Euler's number, the base of the natural logarithms.
- <b>epsilon</b><p> @anchor epsilon_0
The difference between the float `1.0` and the next largest floating point number.
- <b>inf</b><p> @anchor inf_0
Infinity according to the IEEE Floating-Point standard. Note that evaluating this term will generate a domain error in the `iso` language mode.
Note also that YAP supports `+inf` and `-inf`
- <b>nan (not a number)</b><p> @anchor nan_0
Not-a-number according to the IEEE Floating-Point standard. Note that evaluating this term will generate a domain error in the `iso` language mode.
- <b>random</b><p> @anchor random_0
A "random" floating point number between 0 and 1.
- <b>cputime</b><p> @anchor cputime_0
CPU time since YAP was invoked, in seconds.
- <b>heapused</b><p> @anchor heapused_0
Heap (data-base) space used, in bytes.
- <b>local</b><p> @anchor local_0
Local stack in use, in bytes
- <b>$b</b><p> @anchor b_0
current choicepoint
- <b>$env</b><p> @anchor env_0
Environment
- <b>$tr</b><p> @anchor tr_0
Trail in use
- <b>$free_stack</b><p> @anchor free_stack_0
Amount of free stack space, that is, free space between global and local stacks.
- <b>global</b><p> @anchor global_0
Global stack in use, in bytes.
*
*/
#include "Yap.h"
#include "Yatom.h"
#include "YapHeap.h"
#include "eval.h"
#include "YapEval.h"
#include "alloc.h"
#ifndef PI
#ifdef M_PI
#define PI M_PI
#else
#define PI 3.14159265358979323846
#endif
#endif
#ifndef M_E
#define M_E 2.7182818284590452354
#endif
#ifndef INFINITY
#define INFINITY (1.0/0.0)
#endif
#ifndef NAN
#define NAN (0.0/0.0)
#endif
/* copied from SWI-Prolog */
#ifndef DBL_EPSILON /* normal for IEEE 64-bit double */
#define DBL_EPSILON 0.00000000000000022204
#endif
static Term
eval0(Int fi) {
@ -74,12 +136,12 @@ eval0(Int fi) {
case op_inf:
{
#ifdef _MSC_VER /* Microsoft's Visual C++ Compiler */
Yap_Error(TYPE_ERROR_EVALUABLE, TermNil, "evaluating infinity");
Yap_ArithError(TYPE_ERROR_EVALUABLE, TermNil, "evaluating infinity");
P = (yamop *)FAILCODE;
RERROR();
#else
if (yap_flags[LANGUAGE_MODE_FLAG] == 1) {/* iso */
Yap_Error(TYPE_ERROR_EVALUABLE, TermNil, "evaluating infinity");
if (isoLanguageFlag()) {/* iso */
Yap_ArithError(TYPE_ERROR_EVALUABLE, TermNil, "evaluating infinity");
P = (yamop *)FAILCODE;
RERROR();
} else {
@ -89,14 +151,12 @@ eval0(Int fi) {
}
case op_nan:
{
#ifdef _MSC_VER /* Microsoft's Visual C++ Compiler */
Yap_Error(TYPE_ERROR_EVALUABLE, TermNil, "evaluating infinity");
P = (yamop *)FAILCODE;
#ifdef _MSC_VER /* Microsoft's Visual C++ Compi<ler */
Yap_ArithError(TYPE_ERROR_EVALUABLE, TermNil, "evaluating infinity");
RERROR();
#else
if (yap_flags[LANGUAGE_MODE_FLAG] == 1) {/* iso */
Yap_Error(TYPE_ERROR_EVALUABLE, TermNil, "evaluating not-a-number");
P = (yamop *)FAILCODE;
if (isoLanguageFlag()) {/* iso */
Yap_ArithError(TYPE_ERROR_EVALUABLE, TermNil, "evaluating not-a-number");
RERROR();
} else {
RFLOAT(NAN);
@ -112,40 +172,55 @@ eval0(Int fi) {
RFLOAT((Float)Yap_cputime()/1000.0);
}
case op_heapused:
RINT(HeapUsed);
/// - heapused
/// Heap (data-base) space used, in bytes. In fact YAP either reports
/// the total memory malloced, or the amount of allocated space in
/// predicates.
///
RINT(Yap_HeapUsed());
case op_localsp:
/// - local
/// Local stack in use, in bytes
///
#if YAPOR_SBA
RINT((Int)ASP);
#else
RINT(LCL0 - ASP);
#endif
case op_b:
#if YAPOR_SBA
RINT((Int)B);
#else
RINT(LCL0 - (CELL *)B);
#endif
case op_env:
/// - $env
/// Environment
///
#if YAPOR_SBA
RINT((Int)YENV);
#else
RINT(LCL0 - YENV);
#endif
case op_tr:
/// - $tr
/// Trail in use
///
#if YAPOR_SBA
RINT(TR);
#else
RINT(((CELL *)TR)-LCL0);
#endif
case op_stackfree:
RINT(Unsigned(ASP) - Unsigned(H));
/// - $free_stack
///
/// Not-a-number according to the IEEE Floating-Point standard. Note that evaluating this term will generate a domain error in the `iso` language mode.
RINT(Unsigned(ASP) - Unsigned(HR));
case op_globalsp:
/// - global
/// Global stack in use, in bytes.
///
#if YAPOR_SBA
RINT((Int)H);
RINT((Int)HR);
#else
RINT(H - H0);
RINT(HR - H0);
#endif
}
/// end of switch
RERROR();
}
@ -170,7 +245,6 @@ static InitConstEntry InitConstTab[] = {
{"heapused", op_heapused},
{"local_sp", op_localsp},
{"global_sp", op_globalsp},
{"$last_choice_pt", op_b},
{"$env", op_env},
{"$tr", op_tr},
{"stackfree", op_stackfree},
@ -185,7 +259,7 @@ Yap_InitConstExps(void)
for (i = 0; i < sizeof(InitConstTab)/sizeof(InitConstEntry); ++i) {
AtomEntry *ae = RepAtom(Yap_LookupAtom(InitConstTab[i].OpName));
if (ae == NULL) {
Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"at InitConstExps");
Yap_EvalError(RESOURCE_ERROR_HEAP,TermNil,"at InitConstExps");
return;
}
WRITE_LOCK(ae->ARWLock);
@ -203,6 +277,7 @@ Yap_InitConstExps(void)
}
}
/* This routine is called from Restore to make sure we have the same arithmetic operators */
int
Yap_ReInitConstExps(void)
@ -210,3 +285,4 @@ Yap_ReInitConstExps(void)
return TRUE;
}
/// @}

1138
C/arith1.c

File diff suppressed because it is too large Load Diff

View File

@ -18,15 +18,116 @@
static char SccsId[] = "%W% %G%";
#endif
/*
* This file implements unary arithmetic operations in YAP
*
*/
/**
@file arith2.c
@addtogroup arithmetic_operators
These are the binary numeric operators currently supported by YAP.
- <b> _X_+ _Y_ [ISO]</b><p>
Sum.
- <b> _X_- _Y_ [ISO]</b><p>
Difference.
- <b> _X_\* _Y_ [ISO]</b><p>
Product.
- <b> _X_/ _Y_ [ISO]</b><p>
Quotient.
- <b> _X_// _Y_ [ISO]</b><p>
Integer quotient.
- <b> _X_ mod _Y_ [ISO]</b><p> @anchor mod_2
Integer module operator, always positive.
- <b> _X_ rem _Y_ [ISO]</b><p> @anchor rem_2
Integer remainder, similar to `mod` but always has the same sign as `X`.
- <b> _X_ div _Y_ [ISO]</b><p> @anchor div_2
Integer division, as if defined by `( _X_ - _X_ mod _Y_)// _Y_`.
- <b> max( _X_, _Y_) [ISO]</b><p> @anchor max_2
The greater value of _X_ and _Y_.
- <b> min( _X_, _Y_) [ISO]</b><p> @anchor min_2
The lesser value of _X_ and _Y_.
- <b> _X_ ^ _Y_ [ISO]</b><p>
_X_ raised to the power of _Y_, (from the C-Prolog syntax).
- <b> exp( _X_, _Y_)</b><p> @anchor exp_2
_X_ raised to the power of _Y_, (from the Quintus Prolog syntax).
- <b> _X_ \*\* _Y_ [ISO]</b><p>
_X_ raised to the power of _Y_ (from ISO).
- <b> _X_ /\\ _Y_ [ISO]</b><p>
Integer bitwise conjunction.
- <b> _X_ \\/ _Y_ [ISO]</b><p>
Integer bitwise disjunction.
- <b> _X_ # _Y_</b><p>
Integer bitwise exclusive disjunction.
- <b> _X_ \>\< _Y_</b><p>
Integer bitwise exclusive disjunction.
- <b> xor( _X_ , _Y_) [ISO]</b><p> @anchor xor_2
Integer bitwise exclusive disjunction.
- <b> _X_ \<\< _Y_</b><p>
Integer bitwise left logical shift of _X_ by _Y_ places.
- <b> _X_ \>\> _Y_ [ISO]</b><p>
Integer bitwise right logical shift of _X_ by _Y_ places.
- <b> gcd( _X_, _Y_)</b><p> @anchor gcd_2
The greatest common divisor of the two integers _X_ and _Y_.
- <b> atan( _X_, _Y_)</b><p> @anchor atan_2
Four-quadrant arc tangent. Also available as `atan2/2`.
- <b> atan2( _X_, _Y_) [ISO]</b><p> @anchor atan2_2
Four-quadrant arc tangent.
- <b> _X_ rdiv _Y_ [ISO]</b><p> @anchor rdiv_2
Rational division.
*/
#include "Yap.h"
#include "Yatom.h"
#include "YapHeap.h"
#include "eval.h"
#include "YapEval.h"
#include "arith2.h"
@ -37,7 +138,7 @@ typedef struct init_un_eval {
static Term
p_mod(Term t1, Term t2) {
p_mod(Term t1, Term t2 USES_REGS) {
switch (ETypeOfTerm(t1)) {
case (CELL)long_int_e:
switch (ETypeOfTerm(t2)) {
@ -49,14 +150,9 @@ p_mod(Term t1, Term t2) {
Int mod;
if (i2 == 0)
return Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is " Int_FORMAT " mod 0", i1);
Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is " Int_FORMAT " mod 0", i1);
if (i1 == Int_MIN && i2 == -1) {
#ifdef USE_GMP
return Yap_gmp_add_ints(Int_MAX, 1);
#else
return Yap_ArithError(EVALUATION_ERROR_INT_OVERFLOW, t1,
"// /2 with %d and %d", i1, i2);
#endif
return MkIntTerm(0);
}
mod = i1%i2;
if (mod && (mod ^ i2) < 0)
@ -64,7 +160,7 @@ p_mod(Term t1, Term t2) {
RINT(mod);
}
case (CELL)double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "mod/2");
case (CELL)big_int_e:
#ifdef USE_GMP
return Yap_gmp_mod_int_big(IntegerOfTerm(t1), t2);
@ -74,7 +170,7 @@ p_mod(Term t1, Term t2) {
break;
}
case (CELL)double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t1, "mod/2");
case (CELL)big_int_e:
#ifdef USE_GMP
switch (ETypeOfTerm(t2)) {
@ -84,14 +180,14 @@ p_mod(Term t1, Term t2) {
Int i2 = IntegerOfTerm(t2);
if (i2 == 0)
return Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is ... mod 0");
Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is ... mod 0");
return Yap_gmp_mod_big_int(t1, i2);
}
case (CELL)big_int_e:
/* two bignums */
return Yap_gmp_mod_big_big(t1, t2);
case double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "mod/2");
default:
RERROR();
}
@ -102,7 +198,7 @@ p_mod(Term t1, Term t2) {
}
static Term
p_div2(Term t1, Term t2) {
p_div2(Term t1, Term t2 USES_REGS) {
switch (ETypeOfTerm(t1)) {
case (CELL)long_int_e:
switch (ETypeOfTerm(t2)) {
@ -114,12 +210,12 @@ p_div2(Term t1, Term t2) {
Int res, mod;
if (i2 == 0)
return Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is " Int_FORMAT " div 0", i1);
Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is " Int_FORMAT " div 0", i1);
if (i1 == Int_MIN && i2 == -1) {
#ifdef USE_GMP
return Yap_gmp_add_ints(Int_MAX, 1);
return Yap_gmp_add_ints(Int_MAX, 1);
#else
return Yap_ArithError(EVALUATION_ERROR_INT_OVERFLOW, t1,
Yap_ArithError(EVALUATION_ERROR_INT_OVERFLOW, t1,
"// /2 with %d and %d", i1, i2);
#endif
}
@ -130,7 +226,7 @@ p_div2(Term t1, Term t2) {
RINT(res);
}
case (CELL)double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "div/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "div/2");
case (CELL)big_int_e:
#ifdef USE_GMP
return Yap_gmp_div_int_big(IntegerOfTerm(t1), t2);
@ -140,7 +236,7 @@ p_div2(Term t1, Term t2) {
break;
}
case (CELL)double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "div/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "div/2");
case (CELL)big_int_e:
#ifdef USE_GMP
switch (ETypeOfTerm(t2)) {
@ -150,14 +246,14 @@ p_div2(Term t1, Term t2) {
Int i2 = IntegerOfTerm(t2);
if (i2 == 0)
return Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is ... div 0");
Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is ... div 0");
return Yap_gmp_div2_big_int(t1, i2);
}
case (CELL)big_int_e:
/* two bignums */
return Yap_gmp_div2_big_big(t1, t2);
case double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "div/2");
default:
RERROR();
}
@ -168,7 +264,7 @@ p_div2(Term t1, Term t2) {
}
static Term
p_rem(Term t1, Term t2) {
p_rem(Term t1, Term t2 USES_REGS) {
switch (ETypeOfTerm(t1)) {
case (CELL)long_int_e:
switch (ETypeOfTerm(t2)) {
@ -177,23 +273,16 @@ p_rem(Term t1, Term t2) {
{
Int i1 = IntegerOfTerm(t1);
Int i2 = IntegerOfTerm(t2);
Int mod;
if (i2 == 0)
return Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is " Int_FORMAT " rem 0", i1);
Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is " Int_FORMAT " rem 0", i1);
if (i1 == Int_MIN && i2 == -1) {
#ifdef USE_GMP
return Yap_gmp_add_ints(Int_MAX, 1);
#else
return Yap_ArithError(EVALUATION_ERROR_INT_OVERFLOW, t1,
"rem/2 with %d and %d", i1, i2);
#endif
return MkIntTerm(0);
}
mod = i1%i2;
RINT(i1%i2);
}
case (CELL)double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "rem/2");
case (CELL)big_int_e:
#ifdef USE_GMP
return Yap_gmp_rem_int_big(IntegerOfTerm(t1), t2);
@ -203,19 +292,19 @@ p_rem(Term t1, Term t2) {
}
break;
case (CELL)double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t1, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t1, "rem/2");
case (CELL)big_int_e:
#ifdef USE_GMP
switch (ETypeOfTerm(t2)) {
case long_int_e:
if (IntegerOfTerm(t2) == 0)
return Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is ... rem 0");
Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is ... rem 0");
return Yap_gmp_rem_big_int(t1, IntegerOfTerm(t2));
case (CELL)big_int_e:
/* two bignums */
return Yap_gmp_rem_big_big(t1, t2);
case double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "rem/2");
default:
RERROR();
}
@ -227,11 +316,11 @@ p_rem(Term t1, Term t2) {
static Term
p_rdiv(Term t1, Term t2) {
p_rdiv(Term t1, Term t2 USES_REGS) {
#ifdef USE_GMP
switch (ETypeOfTerm(t1)) {
case (CELL)double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "rdiv/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "rdiv/2");
case (CELL)long_int_e:
switch (ETypeOfTerm(t2)) {
case (CELL)long_int_e:
@ -241,7 +330,7 @@ p_rdiv(Term t1, Term t2) {
Int i2 = IntegerOfTerm(t2);
if (i2 == 0)
return Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is " Int_FORMAT " rdiv 0", i1);
Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is " Int_FORMAT " rdiv 0", i1);
return Yap_gmq_rdiv_int_int(i1, i2);
}
case (CELL)big_int_e:
@ -255,13 +344,13 @@ p_rdiv(Term t1, Term t2) {
switch (ETypeOfTerm(t2)) {
case long_int_e:
if (IntegerOfTerm(t2) == 0)
return Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is ... rdiv 0");
Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is ... rdiv 0");
/* I know the term is much larger, so: */
return Yap_gmq_rdiv_big_int(t1, IntegerOfTerm(t2));
case (CELL)big_int_e:
return Yap_gmq_rdiv_big_big(t1, t2);
case double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "rdiv/2");
default:
RERROR();
}
@ -278,7 +367,7 @@ p_rdiv(Term t1, Term t2) {
Floating point division: /
*/
static Term
p_fdiv(Term t1, Term t2)
p_fdiv(Term t1, Term t2 USES_REGS)
{
switch (ETypeOfTerm(t1)) {
case long_int_e:
@ -350,17 +439,17 @@ p_fdiv(Term t1, Term t2)
xor #
*/
static Term
p_xor(Term t1, Term t2)
p_xor(Term t1, Term t2 USES_REGS)
{
switch (ETypeOfTerm(t1)) {
case long_int_e:
switch (ETypeOfTerm(t2)) {
case long_int_e:
/* two integers */
RINT(IntegerOfTerm(t1) ^ IntegerOfTerm(t2));
case double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "#/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "#/2");
case big_int_e:
#ifdef USE_GMP
return Yap_gmp_xor_int_big(IntegerOfTerm(t1), t2);
@ -370,7 +459,7 @@ p_xor(Term t1, Term t2)
}
break;
case double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t1, "#/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t1, "#/2");
case big_int_e:
#ifdef USE_GMP
switch (ETypeOfTerm(t2)) {
@ -379,7 +468,7 @@ p_xor(Term t1, Term t2)
case big_int_e:
return Yap_gmp_xor_big_big(t1, t2);
case double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "#/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "#/2");
default:
RERROR();
}
@ -394,7 +483,7 @@ p_xor(Term t1, Term t2)
atan2: arc tangent x/y
*/
static Term
p_atan2(Term t1, Term t2)
p_atan2(Term t1, Term t2 USES_REGS)
{
switch (ETypeOfTerm(t1)) {
case long_int_e:
@ -473,7 +562,7 @@ p_atan2(Term t1, Term t2)
power: x^y
*/
static Term
p_power(Term t1, Term t2)
p_power(Term t1, Term t2 USES_REGS)
{
switch (ETypeOfTerm(t1)) {
case long_int_e:
@ -554,7 +643,7 @@ p_power(Term t1, Term t2)
}
/* next function is adapted from:
Inline C++ integer exponentiation routines
Inline C++ integer exponentiation routines
Version 1.01
Copyright (C) 1999-2004 John C. Bowman <bowman@math.ualberta.ca>
*/
@ -565,9 +654,9 @@ ipow(Int x, Int p)
if (p == 0) return ((CELL)1);
if (x == 0 && p > 0) return 0L;
if(p < 0)
if(p < 0)
return (-p % 2) ? x : ((CELL)1);
r = ((CELL)1);
for(;;) {
if(p & 1) {
@ -589,7 +678,7 @@ ipow(Int x, Int p)
power: x^y
*/
static Term
p_exp(Term t1, Term t2)
p_exp(Term t1, Term t2 USES_REGS)
{
switch (ETypeOfTerm(t1)) {
case long_int_e:
@ -598,12 +687,13 @@ p_exp(Term t1, Term t2)
{
Int i1 = IntegerOfTerm(t1);
Int i2 = IntegerOfTerm(t2);
Int pow = ipow(i1,i2);
Int pow;
if (i2 < 0) {
return Yap_ArithError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, t2,
Yap_ArithError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, t2,
"%d ^ %d", i1, i2);
}
pow = ipow(i1,i2);
#ifdef USE_GMP
/* two integers */
if ((i1 && !pow)) {
@ -681,7 +771,7 @@ p_exp(Term t1, Term t2)
}
static Int
gcd(Int m11,Int m21)
gcd(Int m11,Int m21 USES_REGS)
{
/* Blankinship algorithm, provided by Miguel Filgueiras */
Int m12=1, m22=0, k;
@ -731,7 +821,7 @@ Int gcdmult(Int m11,Int m21,Int *pm11) /* *pm11 gets multiplier of m11 */
module gcd
*/
static Term
p_gcd(Term t1, Term t2)
p_gcd(Term t1, Term t2 USES_REGS)
{
switch (ETypeOfTerm(t1)) {
case long_int_e:
@ -743,10 +833,10 @@ p_gcd(Term t1, Term t2)
i1 = (i1 >= 0 ? i1 : -i1);
i2 = (i2 >= 0 ? i2 : -i2);
RINT(gcd(i1,i2));
RINT(gcd(i1,i2 PASS_REGS));
}
case double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "gcd/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "gcd/2");
case big_int_e:
#ifdef USE_GMP
return Yap_gmp_gcd_int_big(IntegerOfTerm(t1), t2);
@ -756,7 +846,7 @@ p_gcd(Term t1, Term t2)
}
break;
case double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t1, "gcd/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t1, "gcd/2");
case big_int_e:
#ifdef USE_GMP
switch (ETypeOfTerm(t2)) {
@ -765,7 +855,7 @@ p_gcd(Term t1, Term t2)
case big_int_e:
return Yap_gmp_gcd_big_big(t1, t2);
case double_e:
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "gcd/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "gcd/2");
default:
RERROR();
}
@ -969,56 +1059,57 @@ p_max(Term t1, Term t2)
}
static Term
eval2(Int fi, Term t1, Term t2) {
eval2(Int fi, Term t1, Term t2 USES_REGS) {
arith2_op f = fi;
switch (f) {
case op_plus:
return p_plus(t1, t2);
return p_plus(t1, t2 PASS_REGS);
case op_minus:
return p_minus(t1, t2);
return p_minus(t1, t2 PASS_REGS);
case op_times:
return p_times(t1, t2);
return p_times(t1, t2 PASS_REGS);
case op_div:
return p_div(t1, t2);
return p_div(t1, t2 PASS_REGS);
case op_idiv:
return p_div2(t1, t2);
return p_div2(t1, t2 PASS_REGS);
case op_and:
return p_and(t1, t2);
return p_and(t1, t2 PASS_REGS);
case op_or:
return p_or(t1, t2);
return p_or(t1, t2 PASS_REGS);
case op_sll:
return p_sll(t1, t2);
return p_sll(t1, t2 PASS_REGS);
case op_slr:
return p_slr(t1, t2);
return p_slr(t1, t2 PASS_REGS);
case op_mod:
return p_mod(t1, t2);
return p_mod(t1, t2 PASS_REGS);
case op_rem:
return p_rem(t1, t2);
return p_rem(t1, t2 PASS_REGS);
case op_fdiv:
return p_fdiv(t1, t2);
return p_fdiv(t1, t2 PASS_REGS);
case op_xor:
return p_xor(t1, t2);
return p_xor(t1, t2 PASS_REGS);
case op_atan2:
return p_atan2(t1, t2);
return p_atan2(t1, t2 PASS_REGS);
case op_power:
return p_exp(t1, t2);
return p_exp(t1, t2 PASS_REGS);
case op_power2:
return p_power(t1, t2);
return p_power(t1, t2 PASS_REGS);
case op_gcd:
return p_gcd(t1, t2);
return p_gcd(t1, t2 PASS_REGS);
case op_min:
return p_min(t1, t2);
case op_max:
return p_max(t1, t2);
case op_rdiv:
return p_rdiv(t1, t2);
return p_rdiv(t1, t2 PASS_REGS);
}
RERROR();
}
Term Yap_eval_binary(Int f, Term t1, Term t2)
{
return eval2(f,t1,t2);
CACHE_REGS
return eval2(f,t1,t2 PASS_REGS);
}
static InitBinEntry InitBinTab[] = {
@ -1051,132 +1142,131 @@ static InitBinEntry InitBinTab[] = {
{"rdiv", op_rdiv}
};
static Int
static Int
p_binary_is( USES_REGS1 )
{ /* X is Y */
Term t = Deref(ARG2);
Term t1, t2;
Term t1, t2, tout;
if (IsVarTerm(t)) {
Yap_ArithError(INSTANTIATION_ERROR,t, "X is Y");
Yap_ArithError(INSTANTIATION_ERROR,t, "VAR(X , Y)");
return(FALSE);
}
t1 = Yap_Eval(Deref(ARG3));
if (!Yap_FoundArithError(t1, ARG3)) {
return FALSE;
}
Yap_ClearExs();
t1 = Yap_Eval(Deref(ARG3));
t2 = Yap_Eval(Deref(ARG4));
if (!Yap_FoundArithError(t2, ARG4)) {
return FALSE;
}
if (IsIntTerm(t)) {
Term tout = Yap_FoundArithError(eval2(IntOfTerm(t), t1, t2), 0L);
if (!tout)
return FALSE;
Int i = IntOfTerm(t);
bool go;
do {
go = false;
tout = eval2(i, t1, t2 PASS_REGS);
go = Yap_CheckArithError();
} while (go);
return Yap_unify_constant(ARG1,tout);
}
if (IsAtomTerm(t)) {
Atom name = AtomOfTerm(t);
ExpEntry *p;
Term out;
bool go;
int j;
if (EndOfPAEntr(p = RepExpProp(Yap_GetExpProp(name, 2)))) {
Term ti[2];
/* error */
ti[0] = t;
ti[1] = MkIntTerm(1);
t = Yap_MkApplTerm(FunctorSlash, 2, ti);
Yap_Error(TYPE_ERROR_EVALUABLE, t,
"functor %s/%d for arithmetic expression",
RepAtom(name)->StrOfAE,2);
P = FAILCODE;
return(FALSE);
Yap_EvalError(TYPE_ERROR_EVALUABLE, t, "`%s ", name->StrOfAE
);
}
if (!(out=Yap_FoundArithError(eval2(p->FOfEE, t1, t2), 0L)))
return FALSE;
return Yap_unify_constant(ARG1,out);
j = p->FOfEE;
do {
go = false;
Yap_ClearExs();
tout = eval2(j, t1, t2 PASS_REGS);
go = Yap_CheckArithError();
} while (go);
return Yap_unify_constant(ARG1,tout);
}
return FALSE;
}
static Int
static Int
do_arith23(arith2_op op USES_REGS)
{ /* X is Y */
Term t = Deref(ARG1);
Int out;
Term t1, t2;
bool go;
Term t1, t2, out;
if (IsVarTerm(t)) {
Yap_ArithError(INSTANTIATION_ERROR,t, "X is Y");
Yap_EvalError(INSTANTIATION_ERROR,t, "X is Y");
return(FALSE);
}
t1 = Yap_Eval(t);
if (t1 == 0L)
return FALSE;
do {
go = false;
Yap_ClearExs();
t1 = Yap_Eval(t);
t2 = Yap_Eval(Deref(ARG2));
if (t2 == 0L)
return FALSE;
if (!(out=Yap_FoundArithError(eval2(op, t1, t2), 0L)))
return FALSE;
out= eval2(op, t1, t2 PASS_REGS);
go = Yap_CheckArithError();
} while (go);
return Yap_unify_constant(ARG3,out);
}
static Int
static Int
export_p_plus( USES_REGS1 )
{ /* X is Y */
return do_arith23(op_plus PASS_REGS);
}
static Int
static Int
export_p_minus( USES_REGS1 )
{ /* X is Y */
return do_arith23(op_minus PASS_REGS);
}
static Int
static Int
export_p_times( USES_REGS1 )
{ /* X is Y */
return do_arith23(op_times PASS_REGS);
}
static Int
static Int
export_p_div( USES_REGS1 )
{ /* X is Y */
return do_arith23(op_div PASS_REGS);
}
static Int
static Int
export_p_and( USES_REGS1 )
{ /* X is Y */
return do_arith23(op_and PASS_REGS);
}
static Int
static Int
export_p_or( USES_REGS1 )
{ /* X is Y */
return do_arith23(op_or PASS_REGS);
}
static Int
static Int
export_p_slr( USES_REGS1 )
{ /* X is Y */
return do_arith23(op_slr PASS_REGS);
}
static Int
static Int
export_p_sll( USES_REGS1 )
{ /* X is Y */
return do_arith23(op_sll PASS_REGS);
}
static Int
static Int
p_binary_op_as_integer( USES_REGS1 )
{ /* X is Y */
Term t = Deref(ARG1);
if (IsVarTerm(t)) {
Yap_Error(INSTANTIATION_ERROR,t, "X is Y");
Yap_EvalError(INSTANTIATION_ERROR,t, "X is Y");
return(FALSE);
}
if (IsIntTerm(t)) {
@ -1185,7 +1275,6 @@ p_binary_op_as_integer( USES_REGS1 )
if (IsAtomTerm(t)) {
Atom name = AtomOfTerm(t);
ExpEntry *p;
if (EndOfPAEntr(p = RepExpProp(Yap_GetExpProp(name, 2)))) {
return Yap_unify(ARG1,ARG2);
}
@ -1194,6 +1283,12 @@ p_binary_op_as_integer( USES_REGS1 )
return(FALSE);
}
Atom
Yap_NameOfBinaryOp(int i)
{
return Yap_LookupAtom(InitBinTab[i].OpName);
}
void
Yap_InitBinaryExps(void)
@ -1204,7 +1299,7 @@ Yap_InitBinaryExps(void)
for (i = 0; i < sizeof(InitBinTab)/sizeof(InitBinEntry); ++i) {
AtomEntry *ae = RepAtom(Yap_LookupAtom(InitBinTab[i].OpName));
if (ae == NULL) {
Yap_Error(OUT_OF_HEAP_ERROR,TermNil,"at InitBinaryExps");
Yap_EvalError(RESOURCE_ERROR_HEAP,TermNil,"at InitBinaryExps");
return;
}
WRITE_LOCK(ae->ARWLock);
@ -1238,4 +1333,3 @@ Yap_ReInitBinaryExps(void)
{
return(TRUE);
}

2570
C/arrays.c

File diff suppressed because it is too large Load Diff

2796
C/atomic.c Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

76
C/bb.c
View File

@ -18,6 +18,37 @@
static char SccsId[] = "%W% %G%";
#endif
/**
* @file bb.c
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP-2.lan>
* @date Mon Apr 30 09:32:54 2018
*
* @brief blackboard
*
* @namespace prolog
*
*/
/** @defgroup BlackBoard The Blackboard
@ingroup builtins
@{
YAP implements a blackboard in the style of the SICStus Prolog
blackboard. The blackboard uses the same underlying mechanism as the
internal data-base but has several important differences:
+ It is module aware, in contrast to the internal data-base.
+ Keys can only be atoms or integers, and not compound terms.
+ A single term can be stored per key.
+ An atomic update operation is provided; this is useful for
parallelism.
*/
#include "Yap.h"
#include "clause.h"
#ifndef NULL
@ -40,7 +71,7 @@ PutBBProp(AtomEntry *ae, Term mod USES_REGS) /* get BBentry for at; */
p = (BBProp)Yap_AllocAtomSpace(sizeof(*p));
if (p == NULL) {
WRITE_UNLOCK(ae->ARWLock);
Yap_Error(OUT_OF_HEAP_ERROR,ARG1,"could not allocate space in bb_put/2");
Yap_Error(RESOURCE_ERROR_HEAP,ARG1,"could not allocate space in bb_put/2");
return(NULL);
}
AddPropToAtom(ae, (PropEntry *)p);
@ -71,7 +102,7 @@ PutIntBBProp(Int key, Term mod USES_REGS) /* get BBentry for at; */
pp++;
}
} else {
Yap_Error(OUT_OF_HEAP_ERROR,ARG1,"could not allocate space in bb_put/2");
Yap_Error(RESOURCE_ERROR_HEAP,ARG1,"could not allocate space in bb_put/2");
return(NULL);
}
}
@ -88,7 +119,7 @@ PutIntBBProp(Int key, Term mod USES_REGS) /* get BBentry for at; */
p = (BBProp)Yap_AllocAtomSpace(sizeof(*p));
if (p == NULL) {
YAPLeaveCriticalSection();
Yap_Error(OUT_OF_HEAP_ERROR,ARG1,"could not allocate space in bb_put/2");
Yap_Error(RESOURCE_ERROR_HEAP,ARG1,"could not allocate space in bb_put/2");
return(NULL);
}
p->ModuleOfBB = mod;
@ -159,7 +190,7 @@ resize_bb_int_keys(UInt new_size) {
new = (Prop *)Yap_AllocCodeSpace(sizeof(Prop)*new_size);
if (new == NULL) {
YAPLeaveCriticalSection();
Yap_Error(OUT_OF_HEAP_ERROR,ARG1,"could not allocate space");
Yap_Error(RESOURCE_ERROR_HEAP,ARG1,"could not allocate space");
return(FALSE);
}
for (i = 0; i < new_size; i++) {
@ -263,6 +294,14 @@ BBPut(Term t0, Term t2)
}
}
/** @pred bb_put(+ _Key_,? _Term_)
Store term table _Term_ in the blackboard under key _Key_. If a
previous term was stored under key _Key_ it is simply forgotten.
*/
static Int
p_bb_put( USES_REGS1 )
{
@ -294,6 +333,14 @@ BBGet(Term t, UInt arity USES_REGS)
}
}
/** @pred bb_get(+ _Key_,? _Term_)
Unify _Term_ with a term stored in the blackboard under key
_Key_, or fail silently if no such term exists.
*/
static Int
p_bb_get( USES_REGS1 )
{
@ -313,6 +360,14 @@ p_bb_get( USES_REGS1 )
return Yap_unify(ARG2,out);
}
/** @pred bb_delete(+ _Key_,? _Term_)
Delete any term stored in the blackboard under key _Key_ and unify
it with _Term_. Fail silently if no such term exists.
*/
static Int
p_bb_delete( USES_REGS1 )
{
@ -333,6 +388,14 @@ p_bb_delete( USES_REGS1 )
return Yap_unify(ARG2,out);
}
/** @pred bb_update( +_Key_, ?_Term_, ?_New_)
Atomically unify a term stored in the blackboard under key _Key_
with _Term_, and if the unification succeeds replace it by
_New_. Fail silently if no such term exists or if unification fails.
*/
static Int
p_bb_update( USES_REGS1 )
{
@ -375,6 +438,9 @@ Yap_InitBBPreds(void)
Yap_InitCPred("bb_get", 2, p_bb_get, 0);
Yap_InitCPred("bb_delete", 2, p_bb_delete, 0);
Yap_InitCPred("bb_update", 3, p_bb_update, 0);
Yap_InitCPred("$resize_bb_int_keys", 1, p_resize_bb_int_keys, SafePredFlag|SyncPredFlag|HiddenPredFlag);
Yap_InitCPred("$resize_bb_int_keys", 1, p_resize_bb_int_keys, SafePredFlag|SyncPredFlag);
}
/**
@}
*/

View File

@ -1,22 +1,33 @@
/*************************************************************************
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* *
**************************************************************************
* *
* File: arith1.c *
* Last rev: *
* mods: *
* comments: bignum support through gmp *
* *
*************************************************************************/
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* *
**************************************************************************
* *
* File: arith1.c *
* Last rev: *
* mods: *
* comments: bignum support through gmp *
* *
*************************************************************************/
#ifdef SCCS
static char SccsId[] = "%W% %G%";
static char SccsId[] = "%W% %G%";
#endif
/**
* @file bignum.c
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP-2.lan>
* @date Mon Apr 30 09:34:59 2018
*
* @brief BigNums and More
* @namespace prolog
*
*
*
*/
#include "Yap.h"
#include "Yatom.h"
@ -26,284 +37,397 @@ static char SccsId[] = "%W% %G%";
#endif
#include "YapHeap.h"
#include "YapText.h"
#ifdef USE_GMP
#include "eval.h"
#include "YapEval.h"
#include "alloc.h"
Term
Yap_MkBigIntTerm(MP_INT *big)
{
Term Yap_MkBigIntTerm(MP_INT *big) {
CACHE_REGS
Int nlimbs;
MP_INT *dst = (MP_INT *)(H+2);
CELL *ret = H;
MP_INT *dst = (MP_INT *)(HR + 2);
CELL *ret = HR;
Int bytes;
if (mpz_fits_slong_p(big)) {
long int out = mpz_get_si(big);
return MkIntegerTerm((Int)out);
}
nlimbs = (big->_mp_alloc)*(sizeof(mp_limb_t)/CellSize);
if (nlimbs > (ASP-ret)-1024) {
// bytes = big->_mp_alloc * sizeof(mp_limb_t);
// nlimbs = ALIGN_YAPTYPE(bytes,CELL)/CellSize;
// this works, but it shouldn't need to do this...
nlimbs = big->_mp_alloc;
bytes = nlimbs * sizeof(CELL);
if (nlimbs > (ASP - ret) - 1024) {
return TermNil;
}
H[0] = (CELL)FunctorBigInt;
H[1] = BIG_INT;
HR[0] = (CELL)FunctorBigInt;
HR[1] = BIG_INT;
dst->_mp_size = big->_mp_size;
dst->_mp_alloc = big->_mp_alloc;
memmove((void *)(dst+1), (const void *)(big->_mp_d), nlimbs*CellSize);
H = (CELL *)(dst+1)+nlimbs;
H[0] = EndSpecials;
H++;
dst->_mp_alloc = nlimbs * (CellSize / sizeof(mp_limb_t));
memmove((void *)(dst + 1), (const void *)(big->_mp_d), bytes);
HR = (CELL *)(dst + 1) + nlimbs;
HR[0] = EndSpecials;
HR++;
return AbsAppl(ret);
}
MP_INT *Yap_BigIntOfTerm(Term t) {
MP_INT *new = (MP_INT *)(RepAppl(t) + 2);
MP_INT *
Yap_BigIntOfTerm(Term t)
{
MP_INT *new = (MP_INT *)(RepAppl(t)+2);
new->_mp_d = (mp_limb_t *)(new+1);
return(new);
new->_mp_d = (mp_limb_t *)(new + 1);
return (new);
}
Term
Yap_MkBigRatTerm(MP_RAT *big)
{
Term Yap_MkBigRatTerm(MP_RAT *big) {
CACHE_REGS
Int nlimbs;
MP_INT *dst = (MP_INT *)(H+2);
MP_INT *dst = (MP_INT *)(HR + 2);
MP_INT *num = mpq_numref(big);
MP_INT *den = mpq_denref(big);
MP_RAT *rat;
CELL *ret = H;
CELL *ret = HR;
if (mpz_cmp_si(den, 1) == 0)
return Yap_MkBigIntTerm(num);
if ((num->_mp_alloc+den->_mp_alloc)*(sizeof(mp_limb_t)/CellSize) > (ASP-ret)-1024) {
if ((num->_mp_alloc + den->_mp_alloc) * (sizeof(mp_limb_t) / CellSize) >
(ASP - ret) - 1024) {
return TermNil;
}
H[0] = (CELL)FunctorBigInt;
H[1] = BIG_RATIONAL;
HR[0] = (CELL)FunctorBigInt;
HR[1] = BIG_RATIONAL;
dst->_mp_size = 0;
rat = (MP_RAT *)(dst+1);
rat = (MP_RAT *)(dst + 1);
rat->_mp_num._mp_size = num->_mp_size;
rat->_mp_num._mp_alloc = num->_mp_alloc;
nlimbs = (num->_mp_alloc)*(sizeof(mp_limb_t)/CellSize);
memmove((void *)(rat+1), (const void *)(num->_mp_d), nlimbs*CellSize);
nlimbs = (num->_mp_alloc) * (sizeof(mp_limb_t) / CellSize);
memmove((void *)(rat + 1), (const void *)(num->_mp_d), nlimbs * CellSize);
rat->_mp_den._mp_size = den->_mp_size;
rat->_mp_den._mp_alloc = den->_mp_alloc;
H = (CELL *)(rat+1)+nlimbs;
nlimbs = (den->_mp_alloc)*(sizeof(mp_limb_t)/CellSize);
memmove((void *)(H), (const void *)(den->_mp_d), nlimbs*CellSize);
H += nlimbs;
dst->_mp_alloc = (H-(CELL *)(dst+1));
H[0] = EndSpecials;
H++;
HR = (CELL *)(rat + 1) + nlimbs;
nlimbs = (den->_mp_alloc) * (sizeof(mp_limb_t) / CellSize);
memmove((void *)(HR), (const void *)(den->_mp_d), nlimbs * CellSize);
HR += nlimbs;
dst->_mp_alloc = (HR - (CELL *)(dst + 1));
HR[0] = EndSpecials;
HR++;
return AbsAppl(ret);
}
MP_RAT *
Yap_BigRatOfTerm(Term t)
{
MP_RAT *new = (MP_RAT *)(RepAppl(t)+2+sizeof(MP_INT)/sizeof(CELL));
MP_RAT *Yap_BigRatOfTerm(Term t) {
MP_RAT *new = (MP_RAT *)(RepAppl(t) + 2 + sizeof(MP_INT) / sizeof(CELL));
mp_limb_t *nt;
nt = new->_mp_num._mp_d = (mp_limb_t *)(new+1);
nt = new->_mp_num._mp_d = (mp_limb_t *)(new + 1);
nt += new->_mp_num._mp_alloc;
new->_mp_den._mp_d = nt;
return new;
}
Term
Yap_RatTermToApplTerm(Term t)
{
Term Yap_RatTermToApplTerm(Term t) {
Term ts[2];
MP_RAT *rat = Yap_BigRatOfTerm(t);
ts[0] = Yap_MkBigIntTerm(mpq_numref(rat));
ts[1] = Yap_MkBigIntTerm(mpq_denref(rat));
return Yap_MkApplTerm(FunctorRDiv,2,ts);
ts[0] = Yap_MkBigIntTerm(mpq_numref(rat));
ts[1] = Yap_MkBigIntTerm(mpq_denref(rat));
return Yap_MkApplTerm(FunctorRDiv, 2, ts);
}
#endif
Term
Yap_AllocExternalDataInStack(CELL tag, size_t bytes)
{
Term Yap_AllocExternalDataInStack(CELL tag, size_t bytes, void *pt) {
CACHE_REGS
Int nlimbs;
MP_INT *dst = (MP_INT *)(H+2);
CELL *ret = H;
nlimbs = ALIGN_YAPTYPE(bytes,CELL)/CellSize;
if (nlimbs > (ASP-ret)-1024) {
MP_INT *dst = (MP_INT *)(HR + 2);
CELL *ret = HR;
CELL **blobp;
nlimbs = ALIGN_BY_TYPE(bytes, CELL) / CellSize;
if (nlimbs > (ASP - ret) - 1024) {
return TermNil;
}
H[0] = (CELL)FunctorBigInt;
H[1] = tag;
HR[0] = (CELL)FunctorBigInt;
HR[1] = tag;
dst->_mp_size = 0;
dst->_mp_alloc = nlimbs;
H = (CELL *)(dst+1)+nlimbs;
H[0] = EndSpecials;
H++;
if (tag != EXTERNAL_BLOB) {
TrailTerm(TR) = AbsPair(ret);
TR++;
}
HR = (CELL *)(dst + 1) + nlimbs;
HR[0] = EndSpecials;
HR++;
blobp = (CELL **)pt;
*blobp = (CELL *)(dst + 1);
return AbsAppl(ret);
}
int Yap_CleanOpaqueVariable(CELL *pt)
{
int Yap_CleanOpaqueVariable(CELL d) {
CELL blob_info, blob_tag;
MP_INT *blobp;
CELL *pt = RepAppl(HeadOfTerm(d));
#ifdef DEBUG
/* sanity checking */
if (pt[0] != (CELL)FunctorBigInt) {
Yap_Error(SYSTEM_ERROR, TermNil, "CleanOpaqueVariable bad call");
Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil, "CleanOpaqueVariable bad call");
return FALSE;
}
#endif
blob_tag = pt[1];
if (blob_tag < USER_BLOB_START ||
blob_tag >= USER_BLOB_END) {
Yap_Error(SYSTEM_ERROR, AbsAppl(pt), "clean opaque: bad blob with tag " UInt_FORMAT ,blob_tag);
if (blob_tag < USER_BLOB_START || blob_tag >= USER_BLOB_END) {
Yap_Error(SYSTEM_ERROR_INTERNAL, AbsAppl(pt),
"clean opaque: bad blob with tag " UInt_FORMAT, blob_tag);
return FALSE;
}
blob_info = blob_tag - USER_BLOB_START;
blob_info = blob_tag;
if (!GLOBAL_OpaqueHandlers)
return FALSE;
blobp = (MP_INT *)(pt+2);
return false;
if (!GLOBAL_OpaqueHandlers[blob_info].fail_handler)
return TRUE;
return (GLOBAL_OpaqueHandlers[blob_info].fail_handler)((void *)(blobp+1));
return true;
return (GLOBAL_OpaqueHandlers[blob_info].fail_handler)(d);
}
Opaque_CallOnWrite
Yap_blob_write_handler_from_slot(Int slot)
{
CACHE_REGS
YAP_Opaque_CallOnWrite Yap_blob_write_handler(Term t) {
CELL blob_info, blob_tag;
MP_INT *blobp;
Term t = Yap_GetFromSlot(slot PASS_REGS);
CELL *pt = RepAppl(t);
#ifdef DEBUG
/* sanity checking */
if (pt[0] != (CELL)FunctorBigInt) {
Yap_Error(SYSTEM_ERROR, TermNil, "CleanOpaqueVariable bad call");
Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil, "CleanOpaqueVariable bad call");
return FALSE;
}
#endif
blob_tag = pt[1];
if (blob_tag < USER_BLOB_START ||
blob_tag >= USER_BLOB_END) {
Yap_Error(SYSTEM_ERROR, AbsAppl(pt), "clean opaque: bad blob with tag " UInt_FORMAT ,blob_tag);
if (blob_tag < USER_BLOB_START || blob_tag >= USER_BLOB_END) {
Yap_Error(SYSTEM_ERROR_INTERNAL, AbsAppl(pt),
"clean opaque: bad blob with tag " UInt_FORMAT, blob_tag);
return FALSE;
}
blob_info = blob_tag - USER_BLOB_START;
if (!GLOBAL_OpaqueHandlers)
blob_info = blob_tag;
if (!GLOBAL_OpaqueHandlers) {
return NULL;
blobp = (MP_INT *)(pt+2);
}
return GLOBAL_OpaqueHandlers[blob_info].write_handler;
}
extern Int Yap_blob_tag_from_slot(Int slot)
{
CACHE_REGS
Term t = Yap_GetFromSlot(slot PASS_REGS);
YAP_Opaque_CallOnGCMark Yap_blob_gc_mark_handler(Term t) {
CELL blob_info, blob_tag;
CELL *pt = RepAppl(t);
#ifdef DEBUG
/* sanity checking */
if (pt[0] != (CELL)FunctorBigInt) {
Yap_Error(SYSTEM_ERROR, TermNil, "CleanOpaqueVariable bad call");
Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil, "CleanOpaqueVariable bad call");
return FALSE;
}
#endif
blob_tag = pt[1];
if (blob_tag < USER_BLOB_START || blob_tag >= USER_BLOB_END) {
return NULL;
}
blob_info = blob_tag;
if (!GLOBAL_OpaqueHandlers)
return NULL;
return GLOBAL_OpaqueHandlers[blob_info].mark_handler;
}
YAP_Opaque_CallOnGCRelocate Yap_blob_gc_relocate_handler(Term t) {
CELL blob_info, blob_tag;
CELL *pt = RepAppl(t);
#ifdef DEBUG
/* sanity checking */
if (pt[0] != (CELL)FunctorBigInt) {
Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil, "CleanOpaqueVariable bad call");
return FALSE;
}
#endif
blob_tag = pt[1];
if (blob_tag < USER_BLOB_START || blob_tag >= USER_BLOB_END) {
Yap_Error(SYSTEM_ERROR_INTERNAL, AbsAppl(pt),
"clean opaque: bad blob with tag " UInt_FORMAT, blob_tag);
return FALSE;
}
blob_info = blob_tag;
if (!GLOBAL_OpaqueHandlers)
return NULL;
return GLOBAL_OpaqueHandlers[blob_info].relocate_handler;
}
extern Int Yap_blob_tag(Term t) {
CELL *pt = RepAppl(t);
#ifdef DEBUG
/* sanity checking */
if (pt[0] != (CELL)FunctorBigInt) {
Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil, "CleanOpaqueVariable bad call");
return FALSE;
}
#endif
return pt[1];
}
void *
Yap_blob_info_from_slot(Int slot)
{
CACHE_REGS
CELL blob_info, blob_tag;
void *Yap_blob_info(Term t) {
MP_INT *blobp;
Term t = Yap_GetFromSlot(slot PASS_REGS);
CELL *pt = RepAppl(t);
#ifdef DEBUG
/* sanity checking */
if (pt[0] != (CELL)FunctorBigInt) {
Yap_Error(SYSTEM_ERROR, TermNil, "CleanOpaqueVariable bad call");
Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil, "CleanOpaqueVariable bad call");
return FALSE;
}
#endif
blob_tag = pt[1];
if (blob_tag < USER_BLOB_START ||
blob_tag >= USER_BLOB_END) {
Yap_Error(SYSTEM_ERROR, AbsAppl(pt), "clean opaque: bad blob with tag " UInt_FORMAT ,blob_tag);
return FALSE;
}
blob_info = blob_tag - USER_BLOB_START;
if (!GLOBAL_OpaqueHandlers)
return FALSE;
blobp = (MP_INT *)(pt+2);
return (void *)(blobp+1);
blobp = (MP_INT *)(pt + 2);
return (void *)(blobp + 1);
}
Term
Yap_MkULLIntTerm(YAP_ULONG_LONG n)
{
Term Yap_MkULLIntTerm(YAP_ULONG_LONG n) {
#if __GNUC__ && USE_GMP
mpz_t new;
char tmp[256];
Term t;
mpz_t new;
char tmp[256];
Term t;
#ifdef _WIN32
snprintf(tmp,256,"%I64u",n);
snprintf(tmp, 256, "%I64u", n);
#elif HAVE_SNPRINTF
snprintf(tmp,256,"%llu",n);
#else
sprintf(tmp,"%llu",n);
#endif
/* try to scan it as a bignum */
mpz_init_set_str (new, tmp, 10);
if (mpz_fits_slong_p(new)) {
return MkIntegerTerm(mpz_get_si(new));
}
t = Yap_MkBigIntTerm(new);
mpz_clear(new);
return t;
snprintf(tmp, 256, "%llu", n);
#else
return MkIntegerTerm(n);
sprintf(tmp, "%llu", n);
#endif
/* try to scan it as a bignum */
mpz_init_set_str(new, tmp, 10);
if (mpz_fits_slong_p(new)) {
CACHE_REGS
return MkIntegerTerm(mpz_get_si(new));
}
t = Yap_MkBigIntTerm(new);
mpz_clear(new);
return t;
#else
CACHE_REGS
return MkIntegerTerm(n);
#endif
}
static Int
p_is_bignum( USES_REGS1 )
{
CELL *Yap_HeapStoreOpaqueTerm(Term t) {
CELL *ptr = RepAppl(t);
size_t sz;
void *new;
if (ptr[0] == (CELL)FunctorBigInt) {
sz = sizeof(MP_INT) + 2 * CellSize +
((MP_INT *)(ptr + 2))->_mp_alloc * sizeof(mp_limb_t);
} else { /* string */
sz = sizeof(CELL) * (2 + ptr[1]);
}
new = Yap_AllocCodeSpace(sz);
if (!new) {
Yap_Error(RESOURCE_ERROR_HEAP, TermNil,
"subgoal_search_loop: no space for %s", StringOfTerm(t));
} else {
if (ptr[0] == (CELL)FunctorBigInt) {
MP_INT *new = (MP_INT *)(RepAppl(t) + 2);
new->_mp_d = (mp_limb_t *)(new + 1);
}
memmove(new, ptr, sz);
}
return new;
}
size_t Yap_OpaqueTermToString(Term t, char *str, size_t max) {
size_t str_index = 0;
CELL *li = RepAppl(t);
unsigned char *ptr = (unsigned char *)StringOfTerm(AbsAppl(li));
if (li[0] == (CELL)FunctorString) {
str_index += sprintf(&str[str_index], "\"");
do {
utf8proc_int32_t chr;
ptr += get_utf8(ptr, -1, &chr);
if (chr == '\0')
break;
str_index += sprintf(str + str_index, "%C", chr);
} while (TRUE);
str_index += sprintf(str + str_index, "\"");
} else {
CELL big_tag = li[1];
if (big_tag == ARRAY_INT || big_tag == ARRAY_FLOAT) {
str_index += sprintf(&str[str_index], "{...}");
#ifdef USE_GMP
} else if (big_tag == BIG_INT) {
MP_INT *big = Yap_BigIntOfTerm(AbsAppl(li));
char *s = mpz_get_str(&str[str_index], 10, big);
str_index += strlen(&s[str_index]);
} else if (big_tag == BIG_RATIONAL) {
MP_RAT *big = Yap_BigRatOfTerm(AbsAppl(li));
char *s = mpq_get_str(&str[str_index], 10, big);
str_index += strlen(&s[str_index]);
#endif
}
/*
else if (big_tag >= USER_BLOB_START && big_tag < USER_BLOB_END) {
Opaque_CallOnWrite f;
CELL blob_info;
blob_info = big_tag - USER_BLOB_START;
if (GLOBAL_OpaqueHandlers &&
(f= GLOBAL_OpaqueHandlers[blob_info].write_handler)) {
(f)(wglb->stream, big_tag, ExternalBlobFromTerm(t), 0);
return;
}
} */
str_index += sprintf(&str[str_index], "0");
}
return str_index;
}
static Int p_is_bignum(USES_REGS1) {
#ifdef USE_GMP
Term t = Deref(ARG1);
return(
IsNonVarTerm(t) &&
IsApplTerm(t) &&
FunctorOfTerm(t) == FunctorBigInt &&
RepAppl(t)[1] == BIG_INT
);
return (IsNonVarTerm(t) && IsApplTerm(t) &&
FunctorOfTerm(t) == FunctorBigInt && RepAppl(t)[1] == BIG_INT);
#else
return FALSE;
#endif
}
static Int
p_has_bignums( USES_REGS1 )
{
static Int p_is_string(USES_REGS1) {
Term t = Deref(ARG1);
return (IsNonVarTerm(t) && IsApplTerm(t) &&
FunctorOfTerm(t) == FunctorString);
}
static Int p_nb_set_bit(USES_REGS1) {
#ifdef USE_GMP
Term t = Deref(ARG1);
Term ti = Deref(ARG2);
Int i;
if (!(IsNonVarTerm(t) && IsApplTerm(t) && FunctorOfTerm(t) == FunctorBigInt &&
RepAppl(t)[1] == BIG_INT))
return FALSE;
if (!IsIntegerTerm(ti)) {
return FALSE;
}
if (!IsIntegerTerm(ti)) {
return FALSE;
}
i = IntegerOfTerm(ti);
if (i < 0) {
return FALSE;
}
Yap_gmp_set_bit(i, t);
return TRUE;
#else
return FALSE;
#endif
}
static Int p_has_bignums(USES_REGS1) {
#ifdef USE_GMP
return TRUE;
#else
@ -311,9 +435,27 @@ p_has_bignums( USES_REGS1 )
#endif
}
static Int
p_is_rational( USES_REGS1 )
{
static Int p_is_opaque(USES_REGS1) {
Term t = Deref(ARG1);
if (IsVarTerm(t))
return FALSE;
if (IsApplTerm(t)) {
Functor f = FunctorOfTerm(t);
CELL *pt;
if (f != FunctorBigInt)
return FALSE;
pt = RepAppl(t);
return (pt[1] != BIG_RATIONAL || pt[1] != BIG_INT);
}
return FALSE;
}
/** @pred rational( ?:T )
Checks whether _T_ is a rational number.
*/
static Int p_is_rational(USES_REGS1) {
Term t = Deref(ARG1);
if (IsVarTerm(t))
return FALSE;
@ -328,14 +470,12 @@ p_is_rational( USES_REGS1 )
if (f != FunctorBigInt)
return FALSE;
pt = RepAppl(t);
return ( pt[1] == BIG_RATIONAL || pt[1] == BIG_INT );
return (pt[1] == BIG_RATIONAL || pt[1] == BIG_INT);
}
return FALSE;
}
static Int
p_rational( USES_REGS1 )
{
static Int p_rational(USES_REGS1) {
#ifdef USE_GMP
Term t = Deref(ARG1);
Functor f;
@ -355,164 +495,26 @@ p_rational( USES_REGS1 )
return FALSE;
rat = Yap_BigRatOfTerm(t);
while ((t1 = Yap_MkBigIntTerm(mpq_numref(rat))) == TermNil ||
(t2 = Yap_MkBigIntTerm(mpq_denref(rat))) == TermNil) {
UInt size =
(mpq_numref(rat)->_mp_alloc)*(sizeof(mp_limb_t)/CellSize) +
(mpq_denref(rat)->_mp_alloc)*(sizeof(mp_limb_t)/CellSize);
(t2 = Yap_MkBigIntTerm(mpq_denref(rat))) == TermNil) {
UInt size = (mpq_numref(rat)->_mp_alloc) * (sizeof(mp_limb_t) / CellSize) +
(mpq_denref(rat)->_mp_alloc) * (sizeof(mp_limb_t) / CellSize);
if (!Yap_gcl(size, 3, ENV, P)) {
Yap_Error(OUT_OF_STACK_ERROR, t, LOCAL_ErrorMessage);
Yap_Error(RESOURCE_ERROR_STACK, t, LOCAL_ErrorMessage);
return FALSE;
}
}
return
Yap_unify(ARG2, t1) &&
Yap_unify(ARG3, t2);
return Yap_unify(ARG2, t1) && Yap_unify(ARG3, t2);
#else
return FALSE;
#endif
}
int
Yap_IsStringTerm(Term t)
{
CELL fl;
if (IsVarTerm(t))
return FALSE;
if (!IsApplTerm(t))
return FALSE;
if (FunctorOfTerm(t) != FunctorBigInt)
return FALSE;
fl = RepAppl(t)[1];
return fl == BLOB_STRING || fl == BLOB_WIDE_STRING;
}
int
Yap_IsWideStringTerm(Term t)
{
CELL fl;
if (IsVarTerm(t))
return FALSE;
if (!IsApplTerm(t))
return FALSE;
if (FunctorOfTerm(t) != FunctorBigInt)
return FALSE;
fl = RepAppl(t)[1];
return fl == BLOB_WIDE_STRING;
}
Term
Yap_MkBlobStringTerm(const char *s, size_t len)
{
CACHE_REGS
CELL *ret = H;
size_t sz;
MP_INT *dst = (MP_INT *)(H+2);
blob_string_t *sp;
size_t siz;
char *dest;
sz = strlen(s);
if (len > 0 && sz > len) sz = len;
if (len/sizeof(CELL) > (ASP-ret)-1024) {
return TermNil;
}
H[0] = (CELL)FunctorBigInt;
H[1] = BLOB_STRING;
siz = ALIGN_YAPTYPE((len+1+sizeof(blob_string_t)),CELL);
dst->_mp_size = 0L;
dst->_mp_alloc = siz/sizeof(mp_limb_t);
sp = (blob_string_t *)(dst+1);
sp->len = sz;
dest = (char *)(sp+1);
strncpy(dest, s, sz);
dest[sz] = '\0';
H += (siz + 2*sizeof(CELL)+sizeof(MP_INT)+sizeof(Functor))/sizeof(CELL);
H[-1] = EndSpecials;
return AbsAppl(ret);
}
Term
Yap_MkBlobWideStringTerm(const wchar_t *s, size_t len)
{
CACHE_REGS
CELL *ret = H;
size_t sz;
MP_INT *dst = (MP_INT *)(H+2);
blob_string_t *sp = (blob_string_t *)(dst+1);
size_t siz, i = 0;
H[0] = (CELL)FunctorBigInt;
dst->_mp_size = 0L;
sz = wcslen(s);
if (len > 0 && sz > len) {
sz = len;
}
if ((len/sizeof(CELL)) > (ASP-ret)-1024) {
return TermNil;
}
while (i < sz) {
if (s[i++] >= 255) break;
}
if (i == sz) {
/* we have a standard ascii string */
char *target;
size_t i = 0;
H[1] = BLOB_STRING;
siz = ALIGN_YAPTYPE((sz+1+sizeof(blob_string_t)),CELL);
dst->_mp_alloc = siz/sizeof(mp_limb_t);
sp->len = sz;
target = (char *)(sp+1);
for (i = 0 ; i < sz; i++) {
target[i] = s[i];
}
target[sz] = '\0';
H += (siz+2*sizeof(CELL)+sizeof(MP_INT)+sizeof(Functor))/sizeof(CELL);
} else {
wchar_t * target;
H[1] = BLOB_WIDE_STRING;
siz = ALIGN_YAPTYPE((sz+1)*sizeof(wchar_t)+sizeof(blob_string_t),CELL);
dst->_mp_alloc = siz/sizeof(mp_limb_t);
sp->len = sz;
target = (wchar_t *)(sp+1);
wcsncpy(target, s, sz);
target[sz] = '\0';
H += (siz + 2*sizeof(CELL)+sizeof(MP_INT)+sizeof(Functor))/sizeof(CELL);
}
H[-1] = EndSpecials;
return AbsAppl(ret);
}
char *
Yap_BlobStringOfTerm(Term t)
{
blob_string_t *new = (blob_string_t *)(RepAppl(t)+2+sizeof(MP_INT)/sizeof(CELL));
return (char *)(new+1);
}
wchar_t *
Yap_BlobWideStringOfTerm(Term t)
{
blob_string_t *new = (blob_string_t *)(RepAppl(t)+2+sizeof(MP_INT)/sizeof(CELL));
return (wchar_t *)(new+1);
}
char *
Yap_BlobStringOfTermAndLength(Term t, size_t *sp)
{
blob_string_t *new = (blob_string_t *)(RepAppl(t)+2+sizeof(MP_INT)/sizeof(CELL));
*sp = new->len;
return (char *)(new+1);
}
void
Yap_InitBigNums(void)
{
Yap_InitCPred("$has_bignums", 0, p_has_bignums, SafePredFlag|HiddenPredFlag);
Yap_InitCPred("$bignum", 1, p_is_bignum, SafePredFlag|HiddenPredFlag);
void Yap_InitBigNums(void) {
Yap_InitCPred("$has_bignums", 0, p_has_bignums, SafePredFlag);
Yap_InitCPred("$bignum", 1, p_is_bignum, SafePredFlag);
Yap_InitCPred("rational", 3, p_rational, 0);
Yap_InitCPred("rational", 1, p_is_rational, SafePredFlag);
Yap_InitCPred("string", 1, p_is_string, SafePredFlag);
Yap_InitCPred("opaque", 1, p_is_opaque, SafePredFlag);
Yap_InitCPred("nb_set_bit", 2, p_nb_set_bit, SafePredFlag);
}

247
C/blobs.c Normal file
View File

@ -0,0 +1,247 @@
//
// blobs.c
// yap
//
// Created by VITOR SANTOS COSTA on 09/05/15.
// Copyright (c) 2015 VITOR SANTOS COSTA. All rights reserved.
//
#include <stdio.h>
#include <string.h>
#include "Yap.h"
#include "Yatom.h"
#include "iopreds.h"
#include "yapio.h"
/* for freeBSD9.1 */
#define _WITH_DPRINTF
#include "YapBlobs.h"
static blob_type_t unregistered_blob_atom = {
YAP_BLOB_MAGIC_B, PL_BLOB_NOCOPY | PL_BLOB_TEXT, "unregistered"};
char *Yap_blob_to_string(AtomEntry *ref, const char *s0, size_t sz) {
// int rc;
char *s = (char *)s0;
#if HAVE_FMEMOPEN
blob_type_t *type = RepBlobProp(ref->PropsOfAE)->blob_type;
if (type->write) {
FILE *f = fmemopen(s, sz, "w");
if (f == NULL) {
// could not find stream;
return NULL;
}
Atom at = AbsAtom(ref);
int rc = type->write(f, at, 0);
if (rc < 0) {
Yap_Error(EVALUATION_ERROR_UNDEFINED, MkAtomTerm(at),
"failure in user-defined blob to string code");
}
fclose(f); // return the final result.
return s;
} else {
#endif
#if __APPLE__
size_t sz0 = strlcpy(s, (char *)RepAtom(AtomSWIStream)->StrOfAE, sz);
#else
size_t sz0;
char *f = (char *)memmove(s, (char *)RepAtom(AtomSWIStream)->StrOfAE, sz);
f[0] = '\0';
sz0 = f - s;
#endif
s = s + sz0;
sz -= sz0;
#if defined(__linux__) || defined(__APPLE__)
snprintf(s + strlen(s), sz0, "(%p)", ref);
#else
snprintf(s + strlen(s), sz0, "(0x%p)", ref);
#endif
return s;
#if HAVE_FMEMOPEN
}
return NULL;
#endif
}
int Yap_write_blob(AtomEntry *ref, FILE *stream) {
blob_type_t *type = RepBlobProp(ref->PropsOfAE)->blob_type;
if (type->write) {
Atom at = AbsAtom(ref);
return type->write(stream, at, 0);
} else {
#if defined(__linux__) || defined(__APPLE__)
return fprintf(stream, "\'%s\'(%p)", RepAtom(AtomSWIStream)->StrOfAE, ref);
#else
return fprintf(stream, "\'%s\'(0x%p)", RepAtom(AtomSWIStream)->StrOfAE,
ref);
#endif
}
return 0;
}
bool YAP_is_blob(Term t, blob_type_t **type) {
CACHE_REGS
Term yt = Yap_GetFromSlot(t);
Atom a;
YAP_BlobPropEntry *b;
if (IsVarTerm(yt))
return FALSE;
if (!IsAtomTerm(yt))
return FALSE;
a = AtomOfTerm(yt);
if (!IsBlob(a))
return FALSE;
b = RepBlobProp(a->PropsOfAE);
*type = b->blob_type;
return TRUE;
}
/* void check_chain(void); */
/* void check_chain(void) { */
/* AtomEntry *ae, *old; */
/* ae = Blobs; */
/* old = NULL; */
/* while (ae) { */
/* old = ae; */
/* ae = RepAtom(ae->NextOfAE); */
/* } */
/* } */
AtomEntry *Yap_lookupBlob(void *blob, size_t len, void *type0, int *new) {
YAP_BlobPropEntry *b;
AtomEntry *ae;
blob_type_t *type = type0;
if (new)
*new = FALSE;
LOCK(Blobs_Lock);
if (type->flags & PL_BLOB_UNIQUE) {
/* just keep a linked chain for now */
ae = Blobs;
while (ae) {
if (ae->PropsOfAE && RepBlobProp(ae->PropsOfAE)->blob_type == type &&
ae->rep.blob->length == len &&
!memcmp(ae->rep.blob->data, blob, len)) {
UNLOCK(Blobs_Lock);
return ae;
}
ae = RepAtom(ae->NextOfAE);
}
}
if (new)
*new = TRUE;
b = (YAP_BlobPropEntry *)Yap_AllocCodeSpace(sizeof(YAP_BlobPropEntry));
if (!b) {
UNLOCK(Blobs_Lock);
return NULL;
}
b->NextOfPE = NIL;
b->KindOfPE = BlobProperty;
b->blob_type = type;
ae =
(AtomEntry *)Yap_AllocCodeSpace(sizeof(AtomEntry) + len + sizeof(size_t));
if (!ae) {
UNLOCK(Blobs_Lock);
return NULL;
}
NOfBlobs++;
INIT_RWLOCK(ae->ARWLock);
ae->PropsOfAE = AbsBlobProp(b);
ae->NextOfAE = AbsAtom(Blobs);
ae->rep.blob->length = len;
memmove(ae->rep.blob->data, blob, len);
Blobs = ae;
if (NOfBlobs > NOfBlobsMax) {
Yap_signal(YAP_CDOVF_SIGNAL);
}
UNLOCK(Blobs_Lock);
return ae;
}
bool YAP_unify_blob(Term *t, void *blob, size_t len, blob_type_t *type) {
AtomEntry *ae;
if (!blob)
return FALSE;
ae = Yap_lookupBlob(blob, len, type, NULL);
if (!ae) {
return FALSE;
}
if (type->acquire) {
type->acquire(AbsAtom(ae));
}
*t = MkAtomTerm(AbsAtom(ae));
return true;
}
bool YAP_get_blob(Term t, void **blob, size_t *len, blob_type_t **type) {
CACHE_REGS
Atom a;
Term tt;
AtomEntry *ae;
tt = Yap_GetFromSlot(t);
if (IsVarTerm(tt))
return FALSE;
if (!IsAtomTerm(tt))
return FALSE;
a = AtomOfTerm(tt);
if (!IsBlob(a))
return FALSE;
ae = RepAtom(a);
if (type)
*type = RepBlobProp(ae->PropsOfAE)->blob_type;
if (len)
*len = ae->rep.blob[0].length;
if (blob)
*blob = ae->rep.blob[0].data;
return TRUE;
}
void *YAP_blob_data(YAP_Atom at, size_t *len, blob_type_t **type) {
Atom x = at;
if (!IsBlob(x)) {
if (len)
*len = strlen_utf8(x->UStrOfAE);
if (type)
*type = &unregistered_blob_atom;
return x->StrOfAE;
}
if (len)
*len = x->rep.blob[0].length;
if (type)
*type = RepBlobProp(x->PropsOfAE)->blob_type;
return x->rep.blob[0].data;
}
void YAP_register_blob_type(blob_type_t *type) {
type->next = (void *)BlobTypes;
BlobTypes = (void *)type;
}
blob_type_t *YAP_find_blob_type(const char *name) {
AtomEntry *a = RepAtom(Yap_LookupAtom(name));
if (!IsBlob(a)) {
return &unregistered_blob_atom;
}
return RepBlobProp(a->PropsOfAE)->blob_type;
}
bool YAP_unregister_blob_type(blob_type_t *type) {
fprintf(stderr, "YAP_unregister_blob_type not implemented yet\n");
return FALSE;
}
void Yap_install_blobs(void) {}
/**
* @}
*/

4604
C/c_interface.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

7054
C/cdmgr.c

File diff suppressed because it is too large Load Diff

View File

@ -3,94 +3,89 @@
#include "tracer.h"
#ifdef YAPOR
#include "or.macros.h"
#endif /* YAPOR */
#endif /* YAPOR */
#include "clause_list.h"
/* need to fix overflow handling */
static void
mk_blob(int sz USES_REGS)
{
static void mk_blob(int sz USES_REGS) {
MP_INT *dst;
H[0] = (CELL)FunctorBigInt;
H[1] = CLAUSE_LIST;
dst = (MP_INT *)(H+2);
HR[0] = (CELL)FunctorBigInt;
HR[1] = CLAUSE_LIST;
dst = (MP_INT *)(HR + 2);
dst->_mp_size = 0L;
dst->_mp_alloc = sz;
H += (1+sizeof(MP_INT)/sizeof(CELL));
H[sz] = EndSpecials;
H += sz+1;
HR += (1 + sizeof(MP_INT) / sizeof(CELL));
HR[sz] = EndSpecials;
HR += sz + 1;
}
static CELL *
extend_blob(CELL *start, int sz USES_REGS)
{
static CELL *extend_blob(CELL *start, int sz USES_REGS) {
UInt osize;
MP_INT *dst;
if (H + sz > ASP)
if (HR + sz > ASP)
return NULL;
dst = (MP_INT *)(start+2);
dst = (MP_INT *)(start + 2);
osize = dst->_mp_alloc;
start += (1+sizeof(MP_INT)/sizeof(CELL));
start[sz+osize] = EndSpecials;
start += (1 + sizeof(MP_INT) / sizeof(CELL));
start[sz + osize] = EndSpecials;
dst->_mp_alloc += sz;
H += sz;
return start+osize;
HR += sz;
return start + osize;
}
/*init of ClasuseList*/
X_API clause_list_t
Yap_ClauseListInit(clause_list_t in)
{
CACHE_REGS
in->n = 0;
in->start = H;
clause_list_t Yap_ClauseListInit(clause_list_t in) {
CACHE_REGS in->n = 0;
in->start = HR;
mk_blob(0 PASS_REGS);
in->end = H;
in->end = HR;
return in;
}
/*add clause to ClauseList
returns FALSE on error*/
X_API int
Yap_ClauseListExtend(clause_list_t cl, void * clause, void *pred)
{
int Yap_ClauseListExtend(clause_list_t cl, void *clause, void *pred) {
CACHE_REGS
PredEntry *ap = (PredEntry *)pred;
/* fprintf(stderr,"cl=%p\n",clause); */
if (cl->end != H)
if (cl->end != HR)
return FALSE;
if (cl->n == 0) {
void **ptr;
if (!(ptr = (void **)extend_blob(cl->start,1 PASS_REGS))) return FALSE;
if (!(ptr = (void **)extend_blob(cl->start, 1 PASS_REGS)))
return FALSE;
ptr[0] = clause;
} else if (cl->n == 1) {
} else if (cl->n == 1) {
yamop **ptr;
yamop *code_p, *fclause;
if (!(ptr = (yamop **)extend_blob(cl->start,2*(CELL)NEXTOP((yamop *)NULL,Otapl)/sizeof(CELL)-1 PASS_REGS))) return FALSE;
if (!(ptr = (yamop **)extend_blob(
cl->start, 2 * (CELL)NEXTOP((yamop *)NULL, Otapl) / sizeof(CELL) -
1 PASS_REGS)))
return FALSE;
fclause = ptr[-1];
code_p = (yamop *)(ptr-1);
code_p = (yamop *)(ptr - 1);
code_p->opc = Yap_opcode(_try_clause);
code_p->u.Otapl.d = fclause;
code_p->u.Otapl.s = ap->ArityOfPE;
code_p->u.Otapl.p = ap;
code_p->y_u.Otapl.d = fclause;
code_p->y_u.Otapl.s = ap->ArityOfPE;
code_p->y_u.Otapl.p = ap;
#ifdef TABLING
code_p->u.Otapl.te = ap->TableOfPred;
code_p->y_u.Otapl.te = ap->TableOfPred;
#endif
#ifdef YAPOR
INIT_YAMOP_LTT(code_p, 0);
#endif /* YAPOR */
code_p = NEXTOP(code_p,Otapl);
code_p = NEXTOP(code_p, Otapl);
code_p->opc = Yap_opcode(_trust);
code_p->u.Otapl.d = clause;
code_p->u.Otapl.s = ap->ArityOfPE;
code_p->u.Otapl.p = ap;
code_p->y_u.Otapl.d = clause;
code_p->y_u.Otapl.s = ap->ArityOfPE;
code_p->y_u.Otapl.p = ap;
#ifdef TABLING
code_p->u.Otapl.te = ap->TableOfPred;
code_p->y_u.Otapl.te = ap->TableOfPred;
#endif
#ifdef YAPOR
INIT_YAMOP_LTT(code_p, 0);
@ -98,72 +93,61 @@ Yap_ClauseListExtend(clause_list_t cl, void * clause, void *pred)
} else {
yamop *code_p;
if (!(code_p = (yamop *)extend_blob(cl->start,((CELL)NEXTOP((yamop *)NULL,Otapl))/sizeof(CELL) PASS_REGS))) return FALSE;
if (!(code_p = (yamop *)extend_blob(cl->start,
((CELL)NEXTOP((yamop *)NULL, Otapl)) /
sizeof(CELL) PASS_REGS)))
return FALSE;
code_p->opc = Yap_opcode(_trust);
code_p->u.Otapl.d = clause;
code_p->u.Otapl.s = ap->ArityOfPE;
code_p->u.Otapl.p = ap;
code_p->y_u.Otapl.d = clause;
code_p->y_u.Otapl.s = ap->ArityOfPE;
code_p->y_u.Otapl.p = ap;
#ifdef TABLING
code_p->u.Otapl.te = ap->TableOfPred;
code_p->y_u.Otapl.te = ap->TableOfPred;
#endif
#ifdef YAPOR
INIT_YAMOP_LTT(code_p, 0);
#endif /* YAPOR */
code_p = PREVOP(code_p,Otapl);
code_p = PREVOP(code_p, Otapl);
code_p->opc = Yap_opcode(_retry);
}
cl->end = H;
cl->end = HR;
cl->n++;
return TRUE;
}
/*closes the clause list*/
X_API void
Yap_ClauseListClose(clause_list_t cl)
{
/* no need to do nothing */
void Yap_ClauseListClose(clause_list_t cl) { /* no need to do nothing */
}
/*destroys the clause list freeing memory*/
X_API int
Yap_ClauseListDestroy(clause_list_t cl)
{
int Yap_ClauseListDestroy(clause_list_t cl) {
CACHE_REGS
if (cl->end != H)
if (cl->end != HR)
return FALSE;
H = cl->start;
HR = cl->start;
return TRUE;
}
/*destroys clause list and returns only first clause*/
X_API void *
Yap_ClauseListToClause(clause_list_t cl)
{
void *Yap_ClauseListToClause(clause_list_t cl) {
CACHE_REGS
void **ptr;
if (cl->end != H)
if (cl->end != HR)
return NULL;
if (cl->n != 1)
return NULL;
if (!(ptr = (void **)extend_blob(cl->start,0 PASS_REGS))) return NULL;
if (!(ptr = (void **)extend_blob(cl->start, 0 PASS_REGS)))
return NULL;
return ptr[-1];
}
/*return pointer to start of try-retry-trust sequence*/
X_API void *
Yap_ClauseListCode(clause_list_t cl)
{
void *Yap_ClauseListCode(clause_list_t cl) {
CELL *ptr;
ptr = (CELL *)cl->start;
ptr += (1+sizeof(MP_INT)/sizeof(CELL));
ptr += (1 + sizeof(MP_INT) / sizeof(CELL));
return (void *)ptr;
}
/* where to fail */
X_API void *
Yap_FAILCODE(void)
{
return (void *)FAILCODE;
}
void *Yap_FAILCODE(void) { return (void *)FAILCODE; }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -54,25 +54,24 @@ static char SccsId[] = "%W% %G%";
/*
* This file includes a set of utilities, useful to the several compilation
* modules
* modules
*/
#include "Yap.h"
#include "Yatom.h"
#include "YapHeap.h"
#include "compile.h"
#define COMPILER_NAMES 1
#include "YapCompile.h"
#undef COMPILER_NAMES
#include "YapCompile.h"
#include "yapio.h"
#if HAVE_STRING_H
#include <string.h>
#endif
#ifdef DEBUG
STATIC_PROTO (void ShowOp, (char *, struct PSEUDO *));
#endif /* DEBUG */
/*
* The compiler creates an instruction chain which will be assembled after
* afterwards
* afterwards
*/
@ -81,7 +80,7 @@ typedef struct mem_blk {
union {
struct mem_blk *next;
double fill;
} u;
} ublock;
char contents[1];
} MemBlk;
@ -110,7 +109,7 @@ AllocCMem (UInt size, struct intermediates *cip)
if (LOCAL_CMemFirstBlock) {
p = LOCAL_CMemFirstBlock;
blksz = LOCAL_CMemFirstBlockSz;
p->u.next = NULL;
p->ublock.next = NULL;
} else {
if (blksz < FIRST_CMEM_BLK_SIZE)
blksz = FIRST_CMEM_BLK_SIZE;
@ -132,7 +131,7 @@ AllocCMem (UInt size, struct intermediates *cip)
siglongjmp(cip->CompilerBotch, OUT_OF_HEAP_BOTCH);
}
}
p->u.next = cip->blks;
p->ublock.next = cip->blks;
cip->blks = p;
cip->blk_cur = p->contents;
cip->blk_top = (char *)p+blksz;
@ -144,15 +143,15 @@ AllocCMem (UInt size, struct intermediates *cip)
}
#else
char *p;
p = cip->freep;
cip->freep += size;
if (ASP <= CellPtr (cip->freep) + 256) {
CACHE_REGS
LOCAL_Error_Size = 256+((char *)cip->freep - (char *)H);
LOCAL_Error_Size = 256+((char *)cip->freep - (char *)HR);
save_machine_regs();
siglongjmp(cip->CompilerBotch, OUT_OF_STACK_BOTCH);
}
return (p);
p = cip->freep;
cip->freep += size;
return p;
#endif
}
@ -163,7 +162,7 @@ Yap_ReleaseCMem (struct intermediates *cip)
CACHE_REGS
struct mem_blk *p = cip->blks;
while (p) {
struct mem_blk *nextp = p->u.next;
struct mem_blk *nextp = p->ublock.next;
if (p != LOCAL_CMemFirstBlock)
Yap_FreeCodeSpace((ADDR)p);
p = nextp;
@ -219,7 +218,7 @@ is_a_test(Term arg, Term mod)
return TRUE;
}
return FALSE;
}
}
return pe->PredFlags & (TestPredFlag|BinaryPredFlag);
}
}
@ -288,6 +287,72 @@ Yap_emit_4ops (compiler_vm_op o, CELL r1, CELL r2, CELL r3, CELL r4, struct inte
}
}
void
Yap_emit_5ops (compiler_vm_op o, CELL r1, CELL r2, CELL r3, CELL r4, CELL r5, struct intermediates *cip)
{
PInstr *p;
p = (PInstr *) AllocCMem (sizeof (*p)+3*sizeof(CELL), cip);
p->op = o;
p->rnd1 = r1;
p->rnd2 = r2;
p->rnd3 = r3;
p->rnd4 = r4;
p->rnd5 = r5;
p->nextInst = NIL;
if (cip->cpc == NIL)
cip->cpc = cip->CodeStart = p;
else
{
cip->cpc->nextInst = p;
cip->cpc = p;
}
}
void
Yap_emit_6ops (compiler_vm_op o, CELL r1, CELL r2, CELL r3, CELL r4, CELL r5, CELL r6, struct intermediates *cip)
{
PInstr *p;
p = (PInstr *) AllocCMem (sizeof (*p)+4*sizeof(CELL), cip);
p->op = o;
p->rnd1 = r1;
p->rnd2 = r2;
p->rnd3 = r3;
p->rnd4 = r4;
p->rnd5 = r5;
p->rnd6 = r6;
p->nextInst = NIL;
if (cip->cpc == NIL)
cip->cpc = cip->CodeStart = p;
else
{
cip->cpc->nextInst = p;
cip->cpc = p;
}
}
void
Yap_emit_7ops (compiler_vm_op o, CELL r1, CELL r2, CELL r3, CELL r4, CELL r5, CELL r6, CELL r7, struct intermediates *cip)
{
PInstr *p;
p = (PInstr *) AllocCMem (sizeof (*p)+5*sizeof(CELL), cip);
p->op = o;
p->rnd1 = r1;
p->rnd2 = r2;
p->rnd3 = r3;
p->rnd4 = r4;
p->rnd5 = r5;
p->rnd6 = r6;
p->rnd7 = r7;
p->nextInst = NIL;
if (cip->cpc == NIL)
cip->cpc = cip->CodeStart = p;
else
{
cip->cpc->nextInst = p;
cip->cpc = p;
}
}
CELL *
Yap_emit_extra_size (compiler_vm_op o, CELL r1, int size, struct intermediates *cip)
{
@ -331,6 +396,9 @@ bip_name(Int op, char *s)
case _cut_by:
strcpy(s,"cut_by");
break;
case _save_by:
strcpy(s,"save_by");
break;
case _db_ref:
strcpy(s,"db_ref");
break;
@ -412,14 +480,51 @@ write_address(CELL address)
sprintf(buf,"%p",(void *)address);
#endif
p[31] = '\0'; /* so that I don't have to worry */
Yap_DebugErrorPutc('0');
Yap_DebugErrorPutc('x');
//Yap_DebugErrorPutc('0');
//Yap_DebugErrorPutc('x');
while (*p != '\0') {
Yap_DebugErrorPutc(*p++);
}
}
}
static void
write_special_label(special_label_op arg, special_label_id rn, UInt lab)
{
switch (arg) {
case SPECIAL_LABEL_INIT:
Yap_DebugErrorPuts("init,");
switch (rn) {
case SPECIAL_LABEL_EXCEPTION:
Yap_DebugErrorPuts("exception,");
break;
case SPECIAL_LABEL_SUCCESS:
Yap_DebugErrorPuts("success,");
break;
case SPECIAL_LABEL_FAILURE:
Yap_DebugErrorPuts("fail,");
break;
}
write_address(lab);
case SPECIAL_LABEL_SET:
Yap_DebugErrorPuts("set,");
break;
case SPECIAL_LABEL_CLEAR:
Yap_DebugErrorPuts("clear,");
switch (rn) {
case SPECIAL_LABEL_EXCEPTION:
Yap_DebugErrorPuts("exception");
break;
case SPECIAL_LABEL_SUCCESS:
Yap_DebugErrorPuts("success");
break;
case SPECIAL_LABEL_FAILURE:
Yap_DebugErrorPuts("fail");
break;
}
}
}
static void
write_functor(Functor f)
{
@ -428,8 +533,12 @@ write_functor(Functor f)
Yap_DebugPlWrite(MkAtomTerm(AtomDBREF));
} else if (f == FunctorLongInt) {
Yap_DebugPlWrite(MkAtomTerm(AtomLONGINT));
} else if (f == FunctorBigInt) {
Yap_DebugPlWrite(MkAtomTerm(AtomLONGINT));
} else if (f == FunctorDouble) {
Yap_DebugPlWrite(MkAtomTerm(AtomDOUBLE));
} else if (f == FunctorString) {
Yap_DebugPlWrite(MkAtomTerm(AtomSTRING));
}
} else {
Yap_DebugPlWrite(MkAtomTerm(NameOfFunctor (f)));
@ -438,14 +547,37 @@ write_functor(Functor f)
}
}
static void
ShowOp (char *f, struct PSEUDO *cpc)
static void send_pred(PredEntry *p)
{
Functor f = p->FunctorOfPred;
UInt arity = p->ArityOfPE;
Term mod = TermProlog;
if (p->ModuleOfPred) mod = p->ModuleOfPred;
Yap_DebugPlWrite (mod);
Yap_DebugErrorPutc (':');
if (arity == 0)
Yap_DebugPlWrite (MkAtomTerm ((Atom)f));
else
Yap_DebugPlWrite (MkAtomTerm (NameOfFunctor (f)));
Yap_DebugErrorPutc ('/');
Yap_DebugPlWrite (MkIntTerm (arity));
}
static void
ShowOp (compiler_vm_op ic, const char *f, struct PSEUDO *cpc)
{
CACHE_REGS
char ch;
Int arg = cpc->rnd1;
Int rn = cpc->rnd2;
CELL *cptr = cpc->arnds;
if (ic != label_op && ic != label_ctl_op && ic != name_op) {
Yap_DebugErrorPutc ('\t');
}
while ((ch = *f++) != 0)
{
if (ch == '%')
@ -459,6 +591,19 @@ ShowOp (char *f, struct PSEUDO *cpc)
Yap_DebugPlWrite(MkIntTerm(arg));
break;
#endif
case '2':
{
Ventry *v = (Ventry *) cpc->rnd3;
Yap_DebugErrorPutc (v->KindOfVE == PermVar ? 'Y' : 'X');
Yap_DebugPlWrite (MkIntTerm ((v->NoOfVE) & MaskVarAdrs));
Yap_DebugErrorPutc (',');
Yap_DebugErrorPutc ('A');
Yap_DebugPlWrite (MkIntegerTerm (cpc->rnd4));
Yap_DebugErrorPutc (',');
send_pred( RepPredProp((Prop)(cpc->rnd5)) );
}
break;
case 'a':
case 'n':
Yap_DebugPlWrite ((Term) arg);
@ -472,10 +617,13 @@ ShowOp (char *f, struct PSEUDO *cpc)
Yap_DebugPlWrite(MkIntegerTerm((Int)(*ptr++)));
}
}
break;
break;
case 'l':
write_address (arg);
break;
case 'L':
write_special_label (arg, rn, cpc->rnd3);
break;
case 'B':
{
char s[32];
@ -493,10 +641,12 @@ ShowOp (char *f, struct PSEUDO *cpc)
case 'v':
{
Ventry *v = (Ventry *) arg;
Yap_DebugErrorPutc (v->KindOfVE == PermVar ? 'Y' : 'X');
Yap_DebugPlWrite (MkIntTerm ((v->NoOfVE) & MaskVarAdrs));
if (v) {
Yap_DebugErrorPutc (v->KindOfVE == PermVar ? 'Y' : 'X');
Yap_DebugPlWrite (MkIntTerm ((v->NoOfVE) & MaskVarAdrs));
}
}
break;
break;
case 'N':
{
Ventry *v;
@ -508,50 +658,17 @@ ShowOp (char *f, struct PSEUDO *cpc)
Yap_DebugPlWrite (MkIntTerm ((v->NoOfVE) & MaskVarAdrs));
}
break;
case 'm':
Yap_DebugPlWrite (MkAtomTerm ((Atom) arg));
Yap_DebugErrorPutc ('/');
Yap_DebugPlWrite (MkIntTerm (rn));
break;
case 'm':
Yap_DebugPlWrite (MkAtomTerm ((Atom) arg));
Yap_DebugErrorPutc ('/');
Yap_DebugPlWrite (MkIntTerm (rn));
break;
case 'p':
{
PredEntry *p = RepPredProp ((Prop) arg);
Functor f = p->FunctorOfPred;
UInt arity = p->ArityOfPE;
Term mod;
if (p->ModuleOfPred)
mod = p->ModuleOfPred;
else
mod = TermProlog;
Yap_DebugPlWrite (mod);
Yap_DebugErrorPutc (':');
if (arity == 0)
Yap_DebugPlWrite (MkAtomTerm ((Atom)f));
else
Yap_DebugPlWrite (MkAtomTerm (NameOfFunctor (f)));
Yap_DebugErrorPutc ('/');
Yap_DebugPlWrite (MkIntTerm (arity));
}
break;
case 'P':
{
PredEntry *p = RepPredProp((Prop) rn);
Functor f = p->FunctorOfPred;
UInt arity = p->ArityOfPE;
Term mod = TermProlog;
if (p->ModuleOfPred) mod = p->ModuleOfPred;
Yap_DebugPlWrite (mod);
Yap_DebugErrorPutc (':');
if (arity == 0)
Yap_DebugPlWrite (MkAtomTerm ((Atom)f));
else
Yap_DebugPlWrite (MkAtomTerm (NameOfFunctor (f)));
Yap_DebugErrorPutc ('/');
Yap_DebugPlWrite (MkIntTerm (arity));
}
break;
send_pred( RepPredProp((Prop)(arg) ));
break;
case 'P':
send_pred( RepPredProp((Prop)(rn) ));
break;
case 'f':
write_functor((Functor)arg);
break;
@ -559,6 +676,10 @@ ShowOp (char *f, struct PSEUDO *cpc)
Yap_DebugErrorPutc ('A');
Yap_DebugPlWrite (MkIntTerm (rn));
break;
case 'S':
Yap_DebugErrorPutc ('S');
Yap_DebugPlWrite (MkIntTerm (rn));
break;
case 'h':
{
CELL my_arg = *cptr++;
@ -581,6 +702,8 @@ ShowOp (char *f, struct PSEUDO *cpc)
Yap_DebugPlWrite(MkAtomTerm(AtomLONGINT));
} else if (fun == FunctorDouble) {
Yap_DebugPlWrite(MkAtomTerm(AtomDOUBLE));
} else if (fun == FunctorString) {
Yap_DebugPlWrite(MkAtomTerm(AtomSTRING));
}
} else {
Yap_DebugPlWrite (MkAtomTerm(NameOfFunctor(fun)));
@ -598,7 +721,7 @@ ShowOp (char *f, struct PSEUDO *cpc)
Yap_DebugPlWrite (MkIntTerm (rn & 1));
break;
case 'w':
Yap_DebugPlWrite (arg);
Yap_DebugPlWrite (MkIntTerm(arg));
break;
case 'o':
Yap_DebugPlWrite ((Term) * cptr++);
@ -653,212 +776,23 @@ ShowOp (char *f, struct PSEUDO *cpc)
Yap_DebugErrorPutc ('\n');
}
static char *opformat[] =
{
"nop",
"get_var\t\t%v,%r",
"put_var\t\t%v,%r",
"get_val\t\t%v,%r",
"put_val\t\t%v,%r",
"get_atom\t%a,%r",
"put_atom\t%a,%r",
"get_num\t\t%n,%r",
"put_num\t\t%n,%r",
"get_float\t\t%w,%r",
"put_float\t\t%w,%r",
"get_dbterm\t%w,%r",
"put_dbterm\t%w,%r",
"get_longint\t\t%w,%r",
"put_longint\t\t%w,%r",
"get_bigint\t\t%l,%r",
"put_bigint\t\t%l,%r",
"get_list\t%r",
"put_list\t%r",
"get_struct\t%f,%r",
"put_struct\t%f,%r",
"put_unsafe\t%v,%r",
"unify_var\t%v",
"write_var\t%v",
"unify_val\t%v",
"write_val\t%v",
"unify_atom\t%a",
"write_atom\t%a",
"unify_num\t%n",
"write_num\t%n",
"unify_float\t%w",
"write_float\t%w",
"unify_dbterm\t%w",
"write_dbterm\t%w",
"unify_longint\t%w",
"write_longint\t%w",
"unify_bigint\t%l",
"write_bigint\t%l",
"unify_list",
"write_list",
"unify_struct\t%f",
"write_struct\t%f",
"write_unsafe\t%v",
"unify_local\t%v",
"write local\t%v",
"unify_last_list",
"write_last_list",
"unify_last_struct\t%f",
"write_last_struct\t%f",
"unify_last_var\t%v",
"unify_last_val\t%v",
"unify_last_local\t%v",
"unify_last_atom\t%a",
"unify_last_num\t%n",
"unify_last_float\t%w",
"unify_last_dbterm\t%w",
"unify_last_longint\t%w",
"unify_last_bigint\t%l",
"ensure_space",
"native_code",
"function_to_var\t%v,%B",
"function_to_val\t%v,%B",
"function_to_0\t%B",
"align_float",
"fail",
"cut",
"cutexit",
"allocate",
"deallocate",
"try_me_else\t\t%l\t%x",
"jump\t\t%l",
"jump\t\t%l",
"proceed",
"call\t\t%p,%d,%z",
"execute\t\t%p",
"sys\t\t%p",
"%l:",
"name\t\t%m,%d",
"pop\t\t%l",
"retry_me_else\t\t%l\t%x",
"trust_me_else_fail\t%x",
"either_me\t\t%l,%d,%z",
"or_else\t\t%l,%z",
"or_last",
"push_or",
"pushpop_or",
"pop_or",
"save_by\t\t%v",
"commit_by\t\t%v",
"patch_by\t\t%v",
"try\t\t%g\t%x",
"retry\t\t%g\t%x",
"trust\t\t%g\t%x",
"try_in\t\t%g\t%x",
"jump_if_var\t\t%g",
"jump_if_nonvar\t\t%g",
"cache_arg\t%r",
"cache_sub_arg\t%d",
"user_index",
"switch_on_type\t%h\t%h\t%h\t%h",
"switch_on_constant\t%i\n%c",
"if_constant\t%i\n%c",
"switch_on_functor\t%i\n%e",
"if_functor\t%i\n%e",
"if_not_then\t%i\t%h\t%h\t%h",
"index_on_dbref",
"index_on_blob",
"index_on_long",
"check_var\t %r",
"save_pair\t%v",
"save_appl\t%v",
"pvar_bitmap\t%l,%b",
"pvar_live_regs\t%l,%b",
"fetch_reg1_reg2\t%N,%N",
"fetch_constant_reg\t%l,%N",
"fetch_reg_constant\t%l,%N",
"fetch_integer_reg\t%d,%N",
"fetch_reg_integer\t%d,%N",
"enter_profiling\t\t%g",
"retry_profiled\t\t%g",
"count_call_op\t\t%g",
"count_retry_op\t\t%g",
"restore_temps\t\t%l",
"restore_temps_and_skip\t\t%l",
"enter_lu",
"empty_call\t\t%l,%d",
#ifdef YAPOR
"sync",
#endif /* YAPOR */
#ifdef TABLING
"table_new_answer",
"table_try_single\t%g\t%x",
#endif /* TABLING */
#ifdef TABLING_INNER_CUTS
"clause_with_cut",
#endif /* TABLING_INNER_CUTS */
#ifdef BEAM
"run_op %1,%4",
"body_op %1",
"endgoal_op",
"try_me_op %1,%4",
"retry_me_op %1,%4",
"trust_me_op %1,%4",
"only_1_clause_op %1,%4",
"create_first_box_op %1,%4",
"create_box_op %1,%4",
"create_last_box_op %1,%4",
"remove_box_op %1,%4",
"remove_last_box_op %1,%4",
"prepare_tries",
"std_base_op %1,%4",
"direct_safe_call",
"skip_while_var_op",
"wait_while_var_op",
"force_wait_op",
"write_op",
"is_op",
"equal_op",
"exit",
#endif
"fetch_args_for_bccall\t%v",
"binary_cfunc\t\t%v,%P",
"blob\t%O",
"label_control\t"
#ifdef SFUNC
,
"get_s_f_op\t%f,%r",
"put_s_f_op\t%f,%r",
"unify_s_f_op\t%f",
"write_s_f_op\t%f",
"unify_s_var\t%v,%r",
"write_s_var\t%v,%r",
"unify_s_val\t%v,%r",
"write_s_val\t%v,%r",
"unify_s_a\t%a,%r",
"write_s_a\t%a,%r",
"get_s_end",
"put_s_end",
"unify_s_end",
"write_s_end"
#endif
};
void
Yap_ShowCode (struct intermediates *cint)
{
CACHE_REGS
CELL *oldH = H;
struct PSEUDO *cpc;
cpc = cint->CodeStart;
/* MkIntTerm and friends may build terms in the global stack */
H = (CELL *)cint->freep;
HR = (CELL *)cint->freep;
while (cpc) {
compiler_vm_op ic = cpc->op;
if (ic != nop_op) {
ShowOp (opformat[ic], cpc);
ShowOp (ic, opDesc[ic], cpc);
}
cpc = cpc->nextInst;
}
Yap_DebugErrorPutc ('\n');
H = oldH;
}
#endif /* DEBUG */

561
C/control_absmi_insts.h Normal file
View File

@ -0,0 +1,561 @@
/************************************************************************\
* Cut & Commit Inst
ructions *
\************************************************************************/
#ifdef INDENT_CODE
{
{
{
#endif /* INDENT_CODE */
/* cut */
Op(cut, s);
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackCut, HR);
ENDCACHE_Y_AS_ENV();
do_cut:
#endif
SET_ASP(YREG, PREG->y_u.s.s);
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, s),Osbpp),l);
/* assume cut is always in stack */
saveregs();
prune((choiceptr)YREG[E_CB] PASS_REGS);
setregs();
GONext();
#ifdef COROUTINING
NoStackCut:
PROCESS_INT(interrupt_cut, do_cut);
#endif
ENDOp();
/* cut_t */
/* cut_t does the same as cut */
Op(cut_t, s);
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackCutT, HR);
ENDCACHE_Y_AS_ENV();
do_cut_t:
#endif
SET_ASP(YREG, PREG->y_u.s.s);
/* assume cut is always in stack */
saveregs();
prune((choiceptr)YREG[E_CB] PASS_REGS);
setregs();
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, s),Osbpp),l);
GONext();
#ifdef COROUTINING
NoStackCutT:
PROCESS_INT(interrupt_cut_t, do_cut_t);
#endif
ENDOp();
/* cut_e */
Op(cut_e, s);
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackCutE, HR);
ENDCACHE_Y_AS_ENV();
do_cut_e:
#endif
SET_ASP(YREG, PREG->y_u.s.s);
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, s),Osbpp),l);
saveregs();
prune((choiceptr)SREG[E_CB] PASS_REGS);
setregs();
GONext();
#ifdef COROUTINING
NoStackCutE:
PROCESS_INT(interrupt_cut_e, do_cut_e);
#endif
ENDOp();
/* save_b_x Xi */
Op(save_b_x, x);
BEGD(d0);
d0 = PREG->y_u.x.x;
#if defined(YAPOR_SBA) && defined(FROZEN_STACKS)
XREG(d0) = MkIntegerTerm((Int)B);
#else
XREG(d0) = MkIntegerTerm(LCL0-(CELL *) (B));
#endif /* YAPOR_SBA && FROZEN_STACKS */
PREG = NEXTOP(PREG, x);
ENDD(d0);
GONext();
ENDOp();
/* save_b_y Yi */
Op(save_b_y, y);
#if defined(YAPOR_SBA)
INITIALIZE_PERMVAR(YREG+PREG->y_u.y.y,MkIntegerTerm((Int)B));
#else
INITIALIZE_PERMVAR(YREG+PREG->y_u.y.y,MkIntegerTerm(LCL0-(CELL *)(B)));
#endif /* YAPOR_SBA*/
PREG = NEXTOP(PREG, y);
GONext();
ENDOp();
/* commit_b_x Xi */
Op(commit_b_x, xps);
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackCommitX, HR);
ENDCACHE_Y_AS_ENV();
do_commit_b_x:
#endif
BEGD(d0);
d0 = XREG(PREG->y_u.xps.x);
deref_head(d0, commit_b_x_unk);
commit_b_x_nvar:
/* skip a void call and a label */
SET_ASP(YREG, PREG->y_u.xps.s);
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, xps),Osbpp),l);
{
choiceptr pt0;
#if defined(YAPOR_SBA) && defined(FROZEN_STACKS)
pt0 = (choiceptr)IntegerOfTerm(d0);
#else
pt0 = (choiceptr)(LCL0-IntegerOfTerm(d0));
#endif /* YAPOR_SBA && FROZEN_STACKS */
saveregs();
prune(pt0 PASS_REGS);
setregs();
}
GONext();
BEGP(pt1);
deref_body(d0, pt1, commit_b_x_unk, commit_b_x_nvar);
ENDP(pt1);
/* never cut to a variable */
/* Abort */
FAIL();
ENDD(d0);
#ifdef COROUTINING
/* Problem: have I got an environment or not? */
NoStackCommitX:
PROCESS_INT(interrupt_commit_x, do_commit_b_x);
#endif
ENDOp();
/* commit_b_y Yi */
Op(commit_b_y, yps);
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackCommitY, HR);
ENDCACHE_Y_AS_ENV();
do_commit_b_y:
#endif
BEGD(d0);
d0 = YREG[PREG->y_u.yps.y];
deref_head(d0, commit_b_y_unk);
commit_b_y_nvar:
SET_ASP(YREG, PREG->y_u.yps.s);
PREG = NEXTOP(NEXTOP(NEXTOP(PREG, yps),Osbpp),l);
{
choiceptr pt0;
#if defined(YAPOR_SBA) && defined(FROZEN_STACKS)
pt0 = (choiceptr)IntegerOfTerm(d0);
#else
pt0 = (choiceptr)(LCL0-IntegerOfTerm(d0));
#endif
saveregs();
prune(pt0 PASS_REGS);
setregs();
}
GONext();
BEGP(pt1);
deref_body(d0, pt1, commit_b_y_unk, commit_b_y_nvar);
ENDP(pt1);
/* never cut to a variable */
/* Abort */
FAIL();
ENDD(d0);
#ifdef COROUTINING
/* This is easier: I know there is an environment so I cannot do allocate */
NoStackCommitY:
PROCESS_INT(interrupt_commit_y, do_commit_b_y);
#endif
ENDOp();
/*************************************************************************
* Call / Proceed instructions *
*************************************************************************/
/* Macros for stack trimming */
/* execute Label */
BOp(execute, Osbpp);
{
PredEntry *pt0;
CACHE_Y_AS_ENV(YREG);
pt0 = PREG->y_u.Osbpp.p;
#ifndef NO_CHECKING
check_stack(NoStackExecute, HR);
goto skip_do_execute;
#endif
do_execute:
FETCH_Y_FROM_ENV(YREG);
pt0 = PREG->y_u.Osbpp.p;
skip_do_execute:
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) {
low_level_trace(enter_pred,pt0,XREGS+1);
}
#endif /* LOW_LEVEL_TRACE */
CACHE_A1();
ALWAYS_LOOKAHEAD(pt0->OpcodeOfPred);
BEGD(d0);
d0 = (CELL)B;
PREG = pt0->CodeOfPred;
/* for profiler */
save_pc();
ENV_YREG[E_CB] = d0;
ENDD(d0);
#ifdef DEPTH_LIMIT
if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is prolog */
if (pt0->ModuleOfPred) {
if (DEPTH == MkIntTerm(0)) {
FAIL();
} else { DEPTH = RESET_DEPTH(); }
}
} else if (pt0->ModuleOfPred)
DEPTH -= MkIntConstant(2);
#endif /* DEPTH_LIMIT */
/* this is the equivalent to setting up the stack */
ALWAYS_GONext();
ALWAYS_END_PREFETCH();
ENDCACHE_Y_AS_ENV();
}
NoStackExecute:
PROCESS_INT(interrupt_execute, do_execute);
ENDBOp();
/* dexecute Label */
/* joint deallocate and execute */
BOp(dexecute, Osbpp);
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace)
low_level_trace(enter_pred,PREG->y_u.Osbpp.p,XREGS+1);
#endif /* LOW_LEVEL_TRACER */
CACHE_Y_AS_ENV(YREG);
{
PredEntry *pt0;
CACHE_A1();
pt0 = PREG->y_u.Osbpp.p;
#ifndef NO_CHECKING
/* check stacks */
check_stack(NoStackDExecute, HR);
goto skip_dexecute;
#endif
continue_dexecute:
FETCH_Y_FROM_ENV(YREG);
pt0 = PREG->y_u.Osbpp.p;
skip_dexecute:
#ifdef DEPTH_LIMIT
if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is primitives */
if (pt0->ModuleOfPred) {
if (DEPTH == MkIntTerm(0)) {
FAIL();
} else {
DEPTH = RESET_DEPTH();
}
}
} else if (pt0->ModuleOfPred)
DEPTH -= MkIntConstant(2);
#endif /* DEPTH_LIMIT */
PREG = pt0->CodeOfPred;
/* for profiler */
save_pc();
ALWAYS_LOOKAHEAD(pt0->OpcodeOfPred);
/* do deallocate */
CPREG = (yamop *) ENV_YREG[E_CP];
ENV_YREG = ENV = (CELL *) ENV_YREG[E_E];
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (ENV_YREG > (CELL *) top_b || ENV_YREG < HR) ENV_YREG = (CELL *) top_b;
#else
if (ENV_YREG > (CELL *) top_b) ENV_YREG = (CELL *) top_b;
#endif /* YAPOR_SBA */
else ENV_YREG = (CELL *)((CELL)ENV_YREG + ENV_Size(CPREG));
}
#else
if (ENV_YREG > (CELL *)B) {
ENV_YREG = (CELL *)B;
}
else {
ENV_YREG = (CELL *) ((CELL) ENV_YREG + ENV_Size(CPREG));
}
#endif /* FROZEN_STACKS */
WRITEBACK_Y_AS_ENV();
/* setup GB */
ENV_YREG[E_CB] = (CELL) B;
ALWAYS_GONext();
ALWAYS_END_PREFETCH();
}
ENDCACHE_Y_AS_ENV();
NoStackDExecute:
PROCESS_INT(interrupt_dexecute, continue_dexecute);
ENDBOp();
BOp(fcall, Osbpp);
CACHE_Y_AS_ENV(YREG);
ENV_YREG[E_CP] = (CELL) CPREG;
ENV_YREG[E_E] = (CELL) ENV;
#ifdef DEPTH_LIMIT
ENV_YREG[E_DEPTH] = DEPTH;
#endif /* DEPTH_LIMIT */
ENDCACHE_Y_AS_ENV();
ENDBOp();
BOp(call, Osbpp);
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) {
low_level_trace(enter_pred,PREG->y_u.Osbpp.p,XREGS+1);
}
#endif /* LOW_LEVEL_TRACER */
CACHE_Y_AS_ENV(YREG);
{
PredEntry *pt;
CACHE_A1();
pt = PREG->y_u.Osbpp.p;
#ifndef NO_CHECKING
check_stack(NoStackCall, HR);
goto skip_call;
#endif
call_body:
/* external jump if we don;t want to creep */
FETCH_Y_FROM_ENV(YREG);
pt = PREG->y_u.Osbpp.p;
skip_call:
ENV = ENV_YREG;
/* Try to preserve the environment */
ENV_YREG = (CELL *) (((char *) ENV_YREG) + PREG->y_u.Osbpp.s);
CPREG = NEXTOP(PREG, Osbpp);
ALWAYS_LOOKAHEAD(pt->OpcodeOfPred);
PREG = pt->CodeOfPred;
/* for profiler */
save_pc();
#ifdef DEPTH_LIMIT
if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is primitives */
if (pt->ModuleOfPred) {
if (DEPTH == MkIntTerm(0)) {
FAIL();
} else {
DEPTH = RESET_DEPTH();
}
}
} else if (pt->ModuleOfPred)
DEPTH -= MkIntConstant(2);
#endif /* DEPTH_LIMIT */
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (ENV_YREG > (CELL *) top_b || ENV_YREG < HR) ENV_YREG = (CELL *) top_b;
#else
if (ENV_YREG > (CELL *) top_b) ENV_YREG = (CELL *) top_b;
#endif /* YAPOR_SBA */
}
#else
if (ENV_YREG > (CELL *) B) {
ENV_YREG = (CELL *) B;
}
#endif /* FROZEN_STACKS */
WRITEBACK_Y_AS_ENV();
/* setup GB */
ENV_YREG[E_CB] = (CELL) B;
#ifdef YAPOR
SCH_check_requests();
#endif /* YAPOR */
ALWAYS_GONext();
ALWAYS_END_PREFETCH();
}
ENDCACHE_Y_AS_ENV();
ENDBOp();
BOp(procceed, p);
CACHE_Y_AS_ENV(YREG);
ALWAYS_LOOKAHEAD(CPREG->opc);
PREG = CPREG;
/* for profiler */
save_pc();
ENV_YREG = ENV;
#ifdef DEPTH_LIMIT
DEPTH = ENV_YREG[E_DEPTH];
#endif
WRITEBACK_Y_AS_ENV();
ALWAYS_GONext();
ALWAYS_END_PREFETCH();
ENDCACHE_Y_AS_ENV();
NoStackCall:
PROCESS_INT(interrupt_call, call_body);
ENDBOp();
Op(allocate, e);
CACHE_Y_AS_ENV(YREG);
PREG = NEXTOP(PREG, e);
ENV_YREG[E_CP] = (CELL) CPREG;
ENV_YREG[E_E] = (CELL) ENV;
#ifdef DEPTH_LIMIT
ENV_YREG[E_DEPTH] = DEPTH;
#endif /* DEPTH_LIMIT */
ENV = ENV_YREG;
ENDCACHE_Y_AS_ENV();
GONext();
ENDOp();
Op(deallocate, p);
CACHE_Y_AS_ENV(YREG);
// do this before checking
SREG = YREG;
check_trail(TR);
#ifndef NO_CHECKING
/* check stacks */
check_stack(NoStackDeallocate, HR);
#endif
PREG = NEXTOP(PREG, p);
/* other instructions do depend on S being set by deallocate
:-( */
CPREG = (yamop *) ENV_YREG[E_CP];
ENV = ENV_YREG = (CELL *) ENV_YREG[E_E];
#ifdef DEPTH_LIMIT
DEPTH = ENV_YREG[E_DEPTH];
#endif /* DEPTH_LIMIT */
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (ENV_YREG > (CELL *) top_b || ENV_YREG < HR) ENV_YREG = (CELL *) top_b;
#else
if (ENV_YREG > (CELL *) top_b) ENV_YREG = (CELL *) top_b;
#endif /* YAPOR_SBA */
else ENV_YREG = (CELL *)((CELL) ENV_YREG + ENV_Size(CPREG));
}
#else
if (ENV_YREG > (CELL *) B)
ENV_YREG = (CELL *) B;
else
ENV_YREG = (CELL *) ((CELL) ENV_YREG + ENV_Size(CPREG));
#endif /* FROZEN_STACKS */
WRITEBACK_Y_AS_ENV();
ENDCACHE_Y_AS_ENV();
GONext();
NoStackDeallocate:
BEGD(d0);
#ifdef SHADOW_S
Yap_REGS.S_ = YREG;
#endif
PREG = NEXTOP(PREG,p);
saveregs();
d0 = interrupt_deallocate( PASS_REGS1 );
setregs();
PREG = PREVOP(PREG,p);
#ifdef SHADOW_S
SREG = Yap_REGS.S_;
#endif
// return to original deallocate
if (!d0) FAIL();
JMPNext();
ENDD(d0);
ENDOp();
/**********************************************
* OPTYap instructions *
**********************************************/
#ifdef YAPOR
#include "or.insts.h"
#endif /* YAPOR */
#ifdef TABLING
#include "tab.insts.h"
#include "tab.tries.insts.h"
#endif /* TABLING */
#ifdef BEAM
extern int eam_am(PredEntry *);
Op(retry_eam, e);
printf("Aqui estou eu..................\n");
if (!eam_am(2)) {
abort_eam("Falhei\n");
FAIL();
}
goto procceed;
PREG = NEXTOP(PREG, e);
GONext();
ENDOp();
Op(run_eam, os);
if (inp==-9000) { /* use indexing to find out valid alternatives */
extern CELL *beam_ALTERNATIVES;
*beam_ALTERNATIVES= (CELL *) PREG->y_u.os.opcw;
beam_ALTERNATIVES++;
if (OLD_B!=B) goto fail;
#if PUSH_REGS
Yap_regp=old_regs;
#endif
return(0);
}
saveregs();
if (!eam_am((PredEntry *) PREG->y_u.os.s)) FAIL();
setregs();
/* cut */
BACKUP_B();
while (POP_CHOICE_POINT(B->cp_b)) {
POP_EXECUTE();
}
B = B->cp_b; /* cut_fail */
HB = B->cp_h; /* cut_fail */
RECOVER_B();
if (0) { register choiceptr ccp;
/* initialize ccp */
#define NORM_CP(CP) ((choiceptr)(CP))
YREG = (CELL *) (NORM_CP(YREG) - 1);
ccp = NORM_CP(YREG);
store_yaam_reg_cpdepth(ccp);
ccp->cp_tr = TR;
ccp->cp_ap = BEAM_RETRY_CODE;
ccp->cp_h = HR;
ccp->cp_b = B;
ccp->cp_env= ENV;
ccp->cp_cp = CPREG;
B = ccp;
SET_BB(B);
}
goto procceed;
PREG = NEXTOP(PREG, os);
GONext();
ENDOp();
#endif

View File

@ -15,7 +15,7 @@
* *
*************************************************************************/
#ifdef SCCS
static char SccsId[]="%W% %G%";
static char SccsId[] = "%W% %G%";
#endif
#include "Yap.h"
@ -30,23 +30,20 @@ static char SccsId[]="%W% %G%";
#ifdef COROUTINING
/* check if variable was there */
static Term AddVarIfNotThere(Term var , Term dest USES_REGS)
{
static Term AddVarIfNotThere(Term var, Term dest USES_REGS) {
Term test = dest;
while (test != TermNil) {
if ((RepPair(test))[0] == var) return(dest);
else test = (RepPair(test))[1];
if ((RepPair(test))[0] == var)
return (dest);
else
test = (RepPair(test))[1];
}
return(MkPairTerm(var,dest));
return (MkPairTerm(var, dest));
}
/* This routine verifies whether two complex structures can unify. */
static int can_unify_complex(register CELL *pt0,
register CELL *pt0_end,
register CELL *pt1,
Term *Vars USES_REGS)
{
static int can_unify_complex(register CELL *pt0, register CELL *pt0_end,
register CELL *pt1, Term *Vars USES_REGS) {
/* This is really just unification, folks */
tr_fr_ptr saved_TR;
@ -60,133 +57,141 @@ static int can_unify_complex(register CELL *pt0,
saved_TR = TR;
saved_B = B;
saved_HB = HB;
HB = H;
HB = HR;
loop:
loop:
while (pt0 < pt0_end) {
register CELL d0, d1;
++ pt0;
++ pt1;
++pt0;
++pt1;
d0 = Derefa(pt0);
d1 = Derefa(pt1);
if (IsVarTerm(d0)) {
if (IsVarTerm(d1)) {
if (d0 != d1) {
/* we need to suspend on both variables ! */
*Vars = AddVarIfNotThere(d0, AddVarIfNotThere(d1,*Vars PASS_REGS) PASS_REGS);
/* bind the two variables, we would have to do that to unify
them */
if (d1 > d0) { /* youngest */
/* we don't want to wake up goals */
Bind_Global((CELL *)d1, d0);
} else {
Bind_Global((CELL *)d0, d1);
}
}
/* continue the loop */
continue;
}
else {
/* oh no, some more variables! */
*Vars = AddVarIfNotThere(d0, *Vars PASS_REGS);
if (d0 != d1) {
/* we need to suspend on both variables ! */
*Vars = AddVarIfNotThere(d0, AddVarIfNotThere(d1, *Vars PASS_REGS)
PASS_REGS);
/* bind the two variables, we would have to do that to unify
them */
if (d1 > d0) { /* youngest */
/* we don't want to wake up goals */
Bind_Global_NonAtt((CELL *)d1, d0);
} else {
Bind_Global_NonAtt((CELL *)d0, d1);
}
}
/* continue the loop */
continue;
} else {
/* oh no, some more variables! */
*Vars = AddVarIfNotThere(d0, *Vars PASS_REGS);
}
/* now bind it */
Bind_Global((CELL *)d0, d1);
Bind_Global_NonAtt((CELL *)d0, d1);
/* continue the loop */
} else if (IsVarTerm(d1)) {
} else if (IsVarTerm(d1)) {
*Vars = AddVarIfNotThere(d1, *Vars PASS_REGS);
/* and bind it */
Bind_Global((CELL *)d1, d0);
Bind_Global_NonAtt((CELL *)d1, d0);
/* continue the loop */
} else {
if (d0 == d1) continue;
if (d0 == d1)
continue;
if (IsAtomOrIntTerm(d0) || IsAtomOrIntTerm(d1)) {
if (d0 != d1) goto comparison_failed;
/* else continue the loop */
}
else if (IsPairTerm(d0)) {
if (!IsPairTerm(d1)) goto comparison_failed;
if (d0 != d1)
goto comparison_failed;
/* else continue the loop */
} else if (IsPairTerm(d0)) {
if (!IsPairTerm(d1))
goto comparison_failed;
#ifdef RATIONAL_TREES
to_visit[0] = pt0;
to_visit[1] = pt0_end;
to_visit[2] = pt1;
to_visit[3] = (CELL *)*pt0;
to_visit += 4;
*pt0 = d1;
to_visit[0] = pt0;
to_visit[1] = pt0_end;
to_visit[2] = pt1;
to_visit[3] = (CELL *)*pt0;
to_visit += 4;
*pt0 = d1;
#else
/* store the terms to visit */
if (pt0 < pt0_end) {
to_visit[0] = pt0;
to_visit[1] = pt0_end;
to_visit[2] = pt1;
to_visit += 3;
}
/* store the terms to visit */
if (pt0 < pt0_end) {
to_visit[0] = pt0;
to_visit[1] = pt0_end;
to_visit[2] = pt1;
to_visit += 3;
}
#endif
pt0 = RepPair(d0) - 1;
pt0_end = RepPair(d0) + 1;
pt1 = RepPair(d1) - 1;
continue;
}
else if (IsApplTerm(d0)) {
register Functor f;
register CELL *ap2, *ap3;
if (!IsApplTerm(d1)) {
goto comparison_failed;
} else {
/* store the terms to visit */
ap2 = RepAppl(d0);
ap3 = RepAppl(d1);
f = (Functor)(*ap2);
/* compare functors */
if (f != (Functor)*ap3) {
goto comparison_failed;
}
if (IsExtensionFunctor(f)) {
switch((CELL)f) {
case (CELL)FunctorDBRef:
if (d0 == d1) continue;
goto comparison_failed;
case (CELL)FunctorLongInt:
if (ap2[1] == ap3[1]) continue;
goto comparison_failed;
case (CELL)FunctorDouble:
if (FloatOfTerm(d0) == FloatOfTerm(d1)) continue;
goto comparison_failed;
pt0 = RepPair(d0) - 1;
pt0_end = RepPair(d0) + 1;
pt1 = RepPair(d1) - 1;
continue;
} else if (IsApplTerm(d0)) {
register Functor f;
register CELL *ap2, *ap3;
if (!IsApplTerm(d1)) {
goto comparison_failed;
} else {
/* store the terms to visit */
ap2 = RepAppl(d0);
ap3 = RepAppl(d1);
f = (Functor)(*ap2);
/* compare functors */
if (f != (Functor)*ap3) {
goto comparison_failed;
}
if (IsExtensionFunctor(f)) {
switch ((CELL)f) {
case (CELL) FunctorDBRef:
if (d0 == d1)
continue;
goto comparison_failed;
case (CELL) FunctorLongInt:
if (ap2[1] == ap3[1])
continue;
goto comparison_failed;
case (CELL) FunctorDouble:
if (FloatOfTerm(d0) == FloatOfTerm(d1))
continue;
goto comparison_failed;
case (CELL) FunctorString:
if (strcmp((char *)StringOfTerm(d0), (char *)StringOfTerm(d1)) ==
0)
continue;
goto comparison_failed;
#ifdef USE_GMP
case (CELL)FunctorBigInt:
if (Yap_gmp_tcmp_big_big(d0,d1) == 0) continue;
goto comparison_failed;
case (CELL) FunctorBigInt:
if (Yap_gmp_tcmp_big_big(d0, d1) == 0)
continue;
goto comparison_failed;
#endif /* USE_GMP */
default:
goto comparison_failed;
}
}
default:
goto comparison_failed;
}
}
#ifdef RATIONAL_TREES
to_visit[0] = pt0;
to_visit[1] = pt0_end;
to_visit[2] = pt1;
to_visit[3] = (CELL *)*pt0;
to_visit += 4;
*pt0 = d1;
to_visit[0] = pt0;
to_visit[1] = pt0_end;
to_visit[2] = pt1;
to_visit[3] = (CELL *)*pt0;
to_visit += 4;
*pt0 = d1;
#else
/* store the terms to visit */
if (pt0 < pt0_end) {
to_visit[0] = pt0;
to_visit[1] = pt0_end;
to_visit[2] = pt1;
to_visit += 3;
}
/* store the terms to visit */
if (pt0 < pt0_end) {
to_visit[0] = pt0;
to_visit[1] = pt0_end;
to_visit[2] = pt1;
to_visit += 3;
}
#endif
d0 = ArityOfFunctor(f);
pt0 = ap2;
pt0_end = ap2 + d0;
pt1 = ap3;
continue;
}
d0 = ArityOfFunctor(f);
pt0 = ap2;
pt0_end = ap2 + d0;
pt1 = ap3;
continue;
}
}
}
}
/* Do we still have compound terms to visit */
if (to_visit > (CELL **)to_visit_base) {
@ -214,9 +219,9 @@ static int can_unify_complex(register CELL *pt0,
pt1 = (CELL *)(TrailTerm(--TR));
RESET_VARIABLE(pt1);
}
return(TRUE);
return (TRUE);
comparison_failed:
comparison_failed:
/* failure */
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit);
#ifdef RATIONAL_TREES
@ -229,15 +234,18 @@ static int can_unify_complex(register CELL *pt0,
}
#endif
/* restore B, and later HB */
B = saved_B;
B = saved_B;
HB = saved_HB;
/* untrail all bindings made by IUnify */
while (TR != saved_TR) {
pt1 = (CELL *)(TrailTerm(--TR));
RESET_VARIABLE(pt1);
}
/* the system will take care of TR for me, no need to worry here! */
return(FALSE);
return (FALSE);
}
static int
can_unify(Term t1, Term t2, Term *Vars USES_REGS)
{
static int can_unify(Term t1, Term t2, Term *Vars USES_REGS) {
t1 = Deref(t1);
t2 = Deref(t2);
if (t1 == t2) {
@ -248,16 +256,16 @@ can_unify(Term t1, Term t2, Term *Vars USES_REGS)
/* we know for sure they can't be different */
if (IsVarTerm(t2)) {
/* we need to suspend on both variables because otherwise
Y = susp(_) would not wakeup susp ! */
*Vars = MkPairTerm(t1,MkPairTerm(t2,TermNil));
Y = susp(_) would not wakeup susp ! */
*Vars = MkPairTerm(t1, MkPairTerm(t2, TermNil));
return TRUE;
} else {
*Vars = MkPairTerm(t1,TermNil);
*Vars = MkPairTerm(t1, TermNil);
return TRUE;
}
} else if (IsVarTerm(t2)) {
/* wait until t2 is bound */
*Vars = MkPairTerm(t2,TermNil);
*Vars = MkPairTerm(t2, TermNil);
return TRUE;
}
/* Two standard terms at last! */
@ -273,53 +281,59 @@ can_unify(Term t1, Term t2, Term *Vars USES_REGS)
}
} else if (IsPairTerm(t1)) {
if (IsPairTerm(t2)) {
return(can_unify_complex(RepPair(t1)-1, RepPair(t1)+1,
RepPair(t2)-1, Vars PASS_REGS));
} else return FALSE;
return (can_unify_complex(RepPair(t1) - 1, RepPair(t1) + 1,
RepPair(t2) - 1, Vars PASS_REGS));
} else
return FALSE;
} else {
Functor f = FunctorOfTerm(t1);
if (f != FunctorOfTerm(t2))
return FALSE;
if (IsExtensionFunctor(f)) {
switch((CELL)f) {
case (CELL)FunctorDBRef:
if (t1 == t2) return FALSE;
return FALSE;
case (CELL)FunctorLongInt:
if (RepAppl(t1)[1] == RepAppl(t2)[1]) return(TRUE);
return FALSE;
case (CELL)FunctorDouble:
if (FloatOfTerm(t1) == FloatOfTerm(t2)) return(TRUE);
return FALSE;
switch ((CELL)f) {
case (CELL) FunctorDBRef:
if (t1 == t2)
return FALSE;
return FALSE;
case (CELL) FunctorLongInt:
if (RepAppl(t1)[1] == RepAppl(t2)[1])
return (TRUE);
return FALSE;
case (CELL) FunctorString:
if (strcmp((char *)StringOfTerm(t1), (char *)StringOfTerm(t2)) == 0)
return (TRUE);
return FALSE;
case (CELL) FunctorDouble:
if (FloatOfTerm(t1) == FloatOfTerm(t2))
return (TRUE);
return FALSE;
#ifdef USE_GMP
case (CELL)FunctorBigInt:
if (Yap_gmp_tcmp_big_big(t1,t2) == 0) return(TRUE);
return(FALSE);
case (CELL) FunctorBigInt:
if (Yap_gmp_tcmp_big_big(t1, t2) == 0)
return (TRUE);
return (FALSE);
#endif /* USE_GMP */
default:
return FALSE;
return FALSE;
}
}
/* Two complex terms with the same functor */
return can_unify_complex(RepAppl(t1),
RepAppl(t1)+ArityOfFunctor(f),
RepAppl(t2), Vars PASS_REGS);
return can_unify_complex(RepAppl(t1), RepAppl(t1) + ArityOfFunctor(f),
RepAppl(t2), Vars PASS_REGS);
}
}
/* This routine verifies whether a complex has variables. */
static int non_ground_complex(register CELL *pt0,
register CELL *pt0_end,
Term *Var USES_REGS)
{
static int non_ground_complex(register CELL *pt0, register CELL *pt0_end,
Term *Var USES_REGS) {
register CELL **to_visit = (CELL **)Yap_PreAllocCodeSpace();
CELL **to_visit_base = to_visit;
loop:
loop:
while (pt0 < pt0_end) {
register CELL d0;
++ pt0;
++pt0;
d0 = Derefa(pt0);
if (IsVarTerm(d0)) {
*Var = d0;
@ -327,7 +341,7 @@ static int non_ground_complex(register CELL *pt0,
}
if (IsPairTerm(d0)) {
if (to_visit + 1024 >= (CELL **)AuxSp) {
goto aux_overflow;
goto aux_overflow;
}
#ifdef RATIONAL_TREES
to_visit[0] = pt0;
@ -338,15 +352,14 @@ static int non_ground_complex(register CELL *pt0,
#else
/* store the terms to visit */
if (pt0 < pt0_end) {
to_visit[0] = pt0;
to_visit[1] = pt0_end;
to_visit += 2;
to_visit[0] = pt0;
to_visit[1] = pt0_end;
to_visit += 2;
}
#endif
pt0 = RepPair(d0) - 1;
pt0_end = RepPair(d0) + 1;
}
else if (IsApplTerm(d0)) {
} else if (IsApplTerm(d0)) {
register Functor f;
register CELL *ap2;
@ -355,10 +368,10 @@ static int non_ground_complex(register CELL *pt0,
f = (Functor)(*ap2);
if (IsExtensionFunctor(f)) {
continue;
continue;
}
if (to_visit + 1024 >= (CELL **)AuxSp) {
goto aux_overflow;
goto aux_overflow;
}
#ifdef RATIONAL_TREES
to_visit[0] = pt0;
@ -369,9 +382,9 @@ static int non_ground_complex(register CELL *pt0,
#else
/* store the terms to visit */
if (pt0 < pt0_end) {
to_visit[0] = pt0;
to_visit[1] = pt0_end;
to_visit += 2;
to_visit[0] = pt0;
to_visit[1] = pt0_end;
to_visit += 2;
}
#endif
d0 = ArityOfFunctor(f);
@ -400,7 +413,7 @@ static int non_ground_complex(register CELL *pt0,
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit);
return FALSE;
var_found:
var_found:
/* the term is non-ground */
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit);
#ifdef RATIONAL_TREES
@ -414,7 +427,7 @@ static int non_ground_complex(register CELL *pt0,
/* the system will take care of TR for me, no need to worry here! */
return TRUE;
aux_overflow:
aux_overflow:
/* unwind stack */
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit);
#ifdef RATIONAL_TREES
@ -427,9 +440,7 @@ static int non_ground_complex(register CELL *pt0,
return -1;
}
static int
non_ground(Term t, Term *Var USES_REGS)
{
static int non_ground(Term t, Term *Var USES_REGS) {
int out = -1;
while (out < 0) {
t = Deref(t);
@ -441,24 +452,24 @@ non_ground(Term t, Term *Var USES_REGS)
if (IsPrimitiveTerm(t)) {
return FALSE;
} else if (IsPairTerm(t)) {
out = non_ground_complex(RepPair(t)-1, RepPair(t)+1, Var PASS_REGS);
out = non_ground_complex(RepPair(t) - 1, RepPair(t) + 1, Var PASS_REGS);
if (out >= 0)
return out;
return out;
} else {
Functor f = FunctorOfTerm(t);
if (IsExtensionFunctor(f)) {
return FALSE;
return FALSE;
}
out = non_ground_complex(RepAppl(t),
RepAppl(t)+ArityOfFunctor(FunctorOfTerm(t)),
Var PASS_REGS);
RepAppl(t) + ArityOfFunctor(FunctorOfTerm(t)),
Var PASS_REGS);
if (out >= 0)
return out;
return out;
}
if (!Yap_ExpandPreAllocCodeSpace(0, NULL, TRUE)) {
Yap_Error(OUT_OF_AUXSPACE_ERROR, ARG1, "overflow in ground");
Yap_Error(RESOURCE_ERROR_AUXILIARY_STACK, ARG1, "overflow in ground");
return FALSE;
}
}
}
return FALSE;
}
@ -467,8 +478,7 @@ non_ground(Term t, Term *Var USES_REGS)
/* check whether the two terms unify and return what variables should
be bound before the terms are exactly equal */
static Int p_can_unify( USES_REGS1 )
{
static Int p_can_unify(USES_REGS1) {
#ifdef COROUTINING
Term r = TermNil;
if (!can_unify(ARG1, ARG2, &r PASS_REGS))
@ -480,60 +490,53 @@ static Int p_can_unify( USES_REGS1 )
}
/* if the term is not ground return a variable in the term */
static Int p_non_ground( USES_REGS1 )
{
static Int p_non_ground(USES_REGS1) {
#ifdef COROUTINING
Term r = TermNil;
if (!non_ground(ARG1, &r PASS_REGS))
return(FALSE);
return (FALSE);
return (Yap_unify(ARG2, r));
#else
return(FALSE);
return (FALSE);
#endif
}
/* if the term is not ground return a variable in the term */
static Int p_coroutining( USES_REGS1 )
{
static Int p_coroutining(USES_REGS1) {
#ifdef COROUTINING
return(TRUE);
return (TRUE);
#else
return(FALSE);
return (FALSE);
#endif
}
#if COROUTINING
static Term
ListOfWokenGoals( USES_REGS1 ) {
static Term ListOfWokenGoals(USES_REGS1) {
return Yap_ReadTimedVar(LOCAL_WokenGoals);
}
Term
Yap_ListOfWokenGoals(void) {
Term Yap_ListOfWokenGoals(void) {
CACHE_REGS
return ListOfWokenGoals( PASS_REGS1 );
return ListOfWokenGoals(PASS_REGS1);
}
#endif
/* return a list of awoken goals */
static Int p_awoken_goals( USES_REGS1 )
{
static Int p_awoken_goals(USES_REGS1) {
#ifdef COROUTINING
Term WGs = Yap_ReadTimedVar(LOCAL_WokenGoals);
if (WGs == TermNil) {
return(FALSE);
return (FALSE);
}
WGs = ListOfWokenGoals( PASS_REGS1 );
WGs = ListOfWokenGoals(PASS_REGS1);
Yap_UpdateTimedVar(LOCAL_WokenGoals, TermNil);
return(Yap_unify(ARG1,WGs));
return (Yap_unify(ARG1, WGs));
#else
return(FALSE);
return (FALSE);
#endif
}
static Int
p_yap_has_rational_trees( USES_REGS1 )
{
static Int p_yap_has_rational_trees(USES_REGS1) {
#if RATIONAL_TREES
return TRUE;
#else
@ -541,9 +544,7 @@ p_yap_has_rational_trees( USES_REGS1 )
#endif
}
static Int
p_yap_has_coroutining( USES_REGS1 )
{
static Int p_yap_has_coroutining(USES_REGS1) {
#if COROUTINING
return TRUE;
#else
@ -551,24 +552,21 @@ p_yap_has_coroutining( USES_REGS1 )
#endif
}
void
Yap_InitCoroutPreds( void )
{
void Yap_InitCoroutPreds(void) {
#ifdef COROUTINING
Atom at;
PredEntry *pred;
Atom at;
PredEntry *pred;
at = AtomWakeUpGoal;
pred = RepPredProp(PredPropByFunc(Yap_MkFunctor(at, 2),0));
pred = RepPredProp(PredPropByFunc(Yap_MkFunctor(at, 2), 0));
WakeUpCode = pred;
#endif
Yap_InitAttVarPreds();
Yap_InitCPred("$yap_has_rational_trees", 0, p_yap_has_rational_trees, SafePredFlag|HiddenPredFlag);
Yap_InitCPred("$yap_has_coroutining", 0, p_yap_has_coroutining, SafePredFlag|HiddenPredFlag);
Yap_InitCPred("$can_unify", 3, p_can_unify, SafePredFlag|HiddenPredFlag);
Yap_InitCPred("$non_ground", 2, p_non_ground, SafePredFlag|HiddenPredFlag);
Yap_InitCPred("$coroutining", 0, p_coroutining, SafePredFlag|HiddenPredFlag);
Yap_InitCPred("$awoken_goals", 1, p_awoken_goals, SafePredFlag|HiddenPredFlag);
Yap_InitCPred("$yap_has_rational_trees", 0, p_yap_has_rational_trees,
SafePredFlag);
Yap_InitCPred("$yap_has_coroutining", 0, p_yap_has_coroutining, SafePredFlag);
Yap_InitCPred("$can_unify", 3, p_can_unify, SafePredFlag);
Yap_InitCPred("$non_ground", 2, p_non_ground, SafePredFlag);
Yap_InitCPred("$coroutining", 0, p_coroutining, SafePredFlag);
Yap_InitCPred("$awoken_goals", 1, p_awoken_goals, SafePredFlag);
}

1010
C/cp_absmi_insts.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,10 @@
#ifdef CUT_C
#include "Yap.h"
#include "cut_c.h"
#include <stdio.h>
void cut_c_initialize(void){
void cut_c_initialize(int wid){
CACHE_REGS
Yap_REGS.CUT_C_TOP=(cut_c_str_ptr)LOCAL_LocalBase;
Yap_REGS.CUT_C_TOP=(cut_c_str_ptr)REMOTE_LocalBase(wid);
}
/*Removes a choice_point from the stack*/
@ -33,5 +31,3 @@ void cut_c_push(cut_c_str_ptr new_top){
Yap_REGS.CUT_C_TOP=new_top;
return;
}
#endif /*CUT_C*/

4519
C/dbase.c

File diff suppressed because it is too large Load Diff

459
C/dbload.c Normal file
View File

@ -0,0 +1,459 @@
/*************************************************************************
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* *
**************************************************************************
* *
* File: cdmgr.c *
* comments: Code manager *
* *
* Last rev: $Date: 2008-07-22 23:34:44 $,$Author: vsc $ 8
*************************************************************************/
#include "Yap.h"
#include "YapEval.h"
#include "clause.h"
#include "tracer.h"
#include "yapio.h"
#include <Yatom.h>
#include <assert.h>
#include <heapgc.h>
#include <iopreds.h>
#ifdef DEBUG
static UInt total_megaclause, total_released, nof_megaclauses;
#endif
/******************************************************************
Mega Clauses
******************************************************************/
#define OrArgAdjust(P)
#define TabEntryAdjust(P)
#define DoubleInCodeAdjust(D)
#define IntegerInCodeAdjust(D)
#define IntegerAdjust(D) (D)
#define PtoPredAdjust(X) (X)
#define PtoOpAdjust(X) (X)
#define PtoLUClauseAdjust(P) (P)
#define PtoLUIndexAdjust(P) (P)
#define XAdjust(X) (X)
#define YAdjust(X) (X)
#define AtomTermAdjust(X) (X)
#define CellPtoHeapAdjust(X) (X)
#define FuncAdjust(X) (X)
#define CodeAddrAdjust(X) (X)
#define CodeComposedTermAdjust(X) (X)
#define ConstantAdjust(X) (X)
#define ArityAdjust(X) (X)
#define OpcodeAdjust(X) (X)
#define ModuleAdjust(X) (X)
#define ExternalFunctionAdjust(X) (X)
#define AdjustSwitchTable(X, Y, Z)
#define DBGroundTermAdjust(X) (X)
#define rehash(A, B, C)
static Term BlobTermInCodeAdjust(Term t) {
CACHE_REGS
#if TAGS_FAST_OPS
return t - LOCAL_ClDiff;
#else
return t + LOCAL_ClDiff;
#endif
}
static Term ConstantTermAdjust(Term t) {
if (IsAtomTerm(t))
return AtomTermAdjust(t);
return t;
}
#include "rclause.h"
void Yap_BuildMegaClause(PredEntry *ap) {
CACHE_REGS
StaticClause *cl;
UInt sz;
MegaClause *mcl;
yamop *ptr;
size_t required;
UInt has_blobs = 0;
if (ap->PredFlags & (DynamicPredFlag | LogUpdatePredFlag | MegaClausePredFlag
#ifdef TABLING
| TabledPredFlag
#endif /* TABLING */
| UDIPredFlag) ||
ap->cs.p_code.FirstClause == NULL || ap->cs.p_code.NOfClauses < 16) {
return;
}
cl = ClauseCodeToStaticClause(ap->cs.p_code.FirstClause);
sz = cl->ClSize;
while (TRUE) {
if (!(cl->ClFlags & FactMask))
return; /* no mega clause, sorry */
if (cl->ClSize != sz)
return; /* no mega clause, sorry */
if (cl->ClCode == ap->cs.p_code.LastClause)
break;
has_blobs |= (cl->ClFlags & HasBlobsMask);
cl = cl->ClNext;
}
/* ok, we got the chance for a mega clause */
if (has_blobs) {
sz -= sizeof(StaticClause);
} else {
sz -= (UInt)NEXTOP((yamop *)NULL, p) + sizeof(StaticClause);
}
required = sz * ap->cs.p_code.NOfClauses + sizeof(MegaClause) +
(UInt)NEXTOP((yamop *)NULL, l);
while (!(mcl = (MegaClause *)Yap_AllocCodeSpace(required))) {
if (!Yap_growheap(FALSE, required, NULL)) {
/* just fail, the system will keep on going */
return;
}
}
#ifdef DEBUG
total_megaclause += required;
cl = ClauseCodeToStaticClause(ap->cs.p_code.FirstClause);
total_released += ap->cs.p_code.NOfClauses * cl->ClSize;
nof_megaclauses++;
#endif
Yap_ClauseSpace += required;
/* cool, it's our turn to do the conversion */
mcl->ClFlags = MegaMask | has_blobs;
mcl->ClSize = required;
mcl->ClPred = ap;
mcl->ClItemSize = sz;
mcl->ClNext = NULL;
cl = ClauseCodeToStaticClause(ap->cs.p_code.FirstClause);
mcl->ClLine = cl->usc.ClLine;
ptr = mcl->ClCode;
while (TRUE) {
memmove((void *)ptr, (void *)cl->ClCode, sz);
if (has_blobs) {
LOCAL_ClDiff = (char *)(ptr) - (char *)cl->ClCode;
restore_opcodes(ptr, NULL PASS_REGS);
}
ptr = (yamop *)((char *)ptr + sz);
if (cl->ClCode == ap->cs.p_code.LastClause)
break;
cl = cl->ClNext;
}
ptr->opc = Yap_opcode(_Ystop);
cl = ClauseCodeToStaticClause(ap->cs.p_code.FirstClause);
/* recover the space spent on the original clauses */
while (TRUE) {
StaticClause *ncl, *curcl = cl;
ncl = cl->ClNext;
Yap_InformOfRemoval(cl);
Yap_ClauseSpace -= cl->ClSize;
Yap_FreeCodeSpace((ADDR)cl);
if (curcl->ClCode == ap->cs.p_code.LastClause)
break;
cl = ncl;
}
ap->cs.p_code.FirstClause = ap->cs.p_code.LastClause = mcl->ClCode;
ap->PredFlags |= MegaClausePredFlag;
Yap_inform_profiler_of_clause(mcl, (char *)mcl + required, ap, GPROF_MEGA);
}
void Yap_split_megaclause(PredEntry *ap) {
StaticClause *start = NULL, *prev = NULL;
MegaClause *mcl;
yamop *ptr;
UInt ncls = ap->cs.p_code.NOfClauses, i;
mcl = ClauseCodeToMegaClause(ap->cs.p_code.FirstClause);
if (mcl->ClFlags & ExoMask) {
Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, Yap_PredicateToIndicator(ap),
"while deleting clause from exo predicate %s/%d\n",
RepAtom(NameOfFunctor(ap->FunctorOfPred))->StrOfAE,
ap->ArityOfPE);
return;
}
for (i = 0, ptr = mcl->ClCode; i < ncls; i++) {
StaticClause *new = (StaticClause *)Yap_AllocCodeSpace(
sizeof(StaticClause) + mcl->ClItemSize +
(UInt)NEXTOP((yamop *)NULL, p));
if (new == NULL) {
if (!Yap_growheap(FALSE,
(sizeof(StaticClause) + mcl->ClItemSize) * (ncls - i),
NULL)) {
while (start) {
StaticClause *cl = start;
start = cl->ClNext;
Yap_InformOfRemoval(cl);
Yap_ClauseSpace -= cl->ClSize;
Yap_FreeCodeSpace((char *)cl);
}
if (ap->ArityOfPE) {
Yap_Error(RESOURCE_ERROR_HEAP, TermNil,
"while breaking up mega clause for %s/%d\n",
RepAtom(NameOfFunctor(ap->FunctorOfPred))->StrOfAE,
ap->ArityOfPE);
} else {
Yap_Error(RESOURCE_ERROR_HEAP, TermNil,
"while breaking up mega clause for %s\n",
RepAtom((Atom)ap->FunctorOfPred)->StrOfAE);
}
return;
}
break;
}
Yap_ClauseSpace +=
sizeof(StaticClause) + mcl->ClItemSize + (UInt)NEXTOP((yamop *)NULL, p);
new->ClFlags = StaticMask | FactMask;
new->ClSize = mcl->ClItemSize;
new->usc.ClLine = Yap_source_line_no();
new->ClNext = NULL;
memmove((void *)new->ClCode, (void *)ptr, mcl->ClItemSize);
if (prev) {
prev->ClNext = new;
} else {
start = new;
}
ptr = (yamop *)((char *)ptr + mcl->ClItemSize);
prev = new;
}
ap->PredFlags &= ~MegaClausePredFlag;
ap->cs.p_code.FirstClause = start->ClCode;
ap->cs.p_code.LastClause = prev->ClCode;
}
static UInt compute_dbcl_size(arity_t arity) {
UInt sz;
switch (arity) {
case 2:
sz = (UInt)NEXTOP((yamop *)NULL, cc);
break;
case 3:
sz = (UInt)NEXTOP((yamop *)NULL, ccc);
break;
case 4:
sz = (UInt)NEXTOP((yamop *)NULL, cccc);
break;
case 5:
sz = (UInt)NEXTOP((yamop *)NULL, ccccc);
break;
case 6:
sz = (UInt)NEXTOP((yamop *)NULL, cccccc);
break;
default:
sz = arity * (UInt)NEXTOP((yamop *)NULL, xc);
break;
}
return (UInt)NEXTOP((yamop *)sz, p);
}
#define DerefAndCheck(t, V) \
t = Deref(V); \
if (IsVarTerm(t) || !(IsAtomOrIntTerm(t))) \
Yap_Error(TYPE_ERROR_ATOM, t0, "load_db");
static int store_dbcl_size(yamop *pc, arity_t arity, Term t0, PredEntry *pe) {
Term t;
CELL *tp = RepAppl(t0) + 1;
switch (arity) {
case 2:
pc->opc = Yap_opcode(_get_2atoms);
DerefAndCheck(t, tp[0]);
pc->y_u.cc.c1 = t;
DerefAndCheck(t, tp[1]);
pc->y_u.cc.c2 = t;
pc = NEXTOP(pc, cc);
break;
case 3:
pc->opc = Yap_opcode(_get_3atoms);
DerefAndCheck(t, tp[0]);
pc->y_u.ccc.c1 = t;
DerefAndCheck(t, tp[1]);
pc->y_u.ccc.c2 = t;
DerefAndCheck(t, tp[2]);
pc->y_u.ccc.c3 = t;
pc = NEXTOP(pc, ccc);
break;
case 4:
pc->opc = Yap_opcode(_get_4atoms);
DerefAndCheck(t, tp[0]);
pc->y_u.cccc.c1 = t;
DerefAndCheck(t, tp[1]);
pc->y_u.cccc.c2 = t;
DerefAndCheck(t, tp[2]);
pc->y_u.cccc.c3 = t;
DerefAndCheck(t, tp[3]);
pc->y_u.cccc.c4 = t;
pc = NEXTOP(pc, cccc);
break;
case 5:
pc->opc = Yap_opcode(_get_5atoms);
DerefAndCheck(t, tp[0]);
pc->y_u.ccccc.c1 = t;
DerefAndCheck(t, tp[1]);
pc->y_u.ccccc.c2 = t;
DerefAndCheck(t, tp[2]);
pc->y_u.ccccc.c3 = t;
DerefAndCheck(t, tp[3]);
pc->y_u.ccccc.c4 = t;
DerefAndCheck(t, tp[4]);
pc->y_u.ccccc.c5 = t;
pc = NEXTOP(pc, ccccc);
break;
case 6:
pc->opc = Yap_opcode(_get_6atoms);
DerefAndCheck(t, tp[0]);
pc->y_u.cccccc.c1 = t;
DerefAndCheck(t, tp[1]);
pc->y_u.cccccc.c2 = t;
DerefAndCheck(t, tp[2]);
pc->y_u.cccccc.c3 = t;
DerefAndCheck(t, tp[3]);
pc->y_u.cccccc.c4 = t;
DerefAndCheck(t, tp[4]);
pc->y_u.cccccc.c5 = t;
DerefAndCheck(t, tp[5]);
pc->y_u.cccccc.c6 = t;
pc = NEXTOP(pc, cccccc);
break;
default: {
arity_t i;
for (i = 0; i < arity; i++) {
pc->opc = Yap_opcode(_get_atom);
#if PRECOMPUTE_REGADDRESS
pc->y_u.xc.x = (CELL)(XREGS + (i + 1));
#else
pc->y_u.xc.x = i + 1;
#endif
DerefAndCheck(t, tp[0]);
pc->y_u.xc.c = t;
tp++;
pc = NEXTOP(pc, xc);
}
} break;
}
pc->opc = Yap_opcode(_procceed);
pc->y_u.p.p = pe;
return TRUE;
}
static Int
p_dbload_get_space(USES_REGS1) { /* '$number_of_clauses'(Predicate,M,N) */
Term t = Deref(ARG1);
Term mod = Deref(ARG2);
Term tn = Deref(ARG3);
arity_t arity;
Prop pe;
PredEntry *ap;
UInt sz;
MegaClause *mcl;
yamop *ptr;
UInt ncls;
UInt required;
if (IsVarTerm(mod) || !IsAtomTerm(mod)) {
return (FALSE);
}
if (IsAtomTerm(t)) {
Atom a = AtomOfTerm(t);
arity = 0;
pe = PredPropByAtom(a, mod);
} else if (IsApplTerm(t)) {
register Functor f = FunctorOfTerm(t);
arity = ArityOfFunctor(f);
pe = PredPropByFunc(f, mod);
} else {
return FALSE;
}
if (EndOfPAEntr(pe))
return FALSE;
ap = RepPredProp(pe);
if (ap->PredFlags & (DynamicPredFlag | LogUpdatePredFlag
#ifdef TABLING
| TabledPredFlag
#endif /* TABLING */
)) {
Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE, Yap_PredicateToIndicator(ap),
"dbload_get_space/4");
return FALSE;
}
if (IsVarTerm(tn) || !IsIntegerTerm(tn)) {
return FALSE;
}
ncls = IntegerOfTerm(tn);
if (ncls <= 1) {
return FALSE;
}
sz = compute_dbcl_size(arity);
required = sz * ncls + sizeof(MegaClause) + (UInt)NEXTOP((yamop *)NULL, l);
#ifdef DEBUG
total_megaclause += required;
nof_megaclauses++;
#endif
while (!(mcl = (MegaClause *)Yap_AllocCodeSpace(required))) {
if (!Yap_growheap(FALSE, required, NULL)) {
/* just fail, the system will keep on going */
return FALSE;
}
}
Yap_ClauseSpace += required;
/* cool, it's our turn to do the conversion */
mcl->ClFlags = MegaMask;
mcl->ClSize = sz * ncls;
mcl->ClPred = ap;
mcl->ClItemSize = sz;
mcl->ClNext = NULL;
ap->cs.p_code.FirstClause = ap->cs.p_code.LastClause = mcl->ClCode;
ap->PredFlags |= (MegaClausePredFlag);
ap->cs.p_code.NOfClauses = ncls;
if (ap->PredFlags & (SpiedPredFlag | CountPredFlag | ProfiledPredFlag)) {
ap->OpcodeOfPred = Yap_opcode(_spy_pred);
} else {
ap->OpcodeOfPred = INDEX_OPCODE;
}
ap->CodeOfPred = ap->cs.p_code.TrueCodeOfPred =
(yamop *)(&(ap->OpcodeOfPred));
ptr = (yamop *)((ADDR)mcl->ClCode + ncls * sz);
ptr->opc = Yap_opcode(_Ystop);
return Yap_unify(ARG4, MkIntegerTerm((Int)mcl));
}
static Int p_dbassert(USES_REGS1) { /* '$number_of_clauses'(Predicate,M,N) */
Term thandle = Deref(ARG2);
Term tn = Deref(ARG3);
PredEntry *pe;
MegaClause *mcl;
Int n;
if (IsVarTerm(thandle) || !IsIntegerTerm(thandle)) {
return FALSE;
}
mcl = (MegaClause *)IntegerOfTerm(thandle);
if (IsVarTerm(tn) || !IsIntegerTerm(tn)) {
return FALSE;
}
n = IntegerOfTerm(tn);
pe = mcl->ClPred;
return store_dbcl_size((yamop *)((ADDR)mcl->ClCode + n * (mcl->ClItemSize)),
pe->ArityOfPE, Deref(ARG1), pe);
}
void Yap_InitDBLoadPreds(void) {
CACHE_REGS
//CurrentModule = DBLOAD_MODULE;
Yap_InitCPred("$dbload_get_space", 4, p_dbload_get_space, 0L);
Yap_InitCPred("$dbassert", 3, p_dbassert, 0L);
//CurrentModule = cm;
}

View File

@ -18,18 +18,25 @@
static char SccsId[] = "%W% %G%";
#endif /* SCCS */
#include <math.h>
#include "Yap.h"
#include "Yatom.h"
#include "YapEval.h"
#ifdef DEPTH_LIMIT
#include "Yatom.h"
STD_PROTO(static Int p_get_depth_limit, ( USES_REGS1 ));
STD_PROTO(static Int p_set_depth_limit, ( USES_REGS1 ));
static Int p_get_depth_limit( USES_REGS1 );
static Int p_set_depth_limit( USES_REGS1 );
static Int p_get_depth_limit( USES_REGS1 )
{
return(Yap_unify_constant(ARG1, MkIntTerm(IntOfTerm(DEPTH/2))));
Int d = IntOfTerm(DEPTH);
if (d % 2 == 1)
return(Yap_unify(ARG1, MkFloatTerm(INFINITY)));
return(Yap_unify_constant(ARG1, MkIntTerm(d/2)));
}
static Int p_set_depth_limit( USES_REGS1 )
@ -40,8 +47,12 @@ static Int p_set_depth_limit( USES_REGS1 )
Yap_Error(INSTANTIATION_ERROR, d, "set-depth_limit");
return(FALSE);
} else if (!IsIntegerTerm(d)) {
Yap_Error(TYPE_ERROR_INTEGER, d, "set-depth_limit");
return(FALSE);
if (IsFloatTerm(d) && isinf(FloatOfTerm(d))) {
d = RESET_DEPTH();
} else {
Yap_Error(TYPE_ERROR_INTEGER, d, "set-depth_limit");
return(FALSE);
}
}
d = MkIntTerm(IntegerOfTerm(d)*2);
@ -59,6 +70,10 @@ static Int p_set_depth_limit_for_next_call( USES_REGS1 )
Yap_Error(INSTANTIATION_ERROR, d, "set-depth_limit");
return(FALSE);
} else if (!IsIntegerTerm(d)) {
if (IsFloatTerm(d) && isinf(FloatOfTerm(d))) {
DEPTH = RESET_DEPTH();
return TRUE;
}
Yap_Error(TYPE_ERROR_INTEGER, d, "set-depth_limit");
return(FALSE);
}
@ -72,8 +87,8 @@ static Int p_set_depth_limit_for_next_call( USES_REGS1 )
void Yap_InitItDeepenPreds(void)
{
Yap_InitCPred("get_depth_limit", 1, p_get_depth_limit, SafePredFlag);
Yap_InitCPred("$set_depth_limit", 1, p_set_depth_limit, HiddenPredFlag);
Yap_InitCPred("$set_depth_limit_for_next_call", 1, p_set_depth_limit_for_next_call, HiddenPredFlag);
Yap_InitCPred("$set_depth_limit", 1, p_set_depth_limit, 0);
Yap_InitCPred("$set_depth_limit_for_next_call", 1, p_set_depth_limit_for_next_call, 0);
}
#endif

View File

@ -180,7 +180,7 @@ void
Yap_add_memory_hole(ADDR start, ADDR end)
{
if (Yap_NOfMemoryHoles == MAX_DLMALLOC_HOLES) {
Yap_Error(OPERATING_SYSTEM_ERROR, 0L, "Unexpected Too Much Memory Fragmentation: please contact YAP maintainers");
Yap_Error(SYSTEM_ERROR_OPERATING_SYSTEM, 0L, "Unexpected Too Much Memory Fragmentation: please contact YAP maintainers");
return;
}
Yap_MemoryHoles[Yap_NOfMemoryHoles].start = start;
@ -1978,7 +1978,7 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes;
assert(ncopies >= 3);
if (ncopies > 9)
memcpy(d, s, copysize);
memmove(d, s, copysize);
else {
*(d+0) = *(s+0);
@ -2077,7 +2077,7 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes;
/* Must alloc, copy, free. */
newmem = mALLOc(nb - MALLOC_ALIGN_MASK);
if (newmem != 0) {
memcpy(newmem, oldmem, oldsize - 2*SIZE_SZ);
memmove(newmem, oldmem, oldsize - 2*SIZE_SZ);
fREe(oldmem);
}
}

3129
C/errors.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

534
C/eval.c
View File

@ -15,17 +15,34 @@
* *
*************************************************************************/
#ifdef SCCS
static char SccsId[] = "%W% %G%";
static char SccsId[] = "%W% %G%";
#endif
/*
* This file implements arithmetic operations
/**
* @file eval.c
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP-2.lan>
* @date Mon Apr 30 09:37:59 2018
*
* @brief is/2
*
*
* @namespace prolog
*
*
*
*/
//! @{
/**
@defgroup arithmetic_preds Arithmetic Predicates
@ingroup arithmetic
*/
#include "Yap.h"
#include "Yatom.h"
#include "YapHeap.h"
#include "eval.h"
#include "Yatom.h"
#include "YapEval.h"
#if HAVE_STDARG_H
#include <stdarg.h>
#endif
@ -33,150 +50,503 @@ static char SccsId[] = "%W% %G%";
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_FENV_H
#include <fenv.h>
#endif
static Term Eval(Term t1 USES_REGS);
static Term get_matrix_element(Term t1, Term t2 USES_REGS) {
if (!IsPairTerm(t2)) {
if (t2 == MkAtomTerm(AtomLength)) {
Int sz = 1;
while (IsApplTerm(t1)) {
Functor f = FunctorOfTerm(t1);
if (NameOfFunctor(f) != AtomNil) {
return MkIntegerTerm(sz);
}
sz *= ArityOfFunctor(f);
t1 = ArgOfTerm(1, t1);
}
return MkIntegerTerm(sz);
}
Yap_ArithError(TYPE_ERROR_EVALUABLE, t2, "X is Y^[A]");
return FALSE;
}
while (IsPairTerm(t2)) {
Int indx;
Term indxt = Eval(HeadOfTerm(t2) PASS_REGS);
if (!IsIntegerTerm(indxt)) {
Yap_ArithError(TYPE_ERROR_EVALUABLE, t2, "X is Y^[A]");
return FALSE;
}
indx = IntegerOfTerm(indxt);
if (!IsApplTerm(t1)) {
Yap_ArithError(TYPE_ERROR_EVALUABLE, t1, "X is Y^[A]");
return FALSE;
} else {
Functor f = FunctorOfTerm(t1);
if (ArityOfFunctor(f) < indx) {
Yap_ArithError(TYPE_ERROR_EVALUABLE, t1, "X is Y^[A]");
return FALSE;
}
}
t1 = ArgOfTerm(indx, t1);
t2 = TailOfTerm(t2);
}
if (t2 != TermNil) {
Yap_ArithError(TYPE_ERROR_EVALUABLE, t2, "X is Y^[A]");
return FALSE;
}
return Eval(t1 PASS_REGS);
}
static Term Eval(Term t USES_REGS) {
eval_context_t ctx;
ctx.p = LOCAL_ctx;
static Term
Eval(Term t USES_REGS)
{
if (IsVarTerm(t)) {
LOCAL_ArithError = TRUE;
return Yap_ArithError(INSTANTIATION_ERROR,t,"in arithmetic");
Yap_ArithError(INSTANTIATION_ERROR, t, "in arithmetic");
} else if (IsNumTerm(t)) {
return t;
} else if (IsAtomTerm(t)) {
ExpEntry *p;
Atom name = AtomOfTerm(t);
Atom name = AtomOfTerm(t);
if (EndOfPAEntr(p = RepExpProp(Yap_GetExpProp(name, 0)))) {
/* error */
return Yap_ArithError(TYPE_ERROR_EVALUABLE, t,
"atom %s for arithmetic expression",
RepAtom(name)->StrOfAE);
Yap_ArithError(TYPE_ERROR_EVALUABLE, takeIndicator(t),
"atom %s in arithmetic expression",
RepAtom(name)->StrOfAE);
}
return Yap_eval_atom(p->FOfEE);
} else if (IsApplTerm(t)) {
Functor fun = FunctorOfTerm(t);
if ((Atom)fun == AtomFoundVar) {
return Yap_ArithError(TYPE_ERROR_EVALUABLE, TermNil,
"cyclic term in arithmetic expression");
if (fun == FunctorString) {
const char *s = (const char *)StringOfTerm(t);
if (s[1] == '\0')
return MkIntegerTerm(s[0]);
Yap_ArithError(TYPE_ERROR_EVALUABLE, t,
"string in arithmetic expression");
} else if ((Atom)fun == AtomFoundVar) {
Yap_ArithError(TYPE_ERROR_EVALUABLE, TermNil,
"cyclic term in arithmetic expression");
} else {
Int n = ArityOfFunctor(fun);
Atom name = NameOfFunctor(fun);
Atom name = NameOfFunctor(fun);
ExpEntry *p;
Term t1, t2;
if (EndOfPAEntr(p = RepExpProp(Yap_GetExpProp(name, n)))) {
Term ti[2];
/* error */
ti[0] = t;
ti[1] = MkIntegerTerm(n);
t = Yap_MkApplTerm(FunctorSlash, 2, ti);
return Yap_ArithError(TYPE_ERROR_EVALUABLE, t,
"functor %s/%d for arithmetic expression",
RepAtom(name)->StrOfAE,n);
if (EndOfPAEntr(p = RepExpProp(Yap_GetExpProp(name, n)))) {
Yap_ArithError(TYPE_ERROR_EVALUABLE, takeIndicator(t),
"functor %s/%d for arithmetic expression",
RepAtom(name)->StrOfAE, n);
}
if (p->FOfEE == op_power && p->ArityOfEE == 2) {
t2 = ArgOfTerm(2, t);
if (IsPairTerm(t2)) {
return get_matrix_element(ArgOfTerm(1, t), t2 PASS_REGS);
}
}
ctx.f = fun;
ctx.fp = RepAppl(t);
LOCAL_ctx = &ctx;
*RepAppl(t) = (CELL)AtomFoundVar;
t1 = Eval(ArgOfTerm(1,t) PASS_REGS);
if (t1 == 0L) {
*RepAppl(t) = (CELL)fun;
return FALSE;
}
t1 = Eval(ArgOfTerm(1, t) PASS_REGS);
if (n == 1) {
*RepAppl(t) = (CELL)fun;
return Yap_eval_unary(p->FOfEE, t1);
*RepAppl(t) = (CELL)fun;
LOCAL_ctx = ctx.p;
return Yap_eval_unary(p->FOfEE, t1);
}
t2 = Eval(ArgOfTerm(2,t) PASS_REGS);
t2 = Eval(ArgOfTerm(2, t) PASS_REGS);
*RepAppl(t) = (CELL)fun;
if (t2 == 0L)
return FALSE;
return Yap_eval_binary(p->FOfEE,t1,t2);
LOCAL_ctx = ctx.p;
return Yap_eval_binary(p->FOfEE, t1, t2);
}
} /* else if (IsPairTerm(t)) */ {
} /* else if (IsPairTerm(t)) */
{
if (TailOfTerm(t) != TermNil) {
return Yap_ArithError(TYPE_ERROR_EVALUABLE, t,
"string must contain a single character to be evaluated as an arithmetic expression");
Yap_ArithError(TYPE_ERROR_EVALUABLE, t,
"string must contain a single character to be "
"evaluated as an arithmetic expression");
}
return Eval(HeadOfTerm(t) PASS_REGS);
}
}
Term
Yap_InnerEval(Term t)
{
CACHE_REGS
Term Yap_InnerEval__(Term t USES_REGS) {
return Eval(t PASS_REGS);
}
}
#ifdef BEAM
Int BEAM_is(void);
Int
BEAM_is(void)
{ /* X is Y */
Int BEAM_is(void) { /* X is Y */
union arith_ret res;
blob_type bt;
bt = Eval(Deref(XREGS[2]), &res);
if (bt==db_ref_e) return (NULL);
return (EvalToTerm(bt,&res));
if (bt == db_ref_e)
return (NULL);
return (EvalToTerm(bt, &res));
}
#endif
static Int
p_is( USES_REGS1 )
{ /* X is Y */
/**
@pred is( X:number, + Y:ground) is det
This predicate succeeds iff the result of evaluating the expression
_Y_ unifies with _X_. This is the predicate normally used to
perform evaluation of arithmetic expressions:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
X is 2+3*4
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
succeeds with `X = 14`.
Consult @ref arithmetic_operators for the complete list of
arithmetic_operators
*/
/// @memberof is/2
static Int p_is(USES_REGS1) { /* X is Y */
Term out = TermNil;
bool go;
Term t = Deref(ARG2);
if (IsVarTerm(t)) {
Yap_ThrowError(INSTANTIATION_ERROR, t, "var(Y) in X is Y");
return (FALSE);
}
do {
go = false;
out = Yap_Eval(t PASS_REGS);
go = Yap_CheckArithError();
} while (go);
return Yap_unify_constant(ARG1, out);
}
/**
@pred isnan(? X:float) is det
Interface to the IEE754 `isnan` test.
*/
/// @memberof isnan/1
static Int p_isnan(USES_REGS1) { /* X isnan Y */
Term out = 0L;
while (!(out = Eval(Deref(ARG2) PASS_REGS))) {
while (!(out = Eval(Deref(ARG1) PASS_REGS))) {
if (LOCAL_Error_TYPE == RESOURCE_ERROR_STACK) {
LOCAL_Error_TYPE = YAP_NO_ERROR;
if (!Yap_gcl(LOCAL_Error_Size, 2, ENV, CP)) {
Yap_Error(RESOURCE_ERROR_STACK, ARG2, LOCAL_ErrorMessage);
return FALSE;
if (!Yap_gcl(LOCAL_Error_Size, 1, ENV, CP)) {
Yap_EvalError(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage);
return FALSE;
}
} else {
Yap_Error(LOCAL_Error_TYPE, LOCAL_Error_Term, LOCAL_ErrorMessage);
Yap_EvalError(LOCAL_Error_TYPE, ARG1, LOCAL_ErrorMessage);
return FALSE;
}
}
return Yap_unify_constant(ARG1,out);
if (IsVarTerm(out)) {
Yap_EvalError(INSTANTIATION_ERROR, out, "isnan/1");
return FALSE;
}
if (!IsFloatTerm(out)) {
Yap_EvalError(TYPE_ERROR_FLOAT, out, "isnan/1");
return FALSE;
}
return isnan(FloatOfTerm(out));
}
Int
Yap_ArithError(yap_error_number type, Term where, char *format,...)
{
/**
@pred isinf(? X:float) is det
Interface to the IEE754 `isinf` test.
*/
/// @memberof isnan/1
static Int p_isinf(USES_REGS1) { /* X is Y */
Term out = 0L;
while (!(out = Eval(Deref(ARG1) PASS_REGS))) {
if (LOCAL_Error_TYPE == RESOURCE_ERROR_STACK) {
LOCAL_Error_TYPE = YAP_NO_ERROR;
if (!Yap_gcl(LOCAL_Error_Size, 1, ENV, CP)) {
Yap_EvalError(RESOURCE_ERROR_STACK, ARG2, LOCAL_ErrorMessage);
return FALSE;
}
} else {
Yap_EvalError(LOCAL_Error_TYPE, ARG1, LOCAL_ErrorMessage);
return FALSE;
}
}
if (IsVarTerm(out)) {
Yap_EvalError(INSTANTIATION_ERROR, out, "isinf/1");
return FALSE;
}
if (!IsFloatTerm(out)) {
Yap_EvalError(TYPE_ERROR_FLOAT, out, "isinf/1");
return FALSE;
}
return isinf(FloatOfTerm(out));
}
/**
@pred logsum(+ Log1:float, + Log2:float, - Out:float ) is det
True if _Log1_ is the logarithm of the positive number _A1_,
_Log2_ is the logarithm of the positive number _A2_, and
_Out_ is the logarithm of the sum of the numbers _A1_ and
_A2_. Useful in probability computation.
*/
/// @memberof logsum/3
static Int p_logsum(USES_REGS1) { /* X is Y */
Term t1 = Deref(ARG1);
Term t2 = Deref(ARG2);
int done = FALSE;
Float f1, f2;
while (!done) {
if (IsFloatTerm(t1)) {
f1 = FloatOfTerm(t1);
done = TRUE;
} else if (IsIntegerTerm(t1)) {
f1 = IntegerOfTerm(t1);
done = TRUE;
#if USE_GMP
} else if (IsBigIntTerm(t1)) {
f1 = Yap_gmp_to_float(t1);
done = TRUE;
#endif
} else {
while (!(t1 = Eval(t1 PASS_REGS))) {
if (LOCAL_Error_TYPE == RESOURCE_ERROR_STACK) {
LOCAL_Error_TYPE = YAP_NO_ERROR;
if (!Yap_gcl(LOCAL_Error_Size, 1, ENV, CP)) {
Yap_EvalError(RESOURCE_ERROR_STACK, ARG2, LOCAL_ErrorMessage);
return FALSE;
}
} else {
Yap_EvalError(LOCAL_Error_TYPE, ARG1, LOCAL_ErrorMessage);
return FALSE;
}
}
}
}
done = FALSE;
while (!done) {
if (IsFloatTerm(t2)) {
f2 = FloatOfTerm(t2);
done = TRUE;
} else if (IsIntegerTerm(t2)) {
f2 = IntegerOfTerm(t2);
done = TRUE;
#if USE_GMP
} else if (IsBigIntTerm(t2)) {
f2 = Yap_gmp_to_float(t2);
done = TRUE;
#endif
} else {
while (!(t2 = Eval(t2 PASS_REGS))) {
if (LOCAL_Error_TYPE == RESOURCE_ERROR_STACK) {
LOCAL_Error_TYPE = YAP_NO_ERROR;
if (!Yap_gcl(LOCAL_Error_Size, 2, ENV, CP)) {
Yap_EvalError(RESOURCE_ERROR_STACK, ARG2, LOCAL_ErrorMessage);
return FALSE;
}
} else {
Yap_EvalError(LOCAL_Error_TYPE, ARG1, LOCAL_ErrorMessage);
return FALSE;
}
}
}
}
if (f1 >= f2) {
Float fi = exp(f2 - f1);
return Yap_unify(ARG3, MkFloatTerm(f1 + log(1 + fi)));
} else {
Float fi = exp(f1 - f2);
return Yap_unify(ARG3, MkFloatTerm(f2 + log(1 + fi)));
}
}
void Yap_EvalError__(const char *file, const char *function, int lineno,
yap_error_number type, Term where, ...) {
CACHE_REGS
va_list ap;
char *format, buf[MAX_ERROR_MSG_SIZE];
LOCAL_ArithError = TRUE;
LOCAL_Error_TYPE = type;
LOCAL_Error_Term = where;
if (!LOCAL_ErrorMessage)
LOCAL_ErrorMessage = LOCAL_ErrorSay;
va_start (ap, format);
va_start(ap, where);
format = va_arg(ap, char *);
if (format != NULL) {
#if HAVE_VSNPRINTF
(void) vsnprintf(LOCAL_ErrorMessage, MAX_ERROR_MSG_SIZE, format, ap);
#if HAVE_VSNPRINTF
(void)vsnprintf(buf, MAX_ERROR_MSG_SIZE, format, ap);
#else
(void) vsprintf(LOCAL_ErrorMessage, format, ap);
(void)vsprintf(buf, format, ap);
#endif
} else {
LOCAL_ErrorMessage[0] = '\0';
buf[0] = '\0';
}
va_end (ap);
return 0L;
va_end(ap);
Yap_Error__(false, file, function, lineno, type, where, buf);
}
void
Yap_InitEval(void)
{
/**
@pred between(+ Low:int, + High:int, ? Value:int) is nondet
_Low_ and _High_ are integers, _High_ \>= _Low_. If
_Value_ is an integer, _Low_ =\< _Value_
=\< _High_. When _Value_ is a variable it is successively
bound to all integers between _Low_ and _High_. If
_High_ is inf or infinite between/3 is true iff
_Value_ \>= _Low_, a feature that is particularly interesting
for generating integers from a certain value.
*/
/// @memberof between/3
static Int cont_between(USES_REGS1) {
Term t1 = EXTRA_CBACK_ARG(3, 1);
Term t2 = EXTRA_CBACK_ARG(3, 2);
Yap_unify(ARG3, t1);
if (IsIntegerTerm(t1)) {
Int i1;
Term tn;
if (t1 == t2)
cut_succeed();
i1 = IntegerOfTerm(t1);
tn = add_int(i1, 1 PASS_REGS);
EXTRA_CBACK_ARG(3, 1) = tn;
HB = B->cp_h = HR;
return TRUE;
} else {
Term t[2];
Term tn;
Int cmp;
cmp = Yap_acmp(t1, t2 PASS_REGS);
if (cmp == 0)
cut_succeed();
t[0] = t1;
t[1] = MkIntTerm(1);
tn = Eval(Yap_MkApplTerm(FunctorPlus, 2, t) PASS_REGS);
EXTRA_CBACK_ARG(3, 1) = tn;
HB = B->cp_h = HR;
return TRUE;
}
}
/// @memberof between/3
static Int init_between(USES_REGS1) {
Term t1 = Deref(ARG1);
Term t2 = Deref(ARG2);
if (IsVarTerm(t1)) {
Yap_EvalError(INSTANTIATION_ERROR, t1, "between/3");
return FALSE;
}
if (IsVarTerm(t2)) {
Yap_EvalError(INSTANTIATION_ERROR, t1, "between/3");
return FALSE;
}
if (!IsIntegerTerm(t1) && !IsBigIntTerm(t1)) {
Yap_EvalError(TYPE_ERROR_INTEGER, t1, "between/3");
return FALSE;
}
if (!IsIntegerTerm(t2) && !IsBigIntTerm(t2) && t2 != MkAtomTerm(AtomInf) &&
t2 != MkAtomTerm(AtomInfinity)) {
Yap_EvalError(TYPE_ERROR_INTEGER, t2, "between/3");
return FALSE;
}
if (IsIntegerTerm(t1) && IsIntegerTerm(t2)) {
Int i1 = IntegerOfTerm(t1);
Int i2 = IntegerOfTerm(t2);
Term t3;
t3 = Deref(ARG3);
if (!IsVarTerm(t3)) {
if (!IsIntegerTerm(t3)) {
if (!IsBigIntTerm(t3)) {
Yap_EvalError(TYPE_ERROR_INTEGER, t3, "between/3");
return FALSE;
}
cut_fail();
} else {
Int i3 = IntegerOfTerm(t3);
if (i3 >= i1 && i3 <= i2)
cut_succeed();
cut_fail();
}
}
if (i1 > i2)
cut_fail();
if (i1 == i2) {
Yap_unify(ARG3, t1);
cut_succeed();
}
} else if (IsIntegerTerm(t1) && IsAtomTerm(t2)) {
Int i1 = IntegerOfTerm(t1);
Term t3;
t3 = Deref(ARG3);
if (!IsVarTerm(t3)) {
if (!IsIntegerTerm(t3)) {
if (!IsBigIntTerm(t3)) {
Yap_EvalError(TYPE_ERROR_INTEGER, t3, "between/3");
return FALSE;
}
cut_fail();
} else {
Int i3 = IntegerOfTerm(t3);
if (i3 >= i1)
cut_succeed();
cut_fail();
}
}
} else {
Term t3 = Deref(ARG3);
Int cmp;
if (!IsVarTerm(t3)) {
if (!IsIntegerTerm(t3) && !IsBigIntTerm(t3)) {
Yap_EvalError(TYPE_ERROR_INTEGER, t3, "between/3");
return FALSE;
}
if (Yap_acmp(t3, t1 PASS_REGS) >= 0 && Yap_acmp(t2, t3 PASS_REGS) >= 0 &&
P != FAILCODE)
cut_succeed();
cut_fail();
}
cmp = Yap_acmp(t1, t2 PASS_REGS);
if (cmp > 0)
cut_fail();
if (cmp == 0) {
Yap_unify(ARG3, t1);
cut_succeed();
}
}
EXTRA_CBACK_ARG(3, 1) = t1;
EXTRA_CBACK_ARG(3, 2) = t2;
return cont_between(PASS_REGS1);
}
void Yap_InitEval(void) {
/* here are the arithmetical predicates */
Yap_InitConstExps();
Yap_InitUnaryExps();
Yap_InitBinaryExps();
Yap_InitCPred("is", 2, p_is, 0L);
Yap_InitCPred("isnan", 1, p_isnan, TestPredFlag);
Yap_InitCPred("isinf", 1, p_isinf, TestPredFlag);
Yap_InitCPred("logsum", 3, p_logsum, TestPredFlag);
Yap_InitCPredBack("between", 3, 2, init_between, cont_between, 0);
}
/**
*
* @}
*/

4004
C/exec.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

787
C/exo.c Executable file
View File

@ -0,0 +1,787 @@
/*************************************************************************
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* *
**************************************************************************
* *
* File: exo.c *
* comments: Exo compilation *
* *
* Last rev: $Date: 2008-07-22 23:34:44 $,$Author: vsc $ * *
* $Log: not supported by cvs2svn $ *
* *
* *
*************************************************************************/
#include "Yap.h"
#include "clause.h"
#include "yapio.h"
#include "YapEval.h"
#include "tracer.h"
#ifdef YAPOR
#include "or.macros.h"
#endif /* YAPOR */
#ifdef TABLING
#include "tab.macros.h"
#endif /* TABLING */
#if HAVE_STRING_H
#include <string.h>
#endif
#if HAVE_STRING_H
#include <string.h>
#endif
#if HAVE_STDBOOL_H
#include <stdbool.h>
#endif
bool YAP_NewExo( PredEntry *ap, size_t data, struct udi_info *udi);
bool YAP_AssertTuples( PredEntry *pe, const Term *ts, size_t offset, size_t m);
//static int exo_write=FALSE;
//void do_write(void) { exo_write=TRUE;}
#define MAX_ARITY 256
#if SIZEOF_INT_P==4
#define FNV32_PRIME (16777619UL)
#define FNV32_OFFSET (0x811c9dc5UL)
#define FNV_PRIME FNV32_PRIME
#define FNV_OFFSET FNV32_OFFSET
#elif SIZEOF_INT_P==8
#define FNV64_PRIME (1099511628211)
#if SIZEOF_LONG_INT==4
#define FNV64_OFFSET (14695981039346656037ULL)
#else
#define FNV64_OFFSET (14695981039346656037UL)
#endif
#define FNV_PRIME FNV64_PRIME
#define FNV_OFFSET FNV64_OFFSET
#endif
/*MurmurHash3 from: https://code.google.com/p/smhasher/wiki/MurmurHash3*/
BITS32 rotl32 ( BITS32, int8_t);
inline BITS32 rotl32 ( BITS32 x, int8_t r )
{
return (x << r) | (x >> (32 - r));
}
#define ROTL32(x,y) rotl32(x,y)
//-----------------------------------------------------------------------------
// Finalization mix - force all bits of a hash block to avalanche
BITS32 fmix32 ( BITS32 );
inline BITS32 fmix32 ( BITS32 h )
{
h ^= h >> 16;
h *= 0x85ebca6b;
h ^= h >> 13;
h *= 0xc2b2ae35;
h ^= h >> 16;
return h;
}
//-----------------------------------------------------------------------------
INLINE_ONLY BITS32
HASH_MURMUR3_32 (UInt arity, CELL *cl, UInt bnds[], UInt sz);
INLINE_ONLY BITS32
HASH_MURMUR3_32 (UInt arity, CELL *cl, UInt bnds[], UInt sz)
{
UInt hash;
UInt j=0;
int len = 0;
const BITS32 c1 = 0xcc9e2d51;
const BITS32 c2 = 0x1b873593;
hash = FNV_OFFSET; /*did not find what seed to use yet*/
while (j < arity) {
if (bnds[j]) {
unsigned char *i=(unsigned char*)(cl+j);
unsigned char *m=(unsigned char*)(cl+(j+1));
while (i < m) {
BITS32 k1 = i[0];
k1 *= c1;
k1 = ROTL32(k1,15);
k1 *= c2;
hash ^= k1;
hash = ROTL32(hash,13);
hash = hash*5+0xe6546b64;
i++;
len++;
}
}
j++;
}
//----------
// tail not used becouse len is block multiple
//----------
// finalization
hash ^= len;
hash = fmix32(hash);
return hash;
}
/*DJB2*/
#define DJB2_OFFSET 5381
INLINE_ONLY BITS32
HASH_DJB2(UInt arity, CELL *cl, UInt bnds[], UInt sz);
INLINE_ONLY BITS32
HASH_DJB2(UInt arity, CELL *cl, UInt bnds[], UInt sz)
{
BITS32 hash;
UInt j=0;
hash = DJB2_OFFSET;
while (j < arity) {
if (bnds[j]) {
unsigned char *i=(unsigned char*)(cl+j);
unsigned char *m=(unsigned char*)(cl+(j+1));
while (i < m) {
BITS32 h5 = hash << 5;
hash += h5 + i[0]; /* hash * 33 + i[0] */
i++;
}
}
j++;
}
return hash;
}
INLINE_ONLY BITS32
HASH_RS(UInt arity, CELL *cl, UInt bnds[], UInt sz);
/* RS Hash Function */
INLINE_ONLY BITS32
HASH_RS(UInt arity, CELL *cl, UInt bnds[], UInt sz)
{
UInt hash=0;
UInt j=0;
UInt b = 378551;
UInt a = 63689;
while (j < arity) {
if (bnds[j]) {
unsigned char *i=(unsigned char*)(cl+j);
unsigned char *m=(unsigned char*)(cl+(j+1));
while (i < m) {
hash = hash * a + i[0];
a = a * b;
i++;
}
}
j++;
}
return hash;
}
INLINE_ONLY BITS32
HASH_FVN_1A(UInt arity, CELL *cl, UInt bnds[], UInt sz);
/* Simple hash function:
FVN-1A
first component is the base key.
hash0 spreads extensions coming from different elements.
spread over j quadrants.
*/
INLINE_ONLY BITS32
HASH_FVN_1A(UInt arity, CELL *cl, UInt bnds[], UInt sz)
{
UInt hash;
UInt j=0;
hash = FNV_OFFSET;
while (j < arity) {
if (bnds[j]) {
unsigned char *i=(unsigned char*)(cl+j);
unsigned char *m=(unsigned char*)(cl+(j+1));
while (i < m) {
hash = hash ^ i[0];
hash = hash * FNV_PRIME;
i++;
}
}
j++;
}
return hash;
}
//#define TEST_HASH_DJB 1
#if defined TEST_HASH_MURMUR
# define HASH(...) HASH_MURMUR3_32(__VA_ARGS__)
#elif defined TEST_HASH_DJB
# define HASH(...) HASH_DJB2(__VA_ARGS__)
#elif defined TEST_HASH_RS
# define HASH(...) HASH_RS(__VA_ARGS__)
#else
/* Default: TEST_HASH_FVN */
# define HASH(...) HASH_FVN_1A(__VA_ARGS__)
# define HASH1(...) HASH_MURMUR3_32(__VA_ARGS__)
#endif
static BITS32
NEXT(UInt arity, CELL *cl, UInt bnds[], UInt sz, BITS32 hash)
{
int i = 0;
BITS32 hash1;
while (bnds[i]==0) i++;
hash1 = HASH1(arity, cl, bnds, sz);
return (hash + hash1 +cl[i]);
}
/* search for matching elements */
static int
MATCH(CELL *clp, CELL *kvp, UInt arity, UInt bnds[])
{
UInt j = 0;
while (j< arity) {
if ( bnds[j] && clp[j] != kvp[j])
return FALSE;
j++;
}
return TRUE;
}
static void
ADD_TO_TRY_CHAIN(CELL *kvp, CELL *cl, struct index_t *it)
{
BITS32 old = EXO_ADDRESS_TO_OFFSET(it, kvp);
BITS32 new = EXO_ADDRESS_TO_OFFSET(it, cl);
BITS32 *links = it->links;
BITS32 tmp = links[old]; /* points to the end of the chain */
if (!tmp) {
links[old] = links[new] = new;
} else {
links[new] = links[tmp];
links[tmp] = new;
links[old] = new;
}
}
/* This is the critical routine, it builds the hash table *
* each HT field stores a key pointer which is actually
* a pointer to the point in the clause where one can find the element.
*
* The cls table indexes all elements that can be reached using that key.
*
* Insert:
* j = first
* not match cij -> insert, open new chain
* match ci..j ck..j -> find j = minarg(cij \= c2j),
* else j = +inf -> c2+ci
* Lookup:
* j= first
* not match cij -> fail
* match ci..j ck..j -> find j = minarg(cij \= c2j)
* else
*/
static int
INSERT(CELL *cl, struct index_t *it, UInt arity, UInt base, UInt bnds[])
{
CELL *kvp;
BITS32 hash;
int coll_count = 0;
hash = HASH(arity, cl, bnds, it->hsize);
next:
kvp = EXO_OFFSET_TO_ADDRESS(it, it->key [hash % it->hsize]);
if (kvp == NULL) {
/* simple case, new entry */
it->nentries++;
it->key[hash % it->hsize ] = EXO_ADDRESS_TO_OFFSET(it, cl);
if (coll_count > it -> max_col_count)
it->max_col_count = coll_count;
return TRUE;
} else if (MATCH(kvp, cl, arity, bnds)) {
it->ntrys++;
ADD_TO_TRY_CHAIN(kvp, cl, it);
return TRUE;
} else {
coll_count++;
it->ncollisions++;
// printf("#");
hash = NEXT(arity, cl, bnds, it->hsize, hash);
//if (exo_write) printf("N=%ld\n", hash);
goto next;
}
}
static yamop *
LOOKUP(struct index_t *it, UInt arity, UInt j, UInt bnds[])
{
CACHE_REGS
CELL *kvp;
BITS32 hash;
/* j is the firs bound element */
/* check if we match */
hash = HASH(arity, XREGS+1, bnds, it->hsize);
next:
/* loop to insert element */
kvp = EXO_OFFSET_TO_ADDRESS(it, it->key[hash % it->hsize]);
if (kvp == NULL) {
/* simple case, no element */
return FAILCODE;
} else if (MATCH(kvp, XREGS+1, arity, bnds)) {
S = kvp;
if (!it->is_key && it->links[EXO_ADDRESS_TO_OFFSET(it, S)])
return it->code;
else
return NEXTOP(NEXTOP(it->code,lp),lp);
} else {
/* collision */
hash = NEXT(arity, XREGS+1, bnds, it->hsize, hash);
goto next;
}
}
static int
fill_hash(UInt bmap, struct index_t *it, UInt bnds[])
{
UInt i;
UInt arity = it->arity;
CELL *cl = it->cls;
for (i=0; i < it->nels; i++) {
if (!INSERT(cl, it, arity, 0, bnds))
return FALSE;
cl += arity;
}
for (i=0; i < it->hsize; i++) {
if (it->key[i]) {
BITS32 offset = it->key[i];
BITS32 last = it->links[offset];
if (last) {
/* the chain used to point straight to the last, and the last back to the original first */
it->links[offset] = it->links[last];
it->links[last] = 0;
}
}
}
return TRUE;
}
static struct index_t *
add_index(struct index_t **ip, UInt bmap, PredEntry *ap, UInt count)
{
CACHE_REGS
UInt ncls = ap->cs.p_code.NOfClauses, j;
CELL *base = NULL;
struct index_t *i;
size_t sz, dsz;
yamop *ptr;
UInt *bnds = LOCAL_ibnds;
sz = (CELL)NEXTOP(NEXTOP((yamop*)NULL,lp),lp)+ap->ArityOfPE*(CELL)NEXTOP((yamop *)NULL,x) +(CELL)NEXTOP(NEXTOP((yamop *)NULL,p),l);
if (!(i = (struct index_t *)Yap_AllocCodeSpace(sizeof(struct index_t)+sz))) {
CACHE_REGS
save_machine_regs();
LOCAL_Error_Size = 3*ncls*sizeof(CELL);
LOCAL_ErrorMessage = "not enough space to index";
Yap_Error(RESOURCE_ERROR_HEAP, TermNil, LOCAL_ErrorMessage);
return NULL;
}
i->is_key = FALSE;
i->next = *ip;
i->prev = NULL;
i->nels = ncls;
i->arity = ap->ArityOfPE;
i->ap = ap;
i->bmap = bmap;
i->is_key = FALSE;
i->hsize = 2*ncls;
dsz = sizeof(BITS32)*(ncls+1+i->hsize);
if (count) {
if (!(base = (CELL *)Yap_AllocCodeSpace(dsz))) {
CACHE_REGS
save_machine_regs();
LOCAL_Error_Size = dsz;
LOCAL_ErrorMessage = "not enough space to generate indices";
Yap_FreeCodeSpace((void *)i);
Yap_Error(RESOURCE_ERROR_HEAP, TermNil, LOCAL_ErrorMessage);
return NULL;
}
memset(base, 0, dsz);
}
i->size = sz+dsz+sizeof(struct index_t);
i->key = (BITS32 *)base;
i->links = (BITS32 *)base+i->hsize;
i->ncollisions = i->nentries = i->ntrys = 0;
i->cls = (CELL *)((ADDR)ap->cs.p_code.FirstClause+2*sizeof(struct index_t *));
i->bcls= i->cls-i->arity;
i->udi_free_args = 0;
i->is_udi = FALSE;
i->udi_arg = 0;
*ip = i;
while (count) {
if (!fill_hash(bmap, i, bnds)) {
size_t sz;
i->hsize += ncls;
if (i->is_key) {
sz = i->hsize*sizeof(BITS32);
} else {
sz = (ncls+1+i->hsize)*sizeof(BITS32);
}
if (base != (CELL *)Yap_ReallocCodeSpace((char *)base, sz))
return FALSE;
memset(base, 0, sz);
i->key = (BITS32 *)base;
i->links = (BITS32 *)(base+i->hsize);
i->ncollisions = i->nentries = i->ntrys = 0;
continue;
}
#if DEBUG
fprintf(stderr, "entries=" UInt_FORMAT " collisions=" UInt_FORMAT" (max=" UInt_FORMAT ") trys=" UInt_FORMAT "\n", i->nentries, i->ncollisions, i->max_col_count, i->ntrys);
#endif
if (!i->ntrys && !i->is_key) {
i->is_key = TRUE;
if (base != (CELL *)Yap_ReallocCodeSpace((char *)base, i->hsize*sizeof(BITS32)))
return FALSE;
}
/* our hash table is just too large */
if (( i->nentries+i->ncollisions )*10 < i->hsize) {
size_t sz;
i->hsize = ( i->nentries+i->ncollisions )*10;
if (i->is_key) {
sz = i->hsize*sizeof(BITS32);
} else {
sz = (ncls+1+i->hsize)*sizeof(BITS32);
}
if (base != (CELL *)Yap_ReallocCodeSpace((char *)base, sz))
return FALSE;
memset(base, 0, sz);
i->key = (BITS32 *)base;
i->links = (BITS32 *)base+i->hsize;
i->ncollisions = i->nentries = i->ntrys = 0;
} else {
break;
}
}
ptr = (yamop *)(i+1);
i->code = ptr;
if (count)
ptr->opc = Yap_opcode(_try_exo);
else
ptr->opc = Yap_opcode(_try_all_exo);
ptr->y_u.lp.l = (yamop *)i;
ptr->y_u.lp.p = ap;
ptr = NEXTOP(ptr, lp);
if (count)
ptr->opc = Yap_opcode(_retry_exo);
else
ptr->opc = Yap_opcode(_retry_all_exo);
ptr->y_u.lp.p = ap;
ptr->y_u.lp.l = (yamop *)i;
ptr = NEXTOP(ptr, lp);
for (j = 0; j < i->arity; j++) {
ptr->opc = Yap_opcode(_get_atom_exo);
#if PRECOMPUTE_REGADDRESS
ptr->y_u.x.x = (CELL) (XREGS + (j+1));
#else
ptr->y_u.x.x = j+1;
#endif
ptr = NEXTOP(ptr, x);
}
ptr->opc = Yap_opcode(_procceed);
ptr->y_u.p.p = ap;
ptr = NEXTOP(ptr, p);
ptr->opc = Yap_opcode(_Ystop);
ptr->y_u.l.l = i->code;
Yap_inform_profiler_of_clause((char *)(i->code), (char *)NEXTOP(ptr,l), ap, GPROF_INDEX);
if (ap->PredFlags & UDIPredFlag) {
Yap_new_udi_clause( ap, NULL, (Term)ip);
} else {
i->is_udi = FALSE;
}
return i;
}
yamop *
Yap_ExoLookup(PredEntry *ap USES_REGS)
{
UInt arity = ap->ArityOfPE;
UInt bmap = 0L, bit = 1, count = 0, j, j0 = 0;
struct index_t **ip = (struct index_t **)(ap->cs.p_code.FirstClause);
struct index_t *i = *ip;
for (j=0; j< arity; j++, bit<<=1) {
Term t = Deref(XREGS[j+1]);
if (!IsVarTerm(t)) {
bmap += bit;
LOCAL_ibnds[j] = TRUE;
if (!count) j0= j;
count++;
} else {
LOCAL_ibnds[j] = FALSE;
}
XREGS[j+1] = t;
}
while (i) {
// if (i->is_key && (i->bmap & bmap) == i->bmap) {
// break;
// }
if (i->bmap == bmap) {
break;
}
ip = &i->next;
i = i->next;
}
if (!i) {
i = add_index(ip, bmap, ap, count);
}
if (count) {
yamop *code = LOOKUP(i, arity, j0, LOCAL_ibnds);
if (code == FAILCODE)
return code;
if (i->is_udi)
return ((CEnterExoIndex)i->udi_first)(i PASS_REGS);
else
return code;
} else if(i->is_udi) {
return ((CEnterExoIndex)i->udi_first)(i PASS_REGS);
} else {
return i->code;
}
}
CELL
Yap_NextExo(choiceptr cptr, struct index_t *it)
{
CACHE_REGS
BITS32 offset = ADDRESS_TO_LINK(it,(BITS32 *)((CELL *)(B+1))[it->arity]);
BITS32 next = it->links[offset];
((CELL *)(B+1))[it->arity] = (CELL)LINK_TO_ADDRESS(it, next);
S = it->cls+it->arity*offset;
return next;
}
static MegaClause *
exodb_get_space( Term t, Term mod, Term tn )
{
UInt arity;
Prop pe;
PredEntry *ap;
MegaClause *mcl;
UInt ncls;
UInt required;
struct index_t **li;
if (IsVarTerm(mod) || !IsAtomTerm(mod)) {
return NULL;
}
if (IsAtomTerm(t)) {
Atom a = AtomOfTerm(t);
arity = 0;
pe = PredPropByAtom(a, mod);
} else if (IsApplTerm(t)) {
register Functor f = FunctorOfTerm(t);
arity = ArityOfFunctor(f);
pe = PredPropByFunc(f, mod);
} else {
return NULL;
}
if (EndOfPAEntr(pe))
return NULL;
ap = RepPredProp(pe);
if (ap->PredFlags & (DynamicPredFlag|LogUpdatePredFlag
#ifdef TABLING
|TabledPredFlag
#endif /* TABLING */
)) {
Yap_Error(PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE,t,"dbload_get_space/4");
return NULL;
}
if (IsVarTerm(tn) || !IsIntegerTerm(tn)) {
return NULL;
}
ncls = IntegerOfTerm(tn);
if (ncls <= 1) {
return NULL;
}
required = ncls*arity*sizeof(CELL)+sizeof(MegaClause)+2*sizeof(struct index_t *);
while (!(mcl = (MegaClause *)Yap_AllocCodeSpace(required))) {
if (!Yap_growheap(FALSE, required, NULL)) {
/* just fail, the system will keep on going */
return NULL;
}
}
Yap_ClauseSpace += required;
/* cool, it's our turn to do the conversion */
mcl->ClFlags = MegaMask|ExoMask;
mcl->ClSize = required;
mcl->ClPred = ap;
mcl->ClItemSize = arity*sizeof(CELL);
mcl->ClNext = NULL;
li = (struct index_t **)(mcl->ClCode);
li[0] = li[1] = NULL;
ap->cs.p_code.FirstClause =
ap->cs.p_code.LastClause =
mcl->ClCode;
ap->PredFlags |= MegaClausePredFlag;
ap->cs.p_code.NOfClauses = ncls;
if (ap->PredFlags & (SpiedPredFlag|CountPredFlag|ProfiledPredFlag)) {
ap->OpcodeOfPred = Yap_opcode(_spy_pred);
} else {
ap->OpcodeOfPred = Yap_opcode(_enter_exo);
}
ap->CodeOfPred = ap->cs.p_code.TrueCodeOfPred = (yamop *)(&(ap->OpcodeOfPred));
return mcl;
}
bool
YAP_NewExo( PredEntry *ap, size_t data, struct udi_info *udi)
{
MegaClause *mcl;
size_t required;
struct index_t **li;
if (data <= ap->ArityOfPE*sizeof(CELL)) {
return false;
}
// data = ncls*arity*sizeof(CELL);
required = data+sizeof(MegaClause)+2*sizeof(struct index_t *);
while (!(mcl = (MegaClause *)Yap_AllocCodeSpace(required))) {
if (!Yap_growheap(FALSE, required, NULL)) {
/* just fail, the system will keep on going */
return false;
}
}
Yap_ClauseSpace += required;
/* cool, it's our turn to do the conversion */
mcl->ClFlags = MegaMask|ExoMask;
mcl->ClSize = required;
mcl->ClPred = ap;
mcl->ClItemSize = ap->ArityOfPE*sizeof(CELL);
mcl->ClNext = NULL;
li = (struct index_t **)(mcl->ClCode);
li[0] = li[1] = NULL;
ap->cs.p_code.FirstClause =
ap->cs.p_code.LastClause =
mcl->ClCode;
ap->PredFlags |= MegaClausePredFlag;
ap->cs.p_code.NOfClauses = 0;
if (ap->PredFlags & (SpiedPredFlag|CountPredFlag|ProfiledPredFlag)) {
ap->OpcodeOfPred = Yap_opcode(_spy_pred);
} else {
ap->OpcodeOfPred = Yap_opcode(_enter_exo);
}
ap->CodeOfPred = ap->cs.p_code.TrueCodeOfPred = (yamop *)(&(ap->OpcodeOfPred));
return true;
}
static Int
p_exodb_get_space( USES_REGS1 )
{ /* '$number_of_clauses'(Predicate,M,N) */
void *mcl;
if ((mcl = exodb_get_space(Deref(ARG1), Deref(ARG2), Deref(ARG3))) == NULL)
return FALSE;
return Yap_unify(ARG4, MkIntegerTerm((Int)mcl));
}
#define DerefAndCheck(t, V) \
t = Deref(V); if(IsVarTerm(t) || !(IsAtomOrIntTerm(t))) Yap_Error(TYPE_ERROR_ATOMIC, t0, "load_db");
static Int
store_exo(yamop *pc, UInt arity, Term t0)
{
Term t;
CELL *tp = RepAppl(t0)+1,
*cpc = (CELL *)pc;
UInt i;
for (i = 0; i< arity; i++) {
DerefAndCheck(t, tp[0]);
*cpc = t;
// Yap_DebugPlWrite(t); fprintf(stderr,"\n");
tp++;
cpc++;
}
//fprintf(stderr,"\n");
return TRUE;
}
bool
YAP_AssertTuples( PredEntry *pe, const Term *ts, size_t offset, size_t m)
{
MegaClause *mcl = ClauseCodeToMegaClause(pe->cs.p_code.FirstClause);
size_t i;
ADDR base = (ADDR)mcl->ClCode+2*sizeof(struct index_t *);
for (i=0; i<m; i++) {
yamop *ptr = (yamop *)(base+offset*(mcl->ClItemSize));
store_exo( ptr, pe->ArityOfPE, ts[i]);
}
return true;
}
static void
exoassert( void *handle, Int n, Term term )
{ /* '$number_of_clauses'(Predicate,M,N) */
PredEntry *pe;
MegaClause *mcl;
mcl = (MegaClause *) handle;
pe = mcl->ClPred;
store_exo((yamop *)((ADDR)mcl->ClCode+2*sizeof(struct index_t *)+n*(mcl->ClItemSize)),pe->ArityOfPE, term);
}
static Int
p_exoassert( USES_REGS1 )
{ /* '$number_of_clauses'(Predicate,M,N) */
Term thandle = Deref(ARG2);
Term tn = Deref(ARG3);
MegaClause *mcl;
Int n;
if (IsVarTerm(thandle) || !IsIntegerTerm(thandle)) {
return FALSE;
}
mcl = (MegaClause *)IntegerOfTerm(thandle);
if (IsVarTerm(tn) || !IsIntegerTerm(tn)) {
return FALSE;
}
n = IntegerOfTerm(tn);
exoassert(mcl,n,Deref(ARG1));
return TRUE;
}
void
Yap_InitExoPreds(void)
{
CACHE_REGS
Term cm = CurrentModule;
CurrentModule = DBLOAD_MODULE;
Yap_InitCPred("exo_db_get_space", 4, p_exodb_get_space, 0L);
Yap_InitCPred("exoassert", 3, p_exoassert, 0L);
CurrentModule = cm;
}

588
C/exo_udi.c Executable file
View File

@ -0,0 +1,588 @@
/*************************************************************************
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* *
**************************************************************************
* *
* File: exo.c *
* comments: Exo compilation *
* *
* Last rev: $Date: 2008-07-22 23:34:44 $,$Author: vsc $ * *
* $Log: not supported by cvs2svn $ *
* *
* *
*************************************************************************/
#include "Yap.h"
#include "clause.h"
#include "yapio.h"
#include "YapEval.h"
#include "tracer.h"
#include "attvar.h"
#ifdef YAPOR
#include "or.macros.h"
#endif /* YAPOR */
#ifdef TABLING
#include "tab.macros.h"
#endif /* TABLING */
#if HAVE_STRING_H
#include <string.h>
#endif
#include <udi.h>
static int
compar(const void *ip0, const void *jp0) {
CACHE_REGS
BITS32 *ip = (BITS32 *)ip0, *jp = (BITS32 *)jp0;
Term i = EXO_OFFSET_TO_ADDRESS(LOCAL_exo_it, *ip)[LOCAL_exo_arg];
Term j = EXO_OFFSET_TO_ADDRESS(LOCAL_exo_it, *jp)[LOCAL_exo_arg];
//fprintf(stderr, "%ld-%ld\n", IntOfTerm(i), IntOfTerm(j));
return IntOfTerm(i)-IntOfTerm(j);
}
static Int
cmp_extra_args(CELL *si, CELL *sj, struct index_t *it)
{
UInt m = it->udi_free_args;
UInt m0 = 1, x;
for (x=0; x< it->arity; x++) {
if (m0 & m) {
if (si[x] != sj[x]) {
if (IsIntTerm(si[x]))
return IntOfTerm(si[x])-IntOfTerm(sj[x]);
return AtomOfTerm(si[x])-AtomOfTerm(sj[x]);
}
m -= m0;
if (m == 0)
return 0;
}
m0 <<= 1;
}
return 0;
}
static int
compar2(const void *ip0, const void *jp0) {
CACHE_REGS
BITS32 *ip = (BITS32 *)ip0, *jp = (BITS32 *)jp0;
struct index_t *it = LOCAL_exo_it;
Term* si = EXO_OFFSET_TO_ADDRESS(it, *ip);
Term* sj = EXO_OFFSET_TO_ADDRESS(it, *jp);
int cmp = cmp_extra_args(si, sj, it);
if (cmp)
return cmp;
return IntOfTerm(si[LOCAL_exo_arg])-IntOfTerm(sj[LOCAL_exo_arg]);
}
static int
compare(const BITS32 *ip, Int j USES_REGS) {
Term i = EXO_OFFSET_TO_ADDRESS(LOCAL_exo_it, *ip)[LOCAL_exo_arg];
//fprintf(stderr, "%ld-%ld\n", IntOfTerm(i), j);
return IntOfTerm(i)-j;
}
static UInt free_args(UInt b[], UInt arity, UInt i) {
UInt j;
UInt rc = 0;
for (j=0; j<arity; j++) {
if (i !=j && b[j] == 0)
rc |= 1<<j;
}
return rc;
}
static BITS32*
NEXT_DIFFERENT(BITS32 *pt0, BITS32 *pte, struct index_t *it)
{
Term* si = EXO_OFFSET_TO_ADDRESS(it, pt0[0]);
Term* sj;
do {
pt0++;
if (pt0 == pte)
return NULL;
sj = EXO_OFFSET_TO_ADDRESS(it, *pt0);
} while (!cmp_extra_args(si, sj, it));
return pt0;
}
static BITS32*
PREV_DIFFERENT(BITS32 *pt0, BITS32 *pte, struct index_t *it)
{
Term* si = EXO_OFFSET_TO_ADDRESS(it, pt0[0]);
Term* sj;
do {
pt0--;
if (pt0 == pte)
return NULL;
sj = EXO_OFFSET_TO_ADDRESS(it, *pt0);
} while (!cmp_extra_args(si, sj, it));
return pt0;
}
static BITS32*
NEXT_MIN(BITS32 *pt0, BITS32 *pte, Term tmin, Term tmax, struct index_t *it)
{
Term* si = EXO_OFFSET_TO_ADDRESS(it, pt0[0]);
int do_min, do_max;
Int min = 0, max = 0;
if (IsVarTerm(tmin)) {
do_min = FALSE;
} else {
do_min = TRUE;
min = IntOfTerm(tmin);
}
if (IsVarTerm(tmax)) {
do_max = FALSE;
} else {
do_max = TRUE;
max = IntOfTerm(tmax);
}
while ((do_min && IntOfTerm(si[it->udi_arg]) < min) ||
(do_max && IntOfTerm(si[it->udi_arg]) > max)) {
pt0++;
if (pt0 == pte)
return NULL;
si = EXO_OFFSET_TO_ADDRESS(it, *pt0);
}
return pt0;
}
static BITS32*
NEXT_MAX(BITS32 *pt0, BITS32 *pte, Term tmin, Term tmax, struct index_t *it)
{
Term* si = EXO_OFFSET_TO_ADDRESS(it, pt0[0]);
int do_min, do_max;
Int min = 0, max = 0;
if (IsVarTerm(tmin)) {
do_min = FALSE;
} else {
do_min = TRUE;
min = IntOfTerm(tmin);
}
if (IsVarTerm(tmax)) {
do_max = FALSE;
} else {
do_max = TRUE;
max = IntOfTerm(tmax);
}
while ((do_min && IntOfTerm(si[it->udi_arg]) < min) ||
(do_max && IntOfTerm(si[it->udi_arg]) > max)) {
pt0--;
if (pt0 == pte)
return NULL;
si = EXO_OFFSET_TO_ADDRESS(it, *pt0);
}
return pt0;
}
static void
IntervalUDIRefitIndex(struct index_t **ip, UInt b[] USES_REGS)
{
size_t sz;
struct index_t *it = *ip;
yamop *code;
/* hard-wired implementation for the Interval case */
Int i = it->udi_arg;
/* it is bound, use hash */
if (it->bmap & b[i]) return;
/* no constraints, nothing to gain */
//if (!IsAttVar(VarOfTerm(Deref(XREGS[i+1])))) return;
LOCAL_exo_it = it;
LOCAL_exo_base = it->bcls;
LOCAL_exo_arity = it->arity;
LOCAL_exo_arg = i;
it->udi_free_args = free_args(b, it->arity, i);
if (!it->key) {
UInt ncls = it->ap->cs.p_code.NOfClauses, i;
BITS32 *sorted;
/* handle ll variables */
sz = sizeof(BITS32)*(ncls);
/* allocate space */
if (!(it->udi_data = (BITS32*)Yap_AllocCodeSpace(sz)))
return;
sorted = (BITS32*)it->udi_data;
for (i=0; i< ncls; i++)
sorted[i] = i;
qsort(sorted, (size_t)ncls, sizeof(BITS32), compar);
it->links = NULL;
} else {
BITS32 *sorted0, *sorted;
/* be conservative */
if (it->udi_free_args)
sz = sizeof(BITS32)*(2*it->ntrys+3*it->nentries);
else
sz = sizeof(BITS32)*(it->ntrys+2*it->nentries);
/* allocate space */
if (!(it->udi_data = (BITS32*)malloc(sz)))
return;
sorted0 = sorted = (BITS32 *)it->udi_data;
sorted++; /* leave an initial hole */
for (i=0; i < it->hsize; i++) {
if (it->key[i]) {
BITS32 *s0 = sorted;
BITS32 offset = it->key[i], offset0 = offset;
*sorted++ = 0;
do {
*sorted++ = offset;
offset = it->links[offset];
} while (offset);
// S = EXO_OFFSET_TO_ADDRESS(it, offset0); Yap_DebugPlWrite(S[0]);
// fprintf(stderr, " key[i]=%d offset=%d %d\n", it->key[i], offset0, (sorted-s0)-1);
if (sorted-s0 == 2) {
it->links[offset0] = 0;
sorted = s0;
} else {
/* number of elements comes first */
*s0 = sorted - (s0+1);
qsort(s0+1, (size_t)*s0, sizeof(BITS32), compar);
it->links[offset0] = s0-sorted0;
if (it->udi_free_args) {
memmove(sorted, s0+1, sizeof(BITS32)*(*s0));
qsort(sorted, (size_t)*s0, sizeof(BITS32), compar2);
sorted += *s0;
}
}
}
}
sz = sizeof(BITS32)*(sorted-sorted0);
it->udi_data = (BITS32 *)realloc((char *)it->udi_data, sz);
}
it->is_udi = i+1;
code = it->code;
code->opc = Yap_opcode(_try_exo_udi);
code = NEXTOP(code, lp);
code->opc = Yap_opcode(_retry_exo_udi);
}
static BITS32 *
binary_search(BITS32 *start, BITS32 *end, Int x USES_REGS)
{
BITS32 *mid;
while (start < end) {
int cmp;
mid = start + (end-start)/2;
cmp = compare(mid, x PASS_REGS);
if (!cmp)
return mid;
if (cmp > 0) {
end = mid-1;
} else
start = mid+1;
}
return start;
}
static yamop *
Interval(struct index_t *it, Term min, Term max, Term op, BITS32 off USES_REGS)
{
BITS32 *c;
BITS32 n;
BITS32 *pt;
BITS32 *end;
Atom at;
LOCAL_exo_it = it;
LOCAL_exo_base = it->bcls;
LOCAL_exo_arity = it->arity;
LOCAL_exo_arg = it->udi_arg;
if (!it->links) {
c = (BITS32 *)it->udi_data;
n = it->nels;
pt = c;
end = c+(n-1);
} else if (it->links[off]) {
c = (BITS32 *)it->udi_data;
n = c[it->links[off]];
pt = c;
end = c+(it->links[off]+n);
// fprintf(stderr," %d links %d=%d \n", off, it->links[off], n);
} else {
if (!IsVarTerm(min)) {
Int x;
if (!IsIntegerTerm(min)) {
min = Yap_Eval(min);
if (!IsIntegerTerm(min)) {
Yap_Error(TYPE_ERROR_INTEGER, min, "data-base constraint");
return FAILCODE;
}
}
x = IntegerOfTerm(min);
if (x >= IntegerOfTerm(S[LOCAL_exo_arg])) {
return FAILCODE;
}
}
if (!IsVarTerm(max)) {
Int x;
if (!IsIntegerTerm(max)) {
max = Yap_Eval(max);
if (!IsIntegerTerm(max)) {
Yap_Error(TYPE_ERROR_INTEGER, max, "data-base constraint");
return FAILCODE;
}
}
x = IntegerOfTerm(max);
if (x <= IntegerOfTerm(S[LOCAL_exo_arg])) {
return FAILCODE;
}
}
return NEXTOP(NEXTOP(it->code,lp),lp);
}
if (!IsVarTerm(min)) {
Int x;
if (!IsIntegerTerm(min)) {
min = Yap_Eval(min);
if (!IsIntegerTerm(min)) {
Yap_Error(TYPE_ERROR_INTEGER, min, "data-base constraint");
return FAILCODE;
}
}
x = IntegerOfTerm(min);
if (n > 8) {
int cmp;
pt = binary_search(pt, end, x PASS_REGS);
while ( pt < end+1 && (cmp = compare(pt, x PASS_REGS)) <= 0 ) {
if (cmp > 0) break;
pt++;
}
} else {
while ( pt < end+1 && compare(pt, x PASS_REGS) <= 0 ) {
pt++;
}
}
if (pt > end)
return FAILCODE;
}
if (!IsVarTerm(max)) {
Int x;
BITS32 *pt1;
Int n = end-pt;
if (!IsIntegerTerm(max)) {
max = Yap_Eval(max);
if (!IsIntegerTerm(max)) {
Yap_Error(TYPE_ERROR_INTEGER, max, "data-base constraint");
return FAILCODE;
}
}
x = IntegerOfTerm(max);
if (n > 8) {
int cmp;
pt1 = binary_search(pt, end, x PASS_REGS);
while ( pt1 >= pt && (cmp = compare(pt1, x PASS_REGS)) >= 0 ) {
if (cmp < 0) break;
pt1--;
}
} else {
pt1 = end;
while ( pt1 >= pt && compare(pt1, x PASS_REGS) >= 0 ) {
pt1--;
}
}
if (pt1 < pt)
return FAILCODE;
end = pt1;
}
if (IsVarTerm(op)) {
S = EXO_OFFSET_TO_ADDRESS(it, pt[0]);
if (pt < end ) {
YENV[-1] = (CELL)( end );
YENV[-2] = (CELL)( pt+1 );
YENV -= 2;
return it->code;
}
return NEXTOP(NEXTOP(it->code,lp),lp);
}
at = AtomOfTerm(op);
if (at == AtomAny || at == AtomMinimum) {
S = EXO_OFFSET_TO_ADDRESS(it, pt[0]);
} else if (at == AtomMaximum) {
S = EXO_OFFSET_TO_ADDRESS(it, end[0]);
} else if (at == AtomUnique) {
if (end-2 > pt)
return FAILCODE;
S = EXO_OFFSET_TO_ADDRESS(it, pt[0]);
} else if (at == AtomMin) {
S = EXO_OFFSET_TO_ADDRESS(it, pt[0]);
if (it->udi_free_args) {
BITS32 *ptn;
pt = c+(it->links[off]+n+1);
end = pt+n;
pt = NEXT_MIN(pt, end, min, max, it);
if (!pt)
return FAILCODE;
S = EXO_OFFSET_TO_ADDRESS(it, pt[0]);
ptn = NEXT_DIFFERENT(pt, end, it);
if (ptn)
ptn = NEXT_MIN(ptn, end, min, max, it);
if ( ptn ) {
YENV[-1] = min; // what we are doing
YENV[-2] = max; // what we are doing
YENV[-3] = (CELL) end; // what we are doing
YENV[-4] = MkAtomTerm(AtomMin); // what we are doing
YENV[-5] = (CELL)( ptn ); // where we are in pt0 array
YENV -= 5;
return it->code;
}
}
return NEXTOP(NEXTOP(it->code,lp),lp);
} else if (at == AtomMax) {
S = EXO_OFFSET_TO_ADDRESS(it, pt[0]);
if (it->udi_free_args) {
BITS32 *ptn;
end = c+(it->links[off]+n);
pt = end+n;
pt = NEXT_MAX(pt, end, min, max, it);
if (!pt)
return FAILCODE;
S = EXO_OFFSET_TO_ADDRESS(it, pt[0]);
ptn = PREV_DIFFERENT(pt, end, it);
if (ptn)
ptn = NEXT_MAX(ptn, end, min, max, it);
if ( ptn ) {
YENV[-1] = min; // what we are doing
YENV[-2] = max; // what we are doing
YENV[-3] = (CELL) end; // what we are doing
YENV[-4] = MkAtomTerm(AtomMax); // what we are doing
YENV[-5] = (CELL)( ptn ); // where we are in pt0 array
YENV -= 5;
return it->code;
}
}
return NEXTOP(NEXTOP(it->code,lp),lp);
}
return NEXTOP(NEXTOP(it->code,lp),lp);
}
static yamop *
IntervalEnterUDIIndex(struct index_t *it USES_REGS)
{
Int i = it->udi_arg;
Term t = XREGS[i+1], a1;
BITS32 off = EXO_ADDRESS_TO_OFFSET(it, S);
// printf("off=%d it=%p %p---%p\n", off, it, it->cls, S);
attvar_record *attv;
t = Deref(t);
if (!IsVarTerm(t))
return FALSE;
if(!IsAttVar(VarOfTerm(t)))
return Interval(it, MkVarTerm(), MkVarTerm(), MkVarTerm(), off PASS_REGS);
attv = RepAttVar(VarOfTerm(t));
t = attv->Atts;
a1 = ArgOfTerm(2,t);
if (IsVarTerm(a1)) {
Yap_Error(INSTANTIATION_ERROR, t, "executing exo_interval constraints");
return FAILCODE;
} else if (!IsApplTerm(a1)) {
Yap_Error(TYPE_ERROR_COMPOUND, a1, "executing exo_interval constraints");
return FAILCODE;
} else {
return Interval(it, ArgOfTerm(1,a1), ArgOfTerm(2,a1), ArgOfTerm(3,a1), off PASS_REGS);
}
}
static int
IntervalRetryUDIIndex(struct index_t *it USES_REGS)
{
CELL *w = (CELL*)(B+1)+it->arity;
if (IsVarTerm(w[2])) {
BITS32 *end = (BITS32 *) w[2],
*pt = (BITS32 *) w[1];
BITS32 f = *pt;
S = EXO_OFFSET_TO_ADDRESS(it, f);
if (pt++ == end) return FALSE;
w[1] = (CELL)pt;
} else {
BITS32 *pt0 = (BITS32 *)w[1];
BITS32 *pte = (BITS32 *)w[3];
Atom what = AtomOfTerm(w[2]);
Term min = w[5];
Term max = w[4];
S = EXO_OFFSET_TO_ADDRESS(it, pt0[0]);
if ( what == AtomMin ) {
pt0 = NEXT_DIFFERENT(pt0, pte, it);
if (pt0)
pt0 = NEXT_MIN(pt0, pte, min, max, it);
} else {
pt0 = PREV_DIFFERENT(pt0, pte, it);
if (pt0)
pt0 = NEXT_MAX(pt0, pte, min, max, it);
}
if (!pt0) {
return FALSE;
}
w[1] = (CELL)pt0;
}
return TRUE;
}
static struct udi_control_block IntervalCB;
typedef struct exo_udi_access_t {
CRefitExoIndex refit;
} exo_udi_encaps_t;
static struct exo_udi_access_t ExoCB;
static void *
IntervalUdiInit (Term spec, int arg, int arity) {
ExoCB.refit = IntervalUDIRefitIndex;
return (void *)&ExoCB;
}
static void *
IntervalUdiInsert (void *control,
Term term, int arg, void *data)
{
CACHE_REGS
struct index_t **ip = (struct index_t **)term;
(*ip)->udi_arg = arg-1;
(ExoCB.refit)(ip, LOCAL_ibnds PASS_REGS);
(*ip)->udi_first = (void *)IntervalEnterUDIIndex;
(*ip)->udi_next = (void *)IntervalRetryUDIIndex;
return control;
}
static int IntervalUdiDestroy(void *control)
{
return TRUE;
}
void Yap_udi_Interval_init(void) {
UdiControlBlock cb = &IntervalCB;
Atom name = Yap_LookupAtom("exo_interval");
memset((void *) cb,0, sizeof(*cb));
/*TODO: ask vitor why this gives a warning*/
cb->decl= (YAP_Atom)name;
Yap_MkEmptyWakeUp(name);
cb->init= IntervalUdiInit;
cb->insert=IntervalUdiInsert;
cb->search=NULL;
cb->destroy=IntervalUdiDestroy;
Yap_UdiRegister(cb);
}

414
C/fail_absmi_insts.h Normal file
View File

@ -0,0 +1,414 @@
/*****************************************************************
* Failure *
*****************************************************************/
#ifdef INDENT_CODE
{
#endif /* INDENT_CODE */
/* trust_fail */
BOp(trust_fail, e);
{
while (POP_CHOICE_POINT(B->cp_b)) {
POP_EXECUTE();
}
}
#ifdef YAPOR
{
choiceptr cut_pt;
cut_pt = B->cp_b;
CUT_prune_to(cut_pt);
B = cut_pt;
}
#else
B = B->cp_b;
#endif /* YAPOR */
goto fail;
ENDBOp();
#ifdef YAPOR
shared_fail:
B = Get_LOCAL_top_cp();
SET_BB(PROTECT_FROZEN_B(B));
goto fail;
#endif /* YAPOR */
/* fail */
PBOp(op_fail, e);
if (PP) {
UNLOCK(PP->PELock);
PP = NULL;
}
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackFail, HR);
ENDCACHE_Y_AS_ENV();
#endif
fail : {
register tr_fr_ptr pt0 = TR;
#if defined(YAPOR) || defined(THREADS)
if (PP) {
UNLOCK(PP->PELock);
PP = NULL;
}
#endif
PREG = B->cp_ap;
save_pc();
CACHE_TR(B->cp_tr);
PREFETCH_OP(PREG);
failloop:
if (pt0 == S_TR) {
SP = SP0;
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) {
int go_on = true;
yamop *ipc = PREG;
while (go_on) {
op_numbers opnum = Yap_op_from_opcode(ipc->opc);
go_on = false;
switch (opnum) {
#ifdef TABLING
case _table_load_answer:
low_level_trace(retry_table_loader, LOAD_CP(B)->cp_pred_entry, NULL);
break;
case _table_try_answer:
case _table_retry_me:
case _table_trust_me:
case _table_retry:
case _table_trust:
case _table_completion:
#ifdef THREADS_CONSUMER_SHARING
case _table_answer_resolution_completion:
#endif /* THREADS_CONSUMER_SHARING */
#ifdef DETERMINISTIC_TABLING
if (IS_DET_GEN_CP(B))
low_level_trace(retry_table_generator, DET_GEN_CP(B)->cp_pred_entry,
NULL);
else
#endif /* DETERMINISTIC_TABLING */
low_level_trace(retry_table_generator, GEN_CP(B)->cp_pred_entry,
(CELL *)(GEN_CP(B) + 1));
break;
case _table_answer_resolution:
low_level_trace(retry_table_consumer, CONS_CP(B)->cp_pred_entry,
NULL);
break;
case _trie_trust_var:
case _trie_retry_var:
case _trie_trust_var_in_pair:
case _trie_retry_var_in_pair:
case _trie_trust_val:
case _trie_retry_val:
case _trie_trust_val_in_pair:
case _trie_retry_val_in_pair:
case _trie_trust_atom:
case _trie_retry_atom:
case _trie_trust_atom_in_pair:
case _trie_retry_atom_in_pair:
case _trie_trust_null:
case _trie_retry_null:
case _trie_trust_null_in_pair:
case _trie_retry_null_in_pair:
case _trie_trust_pair:
case _trie_retry_pair:
case _trie_trust_appl:
case _trie_retry_appl:
case _trie_trust_appl_in_pair:
case _trie_retry_appl_in_pair:
case _trie_trust_extension:
case _trie_retry_extension:
case _trie_trust_double:
case _trie_retry_double:
case _trie_trust_longint:
case _trie_retry_longint:
case _trie_trust_gterm:
case _trie_retry_gterm:
low_level_trace(retry_table_loader, UndefCode, NULL);
break;
#endif /* TABLING */
case _or_else:
case _or_last:
low_level_trace(retry_or, NULL, NULL);
break;
case _retry2:
case _retry3:
case _retry4:
ipc = NEXTOP(ipc, l);
go_on = true;
break;
case _jump:
ipc = ipc->y_u.l.l;
go_on = true;
break;
case _retry_c:
case _retry_userc:
low_level_trace(retry_pred, ipc->y_u.OtapFs.p, B->cp_args);
break;
case _retry_profiled:
case _count_retry:
ipc = NEXTOP(ipc, p);
go_on = true;
break;
case _retry_me:
case _trust_me:
case _count_retry_me:
case _count_trust_me:
case _profiled_retry_me:
case _profiled_trust_me:
case _retry_and_mark:
case _profiled_retry_and_mark:
case _retry:
case _trust:
low_level_trace(retry_pred, ipc->y_u.Otapl.p, B->cp_args);
break;
case _try_logical:
case _retry_logical:
case _profiled_retry_logical:
case _count_retry_logical:
case _trust_logical:
case _profiled_trust_logical:
case _count_trust_logical:
low_level_trace(retry_pred, ipc->y_u.OtILl.d->ClPred, B->cp_args);
break;
case _Nstop:
case _Ystop:
low_level_trace(retry_pred, NULL, B->cp_args);
break;
default:
break;
}
}
}
#endif /* LOW_LEVEL_TRACER */
#ifdef FROZEN_STACKS
#ifdef YAPOR_SBA
if (pt0 < TR_FZ || pt0 > (ADDR)CurrentTrailTop + MinTrailGap)
#else
if (pt0 < TR_FZ)
#endif /* YAPOR_SBA */
{
TR = TR_FZ;
TRAIL_LINK(pt0);
} else
#endif /* FROZEN_STACKS */
RESTORE_TR();
GONext();
}
BEGD(d1);
d1 = TrailTerm(pt0 - 1);
pt0--;
if (IsVarTerm(d1)) {
#if defined(YAPOR_SBA) && defined(YAPOR)
/* clean up the trail when we backtrack */
if (Unsigned((Int)(d1) - (Int)(H_FZ)) >
Unsigned((Int)(B_FZ) - (Int)(H_FZ))) {
RESET_VARIABLE(STACK_TO_SBA(d1));
} else
#endif
/* normal variable */
RESET_VARIABLE(d1);
goto failloop;
}
/* pointer to code space */
/* or updatable variable */
if (IsPairTerm(d1))
{
register CELL flags;
CELL *pt1 = RepPair(d1);
#ifdef LIMIT_TABLING
if ((ADDR)pt1 == LOCAL_TrailBase) {
sg_fr_ptr sg_fr = (sg_fr_ptr)TrailVal(pt0);
TrailTerm(pt0) = AbsPair((CELL *)(pt0 - 1));
SgFr_state(sg_fr)--; /* complete_in_use --> complete : compiled_in_use -->
compiled */
insert_into_global_sg_fr_list(sg_fr);
goto failloop;
}
#endif /* LIMIT_TABLING */
#ifdef FROZEN_STACKS /* TRAIL */
/* avoid frozen segments */
if (
#ifdef YAPOR_SBA
(ADDR)pt1 >= HeapTop
#else
IN_BETWEEN(LOCAL_TrailBase, pt1, (ADDR)CurrentTrailTop + MinTrailGap)
#endif /* YAPOR_SBA */
) {
pt0 = (tr_fr_ptr)pt1;
goto failloop;
} else
#endif /* FROZEN_STACKS */
if (IN_BETWEEN(H0, pt1, LCL0)) {
if (IsAttVar(pt1)) {
goto failloop;
} else {
TR = pt0;
Yap_CleanOpaqueVariable(d1);
goto failloop;
}
}
#ifdef FROZEN_STACKS /* TRAIL */
/* don't reset frozen variables */
else if (pt0 < TR_FZ)
goto failloop;
#endif
flags = *pt1;
#if MULTIPLE_STACKS
if (FlagOn(DBClMask, flags)) {
DBRef dbr = DBStructFlagsToDBStruct(pt1);
int erase;
LOCK(dbr->lock);
DEC_DBREF_COUNT(dbr);
erase = (dbr->Flags & ErasedMask) && (dbr->ref_count == 0);
UNLOCK(dbr->lock);
if (erase) {
saveregs();
Yap_ErDBE(dbr);
setregs();
}
} else {
if (flags & LogUpdMask) {
if (flags & IndexMask) {
LogUpdIndex *cl = ClauseFlagsToLogUpdIndex(pt1);
int erase;
#if PARALLEL_YAP
PredEntry *ap = cl->ClPred;
#endif
PELOCK(8, ap);
DEC_CLREF_COUNT(cl);
erase = (cl->ClFlags & ErasedMask) && !(cl->ClRefCount);
if (erase) {
saveregs();
/* at this point,
we are the only ones accessing the clause,
hence we don't need to have a lock it */
Yap_ErLogUpdIndex(cl);
setregs();
} else if (cl->ClFlags & DirtyMask) {
saveregs();
/* at this point,
we are the only ones accessing the clause,
hence we don't need to have a lock it */
Yap_CleanUpIndex(cl);
setregs();
}
UNLOCK(ap->PELock);
} else {
LogUpdClause *cl = ClauseFlagsToLogUpdClause(pt1);
int erase;
PredEntry *ap = cl->ClPred;
/* BB support */
if (ap) {
PELOCK(9, ap);
DEC_CLREF_COUNT(cl);
erase = (cl->ClFlags & ErasedMask) && !(cl->ClRefCount);
if (erase) {
saveregs();
/* at this point,
we are the only ones accessing the clause,
hence we don't need to have a lock it */
Yap_ErLogUpdCl(cl);
setregs();
}
UNLOCK(ap->PELock);
}
}
} else {
DynamicClause *cl = ClauseFlagsToDynamicClause(pt1);
int erase;
LOCK(cl->ClLock);
DEC_CLREF_COUNT(cl);
erase = (cl->ClFlags & ErasedMask) && !(cl->ClRefCount);
UNLOCK(cl->ClLock);
if (erase) {
saveregs();
/* at this point,
we are the only ones accessing the clause,
hence we don't need to have a lock it */
Yap_ErCl(cl);
setregs();
}
}
}
#else
ResetFlag(InUseMask, flags);
*pt1 = flags;
if (FlagOn((ErasedMask | DirtyMask), flags)) {
if (FlagOn(DBClMask, flags)) {
saveregs();
Yap_ErDBE(DBStructFlagsToDBStruct(pt1));
setregs();
} else {
saveregs();
if (flags & LogUpdMask) {
if (flags & IndexMask) {
if (FlagOn(ErasedMask, flags)) {
Yap_ErLogUpdIndex(ClauseFlagsToLogUpdIndex(pt1));
} else {
Yap_CleanUpIndex(ClauseFlagsToLogUpdIndex(pt1));
}
} else {
Yap_ErLogUpdCl(ClauseFlagsToLogUpdClause(pt1));
}
} else {
Yap_ErCl(ClauseFlagsToDynamicClause(pt1));
}
setregs();
}
}
#endif
goto failloop;
}
#ifdef MULTI_ASSIGNMENT_VARIABLES
else /* if (IsApplTerm(d1)) */
{
CELL *pt = RepAppl(d1);
/* AbsAppl means */
/* multi-assignment variable */
/* so the next cell is the old value */
#ifdef FROZEN_STACKS
--pt0;
pt[0] = TrailVal(pt0);
#else
pt[0] = TrailTerm(pt0 - 1);
pt0 -= 2;
#endif /* FROZEN_STACKS */
goto failloop;
}
#endif
ENDD(d1);
ENDCACHE_TR();
}
#ifdef COROUTINING
NoStackFail:
BEGD(d0);
#ifdef SHADOW_S
Yap_REGS.S_ = SREG;
#endif
saveregs();
d0 = interrupt_fail(PASS_REGS1);
setregs();
#ifdef SHADOW_S
SREG = Yap_REGS.S_;
#endif
if (!d0)
FAIL();
JMPNext();
ENDD(d0);
#endif /* COROUTINING */
ENDPBOp();
#ifdef INDENT_CODE
}
#endif /* INDENT_CODE */

1849
C/flags.c Normal file

File diff suppressed because it is too large Load Diff

646
C/fli_absmi_insts.h Normal file
View File

@ -0,0 +1,646 @@
/************************************************************************\
* Call C predicates instructions *
\************************************************************************/
#ifdef INDENT_CODE
{
{
{
#endif /* INDENT_CODE */
BOp(call_cpred, Osbpp);
#if __ANDROID__ && STRONG_DEBUG
char *s;
Atom name;
if (PREG->y_u.Osbpp.p->ArityOfPE) {
Functor f = PREG->y_u.Osbpp.p->FunctorOfPred;
name = f->NameOfFE;
} else {
name = (Atom)(PREG->y_u.Osbpp.p->FunctorOfPred);
}
s = name->StrOfAE;
LOG(" %s ", s);
#endif
check_trail(TR);
if (!(PREG->y_u.Osbpp.p->PredFlags &
(SafePredFlag | NoTracePredFlag | HiddenPredFlag))) {
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackCCall, HR);
ENDCACHE_Y_AS_ENV();
}
do_c_call :
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (YREG > (CELL *)top_b || YREG < HR)
ASP = (CELL *)top_b;
#else
if (YREG > (CELL *)top_b)
ASP = (CELL *)top_b;
#endif /* YAPOR_SBA */
else
ASP = (CELL *)(((char *)YREG) + PREG->y_u.Osbpp.s);
}
#else
SET_ASP(YREG, PREG->y_u.Osbpp.s);
/* for slots to work */
#endif /* FROZEN_STACKS */
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace)
low_level_trace(enter_pred, PREG->y_u.Osbpp.p, XREGS + 1);
#endif /* LOW_LEVEL_TRACE */
BEGD(d0);
CPredicate f = PREG->y_u.Osbpp.p->cs.f_code;
PREG = NEXTOP(PREG, Osbpp);
saveregs();
d0 = f(PASS_REGS1);
setregs();
#ifdef SHADOW_S
SREG = Yap_REGS.S_;
#endif
if (!d0) {
FAIL();
}
CACHE_A1();
ENDD(d0);
JMPNext();
NoStackCCall:
PROCESS_INT(interrupt_call, do_c_call);
ENDBOp();
/* execute Label */
BOp(execute_cpred, Osbpp);
check_trail(TR);
{
PredEntry *pt0;
BEGD(d0);
CACHE_Y_AS_ENV(YREG);
#ifndef NO_CHECKING
check_stack(NoStackExecuteC, HR);
do_executec :
#endif
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (YREG > (CELL *)top_b || YREG < HR)
ASP = (CELL *)top_b;
#else
if (YREG > (CELL *)top_b)
ASP = (CELL *)top_b;
#endif /* YAPOR_SBA */
else
ASP = YREG + E_CB;
}
#else
SET_ASP(YREG, E_CB * sizeof(CELL));
/* for slots to work */
#endif /* FROZEN_STACKS */
pt0 = PREG->y_u.Osbpp.p;
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) {
low_level_trace(enter_pred, pt0, XREGS + 1);
}
#endif /* LOW_LEVEL_TRACE */
CACHE_A1();
BEGD(d0);
d0 = (CELL)B;
/* for profiler */
save_pc();
ENV_YREG[E_CB] = d0;
ENDD(d0);
#ifdef DEPTH_LIMIT
if (DEPTH <= MkIntTerm(1)) { /* I assume Module==0 is prolog */
if (pt0->ModuleOfPred) {
if (DEPTH == MkIntTerm(0)) {
FAIL();
} else {
DEPTH = RESET_DEPTH();
}
}
} else if (pt0->ModuleOfPred) {
DEPTH -= MkIntConstant(2);
}
#endif /* DEPTH_LIMIT */
/* now call C-Code */
{
CPredicate f = PREG->y_u.Osbpp.p->cs.f_code;
yamop *oldPREG = PREG;
saveregs();
d0 = f(PASS_REGS1);
setregs();
#ifdef SHADOW_S
SREG = Yap_REGS.S_;
#endif
if (!d0) {
FAIL();
}
if (oldPREG == PREG) {
/* we did not update PREG */
/* we can proceed */
PREG = CPREG;
ENV_YREG = ENV;
#ifdef DEPTH_LIMIT
DEPTH = ENV_YREG[E_DEPTH];
#endif
WRITEBACK_Y_AS_ENV();
} else {
/* call the new code */
CACHE_A1();
}
}
JMPNext();
ENDCACHE_Y_AS_ENV();
ENDD(d0);
}
NoStackExecuteC:
PROCESS_INT(interrupt_execute, do_executec);
ENDBOp();
/* Like previous, the only difference is that we do not */
/* trust the C-function we are calling and hence we must */
/* guarantee that *all* machine registers are saved and */
/* restored */
BOp(call_usercpred, Osbpp);
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackUserCall, HR);
ENDCACHE_Y_AS_ENV();
do_user_call:
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) {
low_level_trace(enter_pred, PREG->y_u.Osbpp.p, XREGS + 1);
}
#endif /* LOW_LEVEL_TRACE */
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (YREG > (CELL *)top_b || YREG < HR)
ASP = (CELL *)top_b;
#else
if (YREG > (CELL *)top_b)
ASP = (CELL *)top_b;
#endif /* YAPOR_SBA */
else
ASP = (CELL *)(((char *)YREG) + PREG->y_u.Osbpp.s);
}
#else
SET_ASP(YREG, PREG->y_u.Osbpp.s);
/* for slots to work */
#endif /* FROZEN_STACKS */
{
/* make sure that we can still have access to our old PREG after calling
* user defined goals and backtracking or failing */
yamop *savedP;
LOCAL_PrologMode |= UserCCallMode;
{
PredEntry *p = PREG->y_u.Osbpp.p;
PREG = NEXTOP(PREG, Osbpp);
savedP = PREG;
saveregs();
save_machine_regs();
SREG = (CELL *)YAP_Execute(p, p->cs.f_code);
}
setregs();
LOCAL_PrologMode &= ~UserCCallMode;
restore_machine_regs();
PREG = savedP;
}
if (Yap_HasException()) {
Yap_RaiseException();
SREG = NULL;
}
if (!SREG) {
FAIL();
}
/* in case we call Execute */
YENV = ENV;
YREG = ENV;
JMPNext();
NoStackUserCall:
PROCESS_INT(interrupt_call, do_user_call);
ENDBOp();
BOp(call_c_wfail, slpp);
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) {
low_level_trace(enter_pred, PREG->y_u.slpp.p, XREGS + 1);
}
#endif /* LOW_LEVEL_TRACE */
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (YREG > (CELL *)top_b || YREG < HR)
ASP = (CELL *)top_b;
#else
if (YREG > (CELL *)top_b)
ASP = (CELL *)top_b;
#endif /* YAPOR_SBA */
else {
BEGD(d0);
d0 = PREG->y_u.slpp.s;
ASP = ((CELL *)YREG) + d0;
ENDD(d0);
}
}
#else
if (YREG > (CELL *)B)
ASP = (CELL *)B;
else {
BEGD(d0);
d0 = PREG->y_u.slpp.s;
ASP = ((CELL *)YREG) + d0;
ENDD(d0);
}
#endif /* FROZEN_STACKS */
{
CPredicate f = PREG->y_u.slpp.p->cs.f_code;
saveregs();
SREG = (CELL *)((f)(PASS_REGS1));
setregs();
}
if (!SREG) {
/* be careful about error handling */
if (PREG != FAILCODE)
PREG = PREG->y_u.slpp.l;
} else {
PREG = NEXTOP(PREG, slpp);
}
CACHE_A1();
JMPNext();
ENDBOp();
BOp(try_c, OtapFs);
#ifdef YAPOR
CUT_wait_leftmost();
#endif /* YAPOR */
CACHE_Y(YREG);
/* Alocate space for the cut_c structure*/
CUT_C_PUSH(NEXTOP(NEXTOP(PREG, OtapFs), OtapFs), S_YREG);
S_YREG = S_YREG - PREG->y_u.OtapFs.extra;
store_args(PREG->y_u.OtapFs.s);
store_yaam_regs(NEXTOP(P, OtapFs), 0);
B = B_YREG;
#ifdef YAPOR
SCH_set_load(B_YREG);
#endif /* YAPOR */
SET_BB(B_YREG);
ENDCACHE_Y();
TRYCC:
ASP = (CELL *)B;
{
CPredicate f = (CPredicate)(PREG->y_u.OtapFs.f);
saveregs();
SREG = (CELL *)((f)(PASS_REGS1));
/* This last instruction changes B B*/
while (POP_CHOICE_POINT(B)) {
cut_c_pop();
}
setregs();
}
if (!SREG) {
/* Removes the cut functions from the stack
without executing them because we have fail
and not cuted the predicate*/
while (POP_CHOICE_POINT(B))
cut_c_pop();
FAIL();
}
if ((CELL *)B == YREG && ASP != (CELL *)B) {
/* as Luis says, the predicate that did the try C might
* have left some data on the stack. We should preserve
* it, unless the builtin also did cut */
YREG = ASP;
HBREG = PROTECT_FROZEN_H(B);
SET_BB(B);
}
PREG = CPREG;
YREG = ENV;
JMPNext();
ENDBOp();
BOp(retry_c, OtapFs);
#ifdef YAPOR
CUT_wait_leftmost();
#endif /* YAPOR */
CACHE_Y(B);
CPREG = B_YREG->cp_cp;
ENV = B_YREG->cp_env;
HR = PROTECT_FROZEN_H(B);
#ifdef DEPTH_LIMIT
DEPTH = B->cp_depth;
#endif
HBREG = HR;
restore_args(PREG->y_u.OtapFs.s);
ENDCACHE_Y();
goto TRYCC;
ENDBOp();
BOp(cut_c, OtapFs);
/*This is a phantom instruction. This is not executed by the WAM*/
#ifdef DEBUG
/*If WAM executes this instruction, probably there's an error
when we put this instruction, cut_c, after retry_c*/
printf("ERROR: Should not print this message FILE: absmi.c %d\n",
__LINE__);
#endif /*DEBUG*/
ENDBOp();
BOp(try_userc, OtapFs);
#ifdef YAPOR
CUT_wait_leftmost();
#endif /* YAPOR */
CACHE_Y(YREG);
/* Alocate space for the cut_c structure*/
CUT_C_PUSH(NEXTOP(NEXTOP(PREG, OtapFs), OtapFs), S_YREG);
S_YREG = S_YREG - PREG->y_u.OtapFs.extra;
store_args(PREG->y_u.OtapFs.s);
store_yaam_regs(NEXTOP(PREG, OtapFs), 0);
B = B_YREG;
#ifdef YAPOR
SCH_set_load(B_YREG);
#endif
SET_BB(B_YREG);
ENDCACHE_Y();
LOCAL_PrologMode = UserCCallMode;
ASP = YREG;
saveregs();
save_machine_regs();
SREG = (CELL *)YAP_ExecuteFirst(PREG->y_u.OtapFs.p,
(CPredicate)(PREG->y_u.OtapFs.f));
Yap_ResetException( worker_id );
restore_machine_regs();
setregs();
LOCAL_PrologMode &= UserMode;
if (!SREG) {
FAIL();
}
if ((CELL *)B == YREG && ASP != (CELL *)B) {
/* as Luis says, the predicate that did the try C might
* have left some data on the stack. We should preserve
* it, unless the builtin also did cut */
YREG = ASP;
HBREG = PROTECT_FROZEN_H(B);
}
PREG = CPREG;
YREG = ENV;
CACHE_A1();
JMPNext();
ENDBOp();
BOp(retry_userc, OtapFs);
#ifdef YAPOR
CUT_wait_leftmost();
#endif /* YAPOR */
CACHE_Y(B);
CPREG = B_YREG->cp_cp;
ENV = B_YREG->cp_env;
HR = PROTECT_FROZEN_H(B);
#ifdef DEPTH_LIMIT
DEPTH = B->cp_depth;
#endif
HBREG = HR;
restore_args(PREG->y_u.OtapFs.s);
ENDCACHE_Y();
LOCAL_PrologMode |= UserCCallMode;
SET_ASP(YREG, E_CB * sizeof(CELL));
saveregs();
save_machine_regs();
SREG = (CELL *)YAP_ExecuteNext(PREG->y_u.OtapFs.p,
(CPredicate)(PREG->y_u.OtapFs.f));
Yap_ResetException( worker_id);
restore_machine_regs();
setregs();
LOCAL_PrologMode &= ~UserCCallMode;
if (!SREG) {
/* Removes the cut functions from the stack
without executing them because we have fail
and not cuted the predicate*/
while (POP_CHOICE_POINT(B))
cut_c_pop();
FAIL();
}
if ((CELL *)B == YREG && ASP != (CELL *)B) {
/* as Luis says, the predicate that did the try C might
* have left some data on the stack. We should preserve
* it, unless the builtin also did cut */
YREG = ASP;
HBREG = PROTECT_FROZEN_H(B);
}
PREG = CPREG;
YREG = ENV;
CACHE_A1();
JMPNext();
ENDBOp();
BOp(cut_userc, OtapFs);
/*This is a phantom instruction. This is not executed by the WAM*/
#ifdef DEBUG
/*If WAM executes this instruction, probably there's an error
when we put this instruction, cut_userc, after retry_userc*/
printf("ERROR: Should not print this message FILE: absmi.c %d\n",
__LINE__);
#endif /*DEBUG*/
CACHE_A1();
JMPNext();
ENDBOp();
/************************************************************************\
* support instructions *
\************************************************************************/
BOp(lock_pred, e);
{
PredEntry *ap = PredFromDefCode(PREG);
PELOCK(10, ap);
PP = ap;
if (!ap->cs.p_code.NOfClauses) {
UNLOCKPE(11, ap);
FAIL();
}
/*
we do not lock access to the predicate,
we must take extra care here
*/
if (ap->cs.p_code.NOfClauses > 1 &&
!(ap->PredFlags & IndexedPredFlag)) {
/* update ASP before calling IPred */
SET_ASP(YREG, E_CB * sizeof(CELL));
saveregs();
Yap_IPred(ap, 0, CP);
/* IPred can generate errors, it thus must get rid of the lock itself
*/
setregs();
CACHE_A1();
/* for profiler */
save_pc();
}
PREG = ap->cs.p_code.TrueCodeOfPred;
}
JMPNext();
ENDBOp();
BOp(index_pred, e);
{
PredEntry *ap = PredFromDefCode(PREG);
#if defined(YAPOR) || defined(THREADS)
/*
we do not lock access to the predicate,
we must take extra care here
*/
if (!PP) {
PELOCK(11, ap);
}
if (ap->OpcodeOfPred != INDEX_OPCODE) {
/* someone was here before we were */
if (!PP) {
UNLOCKPE(11, ap);
}
PREG = ap->CodeOfPred;
/* for profiler */
save_pc();
JMPNext();
}
#endif
/* update ASP before calling IPred */
SET_ASP(YREG, E_CB * sizeof(CELL));
saveregs();
Yap_IPred(ap, 0, CP);
/* IPred can generate errors, it thus must get rid of the lock itself */
setregs();
CACHE_A1();
PREG = ap->CodeOfPred;
/* for profiler */
save_pc();
#if defined(YAPOR) || defined(THREADS)
if (!PP)
#endif
UNLOCKPE(14, ap);
}
JMPNext();
ENDBOp();
#if THREADS
BOp(thread_local, e);
{
PredEntry *ap = PredFromDefCode(PREG);
ap = Yap_GetThreadPred(ap PASS_REGS);
PREG = ap->CodeOfPred;
/* for profiler */
save_pc();
}
JMPNext();
ENDBOp();
#endif
BOp(expand_index, e);
{
PredEntry *pe = PredFromExpandCode(PREG);
yamop *pt0;
/* update ASP before calling IPred */
SET_ASP(YREG, E_CB * sizeof(CELL));
#if defined(YAPOR) || defined(THREADS)
if (!PP) {
PELOCK(12, pe);
}
if (!same_lu_block(PREG_ADDR, PREG)) {
PREG = *PREG_ADDR;
if (!PP) {
UNLOCKPE(15, pe);
}
JMPNext();
}
#endif
#ifdef SHADOW_S
S = SREG;
#endif /* SHADOW_S */
saveregs();
pt0 = Yap_ExpandIndex(pe, 0);
/* restart index */
setregs();
#ifdef SHADOW_S
SREG = S;
#endif /* SHADOW_S */
PREG = pt0;
#if defined(YAPOR) || defined(THREADS)
if (!PP) {
UNLOCKPE(12, pe);
}
#endif
JMPNext();
}
ENDBOp();
BOp(expand_clauses, sssllp);
{
PredEntry *pe = PREG->y_u.sssllp.p;
yamop *pt0;
/* update ASP before calling IPred */
SET_ASP(YREG, E_CB * sizeof(CELL));
#if defined(YAPOR) || defined(THREADS)
if (PP == NULL) {
PELOCK(13, pe);
}
if (!same_lu_block(PREG_ADDR, PREG)) {
PREG = *PREG_ADDR;
if (!PP) {
UNLOCKPE(16, pe);
}
JMPNext();
}
#endif
saveregs();
pt0 = Yap_ExpandIndex(pe, 0);
/* restart index */
setregs();
PREG = pt0;
#if defined(YAPOR) || defined(THREADS)
if (!PP) {
UNLOCKPE(18, pe);
}
#endif
JMPNext();
}
ENDBOp();
BOp(undef_p, e);
/* save S for module name */
if (LOCAL_DoingUndefp) {
PREG=FAILCODE;
JMPNext();
}
LOCAL_DoingUndefp = true;
saveregs();
undef_goal(PASS_REGS1);
setregs();
/* for profiler */
LOCAL_DoingUndefp = false;
CACHE_A1();
JMPNext();
ENDBOp();
BOp(spy_pred, e);
saveregs();
spy_goal(PASS_REGS1);
setregs();
CACHE_A1();
JMPNext();
ENDBOp();

File diff suppressed because it is too large Load Diff

View File

@ -18,7 +18,7 @@
#include "Yap.h"
#include "Yatom.h"
#include "YapHeap.h"
#include "eval.h"
#include "YapEval.h"
#if HAVE_STRING_H
#include <string.h>
#endif
@ -32,7 +32,7 @@ MkBigAndClose(MP_INT *new)
Term t = Yap_MkBigIntTerm(new);
mpz_clear(new);
if (t == TermNil) {
return Yap_ArithError(RESOURCE_ERROR_STACK, t, ">>/2");
Yap_ArithError(RESOURCE_ERROR_STACK, t, ">>/2");
}
return t;
}
@ -43,7 +43,7 @@ MkRatAndClose(MP_RAT *new)
Term t = Yap_MkBigRatTerm(new);
mpq_clear(new);
if (t == TermNil) {
return Yap_ArithError(RESOURCE_ERROR_STACK, t, ">>/2");
Yap_ArithError(RESOURCE_ERROR_STACK, t, ">>/2");
}
return t;
}
@ -132,6 +132,14 @@ Yap_gmp_add_int_big(Int i, Term t)
}
}
/* add i + b using temporary bigint new */
void
Yap_gmp_set_bit(Int i, Term t)
{
MP_INT *b = Yap_BigIntOfTerm(t);
mpz_setbit(b, i);
}
/* sub i - b using temporary bigint new */
Term
Yap_gmp_sub_int_big(Int i, Term t)
@ -231,11 +239,11 @@ Yap_gmp_div_big_int(Term t, Int i)
MP_INT *b = Yap_BigIntOfTerm(t);
mpz_init_set(&new, b);
if (yap_flags[INTEGER_ROUNDING_FLAG] == 0) {
if ( (-3 / 2) == -2 ) {
if (i > 0) {
mpz_tdiv_q_ui(&new, &new, i);
} else if (i == 0) {
return Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, MkIntTerm(0), "// /2");
Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, MkIntTerm(0), "// /2");
} else {
/* we do not handle MIN_INT */
mpz_tdiv_q_ui(&new, &new, -i);
@ -245,7 +253,7 @@ Yap_gmp_div_big_int(Term t, Int i)
if (i > 0) {
mpz_fdiv_q_ui(&new, &new, i);
} else if (i == 0) {
return Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, MkIntTerm(0), "// /2");
Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, MkIntTerm(0), "// /2");
} else {
/* we do not handle MIN_INT */
mpz_fdiv_q_ui(&new, &new, -i);
@ -277,7 +285,7 @@ Yap_gmp_div2_big_int(Term t, Int i)
if (i > 0) {
mpz_fdiv_q_ui(&new, &new, i);
} else if (i == 0) {
return Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, MkIntTerm(0), "// /2");
Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, MkIntTerm(0), "// /2");
} else {
/* we do not handle MIN_INT */
mpz_fdiv_q_ui(&new, &new, -i);
@ -303,7 +311,7 @@ Yap_gmp_and_int_big(Int i, Term t)
CELL *pt = RepAppl(t);
MP_INT *b;
if (pt[1] != BIG_INT) {
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "/\\/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t, "/\\/2");
}
b = Yap_BigIntOfTerm(t);
@ -320,7 +328,7 @@ Yap_gmp_ior_int_big(Int i, Term t)
CELL *pt = RepAppl(t);
MP_INT *b;
if (pt[1] != BIG_INT) {
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "\\/ /2");
Yap_ArithError(TYPE_ERROR_INTEGER, t, "\\/ /2");
}
b = Yap_BigIntOfTerm(t);
@ -330,7 +338,8 @@ Yap_gmp_ior_int_big(Int i, Term t)
}
#if USE_GMP
#if !defined(HAVE_MPZ_XOR)
// cross-compilers...
#if !defined(HAVE_MPZ_XOR) && !defined(mpz_xor)
static void
mpz_xor(MP_INT *new, MP_INT *r1, MP_INT *r2)
{
@ -358,7 +367,7 @@ Yap_gmp_xor_int_big(Int i, Term t)
CELL *pt = RepAppl(t);
MP_INT *b;
if (pt[1] != BIG_INT) {
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "#/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t, "#/2");
}
b = Yap_BigIntOfTerm(t);
@ -377,16 +386,17 @@ Yap_gmp_sll_big_int(Term t, Int i)
MP_INT *b = Yap_BigIntOfTerm(t);
if (i > 0) {
mpz_init_set(&new, b);
mpz_mul_2exp(&new, &new, i);
mpz_init(&new);
mpz_mul_2exp(&new, b, i);
} else if (i == 0) {
return t;
} else {
mpz_init_set(&new, b);
mpz_init(&new);
if (i == Int_MIN) {
return Yap_ArithError(RESOURCE_ERROR_HUGE_INT, MkIntegerTerm(i), "<</2");
CACHE_REGS
Yap_ArithError(RESOURCE_ERROR_HUGE_INT, MkIntegerTerm(i), "<</2");
}
mpz_tdiv_q_2exp(&new, &new, -i);
mpz_fdiv_q_2exp(&new, b, -i);
}
return MkBigAndClose(&new);
} else {
@ -535,7 +545,7 @@ Yap_gmp_div_big_big(Term t1, Term t2)
MP_INT *b2 = Yap_BigIntOfTerm(t2);
mpz_init_set(&new, b1);
if (yap_flags[INTEGER_ROUNDING_FLAG] == 0) {
if ( (-3 / 2) == -2 ) {
mpz_tdiv_q(&new, &new, b2);
} else {
mpz_fdiv_q(&new, &new, b2);
@ -618,9 +628,9 @@ Yap_gmp_and_big_big(Term t1, Term t2)
return MkBigAndClose(&new);
} else {
if (pt1[1] != BIG_INT) {
return Yap_ArithError(TYPE_ERROR_INTEGER, t1, "/\\/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t1, "/\\/2");
}
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "/\\/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "/\\/2");
}
}
@ -639,9 +649,9 @@ Yap_gmp_ior_big_big(Term t1, Term t2)
return MkBigAndClose(&new);
} else {
if (pt1[1] != BIG_INT) {
return Yap_ArithError(TYPE_ERROR_INTEGER, t1, "\\/ /2");
Yap_ArithError(TYPE_ERROR_INTEGER, t1, "\\/ /2");
}
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "\\/ /2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "\\/ /2");
}
}
@ -660,9 +670,9 @@ Yap_gmp_xor_big_big(Term t1, Term t2)
return MkBigAndClose(&new);
} else {
if (pt1[1] != BIG_INT) {
return Yap_ArithError(TYPE_ERROR_INTEGER, t1, "\\/ /2");
Yap_ArithError(TYPE_ERROR_INTEGER, t1, "\\/ /2");
}
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "\\/ /2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "\\/ /2");
}
}
@ -681,9 +691,9 @@ Yap_gmp_mod_big_big(Term t1, Term t2)
return MkBigAndClose(&new);
} else {
if (pt1[1] != BIG_INT) {
return Yap_ArithError(TYPE_ERROR_INTEGER, t1, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t1, "mod/2");
}
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "mod/2");
}
}
@ -692,7 +702,7 @@ Yap_gmp_mod_big_int(Term t, Int i2)
{
CELL *pt = RepAppl(t);
if (pt[1] != BIG_INT) {
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t, "mod/2");
} else {
MP_INT *b = Yap_BigIntOfTerm(t);
MP_INT new;
@ -706,9 +716,10 @@ Yap_gmp_mod_big_int(Term t, Int i2)
Term
Yap_gmp_mod_int_big(Int i1, Term t)
{
CACHE_REGS
CELL *pt = RepAppl(t);
if (pt[1] != BIG_INT) {
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t, "mod/2");
} else {
MP_INT *b = Yap_BigIntOfTerm(t);
/* integer is much smaller */
@ -757,9 +768,9 @@ Yap_gmp_rem_big_big(Term t1, Term t2)
return MkBigAndClose(&new);
} else {
if (pt1[1] != BIG_INT) {
return Yap_ArithError(TYPE_ERROR_INTEGER, t1, "rem/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t1, "rem/2");
}
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "rem/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "rem/2");
}
}
@ -768,7 +779,7 @@ Yap_gmp_rem_big_int(Term t, Int i2)
{
CELL *pt = RepAppl(t);
if (pt[1] != BIG_INT) {
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t, "rem/2");
} else {
MP_INT *b = Yap_BigIntOfTerm(t);
MP_INT new;
@ -782,9 +793,10 @@ Yap_gmp_rem_big_int(Term t, Int i2)
Term
Yap_gmp_rem_int_big(Int i1, Term t)
{
CACHE_REGS
CELL *pt = RepAppl(t);
if (pt[1] != BIG_INT) {
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t, "rem/2");
} else {
/* integer is much smaller */
return MkIntegerTerm(i1);
@ -806,18 +818,19 @@ Yap_gmp_gcd_big_big(Term t1, Term t2)
return MkBigAndClose(&new);
} else {
if (pt1[1] != BIG_INT) {
return Yap_ArithError(TYPE_ERROR_INTEGER, t1, "gcd/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t1, "gcd/2");
}
return Yap_ArithError(TYPE_ERROR_INTEGER, t2, "gcd/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t2, "gcd/2");
}
}
Term
Yap_gmp_gcd_int_big(Int i, Term t)
{
CACHE_REGS
CELL *pt = RepAppl(t);
if (pt[1] != BIG_INT) {
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "mod/2");
Yap_ArithError(TYPE_ERROR_INTEGER, t, "gcd/2");
} else {
/* integer is much smaller */
if (i > 0) {
@ -855,6 +868,7 @@ Yap_gmp_to_float(Term t)
Term
Yap_gmp_add_float_big(Float d, Term t)
{
CACHE_REGS
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
MP_INT *b = Yap_BigIntOfTerm(t);
@ -868,6 +882,7 @@ Yap_gmp_add_float_big(Float d, Term t)
Term
Yap_gmp_sub_float_big(Float d, Term t)
{
CACHE_REGS
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
MP_INT *b = Yap_BigIntOfTerm(t);
@ -881,6 +896,7 @@ Yap_gmp_sub_float_big(Float d, Term t)
Term
Yap_gmp_sub_big_float(Term t, Float d)
{
CACHE_REGS
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
MP_INT *b = Yap_BigIntOfTerm(t);
@ -894,6 +910,7 @@ Yap_gmp_sub_big_float(Term t, Float d)
Term
Yap_gmp_mul_float_big(Float d, Term t)
{
CACHE_REGS
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
MP_INT *b = Yap_BigIntOfTerm(t);
@ -907,6 +924,7 @@ Yap_gmp_mul_float_big(Float d, Term t)
Term
Yap_gmp_fdiv_float_big(Float d, Term t)
{
CACHE_REGS
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
MP_INT *b = Yap_BigIntOfTerm(t);
@ -920,6 +938,7 @@ Yap_gmp_fdiv_float_big(Float d, Term t)
Term
Yap_gmp_fdiv_big_float(Term t, Float d)
{
CACHE_REGS
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
MP_INT *b = Yap_BigIntOfTerm(t);
@ -943,6 +962,7 @@ Yap_gmp_exp_int_int(Int i1, Int i2)
Term
Yap_gmp_exp_big_int(Term t, Int i)
{
CACHE_REGS
MP_INT new;
CELL *pt = RepAppl(t);
@ -969,9 +989,10 @@ Yap_gmp_exp_big_int(Term t, Int i)
Term
Yap_gmp_exp_int_big(Int i, Term t)
{
CACHE_REGS
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
return Yap_ArithError(RESOURCE_ERROR_HUGE_INT, t, "^/2");
Yap_ArithError(RESOURCE_ERROR_HUGE_INT, t, "^/2");
} else {
MP_INT *b = Yap_BigIntOfTerm(t);
Float dbl = mpz_get_d(b);
@ -982,12 +1003,13 @@ Yap_gmp_exp_int_big(Int i, Term t)
Term
Yap_gmp_exp_big_big(Term t1, Term t2)
{
CACHE_REGS
CELL *pt1 = RepAppl(t1);
CELL *pt2 = RepAppl(t2);
Float dbl1, dbl2;
if (pt1[1] == BIG_INT && pt2[1] == BIG_INT) {
return Yap_ArithError(RESOURCE_ERROR_HUGE_INT, t2, "^/2");
Yap_ArithError(RESOURCE_ERROR_HUGE_INT, t2, "^/2");
} else {
if (pt1[1] != BIG_INT) {
dbl1 = mpz_get_d(Yap_BigIntOfTerm(t1));
@ -1116,6 +1138,7 @@ Yap_gmq_rdiv_big_big(Term t1, Term t2)
Term
Yap_gmp_fdiv_int_big(Int i1, Term t2)
{
CACHE_REGS
MP_RAT new;
MP_RAT *b1, *b2;
MP_RAT bb1, bb2;
@ -1142,6 +1165,7 @@ Yap_gmp_fdiv_int_big(Int i1, Term t2)
Term
Yap_gmp_fdiv_big_int(Term t2, Int i1)
{
CACHE_REGS
MP_RAT new;
MP_RAT *b1, *b2;
MP_RAT bb1, bb2;
@ -1168,6 +1192,7 @@ Yap_gmp_fdiv_big_int(Term t2, Int i1)
Term
Yap_gmp_fdiv_big_big(Term t1, Term t2)
{
CACHE_REGS
CELL *pt1 = RepAppl(t1);
CELL *pt2 = RepAppl(t2);
MP_RAT new;
@ -1209,6 +1234,19 @@ Yap_gmp_cmp_big_int(Term t, Int i)
}
}
int
Yap_gmp_cmp_int_big(Int i, Term t)
{
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
MP_INT *b = Yap_BigIntOfTerm(t);
return -mpz_cmp_si(b,i);
} else {
MP_RAT *b = Yap_BigRatOfTerm(t);
return -mpq_cmp_si(b,i,1);
}
}
int
Yap_gmp_cmp_big_float(Term t, Float d)
{
@ -1279,6 +1317,18 @@ Yap_gmp_tcmp_big_int(Term t, Int i)
}
}
int
Yap_gmp_tcmp_int_big(Int i, Term t)
{
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
MP_INT *b = Yap_BigIntOfTerm(t);
return -mpz_cmp_si(b,i);
} else {
return 1;
}
}
int
Yap_gmp_tcmp_big_float(Term t, Float d)
{
@ -1303,51 +1353,6 @@ Yap_gmp_tcmp_big_big(Term t1, Term t2)
return 1;
} else if (pt1[1] == BIG_RATIONAL) {
b1 = Yap_BigRatOfTerm(t1);
} else if (pt1[1] == BLOB_STRING) {
char *s1 = Yap_BlobStringOfTerm(t1);
if (pt2[1] == BLOB_STRING) {
char *s2 = Yap_BlobStringOfTerm(t2);
return strcmp(s1,s2);
} else if (pt2[1] == BLOB_WIDE_STRING) {
wchar_t *wcs2 = Yap_BlobWideStringOfTerm(t2), *wcs1, *tmp1;
int out;
size_t n = strlen(s1);
if (!(wcs1 = (wchar_t *)malloc((n+1)*sizeof(wchar_t)))) {
Yap_Error(OUT_OF_HEAP_ERROR, t1, "compare/3");
return 0;
}
tmp1 = wcs1;
while (*s1) {
*tmp1++ = *s1++;
}
out = wcscmp(wcs1, wcs2);
free(wcs1);
return out;
}
b1 = Yap_BigRatOfTerm(t1);
} else if (pt1[1] == BLOB_WIDE_STRING) {
wchar_t *wcs1 = Yap_BlobWideStringOfTerm(t1);
if (pt2[1] == BLOB_STRING) {
char *s2 = Yap_BlobStringOfTerm(t2);
wchar_t *wcs2, *tmp2;
int out;
size_t n = strlen(s2);
if (!(wcs2 = (wchar_t *)malloc((n+1)*sizeof(wchar_t)))) {
Yap_Error(OUT_OF_HEAP_ERROR, t2, "compare/3");
return 0;
}
tmp2 = wcs2;
while (*s2) {
*tmp2++ = *s2++;
}
out = wcscmp(wcs1, wcs2);
free(wcs2);
return out;
} else if (pt2[1] == BLOB_WIDE_STRING) {
wchar_t *wcs2 = Yap_BlobWideStringOfTerm(t2);
return wcscmp(wcs1,wcs2);
}
b1 = Yap_BigRatOfTerm(t1);
} else {
return pt1-pt2;
}
@ -1471,7 +1476,7 @@ Yap_gmp_unot_big(Term t)
mpz_com(&new, &new);
return MkBigAndClose(&new);
} else {
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "#/1");
Yap_ArithError(TYPE_ERROR_INTEGER, t, "#/1");
}
}
@ -1566,7 +1571,7 @@ Yap_gmp_float_fractional_part(Term t)
{
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
return Yap_ArithError(TYPE_ERROR_FLOAT, t, "X is float_fractional_part(%f)", FloatOfTerm(t));
Yap_ArithError(TYPE_ERROR_FLOAT, t, "X is float_fractional_part(%f)", FloatOfTerm(t));
} else {
MP_RAT *b = Yap_BigRatOfTerm(t);
MP_RAT new;
@ -1586,7 +1591,7 @@ Yap_gmp_float_integer_part(Term t)
{
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
return Yap_ArithError(TYPE_ERROR_FLOAT, t, "X is float_integer_part(%f)", FloatOfTerm(t));
Yap_ArithError(TYPE_ERROR_FLOAT, t, "X is float_integer_part(%f)", FloatOfTerm(t));
} else {
MP_RAT *b = Yap_BigRatOfTerm(t);
MP_INT new;
@ -1602,6 +1607,7 @@ Yap_gmp_float_integer_part(Term t)
Term
Yap_gmp_sign(Term t)
{
CACHE_REGS
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
return MkIntegerTerm(mpz_sgn(Yap_BigIntOfTerm(t)));
@ -1613,51 +1619,67 @@ Yap_gmp_sign(Term t)
Term
Yap_gmp_lsb(Term t)
{
CACHE_REGS
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
MP_INT *big = Yap_BigIntOfTerm(t);
if ( mpz_sgn(big) <= 0 ) {
return Yap_ArithError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, t,
Yap_ArithError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, t,
"lsb/1 received negative bignum");
}
return MkIntegerTerm(mpz_scan1(big,0));
} else {
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "lsb");
Yap_ArithError(TYPE_ERROR_INTEGER, t, "lsb");
}
}
Term
Yap_gmp_msb(Term t)
{
CACHE_REGS
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
MP_INT *big = Yap_BigIntOfTerm(t);
if ( mpz_sgn(big) <= 0 ) {
return Yap_ArithError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, t,
Yap_ArithError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, t,
"msb/1 received negative bignum");
}
return MkIntegerTerm(mpz_sizeinbase(big,2));
} else {
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "popcount");
Yap_ArithError(TYPE_ERROR_INTEGER, t, "popcount");
}
}
Term
Yap_gmp_popcount(Term t)
{
CACHE_REGS
CELL *pt = RepAppl(t);
if (pt[1] == BIG_INT) {
MP_INT *big = Yap_BigIntOfTerm(t);
if ( mpz_sgn(big) <= 0 ) {
return Yap_ArithError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, t,
Yap_ArithError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, t,
"popcount/1 received negative bignum");
}
return MkIntegerTerm(mpz_popcount(big));
} else {
return Yap_ArithError(TYPE_ERROR_INTEGER, t, "popcount");
Yap_ArithError(TYPE_ERROR_INTEGER, t, "popcount");
}
}
char *
Yap_mpz_to_string( MP_INT *b, char *s, size_t sz, int base)
{
if (s) {
size_t size = mpz_sizeinbase(b, base);
if (size+2 > sz) {
return NULL;
}
return mpz_get_str (s, base, b);
}
return NULL;
}
char *
Yap_gmp_to_string(Term t, char *s, size_t sz, int base)
{

477
C/gprof.c Normal file → Executable file
View File

@ -35,7 +35,7 @@
* Revision 1.3 2006/01/17 14:10:40 vsc
* YENV may be an HW register (breaks some tabling code)
* All YAAM instructions are now brackedted, so Op introduced an { and EndOp introduces an }. This is because Ricardo assumes that.
* Fix attvars when COROUTING is undefined.
* Fix attvars
*
* Revision 1.2 2005/12/23 00:20:13 vsc
* updates to gprof
@ -47,6 +47,41 @@
* *
*************************************************************************/
/// @file gprof.c
/** @addtogroup Tick_Profiler
* @ingroup Profiling@{
*
* The tick profiler works by interrupting the Prolog code every so often
* and checking at each point the code was. The pro/filer must be able to
* retrace the state of the abstract machine at every moment. The major
* advantage of this approach is that it gives the actual amount of time
* being spent per procedure, or whether garbage collection dominates
* execution time. The major drawback is that tracking down the state of
* the abstract machine may take significant time, and in the worst case
* may slow down the whole execution.
*
* The following procedures are available:
*
* + profinit/0
* Initialise the data-structures for the profiler. Unnecessary for
* dynamic profiler.
*
* + profon/0
* Start profiling.
*
* + profoff/0
* Stop profiling.
*
* + profoff/0
* Stop profiling.
*
* + showprofres/0 and showprofres/1
* Stop tick counts per predicate.
*
*
*/
#ifdef SCCS
static char SccsId[] = "%W% %G%";
#endif
@ -63,6 +98,7 @@ typedef greg_t context_reg;
#elif defined(__i386__) && defined (__linux__)
#include <ucontext.h>
typedef greg_t context_reg;
@ -102,8 +138,11 @@ typedef greg_t context_reg;
#else
#define CONTEXT_PC NULL
#define CONTEXT_BP NULL
#define CONTEXT_PC(scv) NULL
#define CONTEXT_BP(scv) NULL
#ifdef LOW_PROF
#undef LOW_PROF
#endif
#endif
@ -120,8 +159,10 @@ typedef greg_t context_reg;
#include <sys/time.h>
#ifdef __APPLE__
#else
#ifdef UCONTEXT_H
#include <ucontext.h>
#endif
#endif
@ -129,12 +170,22 @@ typedef greg_t context_reg;
#define PROFILING_FILE 1
#define PROFPREDS_FILE 2
typedef struct {
char tag;
void *ptr;
} __attribute__ ((packed)) buf_ptr;
typedef struct {
gprof_info inf;
void *end;
PredEntry *pe;
} __attribute__ ((packed)) buf_extra;
typedef struct RB_red_blk_node {
yamop *key; /* first address */
yamop *lim; /* end address */
PredEntry *pe; /* parent predicate */
gprof_info source; /* how block was allocated */
UInt pcs; /* counter with total for each clause */
int red; /* if red=0 then the node is black */
struct RB_red_blk_node* left;
@ -168,10 +219,12 @@ RBTreeCreate(void) {
temp->red=0;
temp->key=temp->lim=NULL;
temp->pe=NULL;
temp->source=GPROF_NO_EVENT;;
temp = RBMalloc(sizeof(rb_red_blk_node));
temp->parent=temp->left=temp->right=GLOBAL_ProfilerNil;
temp->key=temp->lim=NULL;
temp->pe=NULL;
temp->source=GPROF_NO_EVENT;
temp->pcs=0;
temp->red=0;
return temp;
@ -199,7 +252,7 @@ RBTreeCreate(void) {
static void
LeftRotate(rb_red_blk_node* x) {
rb_red_blk_node* y;
rb_red_blk_node* nil=GLOBAL_ProfilerNil;
rb_red_blk_node* rb_nil=GLOBAL_ProfilerNil;
/* I originally wrote this function to use the sentinel for */
/* nil to avoid checking for nil. However this introduces a */
@ -214,7 +267,7 @@ LeftRotate(rb_red_blk_node* x) {
y=x->right;
x->right=y->left;
if (y->left != nil) y->left->parent=x; /* used to use sentinel here */
if (y->left != rb_nil) y->left->parent=x; /* used to use sentinel here */
/* and do an unconditional assignment instead of testing for nil */
y->parent=x->parent;
@ -255,7 +308,7 @@ LeftRotate(rb_red_blk_node* x) {
static void
RightRotate(rb_red_blk_node* y) {
rb_red_blk_node* x;
rb_red_blk_node* nil=GLOBAL_ProfilerNil;
rb_red_blk_node* rb_nil=GLOBAL_ProfilerNil;
/* I originally wrote this function to use the sentinel for */
/* nil to avoid checking for nil. However this introduces a */
@ -270,7 +323,7 @@ RightRotate(rb_red_blk_node* y) {
x=y->left;
y->left=x->right;
if (nil != x->right) x->right->parent=y; /*used to use sentinel here */
if (rb_nil != x->right) x->right->parent=y; /*used to use sentinel here */
/* and do an unconditional assignment instead of testing for nil */
/* instead of checking if x->parent is the root as in the book, we */
@ -309,12 +362,12 @@ TreeInsertHelp(rb_red_blk_node* z) {
/* This function should only be called by InsertRBTree (see above) */
rb_red_blk_node* x;
rb_red_blk_node* y;
rb_red_blk_node* nil=GLOBAL_ProfilerNil;
rb_red_blk_node* rb_nil=GLOBAL_ProfilerNil;
z->left=z->right=nil;
z->left=z->right=rb_nil;
y=GLOBAL_ProfilerRoot;
x=GLOBAL_ProfilerRoot->left;
while( x != nil) {
while( x != rb_nil) {
y=x;
if (x->key > z->key) { /* x.key > z.key */
x=x->left;
@ -429,18 +482,18 @@ RBTreeInsert(yamop *key, yamop *lim) {
static rb_red_blk_node*
RBExactQuery(yamop* q) {
rb_red_blk_node* x;
rb_red_blk_node* nil=GLOBAL_ProfilerNil;
rb_red_blk_node* rb_nil=GLOBAL_ProfilerNil;
if (!GLOBAL_ProfilerRoot) return NULL;
x=GLOBAL_ProfilerRoot->left;
if (x == nil) return NULL;
if (x == rb_nil) return NULL;
while(x->key != q) {/*assignemnt*/
if (x->key > q) { /* x->key > q */
x=x->left;
} else {
x=x->right;
}
if ( x == nil) return NULL;
if ( x == rb_nil) return NULL;
}
return(x);
}
@ -563,11 +616,11 @@ static void RBDeleteFixUp(rb_red_blk_node* x) {
static rb_red_blk_node*
TreeSuccessor(rb_red_blk_node* x) {
rb_red_blk_node* y;
rb_red_blk_node* nil=GLOBAL_ProfilerNil;
rb_red_blk_node* rb_nil=GLOBAL_ProfilerNil;
rb_red_blk_node* root=GLOBAL_ProfilerRoot;
if (nil != (y = x->right)) { /* assignment to y is intentional */
while(y->left != nil) { /* returns the minium of the right subtree of x */
if (rb_nil != (y = x->right)) { /* assignment to y is intentional */
while(y->left != rb_nil) { /* returns the minium of the right subtree of x */
y=y->left;
}
return(y);
@ -577,7 +630,7 @@ TreeSuccessor(rb_red_blk_node* x) {
x=y;
y=y->parent;
}
if (y == root) return(nil);
if (y == root) return(rb_nil);
return(y);
}
}
@ -602,11 +655,11 @@ static void
RBDelete(rb_red_blk_node* z){
rb_red_blk_node* y;
rb_red_blk_node* x;
rb_red_blk_node* nil=GLOBAL_ProfilerNil;
rb_red_blk_node* rb_nil=GLOBAL_ProfilerNil;
rb_red_blk_node* root=GLOBAL_ProfilerRoot;
y= ((z->left == nil) || (z->right == nil)) ? z : TreeSuccessor(z);
x= (y->left == nil) ? y->right : y->left;
y= ((z->left == rb_nil) || (z->right == rb_nil)) ? z : TreeSuccessor(z);
x= (y->left == rb_nil) ? y->right : y->left;
if (root == (x->parent = y->parent)) { /* assignment of y->p to x->p is intentional */
root->left=x;
} else {
@ -652,7 +705,7 @@ RBDelete(rb_red_blk_node* z){
char *set_profile_dir(char *);
char *set_profile_dir(char *name){
int size=0;
int size=0;
if (name!=NULL) {
size=strlen(name)+1;
@ -675,20 +728,18 @@ return GLOBAL_DIRNAME;
char *profile_names(int);
char *profile_names(int k) {
static char *FNAME=NULL;
int size=200;
char *FNAME=NULL;
int size=200;
if (GLOBAL_DIRNAME==NULL) set_profile_dir(NULL);
size=strlen(GLOBAL_DIRNAME)+40;
if (FNAME!=NULL) free(FNAME);
FNAME=malloc(size);
if (FNAME==NULL) { printf("Profiler Out of Mem\n"); exit(1); }
strcpy(FNAME,GLOBAL_DIRNAME);
if (k==PROFILING_FILE) {
sprintf(FNAME,"%s/PROFILING_%d",FNAME,getpid());
sprintf(FNAME,"%s/PROFILING_%d",GLOBAL_DIRNAME,getpid());
} else {
sprintf(FNAME,"%s/PROFPREDS_%d",FNAME,getpid());
sprintf(FNAME,"%s/PROFPREDS_%d",GLOBAL_DIRNAME,getpid());
}
// printf("%s\n",FNAME);
@ -704,18 +755,17 @@ void del_profile_files() {
}
void
Yap_inform_profiler_of_clause(yamop *code_start, yamop *code_end, PredEntry *pe,int index_code) {
static Int order=0;
ProfPreds++;
Yap_inform_profiler_of_clause__(void *code_start, void *code_end, PredEntry *pe,gprof_info index_code) {
buf_ptr b;
buf_extra e;
GLOBAL_ProfOn = TRUE;
if (FPreds != NULL) {
Int temp;
order++;
if (index_code) temp=-order; else temp=order;
fprintf(FPreds,"+%p %p %p %ld\n",code_start,code_end, pe, (long int)temp);
}
b.tag = '+';
b.ptr= code_start;
e.inf= index_code;
e.end= code_end;
e.pe= pe;
fwrite(&b,sizeof(b),1,GLOBAL_FPreds);
fwrite(&e,sizeof(e),1,GLOBAL_FPreds);
GLOBAL_ProfOn = FALSE;
}
@ -753,54 +803,13 @@ InitProfTree(void)
reset_tree();
while (!(GLOBAL_ProfilerRoot = RBTreeCreate())) {
if (!Yap_growheap(FALSE, 0, NULL)) {
Yap_Error(OUT_OF_HEAP_ERROR, TermNil, "while initialisating profiler");
Yap_Error(RESOURCE_ERROR_HEAP, TermNil, "while initializing profiler");
return FALSE;
}
}
return TRUE;
}
static void LookupNode(yamop *current_p) {
rb_red_blk_node *node;
if ((node = RBLookup(current_p))) {
node->pcs++;
return;
} else {
PredEntry *pp = NULL;
CODEADDR start, end;
pp = Yap_PredEntryForCode(current_p, FIND_PRED_FROM_ANYWHERE, &start, &end);
if (!pp) {
#if DEBUG
CACHE_REGS
fprintf(stderr,"lost %p, %d\n", P, Yap_op_from_opcode(P->opc));
#endif
/* lost profiler event !! */
return;
}
#if !USE_SYSTEM_MALLOC
/* add this clause as new node to the tree */
if (start < (CODEADDR)Yap_HeapBase || start > (CODEADDR)HeapTop ||
end < (CODEADDR)Yap_HeapBase || end > (CODEADDR)HeapTop) {
#if DEBUG
fprintf(stderr,"Oops2: %p->%lu %p, %p\n", current_p, (unsigned long int)(current_p->opc), start, end);
#endif
return;
}
#endif
if (pp->ArityOfPE > 100) {
#if DEBUG
fprintf(stderr,"%p(%lu)-->%p\n",current_p,(unsigned long int)Yap_op_from_opcode(current_p->opc),pp);
#endif
return;
}
node = RBTreeInsert((yamop *)start, (yamop *)end);
node->pe = pp;
node->pcs = 1;
}
}
static void RemoveCode(CODEADDR clau)
{
rb_red_blk_node* x, *node;
@ -830,85 +839,87 @@ static void RemoveCode(CODEADDR clau)
}
}
#define MAX_LINE_SIZE 1024
static int
static Int
showprofres( USES_REGS1 ) {
char line[MAX_LINE_SIZE];
yamop *pr_beg, *pr_end;
PredEntry *pr_pp;
long int pr_count;
buf_ptr buf;
profend( PASS_REGS1 ); /* Make sure profiler has ended */
/* First part: Read information about predicates and store it on yap trail */
InitProfTree();
FProf=fopen(profile_names(PROFILING_FILE),"r");
if (FProf==NULL) { fclose(FProf); return FALSE; }
while (fgets(line, MAX_LINE_SIZE, FProf) != NULL) {
if (line[0] == '+') {
rb_red_blk_node *node;
sscanf(line+1,"%p %p %p %ld",&pr_beg,&pr_end,&pr_pp,&pr_count);
node = RBTreeInsert(pr_beg, pr_end);
node->pe = pr_pp;
node->pcs = 0;
} else if (line[0] == '-') {
sscanf(line+1,"%p",&pr_beg);
RemoveCode((CODEADDR)pr_beg);
} else {
rb_red_blk_node *node;
GLOBAL_ProfGCs=0;
GLOBAL_ProfMallocs=0;
GLOBAL_ProfHGrows=0;
GLOBAL_ProfSGrows=0;
GLOBAL_ProfIndexing=0;
GLOBAL_FProf=fopen(profile_names(PROFILING_FILE),"r");
if (GLOBAL_FProf==NULL) { fclose(GLOBAL_FProf); return FALSE; }
while (fread(&buf, sizeof(buf), 1, GLOBAL_FProf)) {
switch (buf.tag) {
case '+':
{
rb_red_blk_node *node;
buf_extra e;
sscanf(line,"%p",&pr_beg);
node = RBLookup(pr_beg);
if (!node) {
if (fread(&e,sizeof(buf_extra),1,GLOBAL_FProf) == 0)
return FALSE;;
node = RBTreeInsert(buf.ptr, e.end);
node->pe = e.pe;
node->source = e.inf;
node->pcs = 0;
}
break;
case '?':
{
prolog_exec_mode md;
md = (prolog_exec_mode)buf.ptr;
if (md & GCMode) {
GLOBAL_ProfGCs++;
} else if (md & MallocMode) {
GLOBAL_ProfMallocs++;
} else if (md & GrowHeapMode) {
GLOBAL_ProfHGrows++;
} else if (md & GrowStackMode) {
GLOBAL_ProfSGrows++;
}
}
break;
case '-':
RemoveCode(buf.ptr);
break;
default:
{
rb_red_blk_node *node;
node = RBLookup(buf.ptr);
if (!node) {
#if DEBUG
fprintf(stderr,"Oops: %p\n", pr_beg);
fprintf(stderr,"Oops: %p\n", buf.ptr);
#endif
} else {
node->pcs++;
} else {
switch(node->source) {
case GPROF_INDEX:
case GPROF_INDEX_EXPAND:
case GPROF_LU_INDEX:
case GPROF_STATIC_INDEX:
case GPROF_INIT_EXPAND:
case GPROF_INIT_LOG_UPD_CLAUSE:
case GPROF_NEW_LU_SWITCH:
case GPROF_NEW_STATIC_SWITCH:
case GPROF_NEW_EXPAND_BLOCK:
GLOBAL_ProfIndexing++;
break;
default:
break;
}
node->pcs++;
}
}
}
}
fclose(FProf);
if (GLOBAL_ProfCalls==0)
return TRUE;
return TRUE;
}
static Int
p_test( USES_REGS1 ) {
char line[MAX_LINE_SIZE];
yamop *pr_beg, *pr_end;
PredEntry *pr_pp;
long int pr_count;
profend( PASS_REGS1 ); /* Make sure profiler has ended */
/* First part: Read information about predicates and store it on yap trail */
InitProfTree();
FProf=fopen("PROFILING_93920","r");
if (FProf==NULL) { fclose(FProf); return FALSE; }
while (fgets(line, MAX_LINE_SIZE, FProf) != NULL) {
if (line[0] == '+') {
rb_red_blk_node *node;
sscanf(line+1,"%p %p %p %ld",&pr_beg,&pr_end,&pr_pp,&pr_count);
node = RBTreeInsert(pr_beg, pr_end);
node->pe = pr_pp;
node->pcs = 0;
} else if (line[0] == '-') {
sscanf(line+1,"%p",&pr_beg);
RemoveCode((CODEADDR)pr_beg);
} else {
rb_red_blk_node *node = RBTreeInsert(pr_beg, pr_end);
node->pe = pr_pp;
node->pcs = 1;
}
}
fclose(FProf);
fclose(GLOBAL_FProf);
if (GLOBAL_ProfCalls==0)
return TRUE;
return TRUE;
@ -922,8 +933,9 @@ static void
prof_alrm(int signo, siginfo_t *si, void *scv)
{
CACHE_REGS
void * oldpc=(void *) CONTEXT_PC(scv);
void * oldpc;
yamop *current_p;
buf_ptr b;
GLOBAL_ProfCalls++;
/* skip an interrupt */
@ -932,34 +944,16 @@ prof_alrm(int signo, siginfo_t *si, void *scv)
return;
}
GLOBAL_ProfOn = TRUE;
oldpc = (void *) CONTEXT_PC(scv);
if (LOCAL_PrologMode & TestMode) {
if (LOCAL_PrologMode & GCMode) {
GLOBAL_ProfGCs++;
GLOBAL_ProfOn = FALSE;
return;
}
if (LOCAL_PrologMode & MallocMode) {
GLOBAL_ProfMallocs++;
GLOBAL_ProfOn = FALSE;
return;
}
if (LOCAL_PrologMode & GrowHeapMode) {
GLOBAL_ProfHGrows++;
GLOBAL_ProfOn = FALSE;
return;
}
if (LOCAL_PrologMode & GrowStackMode) {
GLOBAL_ProfSGrows++;
GLOBAL_ProfOn = FALSE;
return;
}
b.tag = '?';
b.ptr= (void *)LOCAL_PrologMode;
fwrite(&b,sizeof(b),1,GLOBAL_FPreds);
GLOBAL_ProfOn = FALSE;
return;
}
if (oldpc>(void *) &Yap_absmi && oldpc <= (void *) &Yap_absmiEND) {
CACHE_REGS
/* we are running emulator code */
@ -974,10 +968,10 @@ prof_alrm(int signo, siginfo_t *si, void *scv)
if (oop == _call_cpred || oop == _call_usercpred) {
/* doing C-code */
current_p = PREVOP(P,Osbpp)->u.Osbpp.p->CodeOfPred;
} else if ((oop = Yap_op_from_opcode(PREVOP(P,pp)->opc)) == _execute_cpred) {
current_p = PREVOP(P,Osbpp)->y_u.Osbpp.p->CodeOfPred;
} else if ((oop = Yap_op_from_opcode(P->opc)) == _execute_cpred) {
/* doing C-code */
current_p = PREVOP(P,pp)->u.pp.p->CodeOfPred;
current_p = P->y_u.Osbpp.p->CodeOfPred;
} else {
current_p = P;
}
@ -993,28 +987,27 @@ prof_alrm(int signo, siginfo_t *si, void *scv)
}
#endif
if (Yap_OffLineProfiler) {
fprintf(FProf,"%p\n", current_p);
GLOBAL_ProfOn = FALSE;
return;
}
LookupNode(current_p);
b.tag = '.';
b.ptr= current_p;
fwrite(&b,sizeof(b),1,GLOBAL_FPreds);
GLOBAL_ProfOn = FALSE;
}
void
Yap_InformOfRemoval(CODEADDR clau)
Yap_InformOfRemoval(void *clau)
{
GLOBAL_ProfOn = TRUE;
if (FPreds != NULL) {
if (GLOBAL_FPreds != NULL) {
/* just store info about what is going on */
fprintf(FPreds,"-%p\n",clau);
buf_ptr b;
b.tag = '-';
b.ptr= clau;
fwrite(&b,sizeof(b),1,GLOBAL_FPreds);
GLOBAL_ProfOn = FALSE;
return;
}
RemoveCode(clau);
GLOBAL_ProfOn = FALSE;
}
@ -1064,85 +1057,41 @@ profglobs( USES_REGS1 ) {
Yap_unify(ARG3,MkIntegerTerm(GLOBAL_ProfHGrows)) &&
Yap_unify(ARG4,MkIntegerTerm(GLOBAL_ProfSGrows)) &&
Yap_unify(ARG5,MkIntegerTerm(GLOBAL_ProfMallocs)) &&
Yap_unify(ARG6,MkIntegerTerm(GLOBAL_ProfOns)) ;
Yap_unify(ARG6,MkIntegerTerm(GLOBAL_ProfIndexing)) &&
Yap_unify(ARG7,MkIntegerTerm(GLOBAL_ProfOns)) ;
}
static Int
do_profinit( USES_REGS1 )
{
if (Yap_OffLineProfiler) {
// FPreds=fopen(profile_names(PROFPREDS_FILE),"w+");
// if (FPreds == NULL) return FALSE;
FProf=fopen(profile_names(PROFILING_FILE),"w+");
if (FProf==NULL) { fclose(FProf); return FALSE; }
FPreds = FProf;
// GLOBAL_FPreds=fopen(profile_names(PROFPREDS_FILE),"w+");
// if (GLOBAL_FPreds == NULL) return FALSE;
GLOBAL_FProf=fopen(profile_names(PROFILING_FILE),"w+");
if (GLOBAL_FProf==NULL) { fclose(GLOBAL_FProf); return FALSE; }
GLOBAL_FPreds = GLOBAL_FProf;
Yap_dump_code_area_for_profiler();
} else {
InitProfTree();
}
Yap_dump_code_area_for_profiler();
return TRUE;
}
static Int profinit( USES_REGS1 )
{
if (ProfilerOn!=0) return (FALSE);
if (GLOBAL_ProfilerOn!=0) return (FALSE);
if (!do_profinit( PASS_REGS1 ))
return FALSE;
ProfilerOn = -1; /* Inited but not yet started */
GLOBAL_ProfilerOn = -1; /* Inited but not yet started */
return(TRUE);
}
static Int profinit1( USES_REGS1 )
{
Term t = Deref(ARG1);
if (IsVarTerm(t)) {
if (Yap_OffLineProfiler)
Yap_unify(ARG1,MkAtomTerm(AtomOffline));
else
Yap_unify(ARG1,MkAtomTerm(AtomOnline));
} else if (IsAtomTerm(t)) {
char *name = RepAtom(AtomOfTerm(t))->StrOfAE;
if (!strcmp(name,"offline"))
Yap_OffLineProfiler = TRUE;
else if (!strcmp(name,"online"))
Yap_OffLineProfiler = FALSE;
else {
Yap_Error(DOMAIN_ERROR_OUT_OF_RANGE,t,"profinit only allows offline,online");
return FALSE;
}
} else {
Yap_Error(TYPE_ERROR_ATOM,t,"profinit only allows offline,online");
return FALSE;
}
return profinit( PASS_REGS1 );
}
static Int proftype( USES_REGS1 )
{
if (Yap_OffLineProfiler)
return Yap_unify(ARG1,MkAtomTerm(AtomOffline));
else
return Yap_unify(ARG1,MkAtomTerm(AtomOnline));
}
static Int start_profilers(int msec)
{
struct itimerval t;
struct sigaction sa;
if (ProfilerOn!=-1) {
if (Yap_OffLineProfiler) {
return FALSE; /* have to go through profinit */
} else {
CACHE_REGS
if (!do_profinit( PASS_REGS1 ))
return FALSE;
}
if (GLOBAL_ProfilerOn!=-1) {
return FALSE; /* have to go through profinit */
}
sa.sa_sigaction=prof_alrm;
sigemptyset(&sa.sa_mask);
@ -1156,15 +1105,21 @@ static Int start_profilers(int msec)
t.it_value.tv_usec=msec;
setitimer(ITIMER_PROF,&t,NULL);
ProfilerOn = msec;
GLOBAL_ProfilerOn = msec;
return TRUE;
}
static Int profoff( USES_REGS1 ) {
if (ProfilerOn>0) {
setitimer(ITIMER_PROF,NULL,NULL);
ProfilerOn = -1;
if (GLOBAL_ProfilerOn>0) {
struct itimerval t;
t.it_interval.tv_sec=0;
t.it_interval.tv_usec=0;
t.it_value.tv_sec=0;
t.it_value.tv_usec=0;
setitimer(ITIMER_PROF,&t,NULL);
GLOBAL_ProfilerOn = -1;
return TRUE;
}
return FALSE;
@ -1183,23 +1138,22 @@ static Int ProfOn0( USES_REGS1 ) {
}
static Int profison( USES_REGS1 ) {
return (ProfilerOn > 0);
return (GLOBAL_ProfilerOn > 0);
}
static Int profalt( USES_REGS1 ) {
if (ProfilerOn==0) return(FALSE);
if (ProfilerOn==-1) return ProfOn( PASS_REGS1 );
if (GLOBAL_ProfilerOn==0) return(FALSE);
if (GLOBAL_ProfilerOn==-1) return ProfOn( PASS_REGS1 );
return profoff( PASS_REGS1 );
}
static Int profend( USES_REGS1 )
{
if (ProfilerOn==0) return(FALSE);
if (GLOBAL_ProfilerOn==0) return(FALSE);
profoff( PASS_REGS1 ); /* Make sure profiler is off */
ProfilerOn=0;
if (Yap_OffLineProfiler) {
fclose(FProf);
}
GLOBAL_ProfilerOn=0;
fclose(GLOBAL_FProf);
GLOBAL_FPreds = NULL;
return TRUE;
}
@ -1250,22 +1204,23 @@ Yap_InitLowProf(void)
{
#if LOW_PROF
GLOBAL_ProfCalls = 0;
ProfilerOn = FALSE;
Yap_OffLineProfiler = FALSE;
GLOBAL_ProfilerOn = FALSE;
Yap_InitCPred("profinit",0, profinit, SafePredFlag);
Yap_InitCPred("profinit",1, profinit1, SafePredFlag);
Yap_InitCPred("$proftype",1, proftype, SafePredFlag);
Yap_InitCPred("profend" ,0, profend, SafePredFlag);
Yap_InitCPred("ProfOn" , 0, ProfOn0, SafePredFlag);
Yap_InitCPred("ProfOn" , 1, ProfOn, SafePredFlag);
Yap_InitCPred("profon" , 0, ProfOn0, SafePredFlag);
Yap_InitCPred("profoff", 0, profoff, SafePredFlag);
Yap_InitCPred("profalt", 0, profalt, SafePredFlag);
Yap_InitCPred("$offline_showprofres", 0, profres0, SafePredFlag);
Yap_InitCPred("$profnode", 6, profnode, SafePredFlag);
Yap_InitCPred("$profglobs", 6, profglobs, SafePredFlag);
Yap_InitCPred("$profglobs", 7, profglobs, SafePredFlag);
Yap_InitCPred("$profison",0 , profison, SafePredFlag);
Yap_InitCPred("$get_pred_pinfo", 4, getpredinfo, SafePredFlag);
Yap_InitCPred("showprofres", 4, getpredinfo, SafePredFlag);
Yap_InitCPred("prof_test", 0, p_test, 0);
#endif
}
/**
@}
*/

746
C/grow.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

1092
C/heapgc.c

File diff suppressed because it is too large Load Diff

5723
C/index.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

458
C/index_absmi_insts.h Normal file
View File

@ -0,0 +1,458 @@
/************************************************************************\
* Indexing in ARG1 *
\************************************************************************/
#ifdef INDENT_CODE
{
{
#endif /* INDENT_CODE */
BOp(user_switch, lp);
{
yamop *new = Yap_udi_search(PREG->y_u.lp.p);
if (!new) {
PREG = PREG->y_u.lp.l;
JMPNext();
}
PREG = new;
JMPNext();
}
ENDBOp();
BOp(switch_on_type, llll);
BEGD(d0);
d0 = CACHED_A1();
deref_head(d0, swt_unk);
/* nonvar */
swt_nvar:
if (IsPairTerm(d0)) {
/* pair */
SREG = RepPair(d0);
copy_jmp_address(PREG->y_u.llll.l1);
PREG = PREG->y_u.llll.l1;
JMPNext();
}
else if (!IsApplTerm(d0)) {
/* constant */
copy_jmp_address(PREG->y_u.llll.l2);
PREG = PREG->y_u.llll.l2;
I_R = d0;
JMPNext();
}
else {
/* appl */
copy_jmp_address(PREG->y_u.llll.l3);
PREG = PREG->y_u.llll.l3;
SREG = RepAppl(d0);
JMPNext();
}
BEGP(pt0);
deref_body(d0, pt0, swt_unk, swt_nvar);
/* variable */
copy_jmp_address(PREG->y_u.llll.l4);
PREG = PREG->y_u.llll.l4;
JMPNext();
ENDP(pt0);
ENDD(d0);
ENDBOp();
/* specialised case where the arguments may be:
* a list;
* the empty list;
* some other atom;
* a variable;
*
*/
BOp(switch_list_nl, ollll);
ALWAYS_LOOKAHEAD(PREG->y_u.ollll.pop);
BEGD(d0);
d0 = CACHED_A1();
#if UNIQUE_TAG_FOR_PAIRS
deref_list_head(d0, swlnl_unk_p);
swlnl_list_p:
{
#else
deref_head(d0, swlnl_unk_p);
/* non variable */
swlnl_nvar_p:
if (__builtin_expect(IsPairTerm(d0),1)) {
/* pair */
#endif
copy_jmp_address(PREG->y_u.ollll.l1);
PREG = PREG->y_u.ollll.l1;
SREG = RepPair(d0);
ALWAYS_GONext();
}
#if UNIQUE_TAG_FOR_PAIRS
swlnl_nlist_p:
#endif
if (d0 == TermNil) {
/* empty list */
PREG = PREG->y_u.ollll.l2;
JMPNext();
}
else {
/* appl or constant */
if (IsApplTerm(d0)) {
copy_jmp_address(PREG->y_u.ollll.l3);
PREG = PREG->y_u.ollll.l3;
SREG = RepAppl(d0);
JMPNext();
} else {
copy_jmp_address(PREG->y_u.ollll.l3);
PREG = PREG->y_u.ollll.l3;
I_R = d0;
JMPNext();
}
}
BEGP(pt0);
#if UNIQUE_TAG_FOR_PAIRS
swlnl_unk_p:
deref_list_body(d0, pt0, swlnl_list_p, swlnl_nlist_p);
#else
deref_body(d0, pt0, swlnl_unk_p, swlnl_nvar_p);
#endif
ENDP(pt0);
/* variable */
copy_jmp_address(PREG->y_u.ollll.l4);
PREG = PREG->y_u.ollll.l4;
JMPNext();
ENDD(d0);
}
ENDBOp();
BOp(switch_on_arg_type, xllll);
BEGD(d0);
d0 = XREG(PREG->y_u.xllll.x);
deref_head(d0, arg_swt_unk);
/* nonvar */
arg_swt_nvar:
if (IsPairTerm(d0)) {
/* pair */
copy_jmp_address(PREG->y_u.xllll.l1);
PREG = PREG->y_u.xllll.l1;
SREG = RepPair(d0);
JMPNext();
}
else if (!IsApplTerm(d0)) {
/* constant */
copy_jmp_address(PREG->y_u.xllll.l2);
PREG = PREG->y_u.xllll.l2;
I_R = d0;
JMPNext();
}
else {
/* appl */
copy_jmp_address(PREG->y_u.xllll.l3);
PREG = PREG->y_u.xllll.l3;
SREG = RepAppl(d0);
JMPNext();
}
BEGP(pt0);
deref_body(d0, pt0, arg_swt_unk, arg_swt_nvar);
/* variable */
copy_jmp_address(PREG->y_u.xllll.l4);
PREG = PREG->y_u.xllll.l4;
JMPNext();
ENDP(pt0);
ENDD(d0);
ENDBOp();
BOp(switch_on_sub_arg_type, sllll);
BEGD(d0);
d0 = SREG[PREG->y_u.sllll.s];
deref_head(d0, sub_arg_swt_unk);
/* nonvar */
sub_arg_swt_nvar:
if (IsPairTerm(d0)) {
/* pair */
copy_jmp_address(PREG->y_u.sllll.l1);
PREG = PREG->y_u.sllll.l1;
SREG = RepPair(d0);
JMPNext();
}
else if (!IsApplTerm(d0)) {
/* constant */
copy_jmp_address(PREG->y_u.sllll.l2);
PREG = PREG->y_u.sllll.l2;
I_R = d0;
JMPNext();
}
else {
/* appl */
copy_jmp_address(PREG->y_u.sllll.l3);
PREG = PREG->y_u.sllll.l3;
SREG = RepAppl(d0);
JMPNext();
}
BEGP(pt0);
deref_body(d0, pt0, sub_arg_swt_unk, sub_arg_swt_nvar);
/* variable */
copy_jmp_address(PREG->y_u.sllll.l4);
PREG = PREG->y_u.sllll.l4;
JMPNext();
ENDP(pt0);
ENDD(d0);
ENDBOp();
BOp(jump_if_var, l);
BEGD(d0);
d0 = CACHED_A1();
deref_head(d0, jump_if_unk);
/* non var */
jump0_if_nonvar:
PREG = NEXTOP(PREG, l);
JMPNext();
BEGP(pt0);
deref_body(d0, pt0, jump_if_unk, jump0_if_nonvar);
/* variable */
copy_jmp_address(PREG->y_u.l.l);
PREG = PREG->y_u.l.l;
ENDP(pt0);
JMPNext();
ENDD(d0);
ENDBOp();
BOp(jump_if_nonvar, xll);
BEGD(d0);
d0 = XREG(PREG->y_u.xll.x);
deref_head(d0, jump2_if_unk);
/* non var */
jump2_if_nonvar:
copy_jmp_address(PREG->y_u.xll.l1);
PREG = PREG->y_u.xll.l1;
JMPNext();
BEGP(pt0);
deref_body(d0, pt0, jump2_if_unk, jump2_if_nonvar);
/* variable */
PREG = NEXTOP(PREG, xll);
ENDP(pt0);
JMPNext();
ENDD(d0);
ENDBOp();
BOp(if_not_then, clll);
BEGD(d0);
d0 = CACHED_A1();
deref_head(d0, if_n_unk);
if_n_nvar:
/* not variable */
if (d0 == PREG->y_u.clll.c) {
/* equal to test value */
copy_jmp_address(PREG->y_u.clll.l2);
PREG = PREG->y_u.clll.l2;
JMPNext();
}
else {
/* different from test value */
/* the case to optimise */
copy_jmp_address(PREG->y_u.clll.l1);
PREG = PREG->y_u.clll.l1;
JMPNext();
}
BEGP(pt0);
deref_body(d0, pt0, if_n_unk, if_n_nvar);
ENDP(pt0);
/* variable */
copy_jmp_address(PREG->y_u.clll.l3);
PREG = PREG->y_u.clll.l3;
JMPNext();
ENDD(d0);
ENDBOp();
/************************************************************************\
* Indexing on ARG1 *
\************************************************************************/
#define HASH_SHIFT 6
BOp(switch_on_func, sssl);
BEGD(d1);
d1 = *SREG++;
/* we use a very simple hash function to find elements in a
* switch table */
{
CELL
/* first, calculate the mask */
Mask = (PREG->y_u.sssl.s - 1) << 1, /* next, calculate the hash function */
hash = d1 >> (HASH_SHIFT - 1) & Mask;
CELL *base;
base = (CELL *)PREG->y_u.sssl.l;
/* PREG now points at the beginning of the hash table */
BEGP(pt0);
/* pt0 will always point at the item */
pt0 = base + hash;
BEGD(d0);
d0 = pt0[0];
/* a match happens either if we found the value, or if we
* found an empty slot */
if (d0 == d1 || d0 == 0) {
copy_jmp_addressa(pt0+1);
PREG = (yamop *) (pt0[1]);
JMPNext();
}
else {
/* ooops, collision, look for other items */
register CELL d = ((d1 | 1) << 1) & Mask;
while (1) {
hash = (hash + d) & Mask;
pt0 = base + hash;
d0 = pt0[0];
if (d0 == d1 || d0 == 0) {
copy_jmp_addressa(pt0+1);
PREG = (yamop *) pt0[1];
JMPNext();
}
}
}
ENDD(d0);
ENDP(pt0);
}
ENDD(d1);
ENDBOp();
BOp(switch_on_cons, sssl);
BEGD(d1);
d1 = I_R;
/* we use a very simple hash function to find elements in a
* switch table */
{
CELL
/* first, calculate the mask */
Mask = (PREG->y_u.sssl.s - 1) << 1, /* next, calculate the hash function */
hash = d1 >> (HASH_SHIFT - 1) & Mask;
CELL *base;
base = (CELL *)PREG->y_u.sssl.l;
/* PREG now points at the beginning of the hash table */
BEGP(pt0);
/* pt0 will always point at the item */
pt0 = base + hash;
BEGD(d0);
d0 = pt0[0];
/* a match happens either if we found the value, or if we
* found an empty slot */
if (d0 == d1 || d0 == 0) {
copy_jmp_addressa(pt0+1);
PREG = (yamop *) (pt0[1]);
JMPNext();
}
else {
/* ooops, collision, look for other items */
register CELL d = ((d1 | 1) << 1) & Mask;
while (1) {
hash = (hash + d) & Mask;
pt0 = base + hash;
d0 = pt0[0];
if (d0 == d1 || d0 == 0) {
copy_jmp_addressa(pt0+1);
PREG = (yamop *) pt0[1];
JMPNext();
}
}
}
ENDD(d0);
ENDP(pt0);
}
ENDD(d1);
ENDBOp();
BOp(go_on_func, sssl);
BEGD(d0);
{
CELL *pt = (CELL *)(PREG->y_u.sssl.l);
d0 = *SREG++;
if (d0 == pt[0]) {
copy_jmp_addressa(pt+1);
PREG = (yamop *) pt[1];
JMPNext();
} else {
copy_jmp_addressa(pt+3);
PREG = (yamop *) pt[3];
JMPNext();
}
}
ENDD(d0);
ENDBOp();
BOp(go_on_cons, sssl);
BEGD(d0);
{
CELL *pt = (CELL *)(PREG->y_u.sssl.l);
d0 = I_R;
if (d0 == pt[0]) {
copy_jmp_addressa(pt+1);
PREG = (yamop *) pt[1];
JMPNext();
} else {
copy_jmp_addressa(pt+3);
PREG = (yamop *) pt[3];
JMPNext();
}
}
ENDD(d0);
ENDBOp();
BOp(if_func, sssl);
BEGD(d1);
BEGP(pt0);
pt0 = (CELL *) PREG->y_u.sssl.l;
d1 = *SREG++;
while (pt0[0] != d1 && pt0[0] != (CELL)NULL ) {
pt0 += 2;
}
copy_jmp_addressa(pt0+1);
PREG = (yamop *) (pt0[1]);
JMPNext();
ENDP(pt0);
ENDD(d1);
ENDBOp();
BOp(if_cons, sssl);
BEGD(d1);
BEGP(pt0);
pt0 = (CELL *) PREG->y_u.sssl.l;
d1 = I_R;
while (pt0[0] != d1 && pt0[0] != 0L ) {
pt0 += 2;
}
copy_jmp_addressa(pt0+1);
PREG = (yamop *) (pt0[1]);
JMPNext();
ENDP(pt0);
ENDD(d1);
ENDBOp();
Op(index_dbref, e);
PREG = NEXTOP(PREG, e);
I_R = AbsAppl(SREG-1);
GONext();
ENDOp();
Op(index_blob, e);
PREG = NEXTOP(PREG, e);
I_R = Yap_DoubleP_key(SREG);
GONext();
ENDOp();
Op(index_long, e);
PREG = NEXTOP(PREG, e);
I_R = Yap_IntP_key(SREG);
GONext();
ENDOp();

1370
C/init.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

View File

@ -15,39 +15,111 @@
* *
*************************************************************************/
/**
@file inlines.c
@{
@defgroup YAP_Inlines Inlined Tests nad Ter Manipulation
@ingroup builtins
*/
#define IN_INLINES_C 1
#include "absmi.h"
#ifdef CUT_C
#include "cut_c.h"
#endif
STATIC_PROTO(Int p_atom, ( USES_REGS1 ));
STATIC_PROTO(Int p_atomic, ( USES_REGS1 ));
STATIC_PROTO(Int p_integer, ( USES_REGS1 ));
STATIC_PROTO(Int p_nonvar, ( USES_REGS1 ));
STATIC_PROTO(Int p_number, ( USES_REGS1 ));
STATIC_PROTO(Int p_var, ( USES_REGS1 ));
STATIC_PROTO(Int p_db_ref, ( USES_REGS1 ));
STATIC_PROTO(Int p_primitive, ( USES_REGS1 ));
STATIC_PROTO(Int p_compound, ( USES_REGS1 ));
STATIC_PROTO(Int p_float, ( USES_REGS1 ));
STATIC_PROTO(Int p_equal, ( USES_REGS1 ));
STATIC_PROTO(Int p_dif, ( USES_REGS1 ));
STATIC_PROTO(Int p_eq, ( USES_REGS1 ));
STATIC_PROTO(Int p_arg, ( USES_REGS1 ));
STATIC_PROTO(Int p_functor, ( USES_REGS1 ));
static Int p_atom( USES_REGS1 );
static Int p_atomic( USES_REGS1 );
static Int p_integer( USES_REGS1 );
static Int p_nonvar( USES_REGS1 );
static Int p_number( USES_REGS1 );
static Int p_var( USES_REGS1 );
static Int p_db_ref( USES_REGS1 );
static Int p_primitive( USES_REGS1 );
static Int p_compound( USES_REGS1 );
static Int p_float( USES_REGS1 );
static Int p_equal( USES_REGS1 );
static Int p_dif( USES_REGS1 );
static Int p_eq( USES_REGS1 );
static Int p_arg( USES_REGS1 );
static Int p_functor( USES_REGS1 );
static Int p_fail( USES_REGS1 );
static Int p_true( USES_REGS1 );
/** @pred fail is iso
Always fails. Defined as if by:
~~~~~
fail :- 2=1.
~~~~~
*/
/** @pred false is iso
The same as fail. Defined as if by:
~~~~~
false :- 2=1.
~~~~~
*/
static Int p_fail( USES_REGS1 )
{
return false;
}
/** @pred true is iso
Succeed.
Succeeds once. Defined as if by:
~~~~~
true :- true.
~~~~~
*/
/** @pred otherwise is iso
Succeed.
Succeeds once. Defined as if by:
~~~~~
otherwise.
~~~~~
*/
static Int
static Int p_true( USES_REGS1 )
{
return true;
}
/** @pred atom( _T_) is iso
Succeeds if and only if _T_ is currently instantiated to an atom.
*/
static Int
p_atom( USES_REGS1 )
{ /* atom(?) */
BEGD(d0);
d0 = ARG1;
deref_head(d0, atom_unk);
atom_nvar:
if (IsAtomTerm(d0)) {
if (IsAtomTerm(d0) && !IsBlob(AtomOfTerm(d0))) {
return(TRUE);
}
else {
@ -61,7 +133,14 @@ p_atom( USES_REGS1 )
ENDD(d0);
}
static Int
/** @pred atomic(T) is iso
Checks whether _T_ is an atomic symbol (atom or number).
*/
static Int
p_atomic( USES_REGS1 )
{ /* atomic(?) */
BEGD(d0);
@ -82,7 +161,14 @@ p_atomic( USES_REGS1 )
ENDD(d0);
}
static Int
/** @pred integer( _T_) is iso
Succeeds if and only if _T_ is currently instantiated to an integer.
*/
static Int
p_integer( USES_REGS1 )
{ /* integer(?,?) */
BEGD(d0);
@ -96,10 +182,14 @@ p_integer( USES_REGS1 )
Functor f0 = FunctorOfTerm(d0);
if (IsExtensionFunctor(f0)) {
switch ((CELL)f0) {
case (CELL)FunctorLongInt:
#ifdef USE_GMP
case (CELL)FunctorBigInt:
#endif
{ CELL *pt = RepAppl(d0);
if ( pt[1] != BIG_INT ) {
return FALSE;
}
return TRUE;
}
case (CELL)FunctorLongInt:
return(TRUE);
default:
return(FALSE);
@ -117,7 +207,14 @@ p_integer( USES_REGS1 )
ENDD(d0);
}
static Int
/** @pred number( _T_) is iso
Checks whether `T` is an integer, rational or a float.
*/
static Int
p_number( USES_REGS1 )
{ /* number(?) */
BEGD(d0);
@ -131,11 +228,15 @@ p_number( USES_REGS1 )
Functor f0 = FunctorOfTerm(d0);
if (IsExtensionFunctor(f0)) {
switch ((CELL)f0) {
case (CELL)FunctorBigInt:
{ CELL *pt = RepAppl(d0);
if ( pt[1] != BIG_RATIONAL || pt[1] != BIG_INT ) {
return FALSE;
}
return(TRUE);
}
case (CELL)FunctorLongInt:
case (CELL)FunctorDouble:
#ifdef USE_GMP
case (CELL)FunctorBigInt:
#endif
return(TRUE);
default:
return(FALSE);
@ -153,7 +254,14 @@ p_number( USES_REGS1 )
ENDD(d0);
}
static Int
/** @pred db_reference( _T_)
Checks whether _T_ is a database reference.
*/
static Int
p_db_ref( USES_REGS1 )
{ /* db_reference(?,?) */
BEGD(d0);
@ -174,7 +282,14 @@ p_db_ref( USES_REGS1 )
ENDD(d0);
}
static Int
/** @pred primitive( ?_T_)
Checks whether _T_ is an atomic term or a database reference.
*/
static Int
p_primitive( USES_REGS1 )
{ /* primitive(?) */
BEGD(d0);
@ -195,7 +310,14 @@ p_primitive( USES_REGS1 )
ENDD(d0);
}
static Int
/** @pred float( _T_) is iso
Checks whether _T_ is a floating point number.
*/
static Int
p_float( USES_REGS1 )
{ /* float(?) */
BEGD(d0);
@ -216,7 +338,14 @@ p_float( USES_REGS1 )
ENDD(d0);
}
static Int
/** @pred compound( _T_) is iso
Checks whether _T_ is a compound term.
*/
static Int
p_compound( USES_REGS1 )
{ /* compound(?) */
BEGD(d0);
@ -243,7 +372,14 @@ p_compound( USES_REGS1 )
ENDD(d0);
}
static Int
/** @pred nonvar( _T_) is iso
The opposite of `var( _T_)`.
*/
static Int
p_nonvar( USES_REGS1 )
{ /* nonvar(?) */
BEGD(d0);
@ -251,7 +387,7 @@ p_nonvar( USES_REGS1 )
deref_head(d0, nonvar_unk);
nonvar_nvar:
return(TRUE);
BEGP(pt0);
deref_body(d0, pt0, nonvar_unk, nonvar_nvar);
return(FALSE);
@ -259,7 +395,14 @@ p_nonvar( USES_REGS1 )
ENDD(d0);
}
static Int
/** @pred var( _T_) is iso
Succeeds if _T_ is currently a free variable, otherwise fails.
*/
static Int
p_var( USES_REGS1 )
{ /* var(?) */
BEGD(d0);
@ -275,13 +418,20 @@ p_var( USES_REGS1 )
ENDD(d0);
}
static Int
/** @pred _X_ = _Y_ is iso
Tries to unify terms _X_ and _Y_.
*/
static Int
p_equal( USES_REGS1 )
{ /* ?=? */
return(Yap_IUnify(ARG1, ARG2));
}
static Int
static Int
eq(Term t1, Term t2 USES_REGS)
{ /* ? == ? */
BEGD(d0);
@ -319,6 +469,8 @@ eq(Term t1, Term t2 USES_REGS)
return (d0 == d1);
case (CELL)FunctorLongInt:
return(LongIntOfTerm(d0) == LongIntOfTerm(d1));
case (CELL)FunctorString:
return(strcmp((char *)StringOfTerm(d0), (char *)StringOfTerm(d1)) == 0);
#ifdef USE_GMP
case (CELL)FunctorBigInt:
return (Yap_gmp_tcmp_big_big(d0, d1) == 0);
@ -365,20 +517,58 @@ eq(Term t1, Term t2 USES_REGS)
ENDD(d0);
}
static Int
/** @pred ?_X_ == ?_Y_ is iso
Succeeds if terms _X_ and _Y_ are strictly identical. The
difference between this predicate and =/2 is that, if one of the
arguments is a free variable, it only succeeds when they have already
been unified.
~~~~~{.prolog}
?- X == Y.
~~~~~
fails, but,
~~~~~{.prolog}
?- X = Y, X == Y.
~~~~~
succeeds.
~~~~~{.prolog}
?- X == 2.
~~~~~
fails, but,
~~~~~{.prolog}
?- X = 2, X == 2.
~~~~~
succeeds.
*/
static Int
p_eq( USES_REGS1 )
{ /* ? == ? */
return eq(ARG1,ARG2 PASS_REGS);
}
int
int
Yap_eq(Term t1, Term t2)
{ /* ? == ? */
CACHE_REGS
return eq(t1,t2 PASS_REGS);
}
static Int
/** @pred _X_ \= _Y_ is iso
Succeeds if terms _X_ and _Y_ are not unifiable.
*/
static Int
p_dif( USES_REGS1 )
{ /* ? \= ? */
#if SHADOW_HB
@ -417,9 +607,9 @@ p_dif( USES_REGS1 )
/* make B and HB point to H to guarantee all bindings will
* be trailed
*/
HBREG = H;
B = (choiceptr) H;
B->cp_h = H;
HBREG = HR;
B = (choiceptr) HR;
B->cp_h = HR;
SET_BB(B);
save_hb();
d0 = Yap_IUnify(d0, d1);
@ -427,14 +617,14 @@ p_dif( USES_REGS1 )
/* now restore Woken Goals to its old value */
Yap_UpdateTimedVar(LOCAL_WokenGoals, OldWokenGoals);
if (OldWokenGoals == TermNil) {
Yap_undo_signal(YAP_WAKEUP_SIGNAL);
Yap_get_signal(YAP_WAKEUP_SIGNAL);
}
#endif
/* restore B */
B = pt1;
SET_BB(PROTECT_FROZEN_B(pt1));
#ifdef COROUTINING
H = HBREG;
HR = HBREG;
#endif
HBREG = B->cp_h;
/* untrail all bindings made by Yap_IUnify */
@ -456,7 +646,7 @@ p_dif( USES_REGS1 )
CELL *pt = RepAppl(d1);
/* AbsAppl means */
/* multi-assignment variable */
/* so the next cell is the old value */
/* so the next cell is the old value */
#ifdef FROZEN_STACKS
pt[0] = TrailVal(--TR);
#else
@ -486,7 +676,21 @@ p_dif( USES_REGS1 )
ENDD(d0);
}
static Int
/** @pred arg(+ _N_,+ _T_, _A_) is iso
Succeeds if the argument _N_ of the term _T_ unifies with
_A_. The arguments are numbered from 1 to the arity of the term.
The current version will generate an error if _T_ or _N_ are
unbound, if _T_ is not a compound term, of if _N_ is not a positive
integer. Note that previous versions of YAP would fail silently
under these errors.
*/
static Int
p_arg( USES_REGS1 )
{ /* arg(?,?,?) */
#if SHADOW_HB
@ -502,7 +706,8 @@ p_arg( USES_REGS1 )
else if (IsLongIntTerm(d0)) {
d0 = LongIntOfTerm(d0);
} else {
Yap_Error(TYPE_ERROR_INTEGER,d0,"arg 1 of arg/3");
if (!IsBigIntTerm( d0 ))
Yap_Error(TYPE_ERROR_INTEGER,d0,"arg 1 of arg/3");
return(FALSE);
}
@ -518,16 +723,17 @@ p_arg( USES_REGS1 )
pt0 = RepAppl(d1);
d1 = *pt0;
if (IsExtensionFunctor((Functor) d1)) {
Yap_Error(TYPE_ERROR_COMPOUND, d1, "arg 2 of arg/3");
return(FALSE);
}
save_hb();
if ((Int)d0 <= 0 ||
(Int)d0 > ArityOfFunctor((Functor) d1) ||
Yap_IUnify(pt0[d0], ARG3) == FALSE) {
/* don't complain here for Prolog compatibility
/* don't complain here for Prolog compatibility
if ((Int)d0 <= 0) {
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO,
MkIntegerTerm(d0),"arg 1 of arg/3");
MkIntegerTerm(d0),"arg 1 of arg/3");
}
*/
return(FALSE);
@ -555,13 +761,13 @@ p_arg( USES_REGS1 )
else {
if ((Int)d0 < 0)
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO,
MkIntegerTerm(d0),"arg 1 of arg/3");
MkIntegerTerm(d0),"arg 1 of arg/3");
return(FALSE);
}
ENDP(pt0);
}
else {
/* Yap_Error(TYPE_ERROR_COMPOUND, d1, "arg 2 of arg/3"); */
Yap_Error(TYPE_ERROR_COMPOUND, d1, "arg 2 of arg/3");
return(FALSE);
}
@ -581,6 +787,26 @@ p_arg( USES_REGS1 )
}
/** @pred functor( _T_, _F_, _N_) is iso
The top functor of term _T_ is named _F_ and has arity _N_.
When _T_ is not instantiated, _F_ and _N_ must be. If
_N_ is 0, _F_ must be an atomic symbol, which will be unified
with _T_. If _N_ is not 0, then _F_ must be an atom and
_T_ becomes instantiated to the most general term having functor
_F_ and arity _N_. If _T_ is instantiated to a term then
_F_ and _N_ are respectively unified with its top functor name
and arity.
In the current version of YAP the arity _N_ must be an
integer. Previous versions allowed evaluable expressions, as long as the
expression would evaluate to an integer. This feature is not available
in the ISO Prolog standard.
*/
static Int
p_functor( USES_REGS1 ) /* functor(?,?,?) */
{
@ -605,6 +831,8 @@ p_functor( USES_REGS1 ) /* functor(?,?,?) */
d1 = MkIntTerm(0);
} else if (d1 == (CELL)FunctorLongInt) {
d1 = MkIntTerm(0);
} else if (d1 == (CELL)FunctorString) {
d1 = MkIntTerm(0);
} else
return(FALSE);
} else {
@ -623,7 +851,7 @@ p_functor( USES_REGS1 ) /* functor(?,?,?) */
/* let's go and bind them */
{
register CELL arity = d1;
d1 = ARG2;
deref_head(d1, func_nvar_unk);
func_nvar_nvar:
@ -634,11 +862,11 @@ p_functor( USES_REGS1 ) /* functor(?,?,?) */
/* have to buffer ENDP and label */
d0 = arity;
goto func_bind_x3;
BEGP(pt0);
deref_body(d1, pt0, func_nvar_unk, func_nvar_nvar);
/* A2 is a variable, go and bind it */
Bind(pt0, d0);
YapBind(pt0, d0);
/* have to buffer ENDP and label */
d0 = arity;
ENDP(pt0);
@ -659,7 +887,7 @@ p_functor( USES_REGS1 ) /* functor(?,?,?) */
BEGP(pt0);
deref_body(d1, pt0, func_nvar3_unk, func_nvar3_nvar);
/* A3 is a variable, go and bind it */
Bind(pt0, d0);
YapBind(pt0, d0);
return(TRUE);
ENDP(pt0);
@ -697,10 +925,10 @@ p_functor( USES_REGS1 ) /* functor(?,?,?) */
/* We made it!!!!! we got in d0 the name, in d1 the arity and
* in pt0 the variable to bind it to. */
if (d0 == TermDot && d1 == 2) {
RESET_VARIABLE(H);
RESET_VARIABLE(H+1);
d0 = AbsPair(H);
H += 2;
RESET_VARIABLE(HR);
RESET_VARIABLE(HR+1);
d0 = AbsPair(HR);
HR += 2;
}
else if ((Int)d1 > 0) {
/* now let's build a compound term */
@ -714,12 +942,12 @@ p_functor( USES_REGS1 ) /* functor(?,?,?) */
}
else
d0 = (CELL) Yap_MkFunctor(AtomOfTerm(d0), (Int) d1);
pt1 = H;
pt1 = HR;
*pt1++ = d0;
d0 = AbsAppl(H);
if (pt1+d1 > ENV - CreepFlag) {
d0 = AbsAppl(HR);
if (pt1+d1 > ENV - StackGap( PASS_REGS1 )) {
if (!Yap_gcl((1+d1)*sizeof(CELL), 3, ENV, gc_P(P,CP))) {
Yap_Error(OUT_OF_STACK_ERROR, TermNil, LOCAL_ErrorMessage);
Yap_Error(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage);
return FALSE;
}
goto restart;
@ -729,15 +957,15 @@ p_functor( USES_REGS1 ) /* functor(?,?,?) */
pt1++;
}
/* done building the term */
H = pt1;
HR = pt1;
ENDP(pt1);
} else if ((Int)d1 < 0) {
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO,MkIntegerTerm(d1),"functor/3");
return(FALSE);
}
}
/* else if arity is 0 just pass d0 through */
/* Ding, ding, we made it */
Bind(pt0, d0);
YapBind(pt0, d0);
return(TRUE);
@ -760,6 +988,13 @@ p_functor( USES_REGS1 ) /* functor(?,?,?) */
ENDD(d0);
}
static Term
cp_as_integer(choiceptr cp USES_REGS)
{
return(MkIntegerTerm(LCL0-(CELL *)cp));
}
static Int
p_cut_by( USES_REGS1 )
{
@ -780,14 +1015,12 @@ p_cut_by( USES_REGS1 )
#else
pt0 = (choiceptr)(LCL0-IntOfTerm(d0));
#endif
#ifdef CUT_C
{
while (POP_CHOICE_POINT(pt0))
{
POP_EXECUTE();
}
}
#endif /* CUT_C */
#ifdef YAPOR
CUT_prune_to(pt0);
#endif /* YAPOR */
@ -819,29 +1052,69 @@ p_cut_by( USES_REGS1 )
static Int
p_erroneous_call( USES_REGS1 )
{
Yap_Error(SYSTEM_ERROR, TermNil, "bad call to internal built-in");
Yap_Error(SYSTEM_ERROR_INTERNAL, TermNil, "bad call to internal built-in");
return(FALSE);
}
static Int
init_genarg( USES_REGS1 )
{ /* getarg(?Atom) */
Term t0 = Deref(ARG1);
Term t1 = Deref(ARG2);
CELL *pt, *end;
int res;
UInt arity;
static Int
p_save_cp( USES_REGS1 )
{
Term t = Deref(ARG1);
Term td;
#if SHADOW_HB
register CELL *HBREG = HB;
#endif
if (!IsVarTerm(t)) return(FALSE);
td = cp_as_integer(B PASS_REGS);
YapBind((CELL *)t,td);
return(TRUE);
}
if (!IsVarTerm(t0)) {
res = p_arg( PASS_REGS1 );
if (res) {
cut_succeed();
} else {
cut_fail();
}
}
if (IsVarTerm(t1)) {
Yap_Error(INSTANTIATION_ERROR,t1,"genarg/3");
/// @}
/**
*
* @addtogroup args
*
* @{
*
* @namespace args
*
* @pred genarg( ?Index, +Term , -Arg )
*
*
* Similar to arg/3, but it can also backtrack through _T_'s arguments, that is:
~~~~~~~~~
?- arg:genarg(I, f(a,b), A).
A = a,
I = 1.
;
A = b,
I = 2.
~~~~~~~~~
*
* Note: SWI-Prolog defines arg/3 as genarg/3.
*/
static Int
genarg( USES_REGS1 )
{ /* getarg(?Atom) */
Term t0 = Deref(ARG1);
Term t1 = Deref(ARG2);
CELL *pt, *end;
int res;
UInt arity;
if (!IsVarTerm(t0)) {
res = p_arg( PASS_REGS1 );
if (res) {
cut_succeed();
} else {
cut_fail();
}
}
if (IsVarTerm(t1)) {
Yap_Error(INSTANTIATION_ERROR,t1,"genarg/3");
return FALSE;
}
if (IsPrimitiveTerm(t1)) {
@ -898,30 +1171,42 @@ cont_genarg( USES_REGS1 )
}
void
Yap_InitInlines(void)
{
CACHE_REGS
Term cm = CurrentModule;
Yap_InitAsmPred("$$cut_by", 1, _cut_by, p_cut_by, SafePredFlag);
Yap_InitAsmPred("atom", 1, _atom, p_atom, SafePredFlag);
Yap_InitAsmPred("atomic", 1, _atomic, p_atomic, SafePredFlag);
Yap_InitAsmPred("integer", 1, _integer, p_integer, SafePredFlag);
Yap_InitAsmPred("nonvar", 1, _nonvar, p_nonvar, SafePredFlag);
Yap_InitAsmPred("number", 1, _number, p_number, SafePredFlag);
Yap_InitAsmPred("var", 1, _var, p_var, SafePredFlag);
Yap_InitAsmPred("db_reference", 1, _db_ref, p_db_ref, SafePredFlag);
Yap_InitAsmPred("primitive", 1, _primitive, p_primitive, SafePredFlag);
Yap_InitAsmPred("compound", 1, _compound, p_compound, SafePredFlag);
Yap_InitAsmPred("float", 1, _float, p_float, SafePredFlag);
Yap_InitAsmPred("=", 2, _equal, p_equal, SafePredFlag);
Yap_InitAsmPred("\\=", 2, _dif, p_dif, SafePredFlag);
Yap_InitAsmPred("==", 2, _eq, p_eq, SafePredFlag);
Yap_InitAsmPred("arg", 3, _arg, p_arg, SafePredFlag);
Yap_InitAsmPred("functor", 3, _functor, p_functor, 0);
Yap_InitAsmPred("$label_ctl", 2, _p_label_ctl, p_erroneous_call, SafePredFlag);
CurrentModule = ARG_MODULE;
Yap_InitCPredBack("genarg", 3, 3, init_genarg, cont_genarg,SafePredFlag);
CurrentModule = cm;
void
Yap_InitInlines(void)
{
CACHE_REGS
Term cm = CurrentModule;
Yap_InitAsmPred("$$cut_by", 1, _cut_by, p_cut_by, SafePredFlag);
Yap_InitAsmPred("$$save_by", 1, _save_by, p_save_cp, SafePredFlag);
Yap_InitAsmPred("atom", 1, _atom, p_atom, SafePredFlag);
Yap_InitAsmPred("atomic", 1, _atomic, p_atomic, SafePredFlag);
Yap_InitAsmPred("integer", 1, _integer, p_integer, SafePredFlag);
Yap_InitAsmPred("nonvar", 1, _nonvar, p_nonvar, SafePredFlag);
Yap_InitAsmPred("number", 1, _number, p_number, SafePredFlag);
Yap_InitAsmPred("var", 1, _var, p_var, SafePredFlag);
Yap_InitAsmPred("db_reference", 1, _db_ref, p_db_ref, SafePredFlag);
Yap_InitAsmPred("primitive", 1, _primitive, p_primitive, SafePredFlag);
Yap_InitAsmPred("compound", 1, _compound, p_compound, SafePredFlag);
Yap_InitAsmPred("float", 1, _float, p_float, SafePredFlag);
Yap_InitAsmPred("=", 2, _equal, p_equal, SafePredFlag);
#if INLINE_BIG_COMPARISONS
Yap_InitAsmPred("\\=", 2, _dif, p_dif, SafePredFlag|TestPredFlag);
Yap_InitAsmPred("==", 2, _eq, p_eq, SafePredFlag|TestPredFlag);
#else
Yap_InitCPred("\\=", 2, p_dif, SafePredFlag);
Yap_InitCPred("==", 2, p_eq, SafePredFlag);
#endif
Yap_InitAsmPred("arg", 3, _arg, p_arg, SafePredFlag);
Yap_InitAsmPred("functor", 3, _functor, p_functor, 0);
Yap_InitAsmPred("$label_ctl", 2, _p_label_ctl, p_erroneous_call, SafePredFlag);
CurrentModule = ARG_MODULE;
Yap_InitCPredBack("genarg", 3, 3, genarg, cont_genarg,SafePredFlag);
CurrentModule = cm;
Yap_InitCPred("true", 0, p_true, SafePredFlag);
Yap_InitCPred("otherwise", 0, p_true, SafePredFlag);
Yap_InitCPred("false", 0, p_fail, SafePredFlag);
Yap_InitCPred("fail", 0, p_fail, SafePredFlag);
}
// @}

File diff suppressed because it is too large Load Diff

43
C/learn2 Normal file
View File

@ -0,0 +1,43 @@
#!/usr/local/bin/python3.4
import os, sys
if 'LD_LIBRARY_PATH' not in os.environ:
os.environ['LD_LIBRARY_PATH'] = '/usr/local/lib'
try:
os.execv(sys.argv[0], sys.argv)
except Exception as exc:
print( 'Failed re-exec:', exc )
sys.exit(1)
#
# import yourmodule
print( 'Success:', os.environ['LD_LIBRARY_PATH']
# your program goes here
import matplotlib
matplotlib.use('Agg')
#import sys, os
sys.path = sys.path + [os.getcwd()]
sys.druwid_root = os.path.abspath(os.path.dirname(__file__))
import dru.druwid
import dru.druplot
from dru.shell import AlephShell
cq = dru.druwid.ClauseQueue()
learner = dru.druwid.Aleph( cq )
#
# initialize engine
#
def main():
if not learner:
print("Nothing to do, bye!")
exit(2)
AlephShell(learner).cmdloop()
if __name__ == "__main__":
main()

View File

@ -26,9 +26,10 @@
* FindExecutable(argv[0]) should be called on yap initialization to
* locate the executable of Yap
*/
void
Yap_FindExecutable(char *name)
char *
Yap_FindExecutable(void)
{
return NULL;
}
@ -68,7 +69,7 @@ LoadForeign(StringList ofiles, StringList libs,
strcpy(LOCAL_ErrorSay," Load Failed: in AIX you must load a single object file");
return LOAD_FAILLED;
}
if (!Yap_TrueFileName(AtomName(ofiles->name), LOCAL_FileNameBuf, TRUE)) {
if (!Yap_AbsoluteFileInBuffer(AtomName(ofiles->name), LOCAL_FileNameBuf, YAP_FILENAME_MAX, true)) {
strcpy(LOCAL_ErrorSay, " Trying to open unexisting file in LoadForeign ");
return LOAD_FAILLED;
}

View File

@ -54,8 +54,8 @@ this code is no being maintained anymore
* YAP_FindExecutable(argv[0]) should be called on yap initialization to
* locate the executable of Yap
*/
void
Yap_FindExecutable(char *name)
char *
Yap_FindExecutable(void)
{
register char *cp, *cp2;
struct stat stbuf;
@ -67,7 +67,8 @@ Yap_FindExecutable(char *name)
if (*GLOBAL_argv[0] == '/') {
if (oktox(GLOBAL_argv[0])) {
strcpy(LOCAL_FileNameBuf, GLOBAL_argv[0]);
Yap_TrueFileName(LOCAL_FileNameBuf, GLOBAL_Executable, TRUE);
Yap_AbsoluteFileInBuffer(LOCAL_FileNameBuf, true);
strncpy( GLOBAL_Executable, LOCAL_FileNameBuf, YAP_MAXPATHLEN);
return;
}
}
@ -87,16 +88,16 @@ Yap_FindExecutable(char *name)
cp++;
if (!oktox(LOCAL_FileNameBuf))
continue;
Yap_TrueFileName(LOCAL_FileNameBuf, GLOBAL_Executable, TRUE);
Yap_AbsoluteFileInBuffer(Yap_AbsoluteFileInBuffer(LOCAL_FileNameBuf, GLOBAL_Executable, TRUE);
return;
}
/* one last try for dual systems */
strcpy(LOCAL_FileNameBuf, GLOBAL_argv[0]);
Yap_TrueFileName(LOCAL_FileNameBuf, GLOBAL_Executable, TRUE);
strcpy(LOCAL_FileNameBuf, GLOBAL_argv[0]);
Yap_AbsoluteFileInBuffer(Yap_AbsoluteFileInBuffer(LOCAL_FileNameBuf, GLOBAL_Executable, TRUE);
if (oktox(GLOBAL_Executable))
return;
return GLOBAL_Executable;
else
Yap_Error(SYSTEM_ERROR,MkAtomTerm(Yap_LookupAtom(GLOBAL_Executable)),
Yap_Error(SYSTEM_ERROR_INTERNAL,MkAtomTerm(Yap_LookupAtom(GLOBAL_Executable)),
"cannot find file being executed");
}

View File

@ -50,8 +50,8 @@ this code is no being maintained anymore
* YAP_FindExecutable(argv[0]) should be called on yap initialization to
* locate the executable of Yap
*/
void
Yap_FindExecutable(char *name)
char *
Yap_FindExecutable(void)
{
register char *cp, *cp2;
struct stat stbuf;
@ -64,7 +64,7 @@ Yap_FindExecutable(char *name)
if (oktox(GLOBAL_argv[0])) {
strcpy(LOCAL_FileNameBuf, GLOBAL_argv[0]);
Yap_TrueFileName(LOCAL_FileNameBuf, GLOBAL_Executable, TRUE);
return;
return NULL;
}
}
if (*cp == ':')
@ -84,16 +84,17 @@ Yap_FindExecutable(char *name)
if (!oktox(LOCAL_FileNameBuf))
continue;
Yap_TrueFileName(LOCAL_FileNameBuf, GLOBAL_Executable, TRUE);
return;
return GLOBAL_Executable;
}
/* one last try for dual systems */
strcpy(LOCAL_FileNameBuf, GLOBAL_argv[0]);
Yap_TrueFileName(LOCAL_FileNameBuf, GLOBAL_Executable, TRUE);
if (oktox(GLOBAL_Executable))
return;
return GLOBAL_Executable;
else
Yap_Error(SYSTEM_ERROR,MkAtomTerm(Yap_LookupAtom(GLOBAL_Executable)),
Yap_Error(SYSTEM_ERROR_INTERNAL,MkAtomTerm(Yap_LookupAtom(GLOBAL_Executable)),
"cannot find file being executed");
return NULL;
}

269
C/load_dl.c Normal file → Executable file
View File

@ -1,183 +1,249 @@
/*************************************************************************
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* *
**************************************************************************
* *
* File: load_dl.c *
* comments: dl based dynamic loaderr of external routines *
* tested on i486-linuxelf *
*************************************************************************/
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
* *
**************************************************************************
* *
* File: load_dl.c *
* comments: dl based dynamic loaderr of external routines *
* tested on i486-linuxelf *
*************************************************************************/
#include "Yap.h"
#include "Yatom.h"
#include "YapHeap.h"
#include "Yatom.h"
#include "yapio.h"
#include "Foreign.h"
#if LOAD_DL
// use SWI-Prolog code if all else fails
char *findExecutable(const char *av0, char *buffer);
#include <dlfcn.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#if defined(__APPLE__)
#include <dlfcn.h>
#include <mach-o/dyld.h>
#endif
typedef void (*prismf)(void);
/* only works for dlls */
int Yap_CallFunctionByName(const char *thing_string);
int Yap_CallFunctionByName(const char *thing_string) {
void *handle = dlopen(NULL, RTLD_LAZY
#ifndef __CYGWIN__
#ifdef RTLD_NOLOAD
| RTLD_NOLOAD
#endif
#endif
);
// you could do RTLD_NOW as well. shouldn't matter
if (!handle) {
CACHE_REGS
Yap_Error(SYSTEM_ERROR_INTERNAL, ARG1,
"Dynamic linking on main module : %s\n", dlerror());
}
prismf *addr = (prismf *)dlsym(handle, thing_string);
if (addr)
(*addr)();
dlclose(handle);
return TRUE;
}
/*
* YAP_FindExecutable(argv[0]) should be called on yap initialization to
* locate the executable of Yap
*/
void
Yap_FindExecutable(char *name)
{
*/
char *Yap_FindExecutable(void) {
#if HAVE_GETEXECNAME
// Solaris
return getexecname();
#elif __APPLE__
char *buf = malloc(YAP_FILENAME_MAX);
uint32_t size;
if (!_NSGetExecutablePath(buf, &size)) {
buf = realloc(buf, size + 1);
return buf;
}
return "yap";
#elif defined(__linux__)
char *buf = malloc(YAP_FILENAME_MAX);
ssize_t len = readlink("/proc/self/exe", buf, YAP_FILENAME_MAX - 1);
if (len != -1) {
buf[len] = '\0';
return buf;
}
// follow through to standard method
#elif defined(__FreeBSD__) || defined(__DragonFly__)
enum { BUFFERSIZE = 1024 };
char *buf = malloc(BUFFERSIZE);
ssize_t len = readlink("/proc/curproc/file", buf, sizeof(buf) - 1);
if (len != -1) {
buf[len] = '\0';
return buf;
}
int mib[4];
mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
mib[2] = KERN_PROC_PATHNAME;
mib[3] = -1; // current process
size_t cb = BUFFERSIZE;
sysctl(mib, 4, buf, &cb, NULL, 0);
// follow through to standard method
#endif
return NULL;
}
void *
Yap_LoadForeignFile(char *file, int flags)
{
void *Yap_LoadForeignFile(char *file, int flags) {
CACHE_REGS
int dlflag;
void *out;
if (flags & EAGER_LOADING)
if (flags & EAGER_LOADING)
dlflag = RTLD_NOW;
else
dlflag = RTLD_LAZY;
if (flags & GLOBAL_LOADING)
if (flags & GLOBAL_LOADING)
dlflag |= RTLD_GLOBAL;
#ifndef __CYGWIN__
else
else
dlflag |= RTLD_LOCAL;
#endif
out = (void *)dlopen(file,dlflag);
if (!out) {
CACHE_REGS
Yap_Error(SYSTEM_ERROR, ARG1, "dlopen error %s\n", dlerror());
out = (void *)dlopen(file, dlflag);
if (out == NULL) {
const char *m_os = dlerror();
if (m_os) {
LOCAL_ErrorMessage = malloc(MAX_ERROR_MSG_SIZE);
strncpy(LOCAL_ErrorMessage, m_os, MAX_ERROR_MSG_SIZE - 1);
} else {
LOCAL_ErrorMessage = "dlopen failed";
}
}
return out;
}
int
Yap_CallForeignFile(void *handle, char *f)
{
YapInitProc proc = (YapInitProc) dlsym(handle, f);
int Yap_CallForeignFile(void *handle, char *f) {
YapInitProc proc = (YapInitProc)dlsym(handle, f);
if (!proc) {
/* Yap_Error(SYSTEM_ERROR, ARG1, "dlsym error %s\n", dlerror());*/
/* Yap_Error(SYSTEM_ERROR_INTERNAL, ARG1, "dlsym error %s\n", dlerror());*/
return FALSE;
}
(*proc) ();
(*proc)();
return TRUE;
}
int
Yap_CloseForeignFile(void *handle)
{
if ( dlclose(handle) < 0) {
int Yap_CloseForeignFile(void *handle) {
if (dlclose(handle) < 0) {
CACHE_REGS
Yap_Error(SYSTEM_ERROR, ARG1, "dlclose error %s\n", dlerror());
Yap_Error(SYSTEM_ERROR_INTERNAL, ARG1, "dlclose error %s\n", dlerror());
return -1;
}
return 0;
}
/*
* LoadForeign(ofiles,libs,proc_name,init_proc) dynamically loads foreign
* code files and libraries and locates an initialization routine
*/
static Int
LoadForeign(StringList ofiles, StringList libs,
char *proc_name, YapInitProc *init_proc)
{
*/
static Int LoadForeign(StringList
ofiles, StringList libs, char *proc_name,
YapInitProc *init_proc) {
CACHE_REGS
LOCAL_ErrorMessage = NULL;
while (libs) {
if (!Yap_TrueFileName(AtomName(libs->name), LOCAL_FileNameBuf, TRUE)) {
/* use LD_LIBRARY_PATH */
strncpy(LOCAL_FileNameBuf, AtomName(libs->name), YAP_FILENAME_MAX);
}
const char *file = AtomName(libs->name);
#ifdef __osf__
if((libs->handle=dlopen(LOCAL_FileNameBuf,RTLD_LAZY)) == NULL)
if ((libs->handle = dlopen(LOCAL_FileNameBuf, RTLD_LAZY)) == NULL)
#else
if((libs->handle=dlopen(LOCAL_FileNameBuf,RTLD_LAZY|RTLD_GLOBAL)) == NULL)
if ((libs->handle = dlopen(file, RTLD_LAZY | RTLD_GLOBAL)) ==
NULL)
#endif
{
strcpy(LOCAL_ErrorSay,dlerror());
return LOAD_FAILLED;
if (LOCAL_ErrorMessage == NULL) {
LOCAL_ErrorMessage = malloc(MAX_ERROR_MSG_SIZE);
strcpy(LOCAL_ErrorMessage, dlerror());
}
}
libs = libs->next;
}
while (ofiles) {
void *handle;
/* load libraries first so that their symbols are available to
other routines */
/* load libraries first so that their symbols are available to
other routines */
const char *file = AtomName(ofiles->name);
/* dlopen wants to follow the LD_CONFIG_PATH */
if (!Yap_TrueFileName(AtomName(ofiles->name), LOCAL_FileNameBuf, TRUE)) {
strcpy(LOCAL_ErrorSay, "%% Trying to open unexisting file in LoadForeign");
return LOAD_FAILLED;
}
#ifdef __osf__
if((handle=dlopen(LOCAL_FileNameBuf,RTLD_LAZY)) == 0)
#else
if((handle=dlopen(LOCAL_FileNameBuf,RTLD_LAZY|RTLD_GLOBAL)) == 0)
#endif
if ((ofiles->handle = dlopen(file, RTLD_LAZY | RTLD_GLOBAL)) ==
NULL)
{
fprintf(stderr,"dlopen of %s failed with error %s\n", LOCAL_FileNameBuf, dlerror());
/* strcpy(LOCAL_ErrorSay,dlerror());*/
return LOAD_FAILLED;
if (LOCAL_ErrorMessage == NULL) {
LOCAL_ErrorMessage = malloc(MAX_ERROR_MSG_SIZE);
fprintf(stderr, "dlopen of image %s failed: %s\n", LOCAL_FileNameBuf,
dlerror());
}
}
ofiles->handle = handle;
if (proc_name && !*init_proc)
*init_proc = (YapInitProc) dlsym(handle,proc_name);
if (ofiles->handle && proc_name && !*init_proc)
*init_proc = (YapInitProc)dlsym(ofiles->handle, proc_name);
ofiles = ofiles->next;
}
if(! *init_proc) {
strcpy(LOCAL_ErrorSay,"Could not locate initialization routine");
if (!*init_proc && LOCAL_ErrorMessage == NULL) {
char *buf = malloc(1058);
snprintf(buf, 1058 - 1, "Could not locate routine %s in %s: %s\n",
proc_name, LOCAL_FileNameBuf, dlerror());
return LOAD_FAILLED;
}
return LOAD_SUCCEEDED;
}
Int
Yap_LoadForeign(StringList ofiles, StringList libs,
char *proc_name, YapInitProc *init_proc)
{
Int Yap_LoadForeign(StringList ofiles, StringList libs, char *proc_name,
YapInitProc *init_proc) {
return LoadForeign(ofiles, libs, proc_name, init_proc);
}
void
Yap_ShutdownLoadForeign(void)
{
void Yap_ShutdownLoadForeign(void) {
ForeignObj *f_code;
f_code = ForeignCodeLoaded;
while (f_code != NULL) {
StringList objs, libs;
StringList objs, libs, old;
ForeignObj *of_code = f_code;
objs = f_code->objs;
while (objs != NULL) {
old = objs;
if (dlclose(objs->handle) != 0)
return; /* ERROR */
return; /* ERROR */
objs = objs->next;
Yap_FreeCodeSpace((ADDR)old);
}
libs = f_code->libs;
while (libs != NULL) {
old = libs;
if (dlclose(libs->handle) != 0)
return; /* ERROR */
objs = libs->next;
return; /* ERROR */
libs = libs->next;
Yap_FreeCodeSpace((ADDR)old);
}
f_code = f_code->next;
Yap_FreeCodeSpace((ADDR)of_code);
}
/*
make sure that we don't try to close foreign code several times, eg,
@ -186,30 +252,19 @@ Yap_ShutdownLoadForeign(void)
ForeignCodeLoaded = NULL;
}
Int
Yap_ReLoadForeign(StringList ofiles, StringList libs,
char *proc_name, YapInitProc *init_proc)
{
return(LoadForeign(ofiles,libs, proc_name, init_proc));
Int Yap_ReLoadForeign(StringList ofiles, StringList libs, char *proc_name,
YapInitProc *init_proc) {
return (LoadForeign(ofiles, libs, proc_name, init_proc));
}
#endif
#if SIMICS
void dlopen(void)
{
}
void dlopen(void) {}
void dlclose(void)
{
}
void dlclose(void) {}
void dlsym(void)
{
}
void dlsym(void) {}
#endif

View File

@ -26,15 +26,15 @@ this code is no being maintained anymore
* YAP_FindExecutable(argv[0]) should be called on yap initialization to
* locate the executable of Yap
*/
void
Yap_FindExecutable(char *name)
char *
Yap_FindExecutable(void)
{
/* use dld_find_executable */
char *res;
if(name != NULL && (res=dld_find_executable(name))) {
strcpy(GLOBAL_Executable,res);
return GLOBAL_Executable;
} else {
strcpy(GLOBAL_Executable,"./yap");
return "yap";
}
}

57
C/load_dll.c Normal file → Executable file
View File

@ -19,7 +19,7 @@
#include "yapio.h"
#include "Foreign.h"
#if LOAD_DLL
#if _WIN32
#include <windows.h>
@ -27,15 +27,30 @@
* YAP_FindExecutable(argv[0]) should be called on yap initialization to
* locate the executable of Yap
*/
void
Yap_FindExecutable(char *name)
char *
Yap_FindExecutable(void)
{
enum { BUFFERSIZE = 1024 };
char *buf = malloc(BUFFERSIZE);
if (!GetModuleFileName(NULL, buf, BUFFERSIZE-1))
return NULL;
return buf;
}
void *
Yap_LoadForeignFile(char *file, int flags)
{
return (void *)LoadLibrary(file);
char *buf = malloc(1024);
void *ptr= (void *)LoadLibrary(file);
if (!ptr) {
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 1023,
NULL);
}
return ptr;
}
int
@ -60,23 +75,34 @@ Yap_CloseForeignFile(void *handle)
*/
static Int
LoadForeign(StringList ofiles, StringList libs,
char *proc_name, YapInitProc *init_proc)
const char *proc_name, YapInitProc *init_proc)
{
CACHE_REGS
while (ofiles) {
HINSTANCE handle;
if (Yap_TrueFileName(AtomName(ofiles->name), LOCAL_FileNameBuf, TRUE) &&
if (*init_proc == NULL &&
(*init_proc = (YapInitProc)GetProcAddress((HMODULE)handle, proc_name)))
{
YapInitProc f = *init_proc;
f();
return true;
}
const char *file = AtomName(ofiles->name);
if (Yap_findFile(file, NULL, NULL, LOCAL_FileNameBuf, true, YAP_OBJ, true, true) &&
(handle=LoadLibrary(LOCAL_FileNameBuf)) != 0)
{
LOCAL_ErrorSay[0]=~'\0';
LOCAL_ErrorMessage = NULL;
if (*init_proc == NULL)
*init_proc = (YapInitProc)GetProcAddress((HMODULE)handle, proc_name);
} else {
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), LOCAL_ErrorSay, 256,
NULL);
char *buf = malloc(1024);
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 1023,
NULL);
//fprintf(stderr,"WinError: %s\n", LOCAL_ErrorSay);
}
ofiles = ofiles->next;
}
@ -84,7 +110,7 @@ LoadForeign(StringList ofiles, StringList libs,
other routines */
while (libs) {
HINSTANCE handle;
char * s = AtomName(libs->name);
const char * s = AtomName(libs->name);
if (s[0] == '-') {
strcat(LOCAL_FileNameBuf,s+2);
@ -106,7 +132,7 @@ LoadForeign(StringList ofiles, StringList libs,
}
if(*init_proc == NULL) {
strcpy(LOCAL_ErrorSay,"Could not locate initialization routine");
LOCAL_ErrorMessage = "Could not locate initialization routine";
return LOAD_FAILLED;
}
@ -120,7 +146,7 @@ Yap_LoadForeign(StringList ofiles, StringList libs,
return LoadForeign(ofiles, libs, proc_name, init_proc);
}
void
void
Yap_ShutdownLoadForeign(void)
{
}
@ -133,4 +159,3 @@ Yap_ReLoadForeign(StringList ofiles, StringList libs,
}
#endif

22
C/load_dyld.c Normal file → Executable file
View File

@ -62,9 +62,21 @@ mydlerror(void)
* YAP_FindExecutable(argv[0]) should be called on yap initialization to
* locate the executable of Yap
*/
void
Yap_FindExecutable(char *name)
char *
Yap_FindExecutable(void)
{
char path[1024];
uint32_t size = sizeof(path);
if (_NSGetExecutablePath(path, &size) == 0) {
char *rc = malloc(size+1);
strncpy(rc, path, size);
return rc;
} else {
char *rc = malloc(size+1);
if (_NSGetExecutablePath(rc, &size) == 0)
return "yap";
return rc;
}
}
@ -81,7 +93,8 @@ mydlopen(char *path)
/* NSLinkModule will cause the run to abort on any link error's */
/* not very friendly but the error recovery functionality is limited */
handle = NSLinkModule(ofile, path, TRUE);
} return handle;
}
return handle;
}
static void *
@ -145,7 +158,8 @@ LoadForeign(StringList ofiles, StringList libs,
void *handle;
/* mydlopen wants to follow the LD_CONFIG_PATH */
if (!Yap_TrueFileName(AtomName(ofiles->name), LOCAL_FileNameBuf, TRUE)) {
iconst char *file = AtomName(ofiles->name);
if (!Yap_findFile(file, NULL, NULL, LOCAL_FileNameBuf, true, YAP_OBJ, true, true) ) {
strcpy(LOCAL_ErrorSay, "%% Trying to open unexisting file in LoadForeign");
return LOAD_FAILLED;
}

View File

@ -13,13 +13,13 @@
* *
*************************************************************************/
#ifdef SCCS
static char SccsId[] = "%W% %G%.2";
static char SccsId[] = "%W% %G%.2";
#endif
#include "Yap.h"
#include "Yatom.h"
#include "YapHeap.h"
#include "YapText.h"
#include "Yatom.h"
#include "yapio.h"
#include <stdlib.h>
#if HAVE_STRING_H
@ -29,33 +29,35 @@ static char SccsId[] = "%W% %G%.2";
#include "Foreign.h"
#if _WIN32 || defined(__CYGWIN__)
#ifndef YAP_SHLIB_SUFFIX
#define YAP_SHLIB_SUFFIX ".dll"
#ifndef SO_EXT
#define SO_EXT "dll"
#endif
#endif
STD_PROTO(Int p_load_foreign, ( USES_REGS1 ));
Int p_load_foreign(USES_REGS1);
Int
p_load_foreign( USES_REGS1 )
{
Int p_load_foreign(USES_REGS1) {
StringList ofiles = NULL;
StringList libs = NULL;
char *InitProcName;
YapInitProc InitProc = NULL;
Term t, t1;
StringList new;
Int returncode = FALSE;
bool returncode = FALSE;
yhandle_t CurSlot = Yap_StartSlots();
strcpy(LOCAL_ErrorSay,"Invalid arguments");
// Yap_DebugPlWrite(ARG1); printf("%s\n", " \n");
// Yap_DebugPlWrite(ARG2); printf("%s\n", " \n");
// ap_DebugPlWrite(ARG3); printf("%s\n", " \n");
/* collect the list of object files */
t = Deref(ARG1);
while(1) {
if (t == TermNil) break;
while (1) {
if (t == TermNil)
break;
t1 = HeadOfTerm(t);
t = TailOfTerm(t);
new = (StringList) Yap_AllocCodeSpace(sizeof(StringListItem));
new = (StringList)Yap_AllocCodeSpace(sizeof(StringListItem));
new->next = ofiles;
new->name = AtomOfTerm(t1);
ofiles = new;
@ -63,11 +65,12 @@ p_load_foreign( USES_REGS1 )
/* collect the list of library files */
t = Deref(ARG2);
while(1) {
if (t == TermNil) break;
while (1) {
if (t == TermNil)
break;
t1 = HeadOfTerm(t);
t = TailOfTerm(t);
new = (StringList) Yap_AllocCodeSpace(sizeof(StringListItem));
new = (StringList)Yap_AllocCodeSpace(sizeof(StringListItem));
new->next = libs;
new->name = AtomOfTerm(t1);
libs = new;
@ -75,22 +78,39 @@ p_load_foreign( USES_REGS1 )
/* get the initialization function name */
t1 = Deref(ARG3);
InitProcName = RepAtom(AtomOfTerm(t1))->StrOfAE;
InitProcName = (char *)RepAtom(AtomOfTerm(t1))->StrOfAE;
/* call the OS specific function for dynamic loading */
if(Yap_LoadForeign(ofiles,libs,InitProcName,&InitProc)==LOAD_SUCCEEDED) {
// verify if it was waiting for initialization
if (Yap_LateInit(InitProcName)) {
returncode = true;
} else
/* call the OS specific function for dynamic loading */
if (Yap_LoadForeign(ofiles, libs, InitProcName, &InitProc) ==
LOAD_SUCCEEDED) {
if (InitProc == NULL) {
char *f;
if (ofiles) {
f = RepAtom(ofiles->name)->StrOfAE;
} else {
f = RepAtom(libs->name)->StrOfAE;
}
Yap_Error(SYSTEM_ERROR_OPERATING_SYSTEM, ARG3,
"Foreign module %s does not have initialization function %s", f,
InitProcName);
return false;
}
Yap_StartSlots();
(*InitProc)();
returncode = TRUE;
Yap_CloseSlots(CurSlot);
returncode = true;
}
/* I should recover space if load foreign fails */
if (returncode == TRUE) {
ForeignObj *f_code = (ForeignObj *)Yap_AllocCodeSpace(sizeof(ForeignObj));
f_code->objs = ofiles;
f_code->libs = libs;
f_code->f = InitProcName;
f_code->f = AtomOfTerm(t1);
f_code->next = ForeignCodeLoaded;
f_code->module = CurrentModule;
ForeignCodeLoaded = f_code;
@ -109,59 +129,60 @@ p_load_foreign( USES_REGS1 )
return returncode;
}
static Int
p_open_shared_object( USES_REGS1 ) {
static Int p_open_shared_object(USES_REGS1) {
Term t = Deref(ARG1);
Term tflags = Deref(ARG2);
char *s;
void *handle;
if (IsVarTerm(t)) {
Yap_Error(INSTANTIATION_ERROR,t,"open_shared_object/3");
Yap_Error(INSTANTIATION_ERROR, t, "open_shared_object/3");
return FALSE;
}
}
if (!IsAtomTerm(t)) {
Yap_Error(TYPE_ERROR_ATOM,t,"open_shared_object/3");
Yap_Error(TYPE_ERROR_ATOM, t, "open_shared_object/3");
return FALSE;
}
if (IsVarTerm(tflags)) {
Yap_Error(INSTANTIATION_ERROR,tflags,"open_shared_object/3");
return FALSE;
}
if (!IsIntegerTerm(tflags)) {
Yap_Error(TYPE_ERROR_INTEGER,tflags,"open_shared_object/3");
Yap_Error(INSTANTIATION_ERROR, tflags, "open_shared_object/3");
return FALSE;
}
s = RepAtom(AtomOfTerm(t))->StrOfAE;
if ((handle = Yap_LoadForeignFile(s, IntegerOfTerm(tflags)))==NULL) {
if (!IsIntegerTerm(tflags)) {
Yap_Error(TYPE_ERROR_INTEGER, tflags, "open_shared_object/3");
return FALSE;
}
s = (char *)RepAtom(AtomOfTerm(t))->StrOfAE;
if ((handle = Yap_LoadForeignFile(s, IntegerOfTerm(tflags))) == NULL) {
Yap_Error(EXISTENCE_ERROR_SOURCE_SINK, t,
"open_shared_object_failed for %s"
" with %s\n",
s, LOCAL_ErrorMessage);
return FALSE;
} else {
return Yap_unify(MkIntegerTerm((Int)handle),ARG3);
return Yap_unify(MkIntegerTerm((Int)handle), ARG3);
}
}
static Int
p_close_shared_object( USES_REGS1 ) {
static Int p_close_shared_object(USES_REGS1) {
Term t = Deref(ARG1);
void *handle;
if (IsVarTerm(t)) {
Yap_Error(INSTANTIATION_ERROR,t,"close_shared_object/1");
Yap_Error(INSTANTIATION_ERROR, t, "close_shared_object/1");
return FALSE;
}
}
if (!IsIntegerTerm(t)) {
Yap_Error(TYPE_ERROR_INTEGER,t,"close_shared_object/1");
Yap_Error(TYPE_ERROR_INTEGER, t, "close_shared_object/1");
return FALSE;
}
handle = (char *)IntegerOfTerm(t);
return Yap_CloseForeignFile(handle);
}
static Int
p_call_shared_object_function( USES_REGS1 ) {
static Int p_call_shared_object_function(USES_REGS1) {
Term t = Deref(ARG1);
Term tfunc = Deref(ARG2);
Term tmod;
@ -170,76 +191,98 @@ p_call_shared_object_function( USES_REGS1 ) {
Int res;
tmod = CurrentModule;
restart:
restart:
if (IsVarTerm(t)) {
Yap_Error(INSTANTIATION_ERROR,t,"call_shared_object_function/2");
Yap_Error(INSTANTIATION_ERROR, t, "call_shared_object_function/2");
return FALSE;
} else if (IsApplTerm(t)) {
Functor fun = FunctorOfTerm(t);
Functor fun = FunctorOfTerm(t);
if (fun == FunctorModule) {
tmod = ArgOfTerm(1, t);
if (IsVarTerm(tmod) ) {
Yap_Error(INSTANTIATION_ERROR,t,"call_shared_object_function/2");
return FALSE;
if (IsVarTerm(tmod)) {
Yap_Error(INSTANTIATION_ERROR, t, "call_shared_object_function/2");
return FALSE;
}
if (!IsAtomTerm(tmod) ) {
Yap_Error(TYPE_ERROR_ATOM,ARG1,"call_shared_object_function/2");
return FALSE;
if (!IsAtomTerm(tmod)) {
Yap_Error(TYPE_ERROR_ATOM, ARG1, "call_shared_object_function/2");
return FALSE;
}
t = ArgOfTerm(2, t);
goto restart;
}
} else if (!IsIntegerTerm(t)) {
Yap_Error(TYPE_ERROR_INTEGER,t,"call_shared_object_function/2");
Yap_Error(TYPE_ERROR_INTEGER, t, "call_shared_object_function/2");
return FALSE;
}
handle = (void *)IntegerOfTerm(t);
if (IsVarTerm(tfunc)) {
Yap_Error(INSTANTIATION_ERROR,t,"call_shared_object_function/2");
Yap_Error(INSTANTIATION_ERROR, t, "call_shared_object_function/2");
return FALSE;
}
}
if (!IsAtomTerm(tfunc)) {
Yap_Error(TYPE_ERROR_ATOM,t,"call_shared_object_function/2/3");
Yap_Error(TYPE_ERROR_ATOM, t, "call_shared_object_function/2/3");
return FALSE;
}
CurrentModule = tmod;
res = Yap_CallForeignFile(handle, RepAtom(AtomOfTerm(tfunc))->StrOfAE);
res =
Yap_CallForeignFile(handle, (char *)RepAtom(AtomOfTerm(tfunc))->StrOfAE);
CurrentModule = OldCurrentModule;
return res;
}
static Int
p_obj_suffix( USES_REGS1 ) {
return Yap_unify(Yap_StringToList(YAP_SHLIB_SUFFIX),ARG1);
static Int p_obj_suffix(USES_REGS1) {
return Yap_unify(Yap_CharsToListOfCodes(SO_EXT, ENC_ISO_LATIN1 PASS_REGS),
ARG1);
}
static Int
p_open_shared_objects( USES_REGS1 ) {
#ifdef YAP_SHLIB_SUFFIX
static Int p_open_shared_objects(USES_REGS1) {
#ifdef SO_EXT
return TRUE;
#else
return FALSE;
#endif
}
void
Yap_InitLoadForeign( void )
static Int check_embedded(USES_REGS1)
{
if (GLOBAL_argv == NULL)
Yap_FindExecutable("yap");
else
Yap_FindExecutable(GLOBAL_argv[0]);
Yap_InitCPred("$load_foreign_files", 3, p_load_foreign, SafePredFlag|SyncPredFlag|HiddenPredFlag);
Yap_InitCPred("$open_shared_objects", 0, p_open_shared_objects, SafePredFlag|HiddenPredFlag);
Yap_InitCPred("$open_shared_object", 3, p_open_shared_object, SyncPredFlag|HiddenPredFlag);
Yap_InitCPred("close_shared_object", 1, p_close_shared_object, SyncPredFlag|SafePredFlag);
Yap_InitCPred("call_shared_object_function", 2, p_call_shared_object_function, SyncPredFlag);
Yap_InitCPred("$obj_suffix", 1, p_obj_suffix, SafePredFlag|HiddenPredFlag);
const char *s = Yap_TextTermToText(Deref(ARG1));
if (!s)
return false;
#if EMBEDDED_MYDDAS
if (!strcmp("init_myddas",s)) {
init_myddas();
return true;
}
#endif
#if EMBEDDED_SQLITE3
if (!strcmp("init_sqlite3",s)) {
init_sqlite3();
return true;
}
#endif
return false;
}
void
Yap_ReOpenLoadForeign(void)
{
void Yap_InitLoadForeign(void) {
Yap_InitCPred("$check_embedded", 1, check_embedded, SafePredFlag);
Yap_InitCPred("$load_foreign_files", 3, p_load_foreign,
SafePredFlag | SyncPredFlag);
Yap_InitCPred("$open_shared_objects", 0, p_open_shared_objects, SafePredFlag);
Yap_InitCPred("$open_shared_object", 3, p_open_shared_object, SyncPredFlag);
Yap_InitCPred("close_shared_object", 1, p_close_shared_object,
SyncPredFlag | SafePredFlag);
/** @pred close_shared_object(+ _Handle_)
Detach the shared object identified by _Handle_.
*/
Yap_InitCPred("$call_shared_object_function", 2,
p_call_shared_object_function, SyncPredFlag);
Yap_InitCPred("$obj_suffix", 1, p_obj_suffix, SafePredFlag);
}
void Yap_ReOpenLoadForeign(void) {
CACHE_REGS
ForeignObj *f_code = ForeignCodeLoaded;
Term OldModule = CurrentModule;
@ -248,19 +291,18 @@ Yap_ReOpenLoadForeign(void)
YapInitProc InitProc = NULL;
CurrentModule = f_code->module;
if(Yap_ReLoadForeign(f_code->objs,f_code->libs,f_code->f,&InitProc)==LOAD_SUCCEEDED) {
if (Yap_ReLoadForeign(f_code->objs, f_code->libs,
(char *)RepAtom(f_code->f)->StrOfAE,
&InitProc) == LOAD_SUCCEEDED) {
if (InitProc)
(*InitProc)();
(*InitProc)();
}
f_code = f_code->next;
}
CurrentModule = OldModule;
}
X_API bool load_none(void)
{
return true;
}

View File

@ -26,9 +26,10 @@
* YAP_FindExecutable(argv[0]) should be called on yap initialization to
* locate the executable of Yap
*/
void
Yap_FindExecutable(char *name)
char *
Yap_FindExecutable(void)
{
return NULL;
}

View File

@ -16,7 +16,7 @@
* locate the executable of Yap
*/
void Yap_FindExecutable(char *name)
char * Yap_FindExecutable(void)
{
}
@ -51,7 +51,7 @@ LoadForeign( StringList ofiles, StringList libs,
char *proc_name, YapInitProc *init_proc )
{
/* *init_proc is initialised to NULL in load_foreign.c */
/* *init_proc is initialized to NULL in load_foreign.c */
int init_missing = -1;
int n, i;
@ -61,7 +61,8 @@ LoadForeign( StringList ofiles, StringList libs,
int valid_fname;
/* shl_load wants to follow the LD_CONFIG_PATH */
valid_fname = Yap_TrueFileName( AtomName(ofiles->name), LOCAL_FileNameBuf, TRUE );
const char *file = AtomName(ofiles->name);
valid_fname = Yap_findFile(file, NULL, NULL, LOCAL_FileNameBuf, true, YAP_OBJ, true, true);
if( !valid_fname ) {
strcpy( LOCAL_ErrorSay, "%% Trying to open non-existing file in LoadForeign" );
@ -167,7 +168,7 @@ Yap_ReLoadForeign(StringList ofiles, StringList libs,
/*
dunno what this one is supposed to do, no load_* defines it
void STD_PROTO(ReOpenLoadForeign,(void));
void ReOpenLoadForeign(void);
*/
#endif

771
C/lu_absmi_insts.h Normal file
View File

@ -0,0 +1,771 @@
/************************************************************************\
* Logical Updates *
\************************************************************************/
#ifdef INDENT_CODE
{
{
#endif /* INDENT_CODE */
/************************************************************************\
* Logical Updates *
\************************************************************************/
/* enter logical pred */
BOp(enter_lu_pred, Illss);
check_trail(TR);
/* mark the indexing code */
{
LogUpdIndex *cl = PREG->y_u.Illss.I;
PredEntry *ap = cl->ClPred;
if (!cl) { FAIL(); } /* in case the index is empty */
if (ap->LastCallOfPred != LUCALL_EXEC) {
/*
only increment time stamp if we are working on current time
stamp
*/
if (ap->TimeStampOfPred >= TIMESTAMP_RESET)
Yap_UpdateTimestamps(ap);
ap->TimeStampOfPred++;
ap->LastCallOfPred = LUCALL_EXEC;
/* fprintf(stderr,"R %x--%d--%ul\n",ap,ap->TimeStampOfPred,ap->ArityOfPE);*/
}
*--YREG = MkIntegerTerm(ap->TimeStampOfPred);
/* fprintf(stderr,"> %p/%p %d %d\n",cl,ap,ap->TimeStampOfPred,PREG->y_u.Illss.s);*/
PREG = PREG->y_u.Illss.l1;
/* indicate the indexing code is being used */
#if MULTIPLE_STACKS
/* just store a reference */
INC_CLREF_COUNT(cl);
TRAIL_CLREF(cl);
#else
if (!(cl->ClFlags & InUseMask)) {
cl->ClFlags |= InUseMask;
TRAIL_CLREF(cl);
}
#endif
}
JMPNext();
ENDBOp();
BOp(profiled_retry_logical, OtaLl);
check_trail(TR);
{
UInt timestamp;
CACHE_Y(B);
#if defined(YAPOR) || defined(THREADS)
if (PP != PREG->y_u.OtaLl.d->ClPred) {
if (PP) UNLOCKPE(15,PP);
PP = PREG->y_u.OtaLl.d->ClPred;
PELOCK(15,PP);
}
#endif
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->y_u.OtaLl.s]);
if (!VALID_TIMESTAMP(timestamp, PREG->y_u.OtaLl.d)) {
/* jump to next instruction */
PREG=PREG->y_u.OtaLl.n;
JMPNext();
}
restore_yaam_regs(PREG->y_u.OtaLl.n);
restore_args(PREG->y_u.OtaLl.s);
LOCK(PREG->y_u.OtaLl.d->ClPred->StatisticsForPred->lock);
PREG->y_u.OtaLl.d->ClPred->StatisticsForPred->NOfRetries++;
UNLOCK(PREG->y_u.OtaLl.d->ClPred->StatisticsForPred->lock);
#ifdef THREADS
PP = PREG->y_u.OtaLl.d->ClPred;
#endif
PREG = PREG->y_u.OtaLl.d->ClCode;
#ifdef FROZEN_STACKS
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
set_cut(S_YREG, B->cp_b);
#else
set_cut(S_YREG, B_YREG->cp_b);
#endif /* FROZEN_STACKS */
SET_BB(B_YREG);
ENDCACHE_Y();
}
JMPNext();
ENDBOp();
BOp(profiled_trust_logical, OtILl);
CACHE_Y(B);
{
LogUpdIndex *cl = PREG->y_u.OtILl.block;
PredEntry *ap = cl->ClPred;
LogUpdClause *lcl = PREG->y_u.OtILl.d;
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]);
#if defined(YAPOR) || defined(THREADS)
if (PP != ap) {
if (PP) UNLOCKPE(16,PP);
PP = ap;
PELOCK(16,PP);
}
#endif
if (!VALID_TIMESTAMP(timestamp, lcl)) {
/* jump to next alternative */
PREG = FAILCODE;
} else {
LOCK(ap->StatisticsForPred->lock);
ap->StatisticsForPred->NOfRetries++;
UNLOCK(ap->StatisticsForPred->lock);
PREG = lcl->ClCode;
}
/* HEY, leave indexing block alone!! */
/* check if we are the ones using this code */
#if MULTIPLE_STACKS
DEC_CLREF_COUNT(cl);
/* clear the entry from the trail */
B->cp_tr--;
TR = B->cp_tr;
/* actually get rid of the code */
if (cl->ClRefCount == 0 && (cl->ClFlags & (ErasedMask|DirtyMask))) {
if (PREG != FAILCODE) {
/* I am the last one using this clause, hence I don't need a lock
to dispose of it
*/
if (lcl->ClRefCount == 1) {
/* make sure the clause isn't destroyed */
/* always add an extra reference */
INC_CLREF_COUNT(lcl);
TRAIL_CLREF(lcl);
}
}
if (cl->ClFlags & ErasedMask) {
saveregs();
Yap_ErLogUpdIndex(cl);
setregs();
} else {
saveregs();
Yap_CleanUpIndex(cl);
setregs();
}
save_pc();
}
#else
if (TrailTerm(B->cp_tr-1) == CLREF_TO_TRENTRY(cl) &&
B->cp_tr != B->cp_b->cp_tr) {
cl->ClFlags &= ~InUseMask;
--B->cp_tr;
#if FROZEN_STACKS
if (B->cp_tr > TR_FZ)
#endif
{
TR = B->cp_tr;
}
/* next, recover space for the indexing code if it was erased */
if (cl->ClFlags & (ErasedMask|DirtyMask)) {
if (PREG != FAILCODE) {
/* make sure we don't erase the clause we are jumping to,
notice that we can erase a number of refs in one go. */
if (!(lcl->ClFlags & InUseMask)) {
lcl->ClFlags |= InUseMask;
TRAIL_CLREF(lcl);
}
}
if (cl->ClFlags & ErasedMask) {
saveregs();
Yap_ErLogUpdIndex(cl);
setregs();
} else {
saveregs();
Yap_CleanUpIndex(cl);
setregs();
}
save_pc();
}
}
#endif
#ifdef YAPOR
if (SCH_top_shared_cp(B)) {
SCH_last_alternative(PREG, B_YREG);
restore_args(ap->ArityOfPE);
#ifdef FROZEN_STACKS
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
#else
S_YREG++;
#endif /* FROZEN_STACKS */
set_cut(S_YREG, B->cp_b);
} else
#endif /* YAPOR */
{
pop_yaam_regs();
pop_args(ap->ArityOfPE);
S_YREG--;
#ifdef FROZEN_STACKS
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
#endif /* FROZEN_STACKS */
set_cut(S_YREG, B);
}
SET_BB(B_YREG);
ENDCACHE_Y();
JMPNext();
}
ENDBOp();
BOp(try_logical, OtaLl);
check_trail(TR);
{
UInt timestamp;
CACHE_Y(YREG);
timestamp = IntegerOfTerm(S_YREG[0]);
/* fprintf(stderr,"+ %p/%p %d %d %d--%u\n",PREG,PREG->y_u.OtaLl.d->ClPred,timestamp,PREG->y_u.OtaLl.d->ClPred->TimeStampOfPred,PREG->y_u.OtaLl.d->ClTimeStart,PREG->y_u.OtaLl.d->ClTimeEnd);*/
/* Point AP to the code that follows this instruction */
/* always do this, even if we are not going to use it */
store_args(PREG->y_u.OtaLl.s);
store_yaam_regs(PREG->y_u.OtaLl.n, 0);
set_cut(S_YREG, B);
B = B_YREG;
#ifdef YAPOR
SCH_set_load(B_YREG);
#endif /* YAPOR */
#ifdef YAPOR
PP = PREG->y_u.OtaLl.d->ClPred;
#endif /* YAPOR */
if (!VALID_TIMESTAMP(timestamp, PREG->y_u.OtaLl.d)) {
/* jump to next alternative */
PREG=PREG->y_u.OtaLl.n;
} else {
PREG = PREG->y_u.OtaLl.d->ClCode;
}
SET_BB(B_YREG);
ENDCACHE_Y();
}
JMPNext();
ENDBOp();
BOp(count_retry_logical, OtaLl);
check_trail(TR);
{
UInt timestamp;
CACHE_Y(B);
#if defined(YAPOR) || defined(THREADS)
if (PP != PREG->y_u.OtaLl.d->ClPred) {
if (PP) UNLOCKPE(15,PP);
PP = PREG->y_u.OtaLl.d->ClPred;
PELOCK(15,PP);
}
#endif
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->y_u.OtaLl.s]);
if (!VALID_TIMESTAMP(timestamp, PREG->y_u.OtaLl.d)) {
/* jump to next instruction */
PREG=PREG->y_u.OtaLl.n;
JMPNext();
}
restore_yaam_regs(PREG->y_u.OtaLl.n);
restore_args(PREG->y_u.OtaLl.s);
LOCAL_RetriesCounter--;
if (LOCAL_RetriesCounter == 0) {
saveregs();
Yap_NilError(RETRY_COUNTER_UNDERFLOW_EVENT,"");
setregs();
JMPNext();
}
LOCAL_PredEntriesCounter--;
if (LOCAL_PredEntriesCounter == 0) {
saveregs();
Yap_NilError(PRED_ENTRY_COUNTER_UNDERFLOW_EVENT,"");
setregs();
JMPNext();
}
LOCK(PREG->y_u.OtaLl.d->ClPred->StatisticsForPred->lock);
PREG->y_u.OtaLl.d->ClPred->StatisticsForPred->NOfRetries++;
UNLOCK(PREG->y_u.OtaLl.d->ClPred->StatisticsForPred->lock);
#ifdef THREADS
PP = PREG->y_u.OtaLl.d->ClPred;
#endif
PREG = PREG->y_u.OtaLl.d->ClCode;
#ifdef FROZEN_STACKS
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
set_cut(S_YREG, B->cp_b);
#else
set_cut(S_YREG, B_YREG->cp_b);
#endif /* FROZEN_STACKS */
SET_BB(B_YREG);
ENDCACHE_Y();
}
JMPNext();
ENDBOp();
BOp(count_trust_logical, OtILl);
CACHE_Y(B);
{
LogUpdIndex *cl = PREG->y_u.OtILl.block;
PredEntry *ap = cl->ClPred;
LogUpdClause *lcl = PREG->y_u.OtILl.d;
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]);
#if defined(YAPOR) || defined(THREADS)
if (PP != ap) {
if (PP) UNLOCKPE(16,PP);
PP = ap;
PELOCK(16,PP);
}
#endif
if (!VALID_TIMESTAMP(timestamp, lcl)) {
/* jump to next alternative */
PREG = FAILCODE;
} else {
LOCAL_RetriesCounter--;
if (LOCAL_RetriesCounter == 0) {
saveregs();
Yap_NilError(RETRY_COUNTER_UNDERFLOW_EVENT,"");
setregs();
JMPNext();
}
LOCAL_PredEntriesCounter--;
if (LOCAL_PredEntriesCounter == 0) {
saveregs();
Yap_NilError(PRED_ENTRY_COUNTER_UNDERFLOW_EVENT,"");
setregs();
JMPNext();
}
LOCK(ap->StatisticsForPred->lock);
ap->StatisticsForPred->NOfRetries++;
UNLOCK(ap->StatisticsForPred->lock);
PREG = lcl->ClCode;
}
/* HEY, leave indexing block alone!! */
/* check if we are the ones using this code */
#if MULTIPLE_STACKS
PELOCK(2, ap);
PP = ap;
DEC_CLREF_COUNT(cl);
/* clear the entry from the trail */
--B->cp_tr;
TR = B->cp_tr;
/* actually get rid of the code */
if (cl->ClRefCount == 0 && (cl->ClFlags & (ErasedMask|DirtyMask))) {
if (PREG != FAILCODE) {
/* I am the last one using this clause, hence I don't need a lock
to dispose of it
*/
if (lcl->ClRefCount == 1) {
/* make sure the clause isn't destroyed */
/* always add an extra reference */
INC_CLREF_COUNT(lcl);
TRAIL_CLREF(lcl);
}
}
if (cl->ClFlags & ErasedMask) {
saveregs();
Yap_ErLogUpdIndex(cl);
setregs();
} else {
saveregs();
Yap_CleanUpIndex(cl);
setregs();
}
save_pc();
}
#else
if (TrailTerm(B->cp_tr-1) == CLREF_TO_TRENTRY(cl) &&
B->cp_tr != B->cp_b->cp_tr) {
cl->ClFlags &= ~InUseMask;
--B->cp_tr;
#if FROZEN_STACKS
if (B->cp_tr > TR_FZ)
#endif
{
TR = B->cp_tr;
}
/* next, recover space for the indexing code if it was erased */
if (cl->ClFlags & (ErasedMask|DirtyMask)) {
if (PREG != FAILCODE) {
/* make sure we don't erase the clause we are jumping too */
if (!(lcl->ClFlags & InUseMask)) {
lcl->ClFlags |= InUseMask;
TRAIL_CLREF(lcl);
}
}
if (cl->ClFlags & ErasedMask) {
saveregs();
Yap_ErLogUpdIndex(cl);
setregs();
} else {
saveregs();
Yap_CleanUpIndex(cl);
setregs();
}
save_pc();
}
}
#endif
#ifdef YAPOR
if (SCH_top_shared_cp(B)) {
SCH_last_alternative(PREG, B_YREG);
restore_args(ap->ArityOfPE);
#ifdef FROZEN_STACKS
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
#else
S_YREG++;
#endif /* FROZEN_STACKS */
set_cut(S_YREG, B->cp_b);
} else
#endif /* YAPOR */
{
pop_yaam_regs();
pop_args(ap->ArityOfPE);
S_YREG--;
#ifdef FROZEN_STACKS
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
#endif /* FROZEN_STACKS */
set_cut(S_YREG, B);
}
SET_BB(B_YREG);
ENDCACHE_Y();
JMPNext();
}
ENDBOp();
BOp(retry_logical, OtaLl);
check_trail(TR);
{
UInt timestamp;
CACHE_Y(B);
#if defined(YAPOR) || defined(THREADS)
if (PP != PREG->y_u.OtaLl.d->ClPred) {
if (PP) UNLOCKPE(15,PP);
PP = PREG->y_u.OtaLl.d->ClPred;
PELOCK(15,PP);
}
#endif
timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[PREG->y_u.OtaLl.s]);
/* fprintf(stderr,"^ %p/%p %d %d %d--%u\n",PREG,PREG->y_u.OtaLl.d->ClPred,timestamp,PREG->y_u.OtaLl.d->ClPred->TimeStampOfPred,PREG->y_u.OtaLl.d->ClTimeStart,PREG->y_u.OtaLl.d->ClTimeEnd);*/
if (!VALID_TIMESTAMP(timestamp, PREG->y_u.OtaLl.d)) {
/* jump to next instruction */
PREG=PREG->y_u.OtaLl.n;
JMPNext();
}
restore_yaam_regs(PREG->y_u.OtaLl.n);
restore_at_least_one_arg(PREG->y_u.OtaLl.s);
#ifdef THREADS
PP = PREG->y_u.OtaLl.d->ClPred;
#endif
PREG = PREG->y_u.OtaLl.d->ClCode;
#ifdef FROZEN_STACKS
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
set_cut(S_YREG, B->cp_b);
#else
set_cut(S_YREG, B_YREG->cp_b);
#endif /* FROZEN_STACKS */
SET_BB(B_YREG);
ENDCACHE_Y();
}
JMPNext();
ENDBOp();
BOp(trust_logical, OtILl);
CACHE_Y(B);
{
LogUpdIndex *cl = PREG->y_u.OtILl.block;
PredEntry *ap = cl->ClPred;
LogUpdClause *lcl = PREG->y_u.OtILl.d;
UInt timestamp = IntegerOfTerm(((CELL *)(B_YREG+1))[ap->ArityOfPE]);
/* fprintf(stderr,"- %p/%p %d %d %p\n",PREG,ap,timestamp,ap->TimeStampOfPred,PREG->y_u.OtILl.d->ClCode);*/
#if defined(YAPOR) || defined(THREADS)
if (PP != ap) {
if (PP) UNLOCKPE(16,PP);
PP = ap;
PELOCK(16,PP);
}
#endif
if (!VALID_TIMESTAMP(timestamp, lcl)) {
/* jump to next alternative */
PREG = FAILCODE;
} else {
PREG = lcl->ClCode;
}
/* HEY, leave indexing block alone!! */
/* check if we are the ones using this code */
#if MULTIPLE_STACKS
DEC_CLREF_COUNT(cl);
/* clear the entry from the trail */
B->cp_tr--;
TR = B->cp_tr;
/* actually get rid of the code */
if (cl->ClRefCount == 0 && (cl->ClFlags & (ErasedMask|DirtyMask))) {
if (PREG != FAILCODE) {
if (lcl->ClRefCount == 1) {
/* make sure the clause isn't destroyed */
/* always add an extra reference */
INC_CLREF_COUNT(lcl);
TRAIL_CLREF(lcl);
B->cp_tr = TR;
}
}
if (cl->ClFlags & ErasedMask) {
saveregs();
Yap_ErLogUpdIndex(cl);
setregs();
} else {
saveregs();
Yap_CleanUpIndex(cl);
setregs();
}
save_pc();
}
#else
if (TrailTerm(B->cp_tr-1) == CLREF_TO_TRENTRY(cl) &&
B->cp_tr != B->cp_b->cp_tr) {
cl->ClFlags &= ~InUseMask;
B->cp_tr--;
#if FROZEN_STACKS
if (B->cp_tr > TR_FZ)
#endif
{
TR = B->cp_tr;
}
/* next, recover space for the indexing code if it was erased */
if (cl->ClFlags & (ErasedMask|DirtyMask)) {
if (PREG != FAILCODE) {
/* make sure we don't erase the clause we are jumping too */
if (!(lcl->ClFlags & InUseMask)) {
lcl->ClFlags |= InUseMask;
TRAIL_CLREF(lcl);
B->cp_tr = TR;
}
}
if (cl->ClFlags & ErasedMask) {
saveregs();
Yap_ErLogUpdIndex(cl);
setregs();
} else {
saveregs();
Yap_CleanUpIndex(cl);
setregs();
}
}
}
#endif
#ifdef YAPOR
if (SCH_top_shared_cp(B)) {
SCH_last_alternative(PREG, B_YREG);
restore_args(ap->ArityOfPE);
#ifdef FROZEN_STACKS
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
#else
S_YREG++;
#endif /* FROZEN_STACKS */
set_cut(S_YREG, B->cp_b);
} else
#endif /* YAPOR */
{
pop_yaam_regs();
pop_args(ap->ArityOfPE);
S_YREG--;
#ifdef FROZEN_STACKS
S_YREG = (CELL *) PROTECT_FROZEN_B(B_YREG);
#endif /* FROZEN_STACKS */
set_cut(S_YREG, B);
}
SET_BB(B_YREG);
ENDCACHE_Y();
#if defined(YAPOR) || defined(THREADS)
if (PREG == FAILCODE) {
UNLOCKPE(26,PP);
PP = NULL;
}
#endif
JMPNext();
}
ENDBOp();
/*****************************************************************
* enter a logical semantics dynamic predicate *
*****************************************************************/
/* only meaningful with THREADS on! */
/* lock logical updates predicate. */
Op(lock_lu, p);
#if PARALLEL_YAP
if (PP) {
GONext();
}
PP = PREG->y_u.p.p;
PELOCK(3, PP);
#endif
PREG = NEXTOP(PREG, p);
GONext();
ENDOp();
/* only meaningful with THREADS on! */
/* lock logical updates predicate. */
Op(unlock_lu, e);
#if defined(YAPOR) || defined(THREADS)
if (PP) {
UNLOCKPE(1,PP);
PP = NULL;
}
#endif
PREG = NEXTOP(PREG, e);
GONext();
ENDOp();
/* enter logical pred */
BOp(alloc_for_logical_pred, L);
check_trail(TR);
/* say that an environment is using this clause */
/* we have our own copy for the clause */
#if MULTIPLE_STACKS
{
LogUpdClause *cl = PREG->y_u.L.ClBase;
#if PARALLEL_YAP
PredEntry *ap = cl->ClPred;
#endif
/* always add an extra reference */
INC_CLREF_COUNT(cl);
TRAIL_CLREF(cl);
UNLOCKPE(2,ap);
PP = NULL;
}
#else
{
LogUpdClause *cl = (LogUpdClause *)PREG->y_u.L.ClBase;
if (!(cl->ClFlags & InUseMask)) {
cl->ClFlags |= InUseMask;
TRAIL_CLREF(cl);
}
}
#endif
PREG = NEXTOP(PREG, L);
JMPNext();
ENDBOp();
/* copy database term */
BOp(copy_idb_term, e);
{
LogUpdClause *cl = ClauseCodeToLogUpdClause(PREG);
Term t;
SET_ASP(YREG, E_CB*sizeof(CELL));
saveregs();
while ((t = Yap_FetchTermFromDB(cl->lusl.ClSource)) == 0L) {
if (PP) UNLOCKPE(3,PP);
#if defined(YAPOR) || defined(THREADS)
PP = NULL;
#endif
if (LOCAL_Error_TYPE == RESOURCE_ERROR_ATTRIBUTED_VARIABLES) {
LOCAL_Error_TYPE = YAP_NO_ERROR;
if (!Yap_growglobal(NULL)) {
Yap_NilError(RESOURCE_ERROR_ATTRIBUTED_VARIABLES, LOCAL_ErrorMessage);
FAIL();
}
} else {
LOCAL_Error_TYPE = YAP_NO_ERROR;
if (!Yap_gc(3, ENV, CP)) {
Yap_NilError(RESOURCE_ERROR_STACK, LOCAL_ErrorMessage);
FAIL();
}
}
#if defined(YAPOR) || defined(THREADS)
PELOCK(5,ClauseCodeToLogUpdClause(PREG)->ClPred);
PP = ClauseCodeToLogUpdClause(PREG)->ClPred;
#endif
}
if (!Yap_IUnify(ARG2, t)) {
setregs();
#if defined(YAPOR) || defined(THREADS)
if (PP) UNLOCKPE(6,PP);
PP = NULL;
#endif
FAIL();
}
if (!Yap_IUnify(ARG3, MkDBRefTerm((DBRef)cl))) {
setregs();
#if defined(YAPOR) || defined(THREADS)
if (PP) UNLOCKPE(5,PP);
PP = NULL;
#endif
FAIL();
}
setregs();
#if MULTIPLE_STACKS
/* always add an extra reference */
INC_CLREF_COUNT(cl);
TRAIL_CLREF(cl);
if (PP) UNLOCKPE(7,PP);
PP = NULL;
#else
if (!(cl->ClFlags & InUseMask)) {
/* Clause *cl = (Clause *)PREG->y_u.EC.ClBase;
PREG->y_u.EC.ClTrail = TR-(tr_fr_ptr)LOCAL_TrailBase;
PREG->y_u.EC.ClENV = LCL0-YREG;*/
cl->ClFlags |= InUseMask;
TRAIL_CLREF(cl);
}
#endif
}
PREG = CPREG;
YREG = ENV;
#ifdef DEPTH_LIMIT
DEPTH = YREG[E_DEPTH];
#endif
JMPNext();
ENDBOp();
/* unify with database term */
BOp(unify_idb_term, e);
{
LogUpdClause *cl = ClauseCodeToLogUpdClause(PREG);
saveregs();
if (!Yap_IUnify(ARG2, cl->lusl.ClSource->Entry)) {
setregs();
UNLOCKPE(8,PP);
#if defined(YAPOR) || defined(THREADS)
PP = NULL;
#endif
FAIL();
}
if (!Yap_IUnify(ARG3, MkDBRefTerm((DBRef)cl))) {
setregs();
UNLOCKPE(9,PP);
#if defined(YAPOR) || defined(THREADS)
PP = NULL;
#endif
FAIL();
}
setregs();
/* say that an environment is using this clause */
/* we have our own copy for the clause */
#if MULTIPLE_STACKS
/* always add an extra reference */
INC_CLREF_COUNT(cl);
TRAIL_CLREF(cl);
UNLOCKPE(10,PP);
PP = NULL;
#else
if (!(cl->ClFlags & InUseMask)) {
/* Clause *cl = (Clause *)PREG->y_u.EC.ClBase;
PREG->y_u.EC.ClTrail = TR-(tr_fr_ptr)LOCAL_TrailBase;
PREG->y_u.EC.ClENV = LCL0-YREG;*/
cl->ClFlags |= InUseMask;
TRAIL_CLREF(cl);
}
#endif
}
PREG = CPREG;
YREG = ENV;
#ifdef DEPTH_LIMIT
DEPTH = YREG[E_DEPTH];
#endif
JMPNext();
ENDBOp();

108
C/mavar.c
View File

@ -15,20 +15,54 @@
* *
*************************************************************************/
/**
@file mavar.c
@defgroup Term_Modification Term Modification
@ingroup builtins
It is sometimes useful to change the value of instantiated
variables. Although, this is against the spirit of logic programming, it
is sometimes useful. As in other Prolog systems, YAP has
several primitives that allow updating Prolog terms. Note that these
primitives are also backtrackable.
The setarg/3 primitive allows updating any argument of a Prolog
compound terms. The _mutable_ family of predicates provides
<em>mutable variables</em>. They should be used instead of setarg/3,
as they allow the encapsulation of accesses to updatable
variables. Their implementation can also be more efficient for long
deterministic computations.
@{
*/
#include "Yap.h"
#ifdef MULTI_ASSIGNMENT_VARIABLES
#include "Yatom.h"
#include "YapHeap.h"
#include "eval.h"
#include "YapEval.h"
STD_PROTO(static Int p_setarg, ( USES_REGS1 ));
STD_PROTO(static Int p_create_mutable, ( USES_REGS1 ));
STD_PROTO(static Int p_get_mutable, ( USES_REGS1 ));
STD_PROTO(static Int p_update_mutable, ( USES_REGS1 ));
STD_PROTO(static Int p_is_mutable, ( USES_REGS1 ));
static Int p_setarg( USES_REGS1 );
static Int p_create_mutable( USES_REGS1 );
static Int p_get_mutable( USES_REGS1 );
static Int p_update_mutable( USES_REGS1 );
static Int p_is_mutable( USES_REGS1 );
/** @pred setarg(+ _I_,+ _S_,? _T_)
Set the value of the _I_th argument of term _S_ to term _T_.
*/
static Int
p_setarg( USES_REGS1 )
{
@ -36,7 +70,7 @@ p_setarg( USES_REGS1 )
Int i;
if (IsVarTerm(t3) &&
VarOfTerm(t3) > H &&VarOfTerm(t3) < ASP) {
VarOfTerm(t3) > HR &&VarOfTerm(t3) < ASP) {
/* local variable */
Term tn = MkVarTerm();
Bind_Local(VarOfTerm(t3), tn);
@ -109,7 +143,7 @@ p_setarg( USES_REGS1 )
*/
/* create and initialise a new timed var. The problem is: how to set
/* create and initialize a new timed var. The problem is: how to set
the clock?
If I give it the current value of B->TR, we may have trouble if no
@ -124,17 +158,17 @@ NewTimedVar(CELL val USES_REGS)
Term out;
timed_var *tv;
if (IsVarTerm(val) &&
VarOfTerm(val) > H) {
VarOfTerm(val) > HR) {
Term nval = MkVarTerm();
Bind_Local(VarOfTerm(val), nval);
val = nval;
}
out = AbsAppl(H);
*H++ = (CELL)FunctorMutable;
tv = (timed_var *)H;
out = AbsAppl(HR);
*HR++ = (CELL)FunctorMutable;
tv = (timed_var *)HR;
RESET_VARIABLE(&(tv->clock));
tv->value = val;
H += sizeof(timed_var)/sizeof(CELL);
HR += sizeof(timed_var)/sizeof(CELL);
return(out);
}
@ -149,13 +183,13 @@ Term
Yap_NewEmptyTimedVar( void )
{
CACHE_REGS
Term out = AbsAppl(H);
Term out = AbsAppl(HR);
timed_var *tv;
*H++ = (CELL)FunctorMutable;
tv = (timed_var *)H;
*HR++ = (CELL)FunctorMutable;
tv = (timed_var *)HR;
RESET_VARIABLE(&(tv->clock));
RESET_VARIABLE(&(tv->value));
H += sizeof(timed_var)/sizeof(CELL);
HR += sizeof(timed_var)/sizeof(CELL);
return(out);
}
@ -181,7 +215,7 @@ UpdateTimedVar(Term inv, Term new USES_REGS)
CELL t = tv->value;
CELL* timestmp = (CELL *)(tv->clock);
if (IsVarTerm(new) &&
VarOfTerm(new) > H) {
VarOfTerm(new) > HR) {
Term nnew = MkVarTerm();
Bind_Local(VarOfTerm(new), nnew);
new = nnew;
@ -200,9 +234,9 @@ UpdateTimedVar(Term inv, Term new USES_REGS)
#endif
tv->value = new;
} else {
Term nclock = (Term)H;
Term nclock = (Term)HR;
MaBind(&(tv->value), new);
*H++ = TermFoundVar;
*HR++ = TermFoundVar;
MaBind(&(tv->clock), nclock);
}
return(t);
@ -216,6 +250,13 @@ Yap_UpdateTimedVar(Term inv, Term new)
return UpdateTimedVar(inv, new PASS_REGS);
}
/** @pred create_mutable(+ _D_,- _M_)
Create new mutable variable _M_ with initial value _D_.
*/
static Int
p_create_mutable( USES_REGS1 )
{
@ -223,6 +264,13 @@ p_create_mutable( USES_REGS1 )
return(Yap_unify(ARG2,t));
}
/** @pred get_mutable(? _D_,+ _M_)
Unify the current value of mutable term _M_ with term _D_.
*/
static Int
p_get_mutable( USES_REGS1 )
{
@ -243,6 +291,14 @@ p_get_mutable( USES_REGS1 )
return(Yap_unify(ARG1, t));
}
/** @pred update_mutable(+ _D_,+ _M_)
Set the current value of mutable term _M_ to term _D_.
*/
static Int
p_update_mutable( USES_REGS1 )
{
@ -263,6 +319,13 @@ p_update_mutable( USES_REGS1 )
return(TRUE);
}
/** @pred is_mutable(? _D_)
Holds if _D_ is a mutable term.
*/
static Int
p_is_mutable( USES_REGS1 )
{
@ -285,7 +348,6 @@ void
Yap_InitMaVarCPreds(void)
{
#ifdef MULTI_ASSIGNMENT_VARIABLES
/* The most famous contributions of SICStus to the Prolog language */
Yap_InitCPred("setarg", 3, p_setarg, SafePredFlag);
Yap_InitCPred("create_mutable", 2, p_create_mutable, SafePredFlag);
Yap_InitCPred("get_mutable", 2, p_get_mutable, SafePredFlag);
@ -293,3 +355,7 @@ Yap_InitMaVarCPreds(void)
Yap_InitCPred("is_mutable", 1, p_is_mutable, SafePredFlag);
#endif
}
/**
@}
*/

300
C/meta_absmi_insts.h Normal file
View File

@ -0,0 +1,300 @@
#ifdef INDENT_CODE
{
{
{
#endif /* INDENT_CODE */
/* join all the meta-call code into a single procedure with three entry points */
{
CACHE_Y_AS_ENV(YREG);
BEGD(d0); /* term to be meta-called */
Term mod; /* module to be used */
PredEntry *pen; /* predicate */
choiceptr b_ptr; /* cut point */
Functor f;
/* we are doing the rhs of a , */
BOp(p_execute_tail, Osbmp);
FETCH_Y_FROM_ENV(YREG);
/* place to cut to */
b_ptr = (choiceptr)ENV_YREG[E_CB];
/* original goal */
d0 = ENV_YREG[-EnvSizeInCells-1];
/* predicate we had used */
pen = RepPredProp(AddressOfTerm(ENV_YREG[-EnvSizeInCells-2]));
/* current module at the time */
mod = ENV_YREG[-EnvSizeInCells-3];
/* set YREG */
/* Try to preserve the environment */
ENV_YREG = (CELL *) (((char *) YREG) + PREG->y_u.Osbmp.s);
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (ENV_YREG > (CELL *) top_b || ENV_YREG < HR) ENV_YREG = (CELL *) top_b;
#else
if (ENV_YREG > (CELL *) top_b) ENV_YREG = (CELL *) top_b;
#endif /* YAPOR_SBA */
}
#else
if (ENV_YREG > (CELL *) B) {
ENV_YREG = (CELL *) B;
}
#endif /* FROZEN_STACKS */
/* now, jump to actual execution */
if (pen->ArityOfPE) {
f = pen->FunctorOfPred;
/* reuse environment if we are continuining a comma, ie, (g1,g2,g3) */
/* can only do it deterministically */
/* broken
if (f == FunctorComma && (CELL *)B >= ENV) {
ENV_YREG = ENV;
ENV = (CELL *)ENV[E_E];
}
*/
goto execute_pred_f;
} else
goto execute_pred_a;
ENDBOp();
/* fetch the module from ARG2 */
BOp(p_execute2, Osbpp);
mod = ARG2;
deref_head(mod, execute2_unk0);
execute2_nvar0:
if (!IsAtomTerm(mod)) {
saveregs();
Yap_Error(TYPE_ERROR_ATOM, mod, "call/2");
setregs();
}
goto start_execute;
BEGP(pt1);
deref_body(mod, pt1, execute2_unk0, execute2_nvar0);
saveregs();
Yap_Error(INSTANTIATION_ERROR, mod, "call/2");
setregs();
ENDP(pt1);
/* Oops, second argument was unbound too */
FAIL();
ENDBOp();
BOp(p_execute, Osbmp);
/* fetch the module from PREG */
mod = PREG->y_u.Osbmp.mod;
start_execute:
/* place to cut to */
b_ptr = B;
/* we have mod, and ARG1 has the goal, let us roll */
/* Try to preserve the environment */
ENV_YREG = (CELL *) (((char *) YREG) + PREG->y_u.Osbmp.s);
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (ENV_YREG > (CELL *) top_b || ENV_YREG < HR) ENV_YREG = (CELL *) top_b;
#else
if (ENV_YREG > (CELL *) top_b) ENV_YREG = (CELL *) top_b;
#endif /* YAPOR_SBA */
}
#else
if (ENV_YREG > (CELL *) B) {
ENV_YREG = (CELL *) B;
}
#endif /* FROZEN_STACKS */
d0 = ARG1;
restart_execute:
deref_head(d0, execute_unk);
execute_nvar:
if (IsApplTerm(d0)) {
f = FunctorOfTerm(d0);
if (IsExtensionFunctor(f)) {
goto execute_metacall;
}
pen = RepPredProp(PredPropByFunc(f, mod));
execute_pred_f:
if (pen->PredFlags & (MetaPredFlag|UndefPredFlag)) {
/* just strip all of M:G */
if (f == FunctorModule) {
Term tmod = ArgOfTerm(1,d0);
/* loop on modules */
if (!IsVarTerm(tmod) && IsAtomTerm(tmod)) {
d0 = ArgOfTerm(2,d0);
mod = tmod;
goto execute_nvar;
}
goto execute_metacall;
}
if (f == FunctorComma) {
Term nmod = mod;
/* optimise conj */
SREG = RepAppl(d0);
BEGD(d1);
d1 = SREG[2];
/* create an environment to execute the call */
deref_head(d1, execute_comma_unk);
execute_comma_nvar:
if (IsAtomTerm(d1)) {
/* atomic goal is simpler */
ENV_YREG[-EnvSizeInCells-2] = MkIntegerTerm((Int)PredPropByAtom(AtomOfTerm(d1),nmod));
} else if (IsApplTerm(d1)) {
Functor f1 = FunctorOfTerm(d1);
if (IsExtensionFunctor(f1)) {
goto execute_metacall;
} else {
/* check for modules when looking up */
if (f1 == FunctorModule) {
Term tmod = ArgOfTerm(1,d1);
/* loop on modules */
if (!IsVarTerm(tmod) && IsAtomTerm(tmod)) {
d1 = ArgOfTerm(2,d1);
nmod = tmod;
goto execute_comma_nvar;
}
goto execute_metacall;
}
ENV_YREG[-EnvSizeInCells-2] = MkIntegerTerm((Int)PredPropByFunc(f1,nmod));
}
} else {
goto execute_metacall;
}
ENV_YREG[-EnvSizeInCells-3] = mod;
/* now, we can create the new environment for the meta-call */
/* notice that we are at a call, so we should ignore CP */
ENV_YREG[E_CP] = (CELL)NEXTOP(PREG,Osbmp);
ENV_YREG[E_CB] = (CELL)b_ptr;
ENV_YREG[E_E] = (CELL)ENV;
#ifdef DEPTH_LIMIT
ENV_YREG[E_DEPTH] = DEPTH;
#endif /* DEPTH_LIMIT */
ENV_YREG[-EnvSizeInCells-1] = d1;
ENV = ENV_YREG;
ENV_YREG -= EnvSizeInCells+3;
CPREG = NEXTOP(PREG, Osbmp);
PREG = COMMA_CODE;
/* for profiler */
save_pc();
d0 = SREG[1];
goto restart_execute;
BEGP(pt1);
deref_body(d1, pt1, execute_comma_unk, execute_comma_nvar);
goto execute_metacall;
ENDP(pt1);
ENDD(d1);
} else if (mod != CurrentModule) {
goto execute_metacall;
}
}
/* copy arguments of meta-call to XREGS */
BEGP(pt1);
pt1 = RepAppl(d0);
BEGD(d2);
for (d2 = ArityOfFunctor(f); d2; d2--) {
#ifdef YAPOR_SBA
BEGD(d1);
d1 = pt1[d2];
if (d1 == 0) {
XREGS[d2] = (CELL)(pt1+d2);
} else {
XREGS[d2] = d1;
}
#else
XREGS[d2] = pt1[d2];
#endif
}
ENDD(d2);
ENDP(pt1);
CACHE_A1();
} else if (IsAtomTerm(d0)) {
pen = RepPredProp(PredPropByAtom(AtomOfTerm(d0), mod));
execute_pred_a:
/* handle extra pruning */
if (pen->FunctorOfPred == (Functor)AtomCut) {
if (b_ptr != B) {
saveregs();
prune(b_ptr PASS_REGS);
setregs();
}
}
} else {
goto execute_metacall;
}
/* execute, but test first for interrupts */
execute_end:
/* code copied from call */
#ifndef NO_CHECKING
check_stack(NoStackPExecute, HR);
#endif
execute_stack_checked:
CPREG = NEXTOP(PREG, Osbmp);
ALWAYS_LOOKAHEAD(pen->OpcodeOfPred);
PREG = pen->CodeOfPred;
/* for profiler */
save_pc();
#ifdef DEPTH_LIMIT
if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is primitives */
if (pen->ModuleOfPred) {
if (DEPTH == MkIntTerm(0)) {
FAIL();
} else {
DEPTH = RESET_DEPTH();
}
}
} else if (pen->ModuleOfPred)
DEPTH -= MkIntConstant(2);
#endif /* DEPTH_LIMIT */
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace)
low_level_trace(enter_pred,pen,XREGS+1);
#endif /* LOW_LEVEL_TRACER */
WRITEBACK_Y_AS_ENV();
/* setup GB */
ENV_YREG[E_CB] = (CELL) B;
#ifdef YAPOR
SCH_check_requests();
#endif /* YAPOR */
CACHE_A1();
ALWAYS_GONext();
ALWAYS_END_PREFETCH();
/* meta-call: Prolog to the rescue */
BEGP(pt1);
deref_body(d0, pt1, execute_unk, execute_nvar);
execute_metacall:
ARG1 = ARG3 = d0;
pen = PredMetaCall;
ARG2 = Yap_cp_as_integer(b_ptr);
if (mod)
ARG4 = mod;
else
ARG4 = TermProlog;
goto execute_end;
ENDP(pt1);
/* at this point, we have the arguments all set in the argument registers, pen says who is the current predicate. don't remove. */
NoStackPExecute:
WRITEBACK_Y_AS_ENV();
#ifdef SHADOW_S
Yap_REGS.S_ = SREG;
#endif
saveregs_and_ycache();
d0 = interrupt_pexecute( pen PASS_REGS );
setregs_and_ycache();
#ifdef SHADOW_S
SREG = Yap_REGS.S_;
#endif
if (!d0) FAIL();
if (d0 == 2) goto execute_stack_checked;
goto execute_end;
ENDBOp();
ENDD(d0);
ENDCACHE_Y_AS_ENV();
}

View File

@ -14,22 +14,63 @@
* comments: module support *
* *
*************************************************************************/
#ifdef SCCS
static char SccsId[] = "%W% %G%";
#ifdef SCCSLookupSystemModule
static char SccsId[] = "%W% %G%";
#endif
#include "Yap.h"
#include "Yatom.h"
#include "YapHeap.h"
#include "Yatom.h"
STATIC_PROTO(Int p_current_module, ( USES_REGS1 ));
STATIC_PROTO(Int p_current_module1, ( USES_REGS1 ));
static Int current_module(USES_REGS1);
static Int current_module1(USES_REGS1);
static ModEntry *LookupModule(Term a);
static ModEntry *LookupSystemModule(Term a);
static ModEntry *GetModuleEntry(Atom at USES_REGS);
static ModEntry *FetchModuleEntry(Atom at);
/**
* initialize module data-structure
*
* @param to parent module (CurrentModule)
* @param ae module name.
*
* @return a new module structure
*/ /** */
static ModEntry *initMod(AtomEntry *toname, AtomEntry *ae) {
CACHE_REGS
ModEntry *n, *parent;
inline static ModEntry *
FetchModuleEntry(Atom at)
/* get predicate entry for ap/arity; create it if neccessary. */
{
if (toname == NULL)
parent = NULL;
else {
parent = FetchModuleEntry(toname);
}
n = (ModEntry *)Yap_AllocAtomSpace(sizeof(*n));
INIT_RWLOCK(n->ModRWLock);
n->KindOfPE = ModProperty;
n->PredForME = NULL;
n->OpForME = NULL;
n->NextME = CurrentModules;
CurrentModules = n;
n->AtomOfME = ae;
n->NextOfPE = NULL;
n->OwnerFile = Yap_ConsultingFile(PASS_REGS1);
AddPropToAtom(ae, (PropEntry *)n);
Yap_setModuleFlags(n, parent);
return n;
}
/**
* get predicate entry for ap/arity; create it if neccessary
*
* @param[in] at
*
* @return module descriptorxs
*/
static ModEntry *GetModuleEntry(Atom at USES_REGS) {
Prop p0;
AtomEntry *ae = RepAtom(at);
@ -37,8 +78,28 @@ FetchModuleEntry(Atom at)
p0 = ae->PropsOfAE;
while (p0) {
ModEntry *me = RepModProp(p0);
if ( me->KindOfPE == ModProperty
) {
if (me->KindOfPE == ModProperty) {
READ_UNLOCK(ae->ARWLock);
return me;
}
p0 = me->NextOfPE;
}
READ_UNLOCK(ae->ARWLock);
return initMod(
(CurrentModule == PROLOG_MODULE ? NULL : AtomOfTerm(CurrentModule)), at);
}
/** get entry for ap/arity; assumes one is there. */
static ModEntry *FetchModuleEntry(Atom at) {
Prop p0;
AtomEntry *ae = RepAtom(at);
READ_LOCK(ae->ARWLock);
p0 = ae->PropsOfAE;
while (p0) {
ModEntry *me = RepModProp(p0);
if (me->KindOfPE == ModProperty) {
READ_UNLOCK(ae->ARWLock);
return me;
}
@ -48,92 +109,117 @@ FetchModuleEntry(Atom at)
return NULL;
}
inline static ModEntry *
GetModuleEntry(Atom at)
/* get predicate entry for ap/arity; create it if neccessary. */
{
Prop p0;
AtomEntry *ae = RepAtom(at);
ModEntry *new;
p0 = ae->PropsOfAE;
while (p0) {
ModEntry *me = RepModProp(p0);
if ( me->KindOfPE == ModProperty
) {
return me;
}
p0 = me->NextOfPE;
Term Yap_getUnknownModule(ModEntry *m) {
if (m && m->flags & UNKNOWN_ERROR) {
return TermError;
} else if (m && m->flags & UNKNOWN_WARNING) {
return TermWarning;
} else if (m && m->flags & UNKNOWN_FAST_FAIL) {
return TermFastFail;
} else {
return TermFail;
}
new = (ModEntry *) Yap_AllocAtomSpace(sizeof(*new));
INIT_RWLOCK(new->ModRWLock);
new->KindOfPE = ModProperty;
new->PredForME = NULL;
new->NextME = CurrentModules;
CurrentModules = new;
new->AtomOfME = ae;
AddPropToAtom(ae, (PropEntry *)new);
return new;
}
bool Yap_getUnknown(Term mod) {
ModEntry *m = LookupModule(mod);
return Yap_getUnknownModule(m);
}
#define ByteAdr(X) ((char *) &(X))
Term
Yap_Module_Name(PredEntry *ap)
{
bool Yap_CharacterEscapes(Term mt) {
CACHE_REGS
Term mod;
if (mt == PROLOG_MODULE)
mt = TermProlog;
return GetModuleEntry(AtomOfTerm(mt) PASS_REGS)->flags & M_CHARESCAPE;
}
#define ByteAdr(X) ((char *)&(X))
Term Yap_Module_Name(PredEntry *ap) {
CACHE_REGS
if (!ap)
return TermUser;
if (!ap->ModuleOfPred)
/* If the system predicate is a metacall I should return the
/* If the system predicate is a meta-call I should return the
module for the metacall, which I will suppose has to be
reachable from the current module anyway.
So I will return the current module in case the system
predicate is a meta-call. Otherwise it will still work.
*/
mod = CurrentModule;
return TermProlog;
else {
mod = ap->ModuleOfPred;
return ap->ModuleOfPred;
}
if (mod) return mod;
return TermProlog;
}
static ModEntry *
LookupModule(Term a)
{
static ModEntry *LookupSystemModule(Term a) {
CACHE_REGS
Atom at;
ModEntry *me;
/* prolog module */
if (a == 0)
return GetModuleEntry(AtomOfTerm(TermProlog));
if (a == 0) {
a = TermProlog;
}
at = AtomOfTerm(a);
me = GetModuleEntry(at);
me = GetModuleEntry(at PASS_REGS);
if (!me)
return NULL;
me->flags |= M_SYSTEM;
me->OwnerFile = Yap_ConsultingFile(PASS_REGS1);
return me;
}
Term
Yap_Module(Term tmod)
{
static ModEntry *LookupModule(Term a) {
CACHE_REGS
Atom at;
ModEntry *me;
/* prolog module */
if (a == 0) {
return GetModuleEntry(AtomProlog PASS_REGS);
}
at = AtomOfTerm(a);
me = GetModuleEntry(at PASS_REGS);
return me;
}
bool Yap_isSystemModule(Term a) {
ModEntry *me = LookupModule(a);
return me != NULL && me->flags & M_SYSTEM;
}
Term Yap_Module(Term tmod) {
LookupModule(tmod);
return tmod;
}
struct pred_entry *
Yap_ModulePred(Term mod)
{
ModEntry *Yap_GetModuleEntry(Term mod) {
ModEntry *me;
if (!(me = LookupModule(mod)))
return NULL;
return me;
}
Term Yap_GetModuleFromEntry(ModEntry *me) {
return MkAtomTerm(me->AtomOfME);
;
}
struct pred_entry *Yap_ModulePred(Term mod) {
ModEntry *me;
if (!(me = LookupModule(mod)))
return NULL;
return me->PredForME;
}
void
Yap_NewModulePred(Term mod, struct pred_entry *ap)
{
void Yap_NewModulePred(Term mod, struct pred_entry *ap) {
ModEntry *me;
if (mod == 0)
mod = TermProlog;
if (!(me = LookupModule(mod)))
return;
WRITE_LOCK(me->ModRWLock);
@ -142,13 +228,12 @@ Yap_NewModulePred(Term mod, struct pred_entry *ap)
WRITE_UNLOCK(me->ModRWLock);
}
static Int
p_current_module( USES_REGS1 )
{ /* $current_module(Old,New) */
Term t;
static Int
current_module(USES_REGS1) { /* $current_module(Old,N) */
Term t;
if (CurrentModule) {
if(!Yap_unify_constant(ARG1, CurrentModule))
if (!Yap_unify_constant(ARG1, CurrentModule))
return FALSE;
} else {
if (!Yap_unify_constant(ARG1, TermProlog))
@ -160,172 +245,408 @@ p_current_module( USES_REGS1 )
if (t == TermProlog) {
CurrentModule = PROLOG_MODULE;
} else {
// make it very clear that t inherits from cm.
LookupModule(t);
CurrentModule = t;
LookupModule(CurrentModule);
}
LOCAL_SourceModule = CurrentModule;
return TRUE;
}
static Int
p_current_module1( USES_REGS1 )
{ /* $current_module(Old) */
static Int change_module(USES_REGS1) { /* $change_module(N) */
Term mod = Deref(ARG1);
LookupModule(mod);
CurrentModule = mod;
LOCAL_SourceModule = mod;
return TRUE;
}
static Int current_module1(USES_REGS1) { /* $current_module(Old)
*/
if (CurrentModule)
return Yap_unify_constant(ARG1, CurrentModule);
return Yap_unify_constant(ARG1, TermProlog);
}
static Int
p_change_module( USES_REGS1 )
{ /* $change_module(New) */
Term mod = Deref(ARG1);
LookupModule(mod);
CurrentModule = mod;
return TRUE;
}
static Int
cont_current_module( USES_REGS1 )
{
ModEntry *imod = (ModEntry *)IntegerOfTerm(EXTRA_CBACK_ARG(1,1)), *next;
static Int cont_current_module(USES_REGS1) {
ModEntry *imod = AddressOfTerm(EXTRA_CBACK_ARG(1, 1)), *next;
Term t = MkAtomTerm(imod->AtomOfME);
next = imod->NextME;
/* ARG1 is unbound */
Yap_unify(ARG1,t);
Yap_unify(ARG1, t);
if (!next)
cut_succeed();
EXTRA_CBACK_ARG(1,1) = MkIntegerTerm((Int)next);
EXTRA_CBACK_ARG(1, 1) = MkAddressTerm(next);
return TRUE;
}
static Int
init_current_module( USES_REGS1 )
{ /* current_module(?ModuleName) */
static Int init_current_module(
USES_REGS1) { /* current_module(?ModuleName) */
Term t = Deref(ARG1);
if (!IsVarTerm(t)) {
if (!IsAtomTerm(t)) {
Yap_Error(TYPE_ERROR_ATOM,t,"module name must be an atom");
Yap_Error(TYPE_ERROR_ATOM, t, "module name must be an atom");
return FALSE;
}
if (FetchModuleEntry(AtomOfTerm(t)) != NULL)
cut_succeed();
cut_fail();
}
EXTRA_CBACK_ARG(1,1) = MkIntegerTerm((Int)CurrentModules);
return cont_current_module( PASS_REGS1 );
EXTRA_CBACK_ARG(1, 1) = MkIntegerTerm((Int)CurrentModules);
return cont_current_module(PASS_REGS1);
}
static Int
p_strip_module( USES_REGS1 )
{
Term t1 = Deref(ARG1), t2, tmod = CurrentModule;
static Int cont_ground_module(USES_REGS1) {
ModEntry *imod = AddressOfTerm(EXTRA_CBACK_ARG(3, 1)), *next;
Term t2 = MkAtomTerm(imod->AtomOfME);
next = imod->NextME;
/* ARG2 is unbound */
if (!next)
cut_succeed();
EXTRA_CBACK_ARG(3, 1) = MkAddressTerm(next);
return Yap_unify(ARG2, t2);
}
static Int init_ground_module(USES_REGS1) {
/* current_module(?ModuleName) */
Term t1 = Deref(ARG1), tmod = CurrentModule, t3;
if (tmod == PROLOG_MODULE) {
tmod = TermProlog;
}
if (IsVarTerm(t1) ||
!IsApplTerm(t1) ||
FunctorOfTerm(t1) != FunctorModule ||
IsVarTerm(t2 = ArgOfTerm(1,t1)) ||
!IsAtomTerm(t2)) {
return Yap_unify(ARG3, t1) &&
Yap_unify(ARG2, tmod);
t3 = Yap_YapStripModule(t1, &tmod);
if (!t3) {
Yap_Error(TYPE_ERROR_CALLABLE, t3, "trying to obtain module");
return FALSE;
}
do {
tmod = t2;
t1 = ArgOfTerm(2,t1);
} while (!IsVarTerm(t1) &&
IsApplTerm(t1) &&
FunctorOfTerm(t1) == FunctorModule &&
!IsVarTerm(t2 = ArgOfTerm(1,t1)) &&
IsAtomTerm(t2));
return Yap_unify(ARG3, t1) &&
Yap_unify(ARG2, tmod);
if (!IsVarTerm(tmod)) {
if (!IsAtomTerm(tmod)) {
Yap_Error(TYPE_ERROR_ATOM, tmod, "module name must be an atom");
cut_fail();
}
if (FetchModuleEntry(AtomOfTerm(tmod)) != NULL && Yap_unify(tmod, ARG2) &&
Yap_unify(t3, ARG3)) {
cut_succeed();
}
cut_fail();
}
if (!Yap_unify(ARG2, tmod) || !Yap_unify(ARG3, t3)) {
cut_fail();
}
// make sure we keep the binding
B->cp_tr = TR;
B->cp_h = HR;
EXTRA_CBACK_ARG(3, 1) = MkAddressTerm(CurrentModules);
return cont_ground_module(PASS_REGS1);
}
static Int
p_context_module( USES_REGS1 )
{
yamop *parentcp = P;
CELL *yenv;
PredEntry *ap = EnvPreg(parentcp);
if (ap->ModuleOfPred &&
!(ap->PredFlags & MetaPredFlag))
return Yap_unify(ARG1, ap->ModuleOfPred);
parentcp = CP;
yenv = ENV;
do {
ap = EnvPreg(parentcp);
if (ap->ModuleOfPred &&
!(ap->PredFlags & MetaPredFlag))
return Yap_unify(ARG1, ap->ModuleOfPred);
parentcp = (yamop *)yenv[E_CP];
yenv = (CELL *)yenv[E_E];
} while(yenv);
return Yap_unify(ARG1, CurrentModule);
/**
* @pred system_module( + _Mod_)
*
* @param module
*
* @return
*/
static Int is_system_module(USES_REGS1) {
Term t;
if (IsVarTerm(t = Deref(ARG1))) {
return false;
}
if (!IsAtomTerm(t)) {
Yap_Error(TYPE_ERROR_ATOM, t, "load_files/2");
return false;
}
return Yap_isSystemModule(t);
}
Term
Yap_StripModule(Term t, Term *modp)
{
static Int new_system_module(USES_REGS1) {
ModEntry *me;
Term t;
if (IsVarTerm(t = Deref(ARG1))) {
Yap_Error(INSTANTIATION_ERROR, t, NULL);
return false;
}
if (!IsAtomTerm(t)) {
Yap_Error(TYPE_ERROR_ATOM, t, NULL);
return false;
}
if ((me = LookupSystemModule(t)))
me->OwnerFile = Yap_ConsultingFile(PASS_REGS1);
return me != NULL;
}
static Int strip_module(USES_REGS1) {
Term t1 = Deref(ARG1), tmod = CurrentModule;
if (tmod == PROLOG_MODULE) {
tmod = TermProlog;
}
t1 = Yap_StripModule(t1, &tmod);
if (!t1) {
Yap_Error(TYPE_ERROR_CALLABLE, t1, "trying to obtain module");
return FALSE;
}
return Yap_unify(ARG3, t1) && Yap_unify(ARG2, tmod);
}
static Int yap_strip_clause(USES_REGS1) {
Term t1 = Deref(ARG1), tmod = LOCAL_SourceModule;
if (tmod == PROLOG_MODULE) {
tmod = TermProlog;
}
t1 = Yap_StripModule(t1, &tmod);
if (IsVarTerm(t1) || IsVarTerm(tmod)) {
Yap_Error(INSTANTIATION_ERROR, t1, "trying to obtain module");
return false;
} else if (IsApplTerm(t1)) {
Functor f = FunctorOfTerm(t1);
if (IsExtensionFunctor(f)) {
Yap_Error(TYPE_ERROR_CALLABLE, t1, "trying to obtain module");
return false;
}
if (f == FunctorAssert || f == FunctorDoubleArrow) {
Term thmod = tmod;
Term th = ArgOfTerm(1, t1);
th = Yap_StripModule(th, &thmod);
if (IsVarTerm(th)) {
Yap_Error(INSTANTIATION_ERROR, t1, "trying to obtain module");
return false;
} else if (IsVarTerm(thmod)) {
Yap_Error(INSTANTIATION_ERROR, thmod, "trying to obtain module");
return false;
} else if (IsIntTerm(th) ||
(IsApplTerm(th) && IsExtensionFunctor(FunctorOfTerm(t1)))) {
Yap_Error(TYPE_ERROR_CALLABLE, t1, "trying to obtain module");
return false;
} else if (!IsAtomTerm(thmod)) {
Yap_Error(TYPE_ERROR_ATOM, thmod, "trying to obtain module");
return false;
}
}
} else if (IsIntTerm(t1) || IsIntTerm(tmod)) {
Yap_Error(TYPE_ERROR_CALLABLE, t1, "trying to obtain module");
return false;
}
return Yap_unify(ARG3, t1) && Yap_unify(ARG2, tmod);
}
Term Yap_YapStripModule(Term t, Term *modp) {
CACHE_REGS
Term tmod;
tmod = CurrentModule;
restart:
if (IsVarTerm(t)) {
return 0L;
} else if (IsAtomTerm(t) || IsPairTerm(t)) {
*modp = tmod;
if (modp) {
tmod = *modp;
if (tmod == PROLOG_MODULE) {
*modp = tmod = TermProlog;
}
} else {
tmod = CurrentModule;
if (tmod == PROLOG_MODULE) {
tmod = TermProlog;
}
}
restart:
if (IsVarTerm(t) || !IsApplTerm(t)) {
if (modp)
*modp = tmod;
return t;
} else if (IsApplTerm(t)) {
Functor fun = FunctorOfTerm(t);
} else {
Functor fun = FunctorOfTerm(t);
if (fun == FunctorModule) {
tmod = ArgOfTerm(1, t);
if (IsVarTerm(tmod) ) {
return 0L;
}
if (!IsAtomTerm(tmod) ) {
return 0L;
Term t1 = ArgOfTerm(1, t);
tmod = t1;
if (!IsVarTerm(tmod) && !IsAtomTerm(tmod)) {
if (modp)
*modp = tmod;
return t;
}
t = ArgOfTerm(2, t);
goto restart;
}
*modp = tmod;
if (modp)
*modp = tmod;
return t;
}
return 0L;
}
void
Yap_InitModulesC(void)
{
Yap_InitCPred("$current_module", 2, p_current_module, SafePredFlag|SyncPredFlag|HiddenPredFlag);
Yap_InitCPred("$current_module", 1, p_current_module1, SafePredFlag|SyncPredFlag|HiddenPredFlag);
Yap_InitCPred("$change_module", 1, p_change_module, SafePredFlag|SyncPredFlag|HiddenPredFlag);
Yap_InitCPred("strip_module", 3, p_strip_module, SafePredFlag|SyncPredFlag|HiddenPredFlag);
Yap_InitCPred("context_module", 1, p_context_module, 0);
Yap_InitCPredBack("$all_current_modules", 1, 1, init_current_module, cont_current_module,
SafePredFlag|SyncPredFlag|HiddenPredFlag);
static Int yap_strip_module(USES_REGS1) {
Term t1 = Deref(ARG1), tmod = CurrentModule;
if (tmod == PROLOG_MODULE) {
tmod = TermProlog;
}
t1 = Yap_YapStripModule(t1, &tmod);
if (!t1 || (!IsVarTerm(tmod) && !IsAtomTerm(tmod))) {
Yap_Error(TYPE_ERROR_CALLABLE, t1, "trying to obtain module");
return FALSE;
}
return Yap_unify(ARG3, t1) && Yap_unify(ARG2, tmod);
}
static Int context_module(USES_REGS1) {
yamop *parentcp = P;
CELL *yenv;
PredEntry *ap = EnvPreg(parentcp);
if (ap->ModuleOfPred && !(ap->PredFlags & MetaPredFlag))
return Yap_unify(ARG1, ap->ModuleOfPred);
parentcp = CP;
yenv = ENV;
do {
ap = EnvPreg(parentcp);
if (ap->ModuleOfPred && !(ap->PredFlags & MetaPredFlag))
return Yap_unify(ARG1, ap->ModuleOfPred);
parentcp = (yamop *)yenv[E_CP];
yenv = (CELL *)yenv[E_E];
} while (yenv);
return Yap_unify(ARG1, CurrentModule);
}
void
Yap_InitModules(void)
{
/**
* @pred source_module(-Mod)
*
* @param Mod is the current text source module.
*
* : _Mod_ is the current read-in or source module.
*/
static Int source_module(USES_REGS1) {
if (LOCAL_SourceModule == PROLOG_MODULE) {
return Yap_unify(ARG1, TermProlog);
}
return Yap_unify(ARG1, LOCAL_SourceModule);
}
/**
* @pred source_module(-Mod)
*
* @param Mod is the current text source module.
*
* : _Mod_ is the current read-in or source module.
*/
static Int current_source_module(USES_REGS1) {
Term t;
if (LOCAL_SourceModule == PROLOG_MODULE) {
LOCAL_SourceModule = TermProlog;
}
if (!Yap_unify(ARG1, LOCAL_SourceModule)) {
return false;
};
if (IsVarTerm(t = Deref(ARG2))) {
Yap_Error(INSTANTIATION_ERROR, t, NULL);
return false;
}
if (!IsAtomTerm(t)) {
Yap_Error(TYPE_ERROR_ATOM, t, NULL);
return false;
}
LOCAL_SourceModule = CurrentModule = t;
return true;
}
/**
* @pred $copy_operators(+Mode, +ModTarget)
*
* Copy all operators in ModSource to ModTarget
*
* : _Mod_ is the current read-in or source module.
*/
static Int copy_operators(USES_REGS1) {
ModEntry *me = LookupModule(Deref(ARG1));
if (!me)
return true;
ModEntry *she = LookupModule(Deref(ARG2));
if (!she)
return true;
OpEntry *op = me->OpForME;
while (op) {
if (!Yap_dup_op(op, she)) {
return false;
}
op = op->NextForME;
}
return true;
}
Term Yap_StripModule(Term t, Term *modp) {
CACHE_REGS
LookupModule(MkAtomTerm(AtomProlog));
Term tmod;
if (modp)
tmod = *modp;
else {
tmod = CurrentModule;
if (tmod == PROLOG_MODULE) {
tmod = TermProlog;
}
}
restart:
if (IsVarTerm(t) || !IsApplTerm(t)) {
if (modp)
*modp = tmod;
return t;
} else {
Functor fun = FunctorOfTerm(t);
if (fun == FunctorModule) {
Term t1 = ArgOfTerm(1, t);
if (IsVarTerm(t1)) {
*modp = tmod;
return t;
}
tmod = t1;
if (!IsVarTerm(tmod) && !IsAtomTerm(tmod)) {
return 0L;
}
t = ArgOfTerm(2, t);
goto restart;
}
if (modp)
*modp = tmod;
return t;
}
return 0L;
}
void Yap_InitModulesC(void) {
Yap_InitCPred("$current_module", 2, current_module,
SafePredFlag | SyncPredFlag);
Yap_InitCPred("$current_module", 1, current_module1,
SafePredFlag | SyncPredFlag);
Yap_InitCPred("$change_module", 1, change_module,
SafePredFlag | SyncPredFlag);
Yap_InitCPred("strip_module", 3, strip_module, SafePredFlag | SyncPredFlag);
Yap_InitCPred("$yap_strip_module", 3, yap_strip_module,
SafePredFlag | SyncPredFlag);
Yap_InitCPred("source_module", 1, source_module, SafePredFlag | SyncPredFlag);
Yap_InitCPred("current_source_module", 2, current_source_module,
SafePredFlag | SyncPredFlag);
Yap_InitCPred("$yap_strip_clause", 3, yap_strip_clause,
SafePredFlag | SyncPredFlag);
Yap_InitCPred("context_module", 1, context_module, 0);
Yap_InitCPred("$is_system_module", 1, is_system_module, SafePredFlag);
Yap_InitCPred("$copy_operators", 2, copy_operators, 0);
Yap_InitCPred("new_system_module", 1, new_system_module, SafePredFlag);
Yap_InitCPredBack("$all_current_modules", 1, 1, init_current_module,
cont_current_module, SafePredFlag | SyncPredFlag);
Yap_InitCPredBack("$ground_module", 3, 1, init_ground_module,
cont_ground_module, SafePredFlag | SyncPredFlag);
}
void Yap_InitModules(void) {
CACHE_REGS
CurrentModules = NULL;
LookupSystemModule(MkAtomTerm(AtomProlog));
LOCAL_SourceModule = MkAtomTerm(AtomProlog);
LookupModule(USER_MODULE);
LookupModule(IDB_MODULE);
LookupModule(ATTRIBUTES_MODULE);
LookupModule(CHARSIO_MODULE);
LookupModule(TERMS_MODULE);
LookupModule(SYSTEM_MODULE);
LookupModule(READUTIL_MODULE);
LookupModule(HACKS_MODULE);
LookupSystemModule(CHARSIO_MODULE);
LookupSystemModule(TERMS_MODULE);
LookupSystemModule(SYSTEM_MODULE);
LookupSystemModule(READUTIL_MODULE);
LookupSystemModule(HACKS_MODULE);
LookupModule(ARG_MODULE);
LookupModule(GLOBALS_MODULE);
LookupModule(DBLOAD_MODULE);
LookupSystemModule(GLOBALS_MODULE);
LookupSystemModule(DBLOAD_MODULE);
LookupSystemModule(RANGE_MODULE);
CurrentModule = PROLOG_MODULE;
}

192
C/or_absmi_insts.h Normal file
View File

@ -0,0 +1,192 @@
/************************************************************************ \
* Instructions for implemeting 'or;' *
\************************************************************************/
#ifdef INDENT_CODE
{
{
{
#endif /* INDENT_CODE */
BOp(jump, l);
PREG = PREG->y_u.l.l;
JMPNext();
ENDBOp();
/* This instruction is called when the previous goal
was interrupted when waking up goals
*/
BOp(move_back, l);
PREG = (yamop *)(((char *)PREG)-(Int)(NEXTOP((yamop *)NULL,Osbpp)));
JMPNext();
ENDBOp();
/* This instruction is called when the previous goal
was interrupted when waking up goals
*/
BOp(skip, l);
PREG = NEXTOP(PREG,l);
JMPNext();
ENDBOp();
Op(either, Osblp);
#ifdef LOW_LEVEL_TRACER
if (Yap_do_low_level_trace) {
low_level_trace(try_or, PREG->y_u.Osblp.p0, NULL);
}
#endif
#ifdef COROUTINING
CACHE_Y_AS_ENV(YREG);
check_stack(NoStackEither, HR);
ENDCACHE_Y_AS_ENV();
either_notest:
#endif
BEGD(d0);
/* Try to preserve the environment */
d0 = PREG->y_u.Osblp.s;
BEGCHO(pt1);
pt1 = (choiceptr) ((char *) YREG + (yslot) d0);
#ifdef FROZEN_STACKS
{
choiceptr top_b = PROTECT_FROZEN_B(B);
#ifdef YAPOR_SBA
if (pt1 > top_b || pt1 < (choiceptr)HR) pt1 = top_b;
#else
if (pt1 > top_b) pt1 = top_b;
#endif /* YAPOR_SBA */
}
#else
if (pt1 > B) {
pt1 = B;
}
#endif /* FROZEN_STACKS */
pt1 = (choiceptr)(((CELL *) pt1)-1);
*(CELL **) pt1 = YREG;
store_yaam_regs_for_either(PREG->y_u.Osblp.l, PREG);
SREG = (CELL *) (B = pt1);
#ifdef YAPOR
SCH_set_load(pt1);
#endif /* YAPOR */
SET_BB(pt1);
ENDCHO(pt1);
/* skip the current instruction plus the next one */
PREG = NEXTOP(NEXTOP(PREG, Osblp),l);
GONext();
ENDD(d0);
#ifdef COROUTINING
NoStackEither:
PROCESS_INT(interrupt_either, either_notest);
#endif
ENDOp();
Op(or_else, Osblp);
HR = HBREG = PROTECT_FROZEN_H(B);
ENV = B->cp_env;
B->cp_cp = PREG;
#ifdef DEPTH_LIMIT
DEPTH = B->cp_depth;
#endif /* DEPTH_LIMIT */
SET_BB(PROTECT_FROZEN_B(B));
#ifdef YAPOR
if (SCH_top_shared_cp(B)) {
SCH_new_alternative(PREG, PREG->y_u.Osblp.l);
} else
#endif /* YAPOR */
B->cp_ap = PREG->y_u.Osblp.l;
PREG = NEXTOP(PREG, Osblp);
YREG = (CELL *) B->cp_a1;
GONext();
ENDOp();
#ifdef YAPOR
Op(or_last, Osblp);
#else
Op(or_last, p);
#endif /* YAPOR */
BEGCHO(pt0);
pt0 = B;
#ifdef YAPOR
if (SCH_top_shared_cp(B)) {
HR = HBREG = PROTECT_FROZEN_H(pt0);
YREG = (CELL *) pt0->cp_a1;
ENV = pt0->cp_env;
#ifdef DEPTH_LIMIT
DEPTH = pt0->cp_depth;
#endif /* DEPTH_LIMIT */
SCH_new_alternative(PREG, NULL);
}
else
#endif /* YAPOR */
{
B = pt0->cp_b;
HR = PROTECT_FROZEN_H(pt0);
YREG = (CELL *) pt0->cp_a1;
ENV = pt0->cp_env;
#ifdef DEPTH_LIMIT
DEPTH = pt0->cp_depth;
#endif /* DEPTH_LIMIT */
HBREG = PROTECT_FROZEN_H(B);
}
#ifdef YAPOR
PREG = NEXTOP(PREG, Osblp);
#else
PREG = NEXTOP(PREG, p);
#endif /* YAPOR */
SET_BB(PROTECT_FROZEN_B(B));
GONext();
ENDCHO(pt0);
ENDOp();
/************************************************************************\
* Pop operations *
\************************************************************************/
OpRW(pop_n, s);
/* write mode might have been called from read mode */
BEGD(d0);
d0 = PREG->y_u.os.s;
SP = (CELL *) (((char *) SP) + d0);
ENDD(d0);
BEGD(d0);
d0 = SP[0];
if (d0) {
START_PREFETCH(s);
SREG = (CELL *) (SP[1]);
SP += 2;
PREG = NEXTOP(PREG, s);
GONext();
END_PREFETCH();
}
else {
START_PREFETCH_W(s);
SREG = (CELL *) (SP[1]);
SP += 2;
PREG = NEXTOP(PREG, s);
GONextW();
END_PREFETCH_W();
}
ENDD(d0);
ENDOpRW();
OpRW(pop, e);
BEGD(d0);
d0 = SP[0];
SREG = (CELL *) (SP[1]);
SP += 2;
if (d0) {
START_PREFETCH(e);
PREG = NEXTOP(PREG, e);
GONext();
END_PREFETCH();
}
else {
START_PREFETCH_W(e);
PREG = NEXTOP(PREG, e);
GONextW();
END_PREFETCH_W();
}
ENDD(d0);
ENDOpRW();

View File

@ -52,52 +52,58 @@ Term
Yap_MkNewPairTerm(void)
{
CACHE_REGS
register CELL *p = H;
register CELL *p = HR;
RESET_VARIABLE(H);
RESET_VARIABLE(H+1);
H+=2;
RESET_VARIABLE(HR);
RESET_VARIABLE(HR+1);
HR+=2;
return (AbsPair(p));
}
/** compound term constructor, builds a compound term with functor f and n
* args.
*
*
* Room for the new term is allocated from the heap: the functor and arguments are copied there.
*
*/
Term
Yap_MkApplTerm(Functor f, unsigned int n, register Term *a)
/* build compound term with functor f and n
* args a */
{
Yap_MkApplTerm(Functor f, arity_t n, const Term *a)
{
CACHE_REGS
CELL *t = H;
CELL *t = HR;
if (n == 0)
return (MkAtomTerm(NameOfFunctor(f)));
if (f == FunctorList)
return MkPairTerm(a[0], a[1]);
*H++ = (CELL) f;
*HR++ = (CELL) f;
while (n--)
*H++ = (CELL) * a++;
*HR++ = * a++;
return (AbsAppl(t));
}
Term
Yap_MkNewApplTerm(Functor f, unsigned int n)
Yap_MkNewApplTerm(Functor f, arity_t n)
/* build compound term with functor f and n
* args a */
{
CACHE_REGS
CELL *t = H;
CELL *t = HR;
if (n == 0)
return (MkAtomTerm(NameOfFunctor(f)));
if (f == FunctorList) {
RESET_VARIABLE(H);
RESET_VARIABLE(H+1);
H+=2;
RESET_VARIABLE(HR);
RESET_VARIABLE(HR+1);
HR+=2;
return (AbsPair(t));
}
*H++ = (CELL) f;
*HR++ = (CELL) f;
while (n--) {
RESET_VARIABLE(H);
H++;
RESET_VARIABLE(HR);
HR++;
}
return (AbsAppl(t));
}
@ -113,7 +119,7 @@ Yap_Globalise(Term t)
if (!IsVarTerm(t))
return t;
vt = VarOfTerm(t);
if (vt <= H && vt > H0)
if (vt <= HR && vt > H0)
return t;
tn = MkVarTerm();
Yap_unify(t, tn);

1143
C/parser.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

1268
C/pl-yap.c

File diff suppressed because it is too large Load Diff

3339
C/prim_absmi_insts.h Normal file

File diff suppressed because it is too large Load Diff

874
C/qlyr.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

786
C/qlyw.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

129
C/range.c Normal file
View File

@ -0,0 +1,129 @@
/*************************************************************************
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V. Santos Costa and Universidade do Porto 1985-- *
* *
**************************************************************************
* *
* File: range.c *
* comments: Arithmetic interval computation *
* *
* *
* *
*************************************************************************/
#ifdef SCCS
static char SccsId[] = "%W% %G%";
#endif
#include "Yap.h"
#include "Yatom.h"
#include "YapHeap.h"
#include "YapEval.h"
static Int
p_in_range( USES_REGS1 ) {
Term t;
double i,j;
double d1;
double d2;
double d3;
t = Deref(ARG1);
if (IsFloatTerm(t)) i = FloatOfTerm(t); else i = IntegerOfTerm(t);
t = Deref(ARG4);
if (IsFloatTerm(t)) j = FloatOfTerm(t); else j = IntegerOfTerm(t);
d1 = i-j;
t = Deref(ARG2);
if (IsFloatTerm(t)) i = FloatOfTerm(t); else i = IntegerOfTerm(t);
t = Deref(ARG5);
if (IsFloatTerm(t)) j = FloatOfTerm(t); else j = IntegerOfTerm(t);
d2 = i-j;
t = Deref(ARG3);
if (IsFloatTerm(t)) i = FloatOfTerm(t); else i = IntegerOfTerm(t);
t = Deref(ARG6);
if (IsFloatTerm(t)) j = FloatOfTerm(t); else j = IntegerOfTerm(t);
d3 = i-j;
t = Deref(ARG7);
if (IsFloatTerm(t)) i = FloatOfTerm(t); else i = IntegerOfTerm(t);
t = Deref(ARG8);
if (IsFloatTerm(t)) j = FloatOfTerm(t); else j = IntegerOfTerm(t);
return fabs(sqrt(d1*d1 + d2*d2 + d3*d3)-i) <= j;
}
static Int
p_in_range2( USES_REGS1 ) {
CELL *p1, *p2;
Term t;
double i,j;
double d1;
double d2;
double d3;
UInt arity;
p1 = RepAppl(Deref(ARG1));
arity = ArityOfFunctor((Functor)*p1);
p1 += arity-2;
p2 = RepAppl(Deref(ARG2))+(arity-2);;
t = Deref(p1[0]);
if (IsFloatTerm(t)) i = FloatOfTerm(t); else i = IntegerOfTerm(t);
t = Deref(p2[0]);
if (IsFloatTerm(t)) j = FloatOfTerm(t); else j = IntegerOfTerm(t);
d1 = i-j;
t = Deref(p1[1]);
if (IsFloatTerm(t)) i = FloatOfTerm(t); else i = IntegerOfTerm(t);
t = Deref(p2[1]);
if (IsFloatTerm(t)) j = FloatOfTerm(t); else j = IntegerOfTerm(t);
d2 = i-j;
t = Deref(p1[2]);
if (IsFloatTerm(t)) i = FloatOfTerm(t); else i = IntegerOfTerm(t);
t = Deref(p2[2]);
if (IsFloatTerm(t)) j = FloatOfTerm(t); else j = IntegerOfTerm(t);
d3 = i-j;
t = Deref(ARG3);
if (IsFloatTerm(t)) i = FloatOfTerm(t); else i = IntegerOfTerm(t);
t = Deref(ARG4);
if (IsFloatTerm(t)) j = FloatOfTerm(t); else j = IntegerOfTerm(t);
return fabs(sqrt(d1*d1 + d2*d2 + d3*d3)-i) <= j;
}
static Int
p_euc_dist( USES_REGS1 ) {
Term t1 = Deref(ARG1);
Term t2 = Deref(ARG2);
double d1 = (double)(IntegerOfTerm(ArgOfTerm(1,t1))-IntegerOfTerm(ArgOfTerm(1,t2)));
double d2 = (double)(IntegerOfTerm(ArgOfTerm(2,t1))-IntegerOfTerm(ArgOfTerm(2,t2)));
double d3 = (double)(IntegerOfTerm(ArgOfTerm(3,t1))-IntegerOfTerm(ArgOfTerm(3,t2)));
Int result = (Int)sqrt(d1*d1+d2*d2+d3*d3);
return(Yap_unify(ARG3,MkIntegerTerm(result)));
}
#if DEBUG
volatile int loop_counter = 0;
static Int
p_loop( USES_REGS1 ) {
while (loop_counter == 0);
return(TRUE);
}
#endif
void
Yap_InitRange(void)
{
CACHE_REGS
Term cm = CurrentModule;
CurrentModule = RANGE_MODULE;
Yap_InitCPred("euclidean_distance", 3, p_euc_dist, SafePredFlag);
#ifdef DEBUG
Yap_InitCPred("loop", 0, p_loop, SafePredFlag);
#endif
Yap_InitCPred("in_range", 8, p_in_range, TestPredFlag|SafePredFlag);
Yap_InitCPred("in_range", 4, p_in_range2, TestPredFlag|SafePredFlag);
CurrentModule = cm;
}

178
C/realpath.c Normal file
View File

@ -0,0 +1,178 @@
<html>
<head>
<title>/var/www/vhosts/netmite.com/android/mydroid/bionic/libc/bionic/realpath.c</title>
</head>
<body bgcolor="#ffffff" text="#000000">
<pre>
<font color="#444444">/*
* Copyright (c) 1994
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Jan-Simon Pendry.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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 CAUSED 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.
*/</font>
<font color="0000ff"><strong>#if defined(LIBC_SCCS) &amp;&amp; !defined(lint)</strong></font>
<strong>static</strong> <strong>char</strong> <font color="#2040a0">sccsid</font><font color="4444FF">[</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#008000">&quot;@(#)realpath.c 8.1 (Berkeley) 2/16/94&quot;</font><font color="4444FF">;</font>
<strong>static</strong> <strong>char</strong> <font color="#2040a0">rcsid</font><font color="4444FF">[</font><font color="4444FF">]</font> <font color="4444FF">=</font>
<font color="#008000">&quot;$FreeBSD: /repoman/r/ncvs/src/lib/libc/stdlib/realpath.c,v 1.6.2.1 2003/08/03 23:47:39 nectar Exp $&quot;</font><font color="4444FF">;</font>
<font color="0000ff"><strong>#endif<font color="#444444"> /* LIBC_SCCS and not lint */</font></strong></font>
<font color="0000ff"><strong>#include <font color="#008000">&lt;sys/param.h&gt;</font></strong></font>
<font color="0000ff"><strong>#include <font color="#008000">&lt;sys/stat.h&gt;</font></strong></font>
<font color="0000ff"><strong>#include <font color="#008000">&lt;errno.h&gt;</font></strong></font>
<font color="0000ff"><strong>#include <font color="#008000">&lt;fcntl.h&gt;</font></strong></font>
<font color="0000ff"><strong>#include <font color="#008000">&lt;stdlib.h&gt;</font></strong></font>
<font color="0000ff"><strong>#include <font color="#008000">&lt;string.h&gt;</font></strong></font>
<font color="0000ff"><strong>#include <font color="#008000">&lt;unistd.h&gt;</font></strong></font>
<font color="#444444">/*
* char *realpath(const char *path, char resolved_path[MAXPATHLEN]);
*
* Find the real name of path, by removing all &quot;.&quot;, &quot;..&quot; and symlink
* components. Returns (resolved) on success, or (NULL) on failure,
* in which case the path which caused trouble is left in (resolved).
*/</font>
<strong>char</strong> <font color="4444FF">*</font>
<font color="#2040a0">realpath</font><font color="4444FF">(</font><font color="#2040a0">path</font>, <font color="#2040a0">resolved</font><font color="4444FF">)</font>
<strong>const</strong> <strong>char</strong> <font color="4444FF">*</font><font color="#2040a0">path</font><font color="4444FF">;</font>
<strong>char</strong> <font color="4444FF">*</font><font color="#2040a0">resolved</font><font color="4444FF">;</font>
<font color="4444FF"><strong>{</strong></font>
<strong>struct</strong> <font color="#2040a0">stat</font> <font color="#2040a0">sb</font><font color="4444FF">;</font>
<strong>int</strong> <font color="#2040a0">fd</font>, <font color="#2040a0">n</font>, <font color="#2040a0">rootd</font>, <font color="#2040a0">serrno</font><font color="4444FF">;</font>
<strong>char</strong> <font color="4444FF">*</font><font color="#2040a0">p</font>, <font color="4444FF">*</font><font color="#2040a0">q</font>, <font color="#2040a0">wbuf</font><font color="4444FF">[</font><font color="#2040a0">MAXPATHLEN</font><font color="4444FF">]</font><font color="4444FF">;</font>
<strong>int</strong> <font color="#2040a0">symlinks</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<font color="#444444">/* Save the starting point. */</font>
<strong>if</strong> <font color="4444FF">(</font><font color="4444FF">(</font><font color="#2040a0">fd</font> <font color="4444FF">=</font> <font color="#2040a0">open</font><font color="4444FF">(</font><font color="#008000">&quot;.&quot;</font>, <font color="#2040a0">O_RDONLY</font><font color="4444FF">)</font><font color="4444FF">)</font> <font color="4444FF">&lt;</font> <font color="#FF0000">0</font><font color="4444FF">)</font> <font color="4444FF"><strong>{</strong></font>
<font color="4444FF">(</font><strong>void</strong><font color="4444FF">)</font><font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">resolved</font>, <font color="#008000">&quot;.&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<strong>return</strong> <font color="4444FF">(</font><font color="#2040a0">NULL</font><font color="4444FF">)</font><font color="4444FF">;</font>
<font color="4444FF"><strong>}</strong></font>
<font color="#444444">/*
* Find the dirname and basename from the path to be resolved.
* Change directory to the dirname component.
* lstat the basename part.
* if it is a symlink, read in the value and loop.
* if it is a directory, then change to that directory.
* get the current directory name and append the basename.
*/</font>
<font color="4444FF">(</font><strong>void</strong><font color="4444FF">)</font><font color="#2040a0">strncpy</font><font color="4444FF">(</font><font color="#2040a0">resolved</font>, <font color="#2040a0">path</font>, <font color="#2040a0">MAXPATHLEN</font> <font color="4444FF">-</font> <font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font>
<font color="#2040a0">resolved</font><font color="4444FF">[</font><font color="#2040a0">MAXPATHLEN</font> <font color="4444FF">-</font> <font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#008000">'<font color="#77dd77">\0</font>'</font><font color="4444FF">;</font>
<font color="#2040a0">loop</font><font color="4444FF">:</font>
<font color="#2040a0">q</font> <font color="4444FF">=</font> <font color="#2040a0">strrchr</font><font color="4444FF">(</font><font color="#2040a0">resolved</font>, <font color="#008000">'/'</font><font color="4444FF">)</font><font color="4444FF">;</font>
<strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">q</font> <font color="4444FF">!</font><font color="4444FF">=</font> <font color="#2040a0">NULL</font><font color="4444FF">)</font> <font color="4444FF"><strong>{</strong></font>
<font color="#2040a0">p</font> <font color="4444FF">=</font> <font color="#2040a0">q</font> <font color="4444FF">+</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">q</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#2040a0">resolved</font><font color="4444FF">)</font>
<font color="#2040a0">q</font> <font color="4444FF">=</font> <font color="#008000">&quot;/&quot;</font><font color="4444FF">;</font>
<strong>else</strong> <font color="4444FF"><strong>{</strong></font>
<strong>do</strong> <font color="4444FF"><strong>{</strong></font>
<font color="4444FF">-</font><font color="4444FF">-</font><font color="#2040a0">q</font><font color="4444FF">;</font>
<font color="4444FF"><strong>}</strong></font> <strong>while</strong> <font color="4444FF">(</font><font color="#2040a0">q</font> <font color="4444FF">&gt;</font> <font color="#2040a0">resolved</font> <font color="4444FF">&amp;</font><font color="4444FF">&amp;</font> <font color="4444FF">*</font><font color="#2040a0">q</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#008000">'/'</font><font color="4444FF">)</font><font color="4444FF">;</font>
<font color="#2040a0">q</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#008000">'<font color="#77dd77">\0</font>'</font><font color="4444FF">;</font>
<font color="#2040a0">q</font> <font color="4444FF">=</font> <font color="#2040a0">resolved</font><font color="4444FF">;</font>
<font color="4444FF"><strong>}</strong></font>
<strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">chdir</font><font color="4444FF">(</font><font color="#2040a0">q</font><font color="4444FF">)</font> <font color="4444FF">&lt;</font> <font color="#FF0000">0</font><font color="4444FF">)</font>
<strong>goto</strong> <font color="#2040a0">err1</font><font color="4444FF">;</font>
<font color="4444FF"><strong>}</strong></font> <strong>else</strong>
<font color="#2040a0">p</font> <font color="4444FF">=</font> <font color="#2040a0">resolved</font><font color="4444FF">;</font>
<font color="#444444">/* Deal with the last component. */</font>
<strong>if</strong> <font color="4444FF">(</font><font color="4444FF">*</font><font color="#2040a0">p</font> <font color="4444FF">!</font><font color="4444FF">=</font> <font color="#008000">'<font color="#77dd77">\0</font>'</font> <font color="4444FF">&amp;</font><font color="4444FF">&amp;</font> <font color="#2040a0">lstat</font><font color="4444FF">(</font><font color="#2040a0">p</font>, <font color="4444FF">&amp;</font><font color="#2040a0">sb</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">)</font> <font color="4444FF"><strong>{</strong></font>
<strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">S_ISLNK</font><font color="4444FF">(</font><font color="#2040a0">sb</font>.<font color="#2040a0">st_mode</font><font color="4444FF">)</font><font color="4444FF">)</font> <font color="4444FF"><strong>{</strong></font>
<strong>if</strong> <font color="4444FF">(</font><font color="4444FF">+</font><font color="4444FF">+</font><font color="#2040a0">symlinks</font> <font color="4444FF">&gt;</font> <font color="#2040a0">MAXSYMLINKS</font><font color="4444FF">)</font> <font color="4444FF"><strong>{</strong></font>
<font color="#2040a0">errno</font> <font color="4444FF">=</font> <font color="#2040a0">ELOOP</font><font color="4444FF">;</font>
<strong>goto</strong> <font color="#2040a0">err1</font><font color="4444FF">;</font>
<font color="4444FF"><strong>}</strong></font>
<font color="#2040a0">n</font> <font color="4444FF">=</font> <font color="#2040a0">readlink</font><font color="4444FF">(</font><font color="#2040a0">p</font>, <font color="#2040a0">resolved</font>, <font color="#2040a0">MAXPATHLEN</font> <font color="4444FF">-</font> <font color="#FF0000">1</font><font color="4444FF">)</font><font color="4444FF">;</font>
<strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">n</font> <font color="4444FF">&lt;</font> <font color="#FF0000">0</font><font color="4444FF">)</font>
<strong>goto</strong> <font color="#2040a0">err1</font><font color="4444FF">;</font>
<font color="#2040a0">resolved</font><font color="4444FF">[</font><font color="#2040a0">n</font><font color="4444FF">]</font> <font color="4444FF">=</font> <font color="#008000">'<font color="#77dd77">\0</font>'</font><font color="4444FF">;</font>
<strong>goto</strong> <font color="#2040a0">loop</font><font color="4444FF">;</font>
<font color="4444FF"><strong>}</strong></font>
<strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">S_ISDIR</font><font color="4444FF">(</font><font color="#2040a0">sb</font>.<font color="#2040a0">st_mode</font><font color="4444FF">)</font><font color="4444FF">)</font> <font color="4444FF"><strong>{</strong></font>
<strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">chdir</font><font color="4444FF">(</font><font color="#2040a0">p</font><font color="4444FF">)</font> <font color="4444FF">&lt;</font> <font color="#FF0000">0</font><font color="4444FF">)</font>
<strong>goto</strong> <font color="#2040a0">err1</font><font color="4444FF">;</font>
<font color="#2040a0">p</font> <font color="4444FF">=</font> <font color="#008000">&quot;&quot;</font><font color="4444FF">;</font>
<font color="4444FF"><strong>}</strong></font>
<font color="4444FF"><strong>}</strong></font>
<font color="#444444">/*
* Save the last component name and get the full pathname of
* the current directory.
*/</font>
<font color="4444FF">(</font><strong>void</strong><font color="4444FF">)</font><font color="#2040a0">strcpy</font><font color="4444FF">(</font><font color="#2040a0">wbuf</font>, <font color="#2040a0">p</font><font color="4444FF">)</font><font color="4444FF">;</font>
<strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">getcwd</font><font color="4444FF">(</font><font color="#2040a0">resolved</font>, <font color="#2040a0">MAXPATHLEN</font><font color="4444FF">)</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">)</font>
<strong>goto</strong> <font color="#2040a0">err1</font><font color="4444FF">;</font>
<font color="#444444">/*
* Join the two strings together, ensuring that the right thing
* happens if the last component is empty, or the dirname is root.
*/</font>
<strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">resolved</font><font color="4444FF">[</font><font color="#FF0000">0</font><font color="4444FF">]</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#008000">'/'</font> <font color="4444FF">&amp;</font><font color="4444FF">&amp;</font> <font color="#2040a0">resolved</font><font color="4444FF">[</font><font color="#FF0000">1</font><font color="4444FF">]</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#008000">'<font color="#77dd77">\0</font>'</font><font color="4444FF">)</font>
<font color="#2040a0">rootd</font> <font color="4444FF">=</font> <font color="#FF0000">1</font><font color="4444FF">;</font>
<strong>else</strong>
<font color="#2040a0">rootd</font> <font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">;</font>
<strong>if</strong> <font color="4444FF">(</font><font color="4444FF">*</font><font color="#2040a0">wbuf</font><font color="4444FF">)</font> <font color="4444FF"><strong>{</strong></font>
<strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">strlen</font><font color="4444FF">(</font><font color="#2040a0">resolved</font><font color="4444FF">)</font> <font color="4444FF">+</font> <font color="#2040a0">strlen</font><font color="4444FF">(</font><font color="#2040a0">wbuf</font><font color="4444FF">)</font> <font color="4444FF">+</font> <font color="4444FF">(</font><font color="#FF0000">1</font><font color="4444FF">-</font><font color="#2040a0">rootd</font><font color="4444FF">)</font> <font color="4444FF">+</font> <font color="#FF0000">1</font> <font color="4444FF">&gt;</font>
<font color="#2040a0">MAXPATHLEN</font><font color="4444FF">)</font> <font color="4444FF"><strong>{</strong></font>
<font color="#2040a0">errno</font> <font color="4444FF">=</font> <font color="#2040a0">ENAMETOOLONG</font><font color="4444FF">;</font>
<strong>goto</strong> <font color="#2040a0">err1</font><font color="4444FF">;</font>
<font color="4444FF"><strong>}</strong></font>
<strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">rootd</font> <font color="4444FF">=</font><font color="4444FF">=</font> <font color="#FF0000">0</font><font color="4444FF">)</font>
<font color="4444FF">(</font><strong>void</strong><font color="4444FF">)</font><font color="#2040a0">strcat</font><font color="4444FF">(</font><font color="#2040a0">resolved</font>, <font color="#008000">&quot;/&quot;</font><font color="4444FF">)</font><font color="4444FF">;</font>
<font color="4444FF">(</font><strong>void</strong><font color="4444FF">)</font><font color="#2040a0">strcat</font><font color="4444FF">(</font><font color="#2040a0">resolved</font>, <font color="#2040a0">wbuf</font><font color="4444FF">)</font><font color="4444FF">;</font>
<font color="4444FF"><strong>}</strong></font>
<font color="#444444">/* Go back to where we came from. */</font>
<strong>if</strong> <font color="4444FF">(</font><font color="#2040a0">fchdir</font><font color="4444FF">(</font><font color="#2040a0">fd</font><font color="4444FF">)</font> <font color="4444FF">&lt;</font> <font color="#FF0000">0</font><font color="4444FF">)</font> <font color="4444FF"><strong>{</strong></font>
<font color="#2040a0">serrno</font> <font color="4444FF">=</font> <font color="#2040a0">errno</font><font color="4444FF">;</font>
<strong>goto</strong> <font color="#2040a0">err2</font><font color="4444FF">;</font>
<font color="4444FF"><strong>}</strong></font>
<font color="#444444">/* It's okay if the close fails, what's an fd more or less? */</font>
<font color="4444FF">(</font><strong>void</strong><font color="4444FF">)</font><font color="#2040a0">close</font><font color="4444FF">(</font><font color="#2040a0">fd</font><font color="4444FF">)</font><font color="4444FF">;</font>
<strong>return</strong> <font color="4444FF">(</font><font color="#2040a0">resolved</font><font color="4444FF">)</font><font color="4444FF">;</font>
<font color="#2040a0">err1</font><font color="4444FF">:</font> <font color="#2040a0">serrno</font> <font color="4444FF">=</font> <font color="#2040a0">errno</font><font color="4444FF">;</font>
<font color="4444FF">(</font><strong>void</strong><font color="4444FF">)</font><font color="#2040a0">fchdir</font><font color="4444FF">(</font><font color="#2040a0">fd</font><font color="4444FF">)</font><font color="4444FF">;</font>
<font color="#2040a0">err2</font><font color="4444FF">:</font> <font color="4444FF">(</font><strong>void</strong><font color="4444FF">)</font><font color="#2040a0">close</font><font color="4444FF">(</font><font color="#2040a0">fd</font><font color="4444FF">)</font><font color="4444FF">;</font>
<font color="#2040a0">errno</font> <font color="4444FF">=</font> <font color="#2040a0">serrno</font><font color="4444FF">;</font>
<strong>return</strong> <font color="4444FF">(</font><font color="#2040a0">NULL</font><font color="4444FF">)</font><font color="4444FF">;</font>
<font color="4444FF"><strong>}</strong></font>
</pre>
<hr>
syntax highlighted by <a href="http://www.palfrader.org/code2html">Code2HTML</a>, v. 0.9.1
</body>
</html>

1243
C/save.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

2540
C/scanner.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

451
C/signals.c Executable file
View File

@ -0,0 +1,451 @@
/*************************************************************************
* *
* YAP Prolog *
* *
* Yap Prolog was developed at NCCUP - Universidade do Porto *
* *
* Copyright L.Damas, V. Santos Costa and Universidade do Porto 1985-- *
* *
**************************************************************************
* *
* File: signal.c *
* comments: Signal Handling & Debugger Support *
* *
* *
* *
*************************************************************************/
#ifdef SCCS
static char SccsId[] = "%W% %G%";
#endif
#define HAS_CACHE_REGS 1
#include "Yap.h"
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if _WIN32
#include <io.h>
#include <stdio.h>
#endif
#include "YapEval.h"
#include "YapHeap.h"
#include "Yatom.h"
#include "yapio.h"
#ifdef TABLING
#include "tab.macros.h"
#endif /* TABLING */
#include <stdio.h>
#include <stdlib.h>
#if HAVE_STRING_H
#include <string.h>
#endif
#if HAVE_STRINGS_H
#include <strings.h>
#endif
#if HAVE_MALLOC_H
#include <malloc.h>
#endif
#include <wchar.h>
#ifdef LOW_LEVEL_TRACER
#include <tracer.h>
#endif
/*
* The InteractSIGINT function is called after a normal interrupt had been
* caught.
* It allows 6 possibilities: abort, continue, trace, debug, help, exit.
*/
static yap_signals InteractSIGINT(int ch) {
#ifdef HAVE_SETBUF
/* make sure we are not waiting for the end of line */
setbuf(stdin, NULL);
#endif
switch (ch) {
case 'a':
/* abort computation */
#if PUSH_REGS
// restore_absmi_regs(&Yap_standard_regs);
#endif
return YAP_ABORT_SIGNAL;
case 'b':
/* continue */
return YAP_BREAK_SIGNAL;
case 'c':
/* continue */
return YAP_NO_SIGNAL;
case 'd':
/* enter debug mode */
return YAP_DEBUG_SIGNAL;
case 'e':
/* exit */
Yap_exit(1);
return YAP_EXIT_SIGNAL;
case 'g':
/* stack dump */
return YAP_STACK_DUMP_SIGNAL;
case 't':
/* start tracing */
return YAP_TRACE_SIGNAL;
#ifdef LOW_LEVEL_TRACER
case 'T':
toggle_low_level_trace();
return YAP_NO_SIGNAL;
#endif
case 's':
/* show some statistics */
return YAP_STATISTICS_SIGNAL;
case EOF:
return YAP_NO_SIGNAL;
case 'h':
case '?':
default:
/* show an helpful message */
fprintf(stderr, "Please press one of:\n");
fprintf(stderr, " a for abort\n c for continue\n d for debug\n");
fprintf(stderr, " e for exit\n g for stack dump\n s for statistics\n t "
"for trace\n");
fprintf(stderr, " b for break\n");
return YAP_NO_SIGNAL;
}
}
/**
This function interacts with the user about a signal. We assume we are in
the context of the main Prolog thread (trivial in Unix, but hard in WIN32).
*/
static yap_signals ProcessSIGINT(void) {
CACHE_REGS
int ch, out;
#if _WIN32
if (!_isatty(0)) {
return YAP_INT_SIGNAL;
}
#elif HAVE_ISATTY
if (!isatty(0)) {
return YAP_INT_SIGNAL;
}
#endif
LOCAL_PrologMode |= AsyncIntMode;
do {
ch = Yap_GetCharForSIGINT();
} while (!(out = InteractSIGINT(ch)));
LOCAL_PrologMode &= ~AsyncIntMode;
return (out);
}
inline static void do_signal(int wid, yap_signals sig USES_REGS) {
#if THREADS
__sync_fetch_and_or(&REMOTE(wid)->Signals_, SIGNAL_TO_BIT(sig));
if (!REMOTE_InterruptsDisabled(wid)) {
REMOTE_ThreadHandle(wid).current_yaam_regs->CreepFlag_ =
Unsigned(REMOTE_ThreadHandle(wid).current_yaam_regs->LCL0_);
}
#else
LOCAL_Signals |= SIGNAL_TO_BIT(sig);
if (!LOCAL_InterruptsDisabled) {
CreepFlag = Unsigned(LCL0);
}
#endif
}
inline static bool get_signal(yap_signals sig USES_REGS) {
#if THREADS
uint64_t old;
// first, clear the Creep Flag, now if someone sets it it is their problem
CalculateStackGap(PASS_REGS1);
// reset the flag
if ((old = __sync_fetch_and_and(&LOCAL_Signals, ~SIGNAL_TO_BIT(sig))) !=
SIGNAL_TO_BIT(sig)) {
if (!LOCAL_InterruptsDisabled && LOCAL_Signals != 0) {
CreepFlag = (CELL)LCL0;
}
if (!(old & SIGNAL_TO_BIT(sig))) {
// not there?
return FALSE;
}
// more likely case, we have other interrupts.
return TRUE;
}
// success, we are good
return TRUE;
// should we set the flag?
#else
if (LOCAL_Signals & SIGNAL_TO_BIT(sig)) {
LOCAL_Signals &= ~SIGNAL_TO_BIT(sig);
if (!LOCAL_InterruptsDisabled && LOCAL_Signals != 0) {
CreepFlag = (CELL)LCL0;
} else {
CalculateStackGap(PASS_REGS1);
}
return TRUE;
} else {
return FALSE;
}
#endif
}
bool Yap_DisableInterrupts(int wid) {
LOCAL_InterruptsDisabled = true;
YAPEnterCriticalSection();
return true;
}
bool Yap_EnableInterrupts(int wid) {
LOCAL_InterruptsDisabled = false;
YAPLeaveCriticalSection();
return true;
}
/**
Function called to handle delayed interrupts.
*/
bool Yap_HandleSIGINT(void) {
CACHE_REGS
yap_signals sig;
do {
if ((sig = ProcessSIGINT()) != YAP_NO_SIGNAL)
do_signal(worker_id, sig PASS_REGS);
LOCAL_PrologMode &= ~InterruptMode;
return true;
} while (get_signal(YAP_INT_SIGNAL PASS_REGS));
return false;
}
static Int p_creep(USES_REGS1) {
Atom at;
PredEntry *pred;
at = AtomCreep;
pred = RepPredProp(PredPropByFunc(Yap_MkFunctor(at, 1), 0));
CreepCode = pred;
do_signal(worker_id, YAP_CREEP_SIGNAL PASS_REGS);
return TRUE;
}
static Int p_creep_fail(USES_REGS1) {
Atom at;
PredEntry *pred;
at = AtomCreep;
pred = RepPredProp(PredPropByFunc(Yap_MkFunctor(at, 1), 0));
CreepCode = pred;
do_signal(worker_id, YAP_CREEP_SIGNAL PASS_REGS);
return FALSE;
}
static Int stop_creeping(USES_REGS1) {
if (get_signal(YAP_CREEP_SIGNAL PASS_REGS)) {
return Yap_unify(ARG1, TermTrue);
}
return Yap_unify(ARG1, TermFalse);
}
static Int disable_debugging(USES_REGS1) {
get_signal(YAP_CREEP_SIGNAL PASS_REGS);
return true;
}
static Int creep_allowed(USES_REGS1) {
if (PP != NULL) {
get_signal(YAP_CREEP_SIGNAL PASS_REGS);
return true;
}
return false;
}
void Yap_signal(yap_signals sig) {
CACHE_REGS
do_signal(worker_id, sig PASS_REGS);
}
#ifdef DEBUG
static Int p_debug(USES_REGS1);
#endif
void Yap_external_signal(int wid, yap_signals sig) {
#if THREADS
REGSTORE *regcache = REMOTE_ThreadHandle(wid).current_yaam_regs;
#endif
do_signal(wid, sig PASS_REGS);
LOCAL_PrologMode &= ~InterruptMode;
}
int Yap_get_signal__(yap_signals sig USES_REGS) {
return get_signal(sig PASS_REGS);
}
// the caller holds the lock.
int Yap_has_signals__(yap_signals sig1, yap_signals sig2 USES_REGS) {
return LOCAL_Signals & (SIGNAL_TO_BIT(sig1) | SIGNAL_TO_BIT(sig2));
}
int Yap_only_has_signals__(yap_signals sig1, yap_signals sig2 USES_REGS) {
uint64_t sigs = LOCAL_Signals;
return sigs & (SIGNAL_TO_BIT(sig1) | SIGNAL_TO_BIT(sig2)) &&
!(sigs & ~(SIGNAL_TO_BIT(sig1) | SIGNAL_TO_BIT(sig2)));
}
#ifdef DEBUG
volatile int volat = 0;
static Int p_debug(USES_REGS1) { /* $debug(+Flag) */
int i = IntOfTerm(Deref(ARG1));
while (volat == 0) {
}
if (i >= 'a' && i <= 'z')
GLOBAL_Option[i - 96] = !GLOBAL_Option[i - 96];
return 1;
}
void Yap_loop(void);
void Yap_debug_end_loop(void);
void Yap_loop(void) {
while (volat == 0)
;
}
void Yap_debug_end_loop(void) { volat = 1; }
#endif
static Int first_signal(USES_REGS1) {
Atom at;
yap_signals sig;
while (TRUE) {
uint64_t mask = LOCAL_Signals;
if (mask == 0)
return FALSE;
#if HAVE___BUILTIN_FFSLL
sig = __builtin_ffsll(mask);
#elif HAVE_FFSLL
sig = ffsll(mask);
#else
sig = Yap_msb(mask PASS_REGS) + 1;
#endif
if (get_signal(sig PASS_REGS)) {
break;
}
}
loop:
switch (sig) {
case YAP_INT_SIGNAL:
sig = ProcessSIGINT();
if (sig == YAP_INT_SIGNAL) {
at = AtomSigInt;
break;
}
if (sig != YAP_NO_SIGNAL)
goto loop;
return FALSE;
case YAP_ABORT_SIGNAL:
/* abort computation */
LOCAL_PrologMode &= ~AsyncIntMode;
if (LOCAL_PrologMode & (GCMode | ConsoleGetcMode | CritMode)) {
LOCAL_PrologMode |= AbortMode;
return -1;
} else {
Yap_Error(ABORT_EVENT, TermNil, "abort from console");
}
Yap_RestartYap(1);
return FALSE;
case YAP_CREEP_SIGNAL:
at = AtomSigCreep;
break;
case YAP_TRACE_SIGNAL:
at = AtomSigTrace;
break;
case YAP_DEBUG_SIGNAL:
at = AtomSigDebug;
break;
case YAP_BREAK_SIGNAL:
at = AtomSigBreak;
break;
case YAP_FAIL_SIGNAL:
at = AtomFail;
break;
case YAP_STACK_DUMP_SIGNAL:
at = AtomSigStackDump;
break;
case YAP_STATISTICS_SIGNAL:
at = AtomSigStatistics;
break;
#ifdef SIGALRM
case YAP_ALARM_SIGNAL:
#endif
case YAP_WINTIMER_SIGNAL:
at = AtomSigAlarm;
break;
#ifdef SIGVTALRM
case YAP_VTALARM_SIGNAL:
at = AtomSigVTAlarm;
break;
#endif
case YAP_EXIT_SIGNAL:
Yap_exit(1);
return FALSE;
case YAP_WAKEUP_SIGNAL:
at = AtomSigWakeUp;
break;
case YAP_ITI_SIGNAL:
at = AtomSigIti;
break;
#ifdef SIGPIPE
case YAP_PIPE_SIGNAL:
at = AtomSigPipe;
break;
#endif
#ifdef SIGHUP
case YAP_HUP_SIGNAL:
at = AtomSigHup;
break;
#endif
#ifdef SIGUSR1
case YAP_USR1_SIGNAL:
at = AtomSigUsr1;
break;
#endif
#ifdef SIGUSR2
case YAP_USR2_SIGNAL:
at = AtomSigUsr2;
break;
#endif
#ifdef SIGFPE
case YAP_FPE_SIGNAL:
at = AtomSigFPE;
break;
#endif
default:
return FALSE;
}
return Yap_unify(ARG1, MkAtomTerm(at));
}
static Int continue_signals(USES_REGS1) { return first_signal(PASS_REGS1); }
void Yap_InitSignalCPreds(void) {
/* Basic predicates for the debugger */
Yap_InitCPred("$creep", 0, p_creep, SafePredFlag);
Yap_InitCPred("$creep_fail", 0, p_creep_fail, SafePredFlag);
Yap_InitCPred("$stop_creeping", 1, stop_creeping,
NoTracePredFlag | HiddenPredFlag | SafePredFlag);
Yap_InitCPred("$disable_debugging", 0, disable_debugging,
NoTracePredFlag | HiddenPredFlag | SafePredFlag);
Yap_InitCPred("$first_signal", 1, first_signal, SafePredFlag | SyncPredFlag);
Yap_InitCPred("$continue_signals", 0, continue_signals,
SafePredFlag | SyncPredFlag);
Yap_InitCPred("creep_allowed", 0, creep_allowed, 0);
#ifdef DEBUG
Yap_InitCPred("sys_debug", 1, p_debug, SafePredFlag | SyncPredFlag);
#endif
}
void *Yap_InitSignals(int wid) {
void *ptr = (void *)malloc(sizeof(UInt) * REMOTE_MaxActiveSignals(wid));
return ptr;
}

View File

@ -28,14 +28,14 @@
#define M_EVEN 0
#define M_ODD 1
STATIC_PROTO(Int build_new_list, (CELL *, Term CACHE_TYPE));
STATIC_PROTO(void simple_mergesort, (CELL *, Int, int));
STATIC_PROTO(Int compact_mergesort, (CELL *, Int, int));
STATIC_PROTO(int key_mergesort, (CELL *, Int, int, Functor));
STATIC_PROTO(void adjust_vector, (CELL *, Int));
STATIC_PROTO(Int p_sort, ( USES_REGS1 ));
STATIC_PROTO(Int p_msort, ( USES_REGS1 ));
STATIC_PROTO(Int p_ksort, ( USES_REGS1 ));
static Int build_new_list(CELL *, Term CACHE_TYPE);
static void simple_mergesort(CELL *, Int, int);
static Int compact_mergesort(CELL *, Int, int);
static int key_mergesort(CELL *, Int, int, Functor);
static void adjust_vector(CELL *, Int);
static Int p_sort( USES_REGS1 );
static Int p_msort( USES_REGS1 );
static Int p_ksort( USES_REGS1 );
/* copy to a new list of terms */
static Int
@ -58,12 +58,12 @@ build_new_list(CELL *pt, Term t USES_REGS)
}
pt += 2;
if (pt > ASP - 4096) {
if (!Yap_gcl((ASP-H)*sizeof(CELL), 2, ENV, gc_P(P,CP))) {
Yap_Error(OUT_OF_STACK_ERROR, TermNil, LOCAL_ErrorMessage);
if (!Yap_gcl((ASP-HR)*sizeof(CELL), 2, ENV, gc_P(P,CP))) {
Yap_ThrowError(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage);
return(FALSE);
}
t = Deref(ARG1);
pt = H;
pt = HR;
out = 0;
goto restart;
}
@ -267,14 +267,14 @@ Int compact_mergesort(CELL *pt, Int size, int my_p)
while (pt_left < end_pt_left && pt_right < end_pt_right) {
/* if the element to the left is larger than the one to the right */
Int cmp = Yap_compare_terms(pt_left[0], pt_right[0]);
if (cmp < 0) {
if (cmp < (Int)0) {
/* copy the one to the left */
pt[0] = pt_left[0];
/* and avance the two pointers */
pt += 2;
size ++;
pt_left += 2;
} else if (cmp == 0) {
} else if (cmp == (Int)0) {
/* otherwise, just skip one of them, anyone */
pt_left += 2;
} else {
@ -346,7 +346,7 @@ static Int
p_sort( USES_REGS1 )
{
/* use the heap to build a new list */
CELL *pt = H;
CELL *pt = HR;
Term out;
/* list size */
Int size;
@ -355,13 +355,13 @@ p_sort( USES_REGS1 )
return(FALSE);
if (size < 2)
return(Yap_unify(ARG1, ARG2));
pt = H; /* because of possible garbage collection */
pt = HR; /* because of possible garbage collection */
/* make sure no one writes on our temp data structure */
H += size*2;
HR += size*2;
/* reserve the necessary space */
size = compact_mergesort(pt, size, M_EVEN);
/* reajust space */
H = pt+size*2;
HR = pt+size*2;
adjust_vector(pt, size);
out = AbsPair(pt);
return(Yap_unify(out, ARG2));
@ -371,7 +371,7 @@ static Int
p_msort( USES_REGS1 )
{
/* use the heap to build a new list */
CELL *pt = H;
CELL *pt = HR;
Term out;
/* list size */
Int size;
@ -380,9 +380,9 @@ p_msort( USES_REGS1 )
return(FALSE);
if (size < 2)
return(Yap_unify(ARG1, ARG2));
pt = H; /* because of possible garbage collection */
pt = HR; /* because of possible garbage collection */
/* reserve the necessary space */
H += size*2;
HR += size*2;
simple_mergesort(pt, size, M_EVEN);
adjust_vector(pt, size);
out = AbsPair(pt);
@ -393,7 +393,7 @@ static Int
p_ksort( USES_REGS1 )
{
/* use the heap to build a new list */
CELL *pt = H;
CELL *pt = HR;
Term out;
/* list size */
Int size;
@ -403,8 +403,8 @@ p_ksort( USES_REGS1 )
if (size < 2)
return(Yap_unify(ARG1, ARG2));
/* reserve the necessary space */
pt = H; /* because of possible garbage collection */
H += size*2;
pt = HR; /* because of possible garbage collection */
HR += size*2;
if (!key_mergesort(pt, size, M_EVEN, FunctorMinus))
return(FALSE);
adjust_vector(pt, size);
@ -415,7 +415,7 @@ p_ksort( USES_REGS1 )
void
Yap_InitSortPreds(void)
{
Yap_InitCPred("$sort", 2, p_sort, HiddenPredFlag);
Yap_InitCPred("$msort", 2, p_msort, HiddenPredFlag);
Yap_InitCPred("$keysort", 2, p_ksort, HiddenPredFlag);
Yap_InitCPred("$sort", 2, p_sort, 0);
Yap_InitCPred("$msort", 2, p_msort, 0);
Yap_InitCPred("$keysort", 2, p_ksort, 0);
}

2362
C/stack.c Normal file

File diff suppressed because it is too large Load Diff

1159
C/stackinfo.c Normal file

File diff suppressed because it is too large Load Diff

4822
C/stdpreds.c Normal file → Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

1479
C/terms.c Normal file

File diff suppressed because it is too large Load Diff

1270
C/text.c Normal file

File diff suppressed because it is too large Load Diff

1257
C/text.c.new Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

14572
C/traced_absmi_insts.h Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More