Compare commits
5062 Commits
Author | SHA1 | Date |
---|---|---|
Vítor Santos Costa | 6d018bbf2c | |
Vítor Santos Costa | 92181e534e | |
Vítor Santos Costa | d76fa9ca3d | |
Vitor Santos Costa | e6ffe9c2a0 | |
Vitor Santos Costa | ef8e9a2ea3 | |
Vitor Santos Costa | 07cd79ccb7 | |
Vitor Santos Costa | 8f8da92603 | |
Vitor Santos Costa | 60adbb9a75 | |
Vítor Santos Costa | ee12fea7cd | |
Vitor Santos Costa | e96aea3340 | |
Vítor Santos Costa | db7047249c | |
Vitor Santos Costa | 0036e3632e | |
Vitor Santos Costa | 402e6cab55 | |
Vítor Santos Costa | 1a6e97655b | |
Vitor Santos Costa | e7535dd2ee | |
Vitor Santos Costa | 8c3c3f921c | |
Vitor Santos Costa | 52da71cee7 | |
Vitor Santos Costa | 69dc2a963c | |
Vítor Santos Costa | 0e47ddc802 | |
Vítor Santos Costa | c3a254e44d | |
Vitor Santos Costa | 0949f6b494 | |
Vítor Santos Costa | 552cefbcd0 | |
Vitor Santos Costa | ef226da706 | |
Vitor Santos Costa | 5382d4739c | |
Vítor Santos Costa | d3e3515a5f | |
Vítor Santos Costa | 920b63c6bc | |
Vitor Santos Costa | ef3d435dec | |
Vítor Santos Costa | 60890fbf0b | |
Vítor Santos Costa | fb73f42d26 | |
Vítor Santos Costa | 203c064b03 | |
Vitor Santos Costa | babf3dd77d | |
Vitor Santos Costa | 46b9b46bca | |
Vítor Santos Costa | 4d395761a4 | |
Vitor Santos Costa | e23055d4f0 | |
Vitor Santos Costa | adf6ffd2a6 | |
Vítor Santos Costa | 937189ab9e | |
Vítor Santos Costa | 008c091e3c | |
Vitor Santos Costa | 874f621477 | |
Vitor Santos Costa | 91a79d778b | |
Vitor Santos Costa | 644606d8bb | |
Vitor Santos Costa | 86d6751c98 | |
Vitor Santos Costa | c91faf8bc3 | |
Vitor Santos Costa | 7c16af4edf | |
Vitor Santos Costa | 54a222e5df | |
Vitor Santos Costa | 984cf8a07c | |
Vitor Santos Costa | dc5b90a643 | |
Vitor Santos Costa | 5f819fd7b4 | |
Vitor Santos Costa | b97338f84d | |
Vitor Santos Costa | a87654b0b0 | |
Vitor Santos Costa | 71fc7238ff | |
Vitor Santos Costa | b1b6afe801 | |
Vitor Santos Costa | 16015bd8e6 | |
Vitor Santos Costa | 73b6dd4fac | |
Vitor Santos Costa | 6a65977b0f | |
Vitor Santos Costa | 1f7835c5ef | |
Vitor Santos Costa | 9101620974 | |
Vitor Santos Costa | d8b4d1c878 | |
Vítor Santos Costa | 7d85bbfa27 | |
Vitor Santos Costa | 9172f2994b | |
Vitor Santos Costa | 8070e65354 | |
Vitor Santos Costa | e7a2195af6 | |
Vítor Santos Costa | 8da14e339a | |
Vítor Santos Costa | 1739529c8b | |
Vitor Santos Costa | fda10395b8 | |
Vitor Santos Costa | 9ea395c031 | |
Vitor Santos Costa | 1cde9d0eed | |
Vitor Santos Costa | 31743139b0 | |
Vitor Santos Costa | cab11f5205 | |
Vitor Santos Costa | 0f1eaa827a | |
Vitor Santos Costa | 186c156a4a | |
Vitor Santos Costa | 30a332b671 | |
Vítor Santos Costa | 3bfaee9226 | |
Vítor Santos Costa | 0b5a5a33bb | |
Vitor Santos Costa | d306a1bf0c | |
Vítor Santos Costa | 07c8c6d7b1 | |
Vítor Santos Costa | d72770a18c | |
Vítor Santos Costa | ead29987d6 | |
Vitor Santos Costa | c840e9cabb | |
Vitor Santos Costa | 13982dcc94 | |
Vítor Santos Costa | 299a1edf8b | |
Vítor Santos Costa | a237596736 | |
Vitor Santos Costa | b5205f1193 | |
Vitor Santos Costa | 57cc6ab170 | |
Vitor Santos Costa | c04298c1d7 | |
Vítor Santos Costa | 134288da68 | |
Vítor Santos Costa | 03232f53ce | |
Vitor Santos Costa | 10307c27fe | |
Vitor Santos Costa | f54989e03e | |
Vitor Santos Costa | 644a9ad852 | |
Vítor Santos Costa | 63a514cad5 | |
Vitor Santos Costa | 9156b90b66 | |
Vitor Santos Costa | b24df86cb0 | |
Vitor Santos Costa | 2f1eb61cf9 | |
Vitor Santos Costa | 0112ad9c20 | |
Vitor Santos Costa | 4926067be9 | |
Vitor Santos Costa | 4dff2ad2ec | |
Vítor Santos Costa | 3f9e57fc48 | |
Vitor Santos Costa | 2af4dae017 | |
Vitor Santos Costa | de153bd479 | |
Vitor Santos Costa | c50367325e | |
Vitor Santos Costa | 78473ddd2c | |
Vitor Santos Costa | 7383ff79cc | |
Vitor Santos Costa | b7cd534d80 | |
Vitor Santos Costa | c0f7dfe3c3 | |
Vitor Santos Costa | 69fcc9494c | |
Vitor Santos Costa | 953667db21 | |
Vitor Santos Costa | 25afc1477c | |
Vitor Santos Costa | 9980dd49a7 | |
Vitor Santos Costa | e626847e93 | |
Vítor Santos Costa | 044d455597 | |
Vitor Santos Costa | 96a40f1d50 | |
Vitor Santos Costa | 70a43ece1d | |
Vitor Santos Costa | e8d9e71a4e | |
Vitor Santos Costa | d10589d60f | |
Vitor Santos Costa | 044329d115 | |
Vítor Santos Costa | 6825c3e2ac | |
Vitor Santos Costa | e3c399af48 | |
Vitor Santos Costa | e5e38551e0 | |
Vítor Santos Costa | 47b13c3836 | |
Vitor Santos Costa | 4afbc4461c | |
Vítor Santos Costa | 56c4220cf6 | |
Vítor Santos Costa | 4d2b18908d | |
Vitor Santos Costa | ab56074bb1 | |
Vítor Santos Costa | 9378622d42 | |
Vitor Santos Costa | 32a5158c6b | |
Vitor Santos Costa | 21ff73dd70 | |
Vitor Santos Costa | 7ab1624401 | |
Vitor Santos Costa | ae426a3b27 | |
Vitor Santos Costa | 5ec424645d | |
Vitor Santos Costa | 3f4fd7d7a3 | |
Vitor Santos Costa | ff61ab9953 | |
Vitor Santos Costa | 908cfe3b77 | |
Vítor Santos Costa | 5ff09fbf26 | |
Vitor Santos Costa | 8d30742d8f | |
Vitor Santos Costa | facf7ae8cd | |
Vitor Santos Costa | 2d65d0463c | |
Vitor Santos Costa | 5d7c6378e7 | |
Vitor Santos Costa | ccfbe3f809 | |
Vítor Santos Costa | 7dca1f1390 | |
Vitor Santos Costa | 84721e1005 | |
Vitor Santos Costa | c248ef9ccf | |
Vitor Santos Costa | cb0f5ec4db | |
Vitor Santos Costa | f483838610 | |
Vitor Santos Costa | c792db26be | |
Vitor Santos Costa | 79d2330e71 | |
Vitor Santos Costa | 6a3c4bda79 | |
Vitor Santos Costa | 2c1565ac0e | |
Vitor Santos Costa | 5c41c509c0 | |
Vítor Santos Costa | 1ef3f738ee | |
Vitor Santos Costa | 1bd2f0338c | |
Vitor Santos Costa | 90f5720fb0 | |
Vítor Santos Costa | 244d04f90b | |
Vitor Santos Costa | 4b5ae9331f | |
Vítor Santos Costa | 593877f39d | |
Vitor Santos Costa | 302519868f | |
Vitor Santos Costa | 71940dec67 | |
Vitor Santos Costa | 394ecd4657 | |
Vítor Santos Costa | 76b4ddee9c | |
Vitor Santos Costa | c4b78e161b | |
Vitor Santos Costa | 2c80e33c6a | |
Vitor Santos Costa | ac60bee30d | |
Vitor Santos Costa | 3fdc260ee6 | |
Vitor Santos Costa | 24b6908225 | |
Vitor Santos Costa | d0f05d3578 | |
Vitor Santos Costa | 4678b2baee | |
Vitor Santos Costa | 933db5bc7e | |
Vitor Santos Costa | 4092003cd6 | |
Vitor Santos Costa | e5945b8e8b | |
Vitor Santos Costa | 4bc0292ad6 | |
Vítor Santos Costa | 3b8475f882 | |
Vitor Santos Costa | cb4d17cb4f | |
Vitor Santos Costa | d874dc5857 | |
Vitor Santos Costa | 7045b6ef36 | |
Vitor Santos Costa | 208438f0d0 | |
Vítor Santos Costa | 38610c0b0d | |
Vítor Santos Costa | fa96ffa932 | |
Vitor Santos Costa | ca2542c798 | |
Vitor Santos Costa | b382c060e3 | |
Vitor Santos Costa | f6b16ca505 | |
Vitor Santos Costa | b71b4f6fca | |
Vitor Santos Costa | c1dc6b7fb2 | |
Vitor Santos Costa | f7ed109d1c | |
Vitor Santos Costa | 847edfd432 | |
Vitor Santos Costa | 0507d80403 | |
Vítor Santos Costa | dfe0698f03 | |
Vitor Santos Costa | 55ea7d35a3 | |
Vitor Santos Costa | 09d8d07b7e | |
Vitor Santos Costa | 7f71184785 | |
Vitor Santos Costa | 36fedfa321 | |
Vitor Santos Costa | 13d764067f | |
Vitor Santos Costa | 5ec9e31eb9 | |
Vitor Santos Costa | b395177faa | |
Vitor Santos Costa | 700d6ae707 | |
Vitor Santos Costa | 650653cc64 | |
Vítor Santos Costa | bfe5fc2f49 | |
Vítor Santos Costa | 93bb39d5f7 | |
Vitor Santos Costa | a3dd1a1520 | |
Vitor Santos Costa | 92089074f1 | |
Vítor Santos Costa | e0467d95d4 | |
Vitor Santos Costa | 2a090f3484 | |
Vitor Santos Costa | a6d709dabf | |
Vitor Santos Costa | 8ce648422a | |
Vitor Santos Costa | c682058942 | |
Vitor Santos Costa | daa86e9c34 | |
Vitor Santos Costa | 17a75d79ff | |
Vitor Santos Costa | 1c4e272b1d | |
Vítor Santos Costa | 36b376d447 | |
Vítor Santos Costa | e83d1f9d43 | |
Vítor Santos Costa | 4aaad2b221 | |
Vitor Santos Costa | 86decdddde | |
Vitor Santos Costa | 8e2864c0cf | |
Vitor Santos Costa | 670bfd421d | |
Vítor Santos Costa | c21c0079dc | |
Vitor Santos Costa | 29c004d62a | |
Vitor Santos Costa | 6451328782 | |
Vitor Santos Costa | c2ebd2857c | |
Vitor Santos Costa | 9e1a2ad41e | |
Vitor Santos Costa | 3f1c2352f3 | |
Vitor Santos Costa | 3699a715ce | |
Vitor Santos Costa | d08c56fb56 | |
Vitor Santos Costa | 664c17f3b3 | |
Vitor Santos Costa | 7c1a6c9cef | |
Vitor Santos Costa | 92994fb0e4 | |
Vitor Santos Costa | 31423fcf90 | |
Vitor Santos Costa | f0a6018a00 | |
Vitor Santos Costa | 5b96e59311 | |
Vitor Santos Costa | 37d5dcedc1 | |
Vitor Santos Costa | 3fa4bfbcb2 | |
Vitor Santos Costa | 890f77d698 | |
Vitor Santos Costa | e66c3ab7cc | |
Vitor Santos Costa | 705cb09f8d | |
Vítor Santos Costa | 44be8cf600 | |
Vitor Santos Costa | 473132c3ec | |
Vitor Santos Costa | 7e84455117 | |
Vitor Santos Costa | afe5780fc1 | |
Vitor Santos Costa | 13a6cc8ece | |
Vitor Santos Costa | 18e437f038 | |
Vítor Santos Costa | ad57c3cad0 | |
Vítor Santos Costa | d0418167a1 | |
Vitor Santos Costa | 1797e5132e | |
Vítor Santos Costa | 45f388156c | |
Vitor Santos Costa | 6372151bf1 | |
Vitor Santos Costa | 000c9c0968 | |
Vitor Santos Costa | 87a568291b | |
Vitor Santos Costa | b73a1f05ba | |
Vitor Santos Costa | 3d8858954d | |
Vitor Santos Costa | 3a8738a7db | |
Vitor Santos Costa | 9dc86c735b | |
Vitor Santos Costa | 66167abba6 | |
Vitor Santos Costa | b87f0c79e9 | |
Vitor Santos Costa | 4f7a5809d5 | |
Vitor Santos Costa | 286432a849 | |
Vitor Santos Costa | 91a5f0d1c3 | |
Vítor Santos Costa | 81e37d5ce0 | |
Vitor Santos Costa | 0230ff35d1 | |
Vitor Santos Costa | 999de8df19 | |
Vitor Santos Costa | 9be6eb9132 | |
Vitor Santos Costa | 5fdd481d6c | |
Vitor Santos Costa | b7cdaa10ec | |
Vitor Santos Costa | 556fdefe83 | |
Vitor Santos Costa | e2863854a9 | |
Vitor Santos Costa | e528893b73 | |
Vitor Santos Costa | cb8c37ce56 | |
Vitor Santos Costa | 40633a3f83 | |
Vitor Santos Costa | 17411a7384 | |
Vitor Santos Costa | 9b31c93a46 | |
Vitor Santos Costa | e89bc55b9f | |
Vítor Santos Costa | 27227b75c7 | |
Vítor Santos Costa | 2df29817c8 | |
Vítor Santos Costa | 50e1d90085 | |
Vitor Santos Costa | fc65bd6924 | |
Vitor Santos Costa | 4fed99c0aa | |
Vitor Santos Costa | cb5dc1313a | |
Vitor Santos Costa | 337bf7b136 | |
Vitor Santos Costa | b1635505ef | |
Vítor Santos Costa | eb1dfc43b7 | |
Vítor Santos Costa | d297a8834e | |
Vítor Santos Costa | 8d226bbfde | |
Vítor Santos Costa | 54e16f6f19 | |
Vitor Santos Costa | 55ebeb7dd8 | |
Vitor Santos Costa | 76cfa609c2 | |
Vitor Santos Costa | a1f8631844 | |
Vitor Santos Costa | 0f313755cc | |
Vitor Santos Costa | 4a0dd26ecb | |
Vitor Santos Costa | a6090a61ab | |
Vítor Santos Costa | 52bb6a92f1 | |
Vítor Santos Costa | 8e1945ad63 | |
Vitor Santos Costa | 004bbef62b | |
Vitor Santos Costa | a491f71cb0 | |
Vitor Santos Costa | 0d8e28af3e | |
Vitor Santos Costa | 670c2cbf13 | |
Vitor Santos Costa | 5b21bc118f | |
Vitor Santos Costa | ebd4dffed3 | |
Vitor Santos Costa | 7381bf0d84 | |
Vitor Santos Costa | a7fe5683a8 | |
Vitor Santos Costa | 408c15f5eb | |
Vitor Santos Costa | 563b642672 | |
Vítor Santos Costa | e163ccb6c0 | |
Vítor Santos Costa | f0260d2978 | |
Vitor Santos Costa | 3df0110947 | |
Vitor Santos Costa | e1bec5454d | |
vscosta | e4dc9c2e9f | |
vscosta | 18dad4d7e9 | |
vscosta | da6bd115d8 | |
Vítor Santos Costa | 37d9810a99 | |
Vitor Santos Costa | 37212efc55 | |
Vitor Santos Costa | 4bbf6f0367 | |
Vitor Santos Costa | eed36e99a6 | |
Vítor Santos Costa | 0d47af2ad9 | |
Vitor Santos Costa | 5f989e58b2 | |
Vítor Santos Costa | fbcd45bdfe | |
Vítor Santos Costa | 7986e21d59 | |
Vitor Santos Costa | e117d51d98 | |
Vitor Santos Costa | ced5916aa8 | |
Vitor Santos Costa | 8fcf3eb008 | |
Vitor Santos Costa | 3786de19de | |
Vítor Santos Costa | b4bd6b4ba8 | |
Vitor Santos Costa | 45439b8b86 | |
Vitor Santos Costa | 868961ebb5 | |
Vitor Santos Costa | c59b01e53c | |
Vitor Santos Costa | 3fdbbc6a77 | |
Vitor Santos Costa | 68ce1fd045 | |
Vitor Santos Costa | b31493c777 | |
Vitor Santos Costa | 127ebb2523 | |
Vitor Santos Costa | b41986ee3c | |
Vitor Santos Costa | 70cb6ed01e | |
Vitor Santos Costa | a03aa3c27c | |
Vitor Santos Costa | de03a9da58 | |
Vitor Santos Costa | ac41673000 | |
Vitor Santos Costa | d4cdb52f2b | |
Vitor Santos Costa | 5d69b09688 | |
Vitor Santos Costa | 50fb5d21c0 | |
Vitor Santos Costa | 9dac6e9612 | |
Vitor Santos Costa | c386e9d9f6 | |
Vitor Santos Costa | e747b7f9c1 | |
Vitor Santos Costa | a33f2be18b | |
Vitor Santos Costa | 7772699ef7 | |
Vítor Santos Costa | 67cc23725f | |
Vítor Santos Costa | 6096c6407a | |
Vítor Santos Costa | 7666a005dc | |
Vitor Santos Costa | cb1c73c973 | |
Vítor Santos Costa | 32266a8b98 | |
Vitor Santos Costa | 9e3a768220 | |
Vítor Santos Costa | 48e398576f | |
Vitor Santos Costa | 50feadc341 | |
Vitor Santos Costa | be12fb92d6 | |
Vitor Santos Costa | 3d5303529f | |
Vitor Santos Costa | 6d0b702d1c | |
Vitor Santos Costa | ba6e0728ae | |
Vitor Santos Costa | 4f292cb521 | |
Vitor Santos Costa | 5ea98bcf53 | |
Vítor Santos Costa | d0ed3cfe25 | |
Vitor Santos Costa | 50b13a15a0 | |
Vitor Santos Costa | f57377a23a | |
Vitor Santos Costa | 724681dde8 | |
Vítor Santos Costa | cbc90a8293 | |
Vitor Santos Costa | 990a86512d | |
Vitor Santos Costa | a01ba3383b | |
Vitor Santos Costa | 87c6971bb6 | |
Vítor Santos Costa | 13d609867c | |
Vítor Santos Costa | f6ca094534 | |
Vítor Santos Costa | b6235d8ecd | |
Vítor Santos Costa | a6e578090c | |
Vítor Santos Costa | 7661b8581c | |
Vítor Santos Costa | a2d397976f | |
Vitor Santos Costa | bde725e016 | |
Vítor Santos Costa | 29f79473e5 | |
Vitor Santos Costa | 9ec1ffb2c7 | |
Vitor Santos Costa | 46a32fbd83 | |
Vitor Santos Costa | f8d0703983 | |
Vítor Santos Costa | 290ee932ed | |
Vítor Santos Costa | b64853fd1a | |
Vitor Santos Costa | a079139060 | |
Vítor Santos Costa | 46247bca56 | |
Vitor Santos Costa | 724dfee44a | |
Vitor Santos Costa | 059c406fd9 | |
Vitor Santos Costa | 81998122a8 | |
Vitor Santos Costa | 5c8f8457fa | |
Vítor Santos Costa | f6d8304fcf | |
Vitor Santos Costa | e0cc401381 | |
Vitor Santos Costa | f1066036ff | |
Vitor Santos Costa | 1e7ee487b6 | |
Vitor Santos Costa | 63e4b31787 | |
Vitor Santos Costa | d4eea0fbb4 | |
Vitor Santos Costa | 3344dcaf7d | |
Vitor Santos Costa | 244ee465c4 | |
Vitor Santos Costa | dc6a21dbc5 | |
Vitor Santos Costa | 208ed54b45 | |
Vitor Santos Costa | f329a715dd | |
Vitor Santos Costa | ecab37f72c | |
Vitor Santos Costa | d5c1ca716e | |
Vitor Santos Costa | af7584e1f3 | |
Vitor Santos Costa | 4a28e5861a | |
Vitor Santos Costa | 3b186a064a | |
Vitor Santos Costa | 015efac6df | |
Vítor Santos Costa | 1fbd0c49ba | |
Vítor Santos Costa | 4a048aad7d | |
Vitor Santos Costa | 1668763b19 | |
Vitor Santos Costa | 8196666cdc | |
Vitor Santos Costa | 6cdd35b6e1 | |
Vitor Santos Costa | 05733938c1 | |
Vitor Santos Costa | f6596da27d | |
Vitor Santos Costa | a36a0e2e45 | |
Vitor Santos Costa | 24014ded21 | |
Vitor Santos Costa | e455d6cc6a | |
Vitor Santos Costa | 8f5fd1ddc2 | |
Vitor Santos Costa | cfaedf5db4 | |
Vitor Santos Costa | 55b2325b2e | |
Vitor Santos Costa | 22cefb0b9c | |
Vitor Santos Costa | 828a5ec1e9 | |
Vitor Santos Costa | bf712034a9 | |
Vitor Santos Costa | 436f1c205a | |
Vitor Santos Costa | bac1b63080 | |
Vitor Santos Costa | b4201dd0f3 | |
Vitor Santos Costa | 0c950ce5b3 | |
Vitor Santos Costa | 562e9e5af3 | |
Vitor Santos Costa | abc11dcfaa | |
Vitor Santos Costa | e5748f3c9f | |
Vitor Santos Costa | 37992c77be | |
Vitor Santos Costa | 69e0c739e8 | |
Vitor Santos Costa | 52d69d3c06 | |
Vitor Santos Costa | 4b3aedccb5 | |
Vitor Santos Costa | 94621bf8f2 | |
Vitor Santos Costa | 2a1ec9c36b | |
Vitor Santos Costa | ec61b3907e | |
Vitor Santos Costa | 86c71b6da7 | |
Vítor Santos Costa | 04fa39126c | |
Vitor Santos Costa | 069fcc875c | |
Vitor Santos Costa | 6a70362a15 | |
Vítor Santos Costa | 3efb73f35d | |
Vítor Santos Costa | 4b474574d8 | |
Vitor Santos Costa | 4fff363436 | |
Vitor Santos Costa | 4de58e0fe4 | |
Vitor Santos Costa | 7b774ef5cd | |
Vitor Santos Costa | 101bdf0f6c | |
Vítor Santos Costa | c2e2ec8fcf | |
Vítor Santos Costa | aed15571ff | |
Vitor Santos Costa | 2e8dd92d89 | |
Vitor Santos Costa | 387d7cc3fb | |
Vitor Santos Costa | 064b84895e | |
Vitor Santos Costa | ba00e98ad8 | |
Vitor Santos Costa | c93944192e | |
Vitor Santos Costa | db9823d5ef | |
Vitor Santos Costa | fb13a127b0 | |
Vítor Santos Costa | 2905688c0f | |
Vítor Santos Costa | ae35c229e8 | |
Vitor Santos Costa | 260dcbe754 | |
Vitor Santos Costa | 8e43a02789 | |
Vitor Santos Costa | 75b7cebdaf | |
Vitor Santos Costa | 3bf897c503 | |
Vitor Santos Costa | 21a7a3ef44 | |
Vitor Santos Costa | 48540ccc78 | |
Vitor Santos Costa | 176dc4bfb5 | |
Vitor Santos Costa | e2a46cf423 | |
Vitor Santos Costa | fd492b5b16 | |
Vitor Santos Costa | 71aed8b870 | |
Vitor Santos Costa | 53de04c38f | |
Vitor Santos Costa | 5f96c07131 | |
Vitor Santos Costa | c5de0d647c | |
Vitor Santos Costa | 6c1d3d1a95 | |
Vitor Santos Costa | d3370ee141 | |
Vitor Santos Costa | af1fcdac19 | |
Vitor Santos Costa | 1caeb168e9 | |
Vitor Santos Costa | cdd892c012 | |
Vitor Santos Costa | f2d6c99c8a | |
Vitor Santos Costa | 0c946038d5 | |
Vitor Santos Costa | 8911fea5ae | |
Vitor Santos Costa | e97ea388f8 | |
Vitor Santos Costa | 0ca40875db | |
Vitor Santos Costa | 0bfc4d4525 | |
Vitor Santos Costa | f6c8e204c7 | |
Vitor Santos Costa | 510ba1b804 | |
Vitor Santos Costa | 1fcc88865b | |
Vitor Santos Costa | 4495bb2661 | |
Vitor Santos Costa | edc7d2ceb4 | |
Vitor Santos Costa | 81b165d3dc | |
Vitor Santos Costa | 52df4c02ac | |
Vitor Santos Costa | 25faa8f67c | |
Vitor Santos Costa | 58136ead22 | |
Vitor Santos Costa | 3e5cd4b4f1 | |
Vitor Santos Costa | 18c74933af | |
Vitor Santos Costa | d5b96ef518 | |
Vitor Santos Costa | eb43305a38 | |
Vitor Santos Costa | 41bea46575 | |
Vitor Santos Costa | ff2b867ec3 | |
Vitor Santos Costa | 7522e54a2e | |
Vitor Santos Costa | c092d0f62b | |
Vitor Santos Costa | fd4f53a899 | |
Vitor Santos Costa | 4fefb762f2 | |
Vitor Santos Costa | d92191874a | |
Vitor Santos Costa | 87f4092c19 | |
Vitor Santos Costa | 8ab005480f | |
Vitor Santos Costa | ca814eef07 | |
Vitor Santos Costa | f0343fc62c | |
Vitor Santos Costa | a4dd2efbe7 | |
Vitor Santos Costa | a6acc8e9e6 | |
Vitor Santos Costa | 521a5df611 | |
Vitor Santos Costa | d2024c1aed | |
Vitor Santos Costa | 59534a04f6 | |
Vitor Santos Costa | 54c6b8c041 | |
Vitor Santos Costa | 2d55f41ef6 | |
Vitor Santos Costa | 40096b3fdc | |
Vitor Santos Costa | 840eb3b0fd | |
Vitor Santos Costa | 1201357017 | |
Vitor Santos Costa | 72a703393f | |
Vitor Santos Costa | 19fef7d6ac | |
Vitor Santos Costa | 08ece03f4a | |
Vitor Santos Costa | 94a826efcc | |
Vitor Santos Costa | 725a0a692a | |
Vitor Santos Costa | 7325407d23 | |
Vitor Santos Costa | bbd0122fc3 | |
Vitor Santos Costa | 9afb5b07b2 | |
Vítor Santos Costa | 8cfeb53e77 | |
Vitor Santos Costa | e9274ef5d3 | |
Vitor Santos Costa | 2415a2e58c | |
Vitor Santos Costa | b59af58616 | |
Vitor Santos Costa | eeb8f7c6a1 | |
Vítor Santos Costa | 4fe08fd82a | |
Vitor Santos Costa | c4a0d5766b | |
Vítor Santos Costa | 8c3bea4bce | |
Vítor Santos Costa | 7c934d3f40 | |
Vitor Santos Costa | bb2d06fac9 | |
Vitor Santos Costa | ebe4ba266e | |
Vitor Santos Costa | 30a3b72d62 | |
Vitor Santos Costa | ce2185e162 | |
Vítor Santos Costa | 8607aee725 | |
Vitor Santos Costa | 9ea75834ff | |
Vitor Santos Costa | 27b540b72b | |
Vítor Santos Costa | 03d8a64543 | |
Vitor Santos Costa | b7a97a5b19 | |
Vitor Santos Costa | 518ce92bea | |
Vitor Santos Costa | 6e9882c369 | |
Vitor Santos Costa | bdf7088665 | |
Vitor Santos Costa | d7c4ac95e0 | |
Vítor Santos Costa | 67a88a196d | |
Vitor Santos Costa | 8a817a1dc4 | |
Vitor Santos Costa | 65fa980773 | |
Vitor Santos Costa | 3369e0085c | |
Vítor Santos Costa | 37b1e9043b | |
Vitor Santos Costa | 7c4014d15b | |
Vitor Santos Costa | 1206035805 | |
Vitor Santos Costa | 74222843e5 | |
Vítor Santos Costa | 6fe162025b | |
Vitor Santos Costa | 98dd9394b4 | |
Vitor Santos Costa | 69e68ff3cc | |
Vitor Santos Costa | ef04b30d66 | |
Vítor Santos Costa | 44ac70d3ab | |
Vitor Santos Costa | 1c293a9af4 | |
Vitor Santos Costa | af848f28aa | |
Vitor Santos Costa | 2c1d6910de | |
Vitor Santos Costa | f39619b3ef | |
Vítor Santos Costa | dfacbdcfd1 | |
Vítor Santos Costa | 9cfe3a4c7f | |
Vítor Santos Costa | c7995f276c | |
Vitor Santos Costa | 11dae5653e | |
Vítor Santos Costa | 1b27ef94bb | |
Vítor Santos Costa | 6095fe6e00 | |
Vitor Santos Costa | 8bfa835959 | |
Vitor Santos Costa | 4b1efa59b4 | |
Vítor Santos Costa | 7bfe8aedbe | |
Vitor Santos Costa | abb328abf0 | |
Vitor Santos Costa | df961cbd62 | |
Vitor Santos Costa | d172c9a0f7 | |
Vítor Santos Costa | 2c64eea060 | |
Vítor Santos Costa | 470323da5c | |
Vítor Santos Costa | fb5564f9d1 | |
Vitor Santos Costa | ec8eb89cc7 | |
Vitor Santos Costa | 04c38ecc29 | |
Vítor Santos Costa | 2d19db5fce | |
Vitor Santos Costa | 7ce963b63c | |
Vítor Santos Costa | bc3555dfbf | |
Vítor Santos Costa | 3d8ef251a5 | |
Vitor Santos Costa | c3b06ffdd1 | |
Vítor Santos Costa | d379034a96 | |
Vitor Santos Costa | 3a44eb657d | |
Vítor Santos Costa | c1d81ea7c6 | |
Vitor Santos Costa | 48bcffdce7 | |
Vitor Santos Costa | 508e10d0be | |
Vítor Santos Costa | e3ac349a0d | |
Vítor Santos Costa | 29af01c288 | |
Vítor Santos Costa | 3da111bd10 | |
Vítor Santos Costa | 51fa95505f | |
Vítor Santos Costa | 05356df347 | |
Vitor Santos Costa | e02884a94f | |
Vitor Santos Costa | 0b67a66533 | |
Vitor Santos Costa | 4dfad0a7fe | |
Vitor Santos Costa | 7e0611b526 | |
Vitor Santos Costa | 13cdd5124a | |
Vitor Santos Costa | 56e676ef65 | |
Vítor Santos Costa | 9b86a7869b | |
Vitor Santos Costa | c2f2490fee | |
Vítor Santos Costa | ff149367e8 | |
Vitor Santos Costa | 98d52ba347 | |
Vitor Santos Costa | 1b2aa6417c | |
Vitor Santos Costa | da68741b74 | |
Vitor Santos Costa | 1ff06fd2e0 | |
Vitor Santos Costa | 2e9be3d0d4 | |
Vitor Santos Costa | 927a43933c | |
Vitor Santos Costa | b54439d909 | |
Vitor Santos Costa | 8ab38125db | |
Vitor Santos Costa | 9194fda6cc | |
Vitor Santos Costa | 56f47acc49 | |
Vitor Santos Costa | 353690cc59 | |
Vítor Santos Costa | af610dc16d | |
Vitor Santos Costa | cc6eca6903 | |
Vitor Santos Costa | c33a0d72db | |
Vitor Santos Costa | 1a8c26b886 | |
Vitor Santos Costa | 31fd3eb344 | |
Vitor Santos Costa | 3a36285bb2 | |
Vitor Santos Costa | 530246688c | |
Vitor Santos Costa | a073b663ae | |
Vitor Santos Costa | 4db414a05a | |
Vitor Santos Costa | 82df9ce5b5 | |
Vitor Santos Costa | 921b5d497d | |
Vitor Santos Costa | d6aaa8a03e | |
Vitor Santos Costa | 1066ded7d9 | |
Vitor Santos Costa | f798372fb1 | |
Vitor Santos Costa | 54e3d48fb1 | |
Vitor Santos Costa | 21b017967f | |
Vitor Santos Costa | 207d0acb03 | |
Vitor Santos Costa | 81c7fc5d45 | |
Vitor Santos Costa | 1cdd8a482b | |
Vitor Santos Costa | 13f36c1f67 | |
Vitor Santos Costa | 1289899918 | |
Vitor Santos Costa | ca92d8631b | |
Vitor Santos Costa | bdc9e7005d | |
Vitor Santos Costa | 3e71d171e7 | |
Vitor Santos Costa | 7219992154 | |
Vitor Santos Costa | e93c01f8e0 | |
Vitor Santos Costa | 76d0d54a34 | |
Vitor Santos Costa | 311e1d697d | |
Vitor Santos Costa | fe496e840d | |
Vitor Santos Costa | 37f7eb3cf3 | |
Vitor Santos Costa | e7af316ad1 | |
Vitor Santos Costa | 608d87bafe | |
Vitor Santos Costa | ba69fbc955 | |
Vitor Santos Costa | 84aaa82dbe | |
Vitor Santos Costa | b057ac92e4 | |
Vitor Santos Costa | 0b742f3ae3 | |
Vitor Santos Costa | eee6760f96 | |
Vitor Santos Costa | 8d6654d4cf | |
Vitor Santos Costa | 34c6ace8be | |
Vitor Santos Costa | 50b2bae12a | |
Vitor Santos Costa | f037b2478c | |
Vitor Santos Costa | b02c775915 | |
Vitor Santos Costa | fadf853e96 | |
Vitor Santos Costa | 66db3d53f8 | |
Vitor Santos Costa | 5ea47853ac | |
Vitor Santos Costa | 24d895d100 | |
Vitor Santos Costa | 741c5a1e10 | |
Vitor Santos Costa | 1cafba0529 | |
Vitor Santos Costa | aaadd51309 | |
Vitor Santos Costa | eb9cc69bfb | |
Vitor Santos Costa | f3f524960c | |
Vitor Santos Costa | 63e8e89dab | |
Vitor Santos Costa | 9fce1e9ba2 | |
Vitor Santos Costa | fdf7bb516f | |
Vitor Santos Costa | 4c25aa21c5 | |
Vitor Santos Costa | 791484c132 | |
Vitor Santos Costa | 1cff18d1c0 | |
Vitor Santos Costa | 9c862c21bc | |
Vitor Santos Costa | 814aa2bd4c | |
Vitor Santos Costa | 4a5002091f | |
Vitor Santos Costa | 6b03c96a78 | |
Vitor Santos Costa | 85f444cc94 | |
Vitor Santos Costa | 237430afb4 | |
Vitor Santos Costa | 5be3fe4555 | |
Vitor Santos Costa | d348e8c563 | |
Vitor Santos Costa | 9a5681b2cb | |
Vitor Santos Costa | 65dd00be58 | |
Vitor Santos Costa | 3061844c95 | |
Vitor Santos Costa | 645b2c7d93 | |
Vitor Santos Costa | b645f60405 | |
Vitor Santos Costa | 55f4767621 | |
Vitor Santos Costa | 876e42d629 | |
Vitor Santos Costa | 76fb202d7e | |
Vitor Santos Costa | c281d73aef | |
Vitor Santos Costa | 4f366726c6 | |
Vitor Santos Costa | 2a93f1da99 | |
Vitor Santos Costa | 690f1d3830 | |
Vitor Santos Costa | 3688819ea2 | |
Vitor Santos Costa | 8feca162bf | |
Vitor Santos Costa | 06485f071a | |
Vitor Santos Costa | cdcb365a82 | |
Vitor Santos Costa | 9dab200c61 | |
Vitor Santos Costa | 484213efb6 | |
Vitor Santos Costa | bf78d70d66 | |
Vitor Santos Costa | 746a4b4ef8 | |
Vitor Santos Costa | b8f0a34833 | |
Vitor Santos Costa | ed2c85a56b | |
Vitor Santos Costa | 450d7a2bdd | |
Vitor Santos Costa | 5f9e0299ee | |
Vitor Santos Costa | bf67b8e609 | |
Vitor Santos Costa | 23565fc351 | |
Vitor Santos Costa | f7d6d70733 | |
Vitor Santos Costa | d23f7c149f | |
Vitor Santos Costa | 4271f3debe | |
Vitor Santos Costa | af233dbf36 | |
Vitor Santos Costa | 5c199984ed | |
Vitor Santos Costa | 3bb4570c55 | |
Vitor Santos Costa | 538cb4eb2c | |
Vitor Santos Costa | 9100e797f8 | |
Vitor Santos Costa | 7cd3fffe13 | |
Vitor Santos Costa | 2be6dcdbac | |
Vitor Santos Costa | e4fd6a153a | |
Vitor Santos Costa | 29f0f88025 | |
Vitor Santos Costa | 9a211ac1d4 | |
Vitor Santos Costa | 3789f69cf1 | |
Vitor Santos Costa | 978e8e9788 | |
Vitor Santos Costa | 407815e09a | |
Vitor Santos Costa | 2e6684b995 | |
Vitor Santos Costa | 75f5937e2b | |
Vitor Santos Costa | e3ade13cfe | |
Vitor Santos Costa | a83d97f998 | |
Vitor Santos Costa | 368cb492ef | |
Vitor Santos Costa | 73f05f2ed2 | |
Vitor Santos Costa | afd24bb8db | |
Vitor Santos Costa | 74e902c257 | |
Vitor Santos Costa | f12d98a38c | |
Vitor Santos Costa | 861f185ec6 | |
Vitor Santos Costa | 8baaa70cec | |
Vitor Santos Costa | 7dab812d64 | |
Vitor Santos Costa | af38546a0d | |
Vitor Santos Costa | 8437007716 | |
Vitor Santos Costa | d93134dcf6 | |
Vitor Santos Costa | 7a7a9f56ed | |
Vitor Santos Costa | 6b0478db00 | |
Vitor Santos Costa | da94db80cf | |
Vitor Santos Costa | dd48ba6f91 | |
Vitor Santos Costa | d05b1f4b2b | |
Vitor Santos Costa | 9f1ef65ff5 | |
Vitor Santos Costa | c06dd92761 | |
Vitor Santos Costa | 46d997713f | |
Vitor Santos Costa | a40fbe420f | |
Vitor Santos Costa | 70f4f7adcf | |
Vitor Santos Costa | 4d1c031051 | |
Vitor Santos Costa | 27fdeb81cc | |
Vitor Santos Costa | 98a5538f45 | |
Vitor Santos Costa | 53822922c8 | |
Vitor Santos Costa | b24dc4893d | |
Vitor Santos Costa | 717aeb162a | |
Vitor Santos Costa | c1d9a00a81 | |
Vitor Santos Costa | 95dd4890cc | |
Vitor Santos Costa | 5e761f7fd3 | |
Vitor Santos Costa | 00d1bf9af4 | |
Vitor Santos Costa | 35e12bd9c4 | |
Vitor Santos Costa | 65126b1b54 | |
Vitor Santos Costa | ea51f06783 | |
Vitor Santos Costa | 3fd8ccb06b | |
Vitor Santos Costa | a64059612f | |
Vitor Santos Costa | 81f5909095 | |
Vitor Santos Costa | b9c84ab7e9 | |
Vitor Santos Costa | 41dab59126 | |
Vitor Santos Costa | 02a2bb0b0b | |
Vitor Santos Costa | b5bfb638a3 | |
Vitor Santos Costa | e3ab36f091 | |
Vitor Santos Costa | af29600f09 | |
Vitor Santos Costa | abdc8a35f9 | |
Vitor Santos Costa | a115024aee | |
Vitor Santos Costa | 5448987ad0 | |
Vitor Santos Costa | 22c0cbeca3 | |
Vitor Santos Costa | b2a30b0a53 | |
vscosta | 11e81b457d | |
Vitor Santoss Costa | 675ce8c77b | |
vscosta | f255d629e9 | |
vscosta | 51d9637fc4 | |
vscosta | 70c25d37b6 | |
vscosta | 93577a7481 | |
vscosta | b032803616 | |
vscosta | d49a7387ef | |
Vitor Santos Costa | 2efedcb131 | |
Vitor Santos Costa | d2940c981c | |
Vitor Santos Costa | 6e6738b199 | |
Vitor Santos Costa | 3239778cf5 | |
Vitor Santos Costa | b1067dcc34 | |
Vitor Santos Costa | ec3995dd82 | |
Vitor Santos Costa | 2add5f2971 | |
Vitor Santos Costa | 063806f2f3 | |
Vitor Santos Costa | ce61f810c2 | |
Vitor Santos Costa | ccd7916d31 | |
Vitor Santos Costa | 3d6d3f092a | |
Vitor Santos Costa | 7ee2813f90 | |
Vitor Santos Costa | 4574cdb4df | |
Vitor Santos Costa | 51b99388e7 | |
Vitor Santos Costa | 8bf607aa65 | |
Vitor Santos Costa | de7ef115e7 | |
Vitor Santos Costa | ed346ccc65 | |
Vitor Santos Costa | ec518d7d36 | |
Vitor Santos Costa | b2c8b9a06e | |
Vitor Santos Costa | d2f87363ef | |
Vitor Santos Costa | 3e6c24cc0c | |
Vitor Santos Costa | 54234c7e1d | |
Vitor Santos Costa | f8f1d75ad6 | |
Vitor Santos Costa | a7bc4a3c71 | |
Vitor Santos Costa | 5b5e954dbc | |
Vitor Santos Costa | 8ad14f6765 | |
Vitor Santos Costa | f99d048cc2 | |
Vitor Santos Costa | a1b04dee3e | |
Vitor Santos Costa | dac6dc7c22 | |
Vitor Santos Costa | 3d191957db | |
Vitor Santos Costa | 75befc69f7 | |
Vitor Santos Costa | 963752fa9c | |
Vitor Santos Costa | 46468803b1 | |
Vitor Santos Costa | 63a1957d8e | |
Vitor Santos Costa | 023c254d03 | |
Vitor Santos Costa | 22837d498b | |
Vitor Santos Costa | 530d73c470 | |
Vitor Santoss Costa | d91b06bb6c | |
Vitor Santoss Costa | a601d3ebb3 | |
Vitor Santos Costa | 12f93e10d3 | |
Vitor Santos Costa | 1a78144190 | |
Vitor Santoss Costa | efaf86c675 | |
Vitor Santos Costa | 1dec8f5a55 | |
Vitor Santoss Costa | f00b3ccab2 | |
Vitor Santos Costa | c0cf2b0b83 | |
Vitor Santos Costa | ee9e596368 | |
Vitor Santos Costa | d0b2924322 | |
Vitor Santos Costa | 9272a1c7d5 | |
Vitor Santos Costa | d7e21c80df | |
Vitor Santos Costa | 6b545c8f71 | |
Vitor Santos Costa | 31f1c25ee7 | |
Vitor Santos Costa | 8ac3d980c2 | |
Vitor Santos Costa | 97aad19cd0 | |
Vitor Santoss Costa | 3a06d4fecb | |
vsc | e68630cd8a | |
Vitor Santos Costa | d06dd49dd0 | |
Vitor Santos Costa | bba62ea6eb | |
Vitor Santos Costa | ea099c83bb | |
Vitor Santos Costa | 0d96197ddf | |
vsc | c2f6d968c3 | |
vsc | 3938ed7150 | |
vsc | ebd6f0a0c2 | |
Vitor Santos Costa | 732adf9f43 | |
Vitor Santos Costa | f1ddb5822e | |
Vitor Santos Costa | 2ad3420fac | |
Vitor Santos Costa | 78768c354c | |
Vitor Santos Costa | 0c46c894d3 | |
Vitor Santos Costa | 25a2b68b15 | |
Vitor Santos Costa | 9560aa026e | |
Vitor Santos Costa | 6a2d74ac6e | |
Vitor Santos Costa | 18af47bdde | |
Vitor Santos Costa | 87851a68f4 | |
Vitor Santos Costa | a828f3f899 | |
Vitor Santos Costa | 3802a588f9 | |
Vitor Santos Costa | 386c88e372 | |
Vitor Santos Costa | 517667c1d5 | |
Vitor Santos Costa | 214daa5c40 | |
Vitor Santos Costa | 149a010e05 | |
Vitor Santos Costa | 3e3893ceff | |
Vitor Santos Costa | 48a2066f54 | |
Vitor Santos Costa | c2435673cd | |
Vitor Santos Costa | d1e39368f4 | |
Rui Afonso Pereira | 84e90d764f | |
Vitor Santos Costa | 6e7846e210 | |
Vitor Santos Costa | a6e6642eb2 | |
Vitor Santos Costa | b54dd37ef9 | |
Vitor Santos Costa | a21dce7801 | |
Vitor Santos Costa | 0320d8b49b | |
Vitor Santos Costa | 83b137f117 | |
Vitor Santos Costa | 3cb343479e | |
Vitor Santos Costa | 70232133cc | |
Vitor Santos Costa | 7063641a5b | |
Vitor Santos Costa | 4b350ccecc | |
Vitor Santos Costa | faf3c930c8 | |
Vitor Santos Costa | a9f02dddca | |
Vitor Santos Costa | af38d14ba7 | |
Vitor Santos Costa | 4180fd9737 | |
Vitor Santos Costa | 6741d961b3 | |
Vitor Santos Costa | 4deb28e4c6 | |
Vitor Santos Costa | 21ca8eccec | |
Vitor Santos Costa | 6e2260471a | |
Vitor Santos Costa | ad710f3a0c | |
vsc | 380132095a | |
vsc | f1372f72b5 | |
Vitor Santos Costa | fddb79895d | |
Vitor Santos Costa | f7efff157b | |
vsc | 9c004e5446 | |
vscosta | 34d3d7c176 | |
Vitor Santoss Costa | f3b0e962a7 | |
Vitor Santoss Costa | 477772e703 | |
Vitor Santoss Costa | fa88de5951 | |
vscosta | 6ec69aa3c8 | |
vsc | 272ddc0228 | |
Vitor Santos Costa | daffefe28d | |
Vitor Santos Costa | f426d25bef | |
Vitor Santos Costa | 65ff3ed471 | |
Vitor Santos Costa | 55879dbd6c | |
Vitor Santos Costa | 0ed4ea2aa1 | |
Vitor Santos Costa | 9e6e236ee1 | |
Vitor Santos Costa | cd776f4f70 | |
Vitor Santos Costa | b17f4967cb | |
Vitor Santos Costa | 5d6ff87d19 | |
Vitor Santos Costa | a53615ceaf | |
Vitor Santos Costa | 92e2d94186 | |
Vitor Santos Costa | a5e74eddae | |
Vitor Santos Costa | 7d230dac0f | |
Vitor Santos Costa | 8dc3503eb7 | |
Vitor Santos Costa | 53039d3785 | |
Vitor Santos Costa | c6a02d3fe4 | |
Vitor Santos Costa | 4db2a1fe7f | |
Vitor Santos Costa | 6778ea2975 | |
Vitor Santos Costa | 1e379e7635 | |
Vitor Santos Costa | 6aaa32363c | |
Vitor Santos Costa | 747b0e9501 | |
Vitor Santos Costa | 80cb881f3c | |
Vitor Santos Costa | 389a5a440d | |
Vitor Santos Costa | 436a4b4235 | |
Vitor Santos Costa | cacdd173b5 | |
Vitor Santos Costa | cd18a69561 | |
Vitor Santos Costa | 66bc426b09 | |
Vitor Santos Costa | a4bb9f6e0e | |
Vitor Santos Costa | f0740e1b8f | |
Vitor Santos Costa | 0a043720b1 | |
Vitor Santos Costa | c9309dce75 | |
Vitor Santos Costa | f98dfa6994 | |
Vitor Santos Costa | e6c021411b | |
Vitor Santos Costa | d9664b9ec4 | |
Vitor Santos Costa | b0fdea6f34 | |
Vitor Santos Costa | 82ad65a344 | |
Vitor Santos Costa | 45a54e2b04 | |
Vitor Santos Costa | 5526dc48bf | |
Vitor Santos Costa | cbb0d81ac4 | |
Vitor Santos Costa | 9f16487d0c | |
Vitor Santos Costa | d81e077cbe | |
Vitor Santos Costa | 6e2d2628c6 | |
Vitor Santos Costa | 70b11ab8f9 | |
Vitor Santos Costa | 474fa2fe14 | |
Vitor Santos Costa | ea72cd09e3 | |
Vitor Santos Costa | 4f423dc16a | |
Vitor Santos Costa | 6a4dbd91ec | |
Vitor Santos Costa | b07a35a993 | |
Vitor Santos Costa | 14e1b74572 | |
Vitor Santos Costa | 490a07ade2 | |
Vitor Santos Costa | 47b5de9bfc | |
Vitor Santos Costa | 44dab9ab33 | |
Vitor Santos Costa | d37e198c12 | |
Vitor Santos Costa | 6c96a8e35b | |
Vitor Santos Costa | f44ef18fed | |
Vitor Santos Costa | 8d1cc35a8a | |
Vitor Santos Costa | 56905d86ae | |
Vitor Santos Costa | cc7c0ebac8 | |
Vitor Santos Costa | da65d7bd3c | |
Vitor Santos Costa | 0be43c6525 | |
Vitor Santos Costa | c49165a7af | |
Vitor Santos Costa | 51359cb175 | |
Vitor Santos Costa | b03e0634c7 | |
Vitor Santos Costa | 46a9d52d2d | |
Vitor Santos Costa | 02e0e50915 | |
Vitor Santos Costa | 117584e817 | |
Vitor Santos Costa | c959ceeb1d | |
Vitor Santos Costa | d082af605d | |
Vitor Santos Costa | 8f72db3b56 | |
Fabrizio Riguzzi | e078156eb6 | |
Vitor Santos Costa | 8a6de8b157 | |
Vitor Santos Costa | ad5347257b | |
Vitor Santos Costa | 08dd1dcdb3 | |
Vitor Santos Costa | 4a5540e645 | |
Vitor Santos Costa | 558c3eb35b | |
Vitor Santos Costa | 3b124549e4 | |
Vitor Santos Costa | 5c33960535 | |
Vitor Santos Costa | 1c2880fd1b | |
Vitor Santos Costa | 4c01fe8fe3 | |
Vitor Santos Costa | df0ee8eaeb | |
Vitor Santos Costa | 43d3579c57 | |
Vitor Santos Costa | 41ccbf7367 | |
Vitor Santos Costa | ef38613229 | |
Vitor Santos Costa | 3f4fe6815f | |
Vitor Santos Costa | a1ee3b30d3 | |
Vitor Santos Costa | b0ce23f131 | |
Vitor Santos Costa | 51bf90908f | |
Vitor Santos Costa | 97350da9bd | |
Vitor Santos Costa | e39b1e0127 | |
Vitor Santos Costa | 6802e83d83 | |
Vitor Santos Costa | 94cde0bf18 | |
Vitor Santos Costa | bee39cb385 | |
Vitor Santos Costa | 298b287859 | |
Vitor Santos Costa | cd3b94c40c | |
Vitor Santos Costa | f9655cccb6 | |
Vitor Santos Costa | 2bbc3b9265 | |
Vitor Santos Costa | 09b7a5cbf9 | |
Vitor Santos Costa | 02dabe8e3a | |
Vitor Santos Costa | d273270c11 | |
Vitor Santos Costa | e70b7060d1 | |
Vitor Santos Costa | ea366ca22d | |
Vitor Santos Costa | 87c6f13976 | |
Vitor Santos Costa | 3fe4b70112 | |
Vitor Santos Costa | 48c1bed5f9 | |
Vitor Santos Costa | b5e1476a20 | |
Vitor Santos Costa | 368cfd99d5 | |
Vitor Santos Costa | ab9bff2ab5 | |
Vitor Santos Costa | b2156aad2d | |
Vitor Santos Costa | c58064bd0b | |
Vitor Santos Costa | 21324d7434 | |
Vitor Santos Costa | a478a83c27 | |
Vitor Santos Costa | f6d434e314 | |
Vitor Santos Costa | f35f0584eb | |
Vitor Santos Costa | db2aa5b5f2 | |
Vitor Santos Costa | 76b9946358 | |
Vitor Santos Costa | 868ecfe551 | |
Vitor Santos Costa | 350081a90d | |
Vitor Santos Costa | bbd9049111 | |
Vitor Santos Costa | 3845d4e67d | |
Vitor Santos Costa | 2f885bb6f3 | |
Vitor Santos Costa | 029d2836a2 | |
Vitor Santos Costa | df8b264751 | |
Vitor Santos Costa | 124b2e9069 | |
Vitor Santos Costa | 6043125221 | |
Vitor Santos Costa | 1219fb6b6a | |
Vitor Santos Costa | 7d66aa5d01 | |
Vitor Santos Costa | c78f3e085a | |
Vitor Santos Costa | e2f8430e00 | |
Vitor Santos Costa | c46228a03b | |
Vitor Santos Costa | 9bdfabc381 | |
Vitor Santos Costa | e4c82910a2 | |
Vitor Santos Costa | 1e118bee6d | |
Vitor Santos Costa | 06bbdfd553 | |
Vitor Santos Costa | 04ff54917e | |
Vitor Santos Costa | 110a23b209 | |
Vitor Santos Costa | 5fcf173d0a | |
Vitor Santos Costa | 269e7b8806 | |
Vitor Santos Costa | 1ead544a50 | |
Vitor Santos Costa | 15c6381579 | |
Vitor Santos Costa | 85a88feb6f | |
Vitor Santos Costa | 76638bb7d8 | |
Vitor Santos Costa | 1a878579fd | |
Vitor Santos Costa | a5c09f9187 | |
Vitor Santos Costa | aba60111cf | |
Vitor Santos Costa | 1bcbd5ce15 | |
Vitor Santos Costa | e157740bda | |
Vitor Santos Costa | f12349993b | |
Vitor Santos Costa | 79791604d9 | |
Vitor Santos Costa | 67b72f4958 | |
Vitor Santos Costa | f2c6c85c17 | |
Vitor Santos Costa | b378cb8469 | |
Vitor Santos Costa | cd53167d19 | |
Vitor Santos Costa | 676582fe4f | |
Vitor Santos Costa | 227c75a213 | |
Vitor Santos Costa | d9c1c85d30 | |
Vitor Santos Costa | 6148e8199f | |
Vitor Santos Costa | cbef36b565 | |
Vitor Santos Costa | 1bea4230e4 | |
Vitor Santos Costa | cbafd93b03 | |
Vitor Santos Costa | 6f6e294703 | |
Vitor Santos Costa | ba98f237ae | |
Vitor Santos Costa | 23c1c2d4d7 | |
Vitor Santos Costa | 9ed1546ee6 | |
Vitor Santos Costa | 297aae9d36 | |
Vitor Santos Costa | c4544f042d | |
Vitor Santos Costa | f78ddb6724 | |
Vitor Santos Costa | fce05b85d3 | |
Vitor Santos Costa | eea3da22f1 | |
Vitor Santos Costa | a675f6f49e | |
Vitor Santos Costa | 997a0b9895 | |
Vitor Santos Costa | ce4b6c0931 | |
Vitor Santos Costa | 4dcbac42e9 | |
Vitor Santos Costa | 0b635cb2d5 | |
Vitor Santos Costa | 25e59ecd40 | |
Vitor Santos Costa | e9e03f11d3 | |
Vitor Santos Costa | ddf40b67bd | |
Vitor Santos Costa | fe1a677778 | |
Vitor Santos Costa | 9e59f755ff | |
Vitor Santos Costa | ba730273e7 | |
Vitor Santos Costa | e50d722e66 | |
Vitor Santos Costa | 2aaca174e5 | |
Vitor Santos Costa | b80a6bad97 | |
Vitor Santos Costa | b218af8f1b | |
Vitor Santos Costa | 56b2f14a32 | |
Vitor Santos Costa | 03afaaf887 | |
Vitor Santos Costa | 843f9f8d87 | |
Vitor Santos Costa | b27ab0811b | |
Vitor Santos Costa | f6935510a9 | |
Vitor Santos Costa | 56466a446a | |
Vitor Santos Costa | 670eacc823 | |
Vitor Santos Costa | a270349dae | |
Vitor Santos Costa | 9e5675755e | |
Vitor Santos Costa | 2d94bba498 | |
Vitor Santos Costa | 2a9a88c325 | |
Vitor Santos Costa | 3eeaac8d05 | |
Vitor Santos Costa | 93068241d3 | |
Vitor Santos Costa | 2726fb279c | |
Vitor Santos Costa | fab0075f9b | |
Vitor Santos Costa | 0f32e2cc9f | |
Vitor Santos Costa | 27273290e1 | |
Vitor Santos Costa | f8b0cb2c2d | |
Vitor Santos Costa | eb54e3e052 | |
Vitor Santos Costa | cc1a44c7a7 | |
Vitor Santos Costa | 7b86e28e00 | |
Vitor Santos Costa | 44262405df | |
Vitor Santos Costa | ed6385a3e7 | |
Vitor Santos Costa | cad55bcf71 | |
Vitor Santos Costa | fccf3d9f6f | |
Vitor Santos Costa | 2595555982 | |
Vitor Santos Costa | 02bd8a1760 | |
Vitor Santos Costa | a4fa6c5b4b | |
Vitor Santos Costa | afeb4b2870 | |
Vitor Santos Costa | 121d927e85 | |
Vitor Santos Costa | 05d65070b8 | |
Vitor Santos Costa | 7dcd5179ce | |
Vitor Santos Costa | 8f3321d36b | |
Vitor Santos Costa | 9386d70280 | |
Vitor Santos Costa | 339048c76b | |
Vitor Santos Costa | 04b1d2bafb | |
Vitor Santos Costa | 729b798a23 | |
Vitor Santos Costa | b3a11b339a | |
Vitor Santos Costa | 0aeeb726e3 | |
Vitor Santos Costa | 3d4a525e32 | |
Vitor Santos Costa | 0f19d518f2 | |
Vitor Santos Costa | fdfefbbd46 | |
Vitor Santos Costa | 833ffbb104 | |
Vitor Santos Costa | 384e74ae59 | |
Vitor Santos Costa | be1ce69e07 | |
Vitor Santos Costa | 26d2e9721c | |
Vitor Santos Costa | 8594c41487 | |
Vitor Santos Costa | fd23360c63 | |
Vitor Santos Costa | b705c07ac8 | |
Vitor Santos Costa | c79a5ec372 | |
Vitor Santos Costa | 471d6e4f77 | |
Vitor Santos Costa | 0029fdd0b4 | |
Vitor Santos Costa | b8045f1a39 | |
Vitor Santos Costa | f5e560366c | |
Vitor Santos Costa | 2038dd42b6 | |
Vitor Santos Costa | e16c8c573d | |
Vitor Santos Costa | ca2dfeb51e | |
Vitor Santos Costa | 3ff5ddf04a | |
Vitor Santos Costa | 69c3a54cb6 | |
Vitor Santos Costa | 99488a6cea | |
Vitor Santos Costa | a560031167 | |
Vitor Santos Costa | 0dd5da91ca | |
Vitor Santos Costa | 8050747db7 | |
Vitor Santos Costa | 2dbf860a58 | |
Vitor Santos Costa | 9ef2f87165 | |
Vitor Santos Costa | 79a154cbf4 | |
Vitor Santos Costa | d54446d736 | |
Vitor Santos Costa | 4628adc63e | |
Vitor Santos Costa | d0a8e4a722 | |
Vitor Santos Costa | 5e7c08fff7 | |
Vitor Santos Costa | 304489c74f | |
Vitor Santos Costa | a82a72fc14 | |
Vitor Santos Costa | db0deea576 | |
Vitor Santos Costa | 1d84d39b00 | |
Vitor Santos Costa | afc6e64db2 | |
Vitor Santos Costa | 897d59820f | |
Vitor Santos Costa | 9e01be6a22 | |
Vitor Santos Costa | 8e52352878 | |
Vitor Santos Costa | 7651f507c6 | |
Vitor Santos Costa | 8973689b43 | |
Vitor Santos Costa | 957aa9f977 | |
Vitor Santos Costa | 81c00f9736 | |
Vitor Santos Costa | bff0440b64 | |
Vitor Santos Costa | ccc2efd456 | |
Vitor Santos Costa | 750b31b29a | |
Vitor Santos Costa | 99e9809320 | |
Vitor Santos Costa | d8ee7b1f89 | |
Vitor Santos Costa | 6163533208 | |
Vitor Santos Costa | 37ddd18a9d | |
Vitor Santos Costa | 73b10e7207 | |
Vitor Santos Costa | 50e94c9094 | |
Vitor Santos Costa | d7b5be0ccd | |
Vitor Santos Costa | 5b8dd3eb03 | |
Vitor Santos Costa | cbe205344d | |
Vitor Santos Costa | 0248e3ec2f | |
Vitor Santos Costa | bb4820a086 | |
Vitor Santos Costa | 2fef5ffcea | |
Vitor Santos Costa | f7a2c479e7 | |
Vitor Santos Costa | 275e2c0059 | |
Vitor Santos Costa | 9686275b34 | |
Vitor Santos Costa | 1aa3c26af6 | |
Vitor Santos Costa | 7cda920dbc | |
Vitor Santos Costa | 915316b712 | |
Vitor Santos Costa | a2ab31757f | |
Vitor Santos Costa | e138472f87 | |
Vitor Santos Costa | 83326f1657 | |
Vitor Santos Costa | 1c698f596c | |
Vitor Santos Costa | 71afcd0350 | |
Vitor Santos Costa | f6a90c0cac | |
Vitor Santos Costa | 12664254e9 | |
Vitor Santos Costa | a21547d9d4 | |
Vitor Santos Costa | 9ac1b3f2c6 | |
Vitor Santos Costa | 9db06bcfe1 | |
Vitor Santos Costa | 5db8e25735 | |
Vitor Santos Costa | 77335f2ea0 | |
Vitor Santos Costa | 4477350d08 | |
Vitor Santos Costa | 43993f2b08 | |
Vitor Santos Costa | 14d8b7904f | |
Vitor Santos Costa | 19ec491d22 | |
Vitor Santos Costa | 7a7d36a3ef | |
Vitor Santos Costa | afc0f4386c | |
Vitor Santos Costa | 8d19f397d4 | |
Vitor Santos Costa | 91120de170 | |
Vitor Santos Costa | 0c305e8ce3 | |
Vitor Santos Costa | 9ad6bc3120 | |
Vitor Santos Costa | a8f101cbcf | |
Vitor Santos Costa | d5ce45f09f | |
Vitor Santos Costa | 2213bc6f36 | |
Vitor Santos Costa | 460dfafcc8 | |
Vitor Santos Costa | be313a5b49 | |
Vitor Santos Costa | 468a2279c3 | |
Vitor Santos Costa | 4fa33de8a8 | |
Vitor Santos Costa | 168d0b41ec | |
Vitor Santos Costa | 591d5a8653 | |
Vitor Santos Costa | b6f1079503 | |
Vitor Santos Costa | 04fd092e49 | |
Vitor Santos Costa | 133a4fc215 | |
Vitor Santos Costa | d91a0130fa | |
Vitor Santos Costa | 2e6572bfe5 | |
Vitor Santos Costa | 57ae30c79c | |
Vitor Santos Costa | fa26588bbf | |
Vitor Santos Costa | 9d3b46132b | |
Vitor Santos Costa | d3599da6dc | |
Vitor Santos Costa | c6d174841a | |
Vitor Santos Costa | ee03af37fb | |
Vitor Santos Costa | 728edb6b0a | |
Vitor Santos Costa | 84d5974cca | |
Vitor Santos Costa | 9b3bbf5e33 | |
Vitor Santos Costa | 5f2964cce6 | |
Vitor Santos Costa | 63b985c452 | |
Vitor Santos Costa | 943900865e | |
Vitor Santos Costa | 6a076bc8ac | |
Vitor Santos Costa | 8ecb045cb5 | |
Vitor Santos Costa | 5584eb1a55 | |
Vitor Santos Costa | 0f50b2e49c | |
Vitor Santos Costa | dfd7b8f467 | |
Vitor Santos Costa | 7d6082d39a | |
Vitor Santos Costa | 35e9d432c1 | |
Vitor Santos Costa | 6a878d9568 | |
Vitor Santos Costa | d922933898 | |
Vitor Santos Costa | d4b77458e9 | |
Vitor Santos Costa | 2422417a05 | |
Vitor Santos Costa | c663010312 | |
Vitor Santos Costa | d8fd3de13a | |
Vitor Santos Costa | f474dbdb2a | |
Vitor Santos Costa | 9bfdfeb204 | |
Vitor Santos Costa | 557c89a4ad | |
Vitor Santos Costa | 4ebb83e998 | |
Vitor Santos Costa | 0cc010bc42 | |
Vitor Santos Costa | 075f50a11f | |
Vitor Santos Costa | 2b5f0e7705 | |
Vitor Santos Costa | d6c768da2c | |
Vitor Santos Costa | 5606410a64 | |
Vitor Santos Costa | 1da507902c | |
Vitor Santos Costa | f555ea958c | |
Vitor Santos Costa | 1740175e5c | |
Vitor Santos Costa | 85bcce7d19 | |
Vitor Santos Costa | 72fcd2befa | |
Vitor Santos Costa | fb08cfe5f6 | |
Vitor Santos Costa | 7d44e3188b | |
Vitor Santos Costa | 0dd8f62237 | |
Vitor Santos Costa | 60687f4346 | |
Vitor Santos Costa | 3f59ec40cd | |
Vitor Santos Costa | c2fb631106 | |
Vitor Santos Costa | d9b5a21a54 | |
Vitor Santos Costa | 06f5fa2614 | |
Vitor Santos Costa | a6a769c0de | |
Vitor Santos Costa | ff3185b551 | |
Vitor Santos Costa | 8d64753c54 | |
Vitor Santos Costa | 7ca285eb40 | |
Vitor Santos Costa | 736c8ee66e | |
Vitor Santos Costa | dbda4a4d7b | |
Vitor Santos Costa | 46bf534a27 | |
Vitor Santos Costa | 37155d7296 | |
Vitor Santos Costa | ab135e8b74 | |
Vitor Santos Costa | 19a265073f | |
Vitor Santos Costa | 4123764fcc | |
Vitor Santos Costa | e6eff20e82 | |
Vitor Santos Costa | 2b9b92dac7 | |
Vitor Santos Costa | a382ca43fa | |
Vitor Santos Costa | 4b33d5d87b | |
Vitor Santos Costa | a9839b4d4a | |
Vitor Santos Costa | d1b0f45c28 | |
Vitor Santos Costa | eab3fc33be | |
Vitor Santos Costa | fdc01b0c27 | |
Vitor Santos Costa | 8d126b7de6 | |
Vitor Santos Costa | a94260bd33 | |
Vitor Santos Costa | dc2ed1bea8 | |
Vitor Santos Costa | b2fe557503 | |
Vitor Santos Costa | 710ca208d2 | |
Vitor Santos Costa | 735ccca095 | |
Vitor Santos Costa | 79d40f57b1 | |
Vitor Santos Costa | 647ebac5e4 | |
Vitor Santos Costa | 3c28902ec5 | |
Vitor Santos Costa | 3dfab64306 | |
Vitor Santos Costa | 72f72929d3 | |
Vitor Santos Costa | 0007cb896b | |
Vitor Santos Costa | 8f489b0799 | |
Vitor Santos Costa | 57161d83f4 | |
Vitor Santos Costa | a1ec5e6198 | |
Vitor Santos Costa | 730259d47e | |
Vitor Santos Costa | 5c83d305fc | |
Vitor Santos Costa | 899e892aef | |
Vitor Santos Costa | 807cca51ec | |
Vitor Santos Costa | da6d41433f | |
Vitor Santos Costa | a7720d42ed | |
Vitor Santos Costa | a1a4ac9d0b | |
Vitor Santos Costa | e6bbcc566c | |
Vitor Santos Costa | cd05e3f6d8 | |
Vitor Santos Costa | eecc4ecf06 | |
Vitor Santos Costa | 7278d9ee0e | |
Vitor Santos Costa | 8e5352bc03 | |
Vitor Santos Costa | ba78620e34 | |
Vitor Santos Costa | 42347585d3 | |
Vitor Santos Costa | b2cec5467c | |
Vitor Santos Costa | 3c91e1c9a0 | |
Vitor Santos Costa | 0069222b75 | |
Vitor Santos Costa | 00cfb6e432 | |
Vitor Santos Costa | 67c4e14318 | |
Vitor Santos Costa | 8bb7aaad92 | |
Vitor Santos Costa | f905e4d297 | |
Vitor Santos Costa | 67aba666c6 | |
Vitor Santos Costa | 99b3d0db99 | |
Vitor Santos Costa | 31abcd01c3 | |
Vitor Santos Costa | 52801b660f | |
Vitor Santos Costa | 32743f3731 | |
Vitor Santos Costa | 8ce16f64d9 | |
Vitor Santos Costa | 79e6e3fcc1 | |
Vitor Santos Costa | 0779639baf | |
Vitor Santos Costa | e441f30c4c | |
Vitor Santos Costa | dce28a774e | |
Vitor Santos Costa | 5fd4413ffd | |
Vitor Santos Costa | f7c3aef830 | |
Vitor Santos Costa | 66709db4bb | |
Joseph Lee Nunn III | de693e2095 | |
Vitor Santos Costa | d0658b7b53 | |
Vitor Santos Costa | 8f3bb7fe26 | |
Vitor Santos Costa | 71c49f5063 | |
Vitor Santos Costa | 4ac6d11dca | |
Vitor Santos Costa | 33fa5fa3c0 | |
Vitor Santos Costa | d38986fa07 | |
Vitor Santos Costa | 5d4ee60fc9 | |
Vitor Santos Costa | ceb26b68a0 | |
Vitor Santos Costa | cd7571da7a | |
Vitor Santos Costa | a9fe413dd0 | |
Vitor Santos Costa | 437a303681 | |
Vitor Santos Costa | 7c1ea8f3ae | |
Vitor Santos Costa | d00698b76a | |
Vitor Santos Costa | a5bb2e226c | |
Vitor Santos Costa | ef676f68b0 | |
Vitor Santos Costa | 9fcbfca1fa | |
Vitor Santos Costa | f54e11db94 | |
Vitor Santos Costa | 9f2ba2d4fb | |
Vitor Santos Costa | 87e13a9730 | |
Vitor Santos Costa | a72e66d2ae | |
Vitor Santos Costa | 214b6a74ff | |
Vitor Santos Costa | 8e3789d92a | |
Vitor Santos Costa | af61c886b4 | |
Vitor Santos Costa | 9f664c9e36 | |
Vitor Santos Costa | d375d0ffbb | |
Vitor Santos Costa | 7b977c2538 | |
Vitor Santos Costa | 52442e08ec | |
Vitor Santos Costa | eadfef6c3f | |
Vitor Santos Costa | 3b8325bd41 | |
Vitor Santos Costa | d86f0d1942 | |
Vitor Santos Costa | c0db3d4e18 | |
Vitor Santos Costa | 3a9ecf929e | |
Vitor Santos Costa | 428a6255e1 | |
Vitor Santos Costa | 03da182460 | |
Vitor Santos Costa | e5891afe44 | |
Vitor Santos Costa | b28deedffe | |
Vitor Santos Costa | 033d77b47a | |
Vitor Santos Costa | d58c071200 | |
Vitor Santos Costa | 70f6080857 | |
Vitor Santos Costa | abe1168b1d | |
Vitor Santos Costa | d46bef3adb | |
Vitor Santos Costa | ea7d247ec8 | |
Vitor Santos Costa | 1573d5ebd2 | |
Vitor Santos Costa | 9391a1499d | |
Vitor Santos Costa | 969b022e1c | |
Vitor Santos Costa | c5323b2920 | |
Vitor Santos Costa | e92062886b | |
Vitor Santos Costa | 407280ea3b | |
Vitor Santos Costa | 516f89b76d | |
Vitor Santos Costa | e98c4c9f2a | |
Vitor Santos Costa | efe827db6c | |
Vitor Santos Costa | f94bec3cfc | |
Vitor Santos Costa | 2eab5ef225 | |
Vitor Santos Costa | 91e5f03121 | |
Vitor Santos Costa | 18ed15a4ce | |
Vitor Santos Costa | 83a1269553 | |
Vitor Santos Costa | d7318266fe | |
Vitor Santos Costa | 1e8c0b6583 | |
Vitor Santos Costa | c8f1e8a74a | |
Vitor Santos Costa | 70061308ff | |
Vitor Santos Costa | 61ba15fa3a | |
Vitor Santos Costa | 235179ff47 | |
Vitor Santos Costa | f23b8b5418 | |
Vitor Santos Costa | 9b89e6fd92 | |
Vitor Santos Costa | f039a5d688 | |
Vitor Santos Costa | 9d0722bf2f | |
Vitor Santos Costa | 443fe5af18 | |
Vitor Santos Costa | c0a45cf42c | |
Vitor Santos Costa | 2550fc5b87 | |
Vitor Santos Costa | dbd4c979b1 | |
Vitor Santos Costa | 30593e86d6 | |
Vitor Santos Costa | f4111997e7 | |
Vitor Santos Costa | c06d07985e | |
Vitor Santos Costa | b0766abb5c | |
Vitor Santos Costa | 768b17751b | |
Vitor Santos Costa | 445a7f33c1 | |
Vitor Santos Costa | ea90785c6a | |
Vitor Santos Costa | f966a5b912 | |
Vitor Santos Costa | cd41d373db | |
Vitor Santos Costa | 3d68f0e06b | |
Vitor Santos Costa | 96f03e26e8 | |
Vitor Santos Costa | 49699f52e9 | |
Vitor Santos Costa | 3ac1a285a9 | |
Vitor Santos Costa | 6880fc20a6 | |
vscosta | 37649b7d1a | |
vscosta | c1b8d140db | |
vscosta | 76f4868ff6 | |
Vitor Santos Costa | 068b624fca | |
Vitor Santos Costa | 631eb4c265 | |
Vitor Santos Costa | ab1b8cea39 | |
Vitor Santos Costa | 6ff24e9a16 | |
Vitor Santos Costa | 97375d010b | |
Vitor Santos Costa | a761bd752c | |
Vitor Santos Costa | 05a76a2b3f | |
Vitor Santos Costa | 1aa20e24b7 | |
Vitor Santos Costa | 29fba0238d | |
Vitor Santos Costa | 5a5829a583 | |
Vitor Santos Costa | 786cfb71ad | |
Vitor Santos Costa | c0c002134b | |
Vitor Santos Costa | e6c2503563 | |
Vitor Santos Costa | 69bb5c4d08 | |
Vitor Santos Costa | 65f1cb9741 | |
vscosta | 5830eacfec | |
vscosta | 2a119fdf5e | |
vscosta | 2f5386bd6f | |
vscosta | 6ee452f0c5 | |
vscosta | 948c8e7cbb | |
vscosta | c3488eeaed | |
vscosta | 6b4cc7f8ff | |
vscosta | 1649366574 | |
vscosta | 429c8155c9 | |
Vitor Santos Costa | fa650a6440 | |
Vitor Santos Costa | b7eb38fc44 | |
Vitor Santos Costa | da315b2688 | |
Vitor Santos Costa | d680fa0755 | |
Vitor Santos Costa | 106e4bc13f | |
Vitor Santos Costa | c7bc27cc3e | |
Vitor Santos Costa | b89f6e55b4 | |
Vitor Santos Costa | 55a840e2d8 | |
Vitor Santos Costa | 93bba89d52 | |
Vitor Santos Costa | 4cdbabfa69 | |
Vitor Santos Costa | eb5d90d85f | |
Vitor Santos Costa | e485dbc59b | |
Vitor Santos Costa | dfbdce4240 | |
Vitor Santos Costa | 5dbe54dadc | |
Vitor Santos Costa | 7bf8a20f1b | |
Vitor Santos Costa | 867c9ea47c | |
Vitor Santos Costa | 2e238f6bc1 | |
vscosta | 71f0076ed6 | |
vscosta | 4d3d9c408d | |
vscosta | a5951daea9 | |
vscosta | 562ac0251d | |
vscosta | ac71ba72b5 | |
vscosta | 24e6924769 | |
vscosta | abe5953da7 | |
vscosta | 079ed60248 | |
vscosta | d9bfcc0f78 | |
vscosta | 07f105dd80 | |
vscosta | d4a9f97cdd | |
vscosta | 40765a6afb | |
vscosta | 7312765824 | |
vscosta | 396bd2f8c3 | |
Vítor Santos Costa | 636992781c | |
Vítor Santos Costa | 145ad73255 | |
Vítor Santos Costa | 78ba5d01f2 | |
Vítor Santos Costa | 2d8fdad839 | |
Vítor Santos Costa | a304fc721a | |
Vítor Santos Costa | 6b141078b4 | |
Vítor Santos Costa | 1c2383b5b9 | |
Vítor Santos Costa | e0d82cfb23 | |
Vítor Santos Costa | 4103aa6e83 | |
Vítor Santos Costa | f3e8b8b3da | |
Vítor Santos Costa | 6bc4acec15 | |
Vítor Santos Costa | 9dacc20d34 | |
Vítor Santos Costa | 06e5371afd | |
Vítor Santos Costa | 2dae2363a3 | |
Vítor Santos Costa | 9f722319ec | |
Vítor Santos Costa | cda490eda8 | |
Vítor Santos Costa | 1be002558c | |
Vítor Santos Costa | fa69950c67 | |
Vítor Santos Costa | f6379bcd48 | |
Vítor Santos Costa | e9cac424f0 | |
Vítor Santos Costa | 88b179b603 | |
Vítor Santos Costa | 9d1fa8a907 | |
Vítor Santos Costa | cd1497c475 | |
Vítor Santos Costa | b4742fb3cf | |
Vítor Santos Costa | 17ef6ddf34 | |
Vítor Santos Costa | bac60d2d94 | |
Vítor Santos Costa | bc914e9e91 | |
Vítor Santos Costa | 79d99a7768 | |
Vítor Santos Costa | 23d18ac0fd | |
Vítor Santos Costa | a32ac66167 | |
Vítor Santos Costa | 1155b6b876 | |
Vítor Santos Costa | da51cfe6b9 | |
Vítor Santos Costa | cec2e9638a | |
Vítor Santos Costa | 0f4448fdbe | |
Vítor Santos Costa | 59b1aa9129 | |
Vítor Santos Costa | 812a88e277 | |
Vítor Santos Costa | fdcc75d4ae | |
Vítor Santos Costa | 2fe198f68a | |
Vítor Santos Costa | 50bfe3c014 | |
Vítor Santos Costa | 0522720ff4 | |
Vítor Santos Costa | 0fc0e96306 | |
Vítor Santos Costa | f1c9c08f1f | |
Vítor Santos Costa | 001b169d81 | |
Vítor Santos Costa | 52f949d3f9 | |
Vítor Santos Costa | 87c58493d4 | |
Vítor Santos Costa | 96bc776375 | |
Vítor Santos Costa | 5a95c6bbc7 | |
Vítor Santos Costa | 27b7e32036 | |
Vítor Santos Costa | b50cf8d7b4 | |
Vítor Santos Costa | 8c7756f8fb | |
Vítor Santos Costa | f20599478e | |
Vítor Santos Costa | d3796aba5a | |
Vítor Santos Costa | 5f9752baff | |
Vítor Santos Costa | 0db27196aa | |
Vítor Santos Costa | 5c4cedd4fc | |
Vítor Santos Costa | c552dc6a2c | |
Vítor Santos Costa | b384c40213 | |
Vítor Santos Costa | 638f784f81 | |
Vítor Santos Costa | e81acc117b | |
Vítor Santos Costa | b9eb327d86 | |
Vítor Santos Costa | 0ccee1aa55 | |
Vítor Santos Costa | 2192f73b11 | |
Vítor Santos Costa | 7cc9d2f882 | |
Vítor Santos Costa | 675befae75 | |
Vítor Santos Costa | 56e9a8f8d9 | |
Vítor Santos Costa | 25ee4dd7e8 | |
Vítor Santos Costa | 1f29aea94b | |
Vítor Santos Costa | 56ebb0a91a | |
Vítor Santos Costa | d8a7d05e01 | |
Vítor Santos Costa | 733a03beef | |
Vítor Santos Costa | 77123269e7 | |
Vítor Santos Costa | 54985f4678 | |
Vítor Santos Costa | 62e0f0bece | |
Vítor Santos Costa | 6ceb0bf9f3 | |
Vítor Santos Costa | e9712bc9ab | |
Vítor Santos Costa | 7d3053b906 | |
Vítor Santos Costa | 68633a9c34 | |
Vítor Santos Costa | 0e50546005 | |
Vítor Santos Costa | f823ded57f | |
Vítor Santos Costa | d9fe5133d3 | |
Vítor Santos Costa | 0e7cc378af | |
Vítor Santos Costa | 46140f434d | |
Vítor Santos Costa | d2dceb91d3 | |
Vítor Santos Costa | bc291ed08b | |
Vítor Santos Costa | 34b731a4ae | |
Vítor Santos Costa | c25d35356a | |
Vítor Santos Costa | a448e25d8d | |
Vítor Santos Costa | e4e59dedf7 | |
Vítor Santos Costa | 3af377d610 | |
Vítor Santos Costa | 6f1b5fbef9 | |
Vítor Santos Costa | 712d79c7bb | |
Vítor Santos Costa | 588ef40a16 | |
Vítor Santos Costa | df7feea0aa | |
Vítor Santos Costa | 98bd9d7400 | |
Vítor Santos Costa | c7049b5467 | |
Vítor Santos Costa | 405b20e8fa | |
Vítor Santos Costa | 28b1262455 | |
Vítor Santos Costa | bd72ec8f50 | |
Vítor Santos Costa | f017f38dee | |
Vítor Santos Costa | d5862139c8 | |
Vítor Santos Costa | f7d23f9deb | |
Vítor Santos Costa | 19cedad41d | |
Vítor Santos Costa | 20f639fe7b | |
Vítor Santos Costa | 2cacf6f63a | |
Vítor Santos Costa | 8f9fa802a9 | |
Vítor Santos Costa | 1d76cfc7cb | |
Vítor Santos Costa | 26013e2fb9 | |
Vítor Santos Costa | 504734c879 | |
Vítor Santos Costa | 1c68deb663 | |
Vítor Santos Costa | b7ee47ce46 | |
Vítor Santos Costa | ef06ebe698 | |
vscosta | 52d0a38f8f | |
vscosta | 33ebe61371 | |
Vítor Santos Costa | 88df20efca | |
Vítor Santos Costa | eec32e698a | |
DouglasRMiles | 84b617314a | |
Edward J. Schwartz | 12941d9b50 | |
Vítor Santos Costa | bc71e54f20 | |
Vítor Santos Costa | b27c1964bf | |
Vítor Santos Costa | d8620c785e | |
Vítor Santos Costa | efece26020 | |
Vítor Santos Costa | 7b2ff0f16d | |
Vítor Santos Costa | 24bf4088d7 | |
Vítor Santos Costa | 083d374e02 | |
Vítor Santos Costa | ad91eb0ec9 | |
Vítor Santos Costa | 091be7677a | |
Vítor Santos Costa | c381dbe318 | |
Vítor Santos Costa | 56024b2a2c | |
vscosta | a5e99e09bd | |
Vitor Santos Costa | 0e58a8f41e | |
Vítor Santos Costa | fa0ef4e0c8 | |
Vítor Santos Costa | 484168b1ce | |
Edward J. Schwartz | 9b38690055 | |
Edward J. Schwartz | 693272ecdf | |
Vítor Santos Costa | 05a978ce82 | |
Vítor Santos Costa | fb966536a9 | |
Vítor Santos Costa | 0a9f37710c | |
Vítor Santos Costa | ae65bb0265 | |
Vítor Santos Costa | 42091deffc | |
Vítor Santos Costa | 7b8c1815ae | |
Vítor Santos Costa | aed44554f2 | |
Vítor Santos Costa | 92cb3e34eb | |
Vítor Santos Costa | df0b3d3a0d | |
Vítor Santos Costa | 4138e46955 | |
Vítor Santos Costa | afa085de28 | |
Vítor Santos Costa | 9860b6244f | |
Vítor Santos Costa | 994c5d0dfd | |
Vítor Santos Costa | 1deb238d10 | |
Vítor Santos Costa | 78327cf885 | |
Vítor Santos Costa | 48db20515f | |
Vítor Santos Costa | 52a2d00d0c | |
Vítor Santos Costa | c918c052fc | |
Vítor Santos Costa | bea2431c3e | |
Vítor Santos Costa | 8f9fb0437c | |
Vítor Santos Costa | 21fa15bf10 | |
V'itor Santos Costa | 485d20d908 | |
V'itor Santos Costa | 255da61029 | |
V'itor Santos Costa | ee0335124f | |
V'itor Santos Costa | 9a071d5823 | |
V'itor Santos Costa | 6961626a3d | |
V'itor Santos Costa | 74b2b5561d | |
V'itor Santos Costa | f440981b41 | |
V'itor Santos Costa | 574ab5d0ca | |
V'itor Santos Costa | be835c73e6 | |
V'itor Santos Costa | b13dc6812c | |
V'itor Santos Costa | 55deb884d4 | |
Vitor Santos Costa | c8305988ca | |
Vitor Santos Costa | 143684731e | |
Fabrizio Riguzzi | ec999c1126 | |
Fabrizio Riguzzi | 504407eac3 | |
Vitor Santos Costa | e97eb4696e | |
Vítor Santos Costa | c6b7a186c1 | |
Vítor Santos Costa | 965eb4739e | |
V'itor Santos Costa | 77d3101bd8 | |
V'itor Santos Costa | d83c62051b | |
Vítor Santos Costa | a7874dee62 | |
Vítor Santos Costa | 9b38290b8c | |
Vítor Santos Costa | f031e78def | |
Vítor Santos Costa | 7aba41e7c2 | |
Vítor Santos Costa | 3de5b2c2de | |
Vítor Santos Costa | c9babdd03e | |
Vítor Santos Costa | 73f6c456ae | |
Vítor Santos Costa | 0671a1623c | |
Vítor Santos Costa | 60216989f3 | |
Vítor Santos Costa | a143f07ca0 | |
Vítor Santos Costa | cdad87a6fc | |
Vítor Santos Costa | c428e2256d | |
Vítor Santos Costa | c40899d8ec | |
Vítor Santos Costa | 1f7608a735 | |
Vítor Santos Costa | bd337494f1 | |
Vítor Santos Costa | 32f6c44dea | |
Vítor Santos Costa | ae771e70e2 | |
Vítor Santos Costa | b28532a251 | |
Vítor Santos Costa | e5009c733e | |
Vítor Santos Costa | ad7bef51c6 | |
Vítor Santos Costa | 06a2caf7a9 | |
Vítor Santos Costa | 794d04c851 | |
Vítor Santos Costa | 825bfd11c2 | |
Vítor Santos Costa | 5073ff9b43 | |
Vítor Santos Costa | 8c873350c9 | |
Vítor Santos Costa | 017e356cfb | |
Vítor Santos Costa | 8cf73c59ae | |
Vítor Santos Costa | 9c78086a6a | |
Vítor Santos Costa | 35eb33e27f | |
Vítor Santos Costa | 1ebaf342b6 | |
Vítor Santos Costa | 680dae240f | |
Vítor Santos Costa | ebc73ec01e | |
Vítor Santos Costa | 52b282442f | |
Vítor Santos Costa | 4ff7bdd340 | |
Vítor Santos Costa | 5c1c9a8570 | |
Vítor Santos Costa | fbf0c6bd0d | |
Vítor Santos Costa | 7491481e8e | |
Vítor Santos Costa | 1b98e2238c | |
Vítor Santos Costa | 515d5f3705 | |
Vítor Santos Costa | 4f0c539ed6 | |
Vítor Santos Costa | f5c493507e | |
Vítor Santos Costa | 9444c36ff4 | |
Vítor Santos Costa | d90a0f72b0 | |
Vítor Santos Costa | ddabfe45b8 | |
Vítor Santos Costa | 015fbe6703 | |
Vítor Santos Costa | d573407b4d | |
Vítor Santos Costa | 2edae59610 | |
Vítor Santos Costa | 697f57ecef | |
Vitor Santos Costa | 247aa763b5 | |
Vítor Santos Costa | 703ac35735 | |
Vítor Santos Costa | ca2cd734a2 | |
Vítor Santos Costa | a249156989 | |
Vítor Santos Costa | e8f87d2875 | |
Vítor Santos Costa | 10a29998a3 | |
Vítor Santos Costa | 8c69e3811e | |
Vítor Santos Costa | 3074256cc1 | |
Vítor Santos Costa | 828c2c9f6e | |
Vítor Santos Costa | 3966bf2ee1 | |
Vítor Santos Costa | f7207f3c9d | |
Vítor Santos Costa | a2f1ed92ea | |
Vítor Santos Costa | 77a5090276 | |
Vítor Santos Costa | 8c7c258492 | |
Vítor Santos Costa | 97feeda48a | |
Vítor Santos Costa | 6b60742700 | |
Vítor Santos Costa | 93f8179b3b | |
Vítor Santos Costa | f6a6c9deb6 | |
Vítor Santos Costa | 784f9a2880 | |
Vítor Santos Costa | 1a23e47316 | |
Vítor Santos Costa | bdb2f0562a | |
Vítor Santos Costa | a8b8113a8d | |
Vitor Santos Costa | fd2930cbf4 | |
Vitor Santos Costa | 780f42210c | |
Vítor Santos Costa | c11273bc44 | |
Vítor Santos Costa | 2aea33032b | |
Vítor Santos Costa | f6c5a2eea1 | |
Vítor Santos Costa | e315217f0e | |
Vítor Santos Costa | 6d93c35c13 | |
Vítor Santos Costa | 13f020ad25 | |
Vítor Santos Costa | 55c83fc2c8 | |
Vítor Santos Costa | 0eac6ac20b | |
Vítor Santos Costa | c104fb946d | |
Vítor Santos Costa | 3704392811 | |
Vítor Santos Costa | d6c6cecb27 | |
Vítor Santos Costa | c0aa90bc38 | |
Vítor Santos Costa | c8addfd509 | |
Vítor Santos Costa | c56b822cba | |
Vítor Santos Costa | cfbbf6e97e | |
Vítor Santos Costa | 07a37b8c52 | |
Vítor Santos Costa | a03e93a70e | |
Vítor Santos Costa | 5e4cbcef56 | |
Vítor Santos Costa | 5fd4add82b | |
Vítor Santos Costa | 713e9dc9d8 | |
Vítor Santos Costa | 50c8724322 | |
Vítor Santos Costa | c0f00e7a0f | |
Vítor Santos Costa | 99e0458e15 | |
Vítor Santos Costa | 0f121e7f9d | |
Vítor Santos Costa | 801944a0cc | |
Vítor Santos Costa | cde63e2be2 | |
Vítor Santos Costa | bc53e8bae9 | |
Vítor Santos Costa | 1c5b6c3687 | |
Vítor Santos Costa | a8d146dd4d | |
Vítor Santos Costa | bd208fe63e | |
Vítor Santos Costa | 661f33ac7e | |
Vítor Santos Costa | 7a7354fb2b | |
Vítor Santos Costa | 5ca49ae202 | |
Vítor Santos Costa | 811808fc34 | |
Vítor Santos Costa | eabc869c69 | |
Vítor Santos Costa | c927cd5133 | |
Vítor Santos Costa | 792f3e9dd9 | |
Vítor Santos Costa | d942b55dc4 | |
Vítor Santos Costa | ca7d66a791 | |
Vítor Santos Costa | 4e2649c743 | |
Vítor Santos Costa | 9bcd3de29d | |
Vítor Santos Costa | 09106b9a6e | |
Vítor Santos Costa | 7a24d3015e | |
Vítor Santos Costa | 062293055b | |
Vítor Santos Costa | 344cdc69be | |
Vítor Santos Costa | da66171f3d | |
Vítor Santos Costa | 3ee2a11529 | |
Vítor Santos Costa | f0cf91548a | |
Vítor Santos Costa | 3d0e6659b6 | |
Vítor Santos Costa | 60a8efb467 | |
Vítor Santos Costa | 15404b3835 | |
Vítor Santos Costa | 14459cce03 | |
Vítor Santos Costa | 5ceb98bdf9 | |
Vítor Santos Costa | e95e795e08 | |
Vítor Santos Costa | 892cfaed02 | |
Vítor Santos Costa | 63a4b67787 | |
Vítor Santos Costa | 83a3c52a75 | |
Vítor Santos Costa | a3a6386353 | |
Vítor Santos Costa | 3eda5cf68a | |
Vítor Santos Costa | d2ad352f78 | |
Vítor Santos Costa | 95f770f747 | |
Vítor Santos Costa | 9f55c13c34 | |
Vítor Santos Costa | e51de5f83c | |
Vítor Santos Costa | 2bd2de1b9f | |
Vítor Santos Costa | edb6189512 | |
Vítor Santos Costa | c6f1c328f8 | |
Vítor Santos Costa | c04a63d61b | |
Vitor Santos Costa | 8da8e0e472 | |
Vítor Santos Costa | ce8a19d381 | |
Vítor Santos Costa | 7236d4a527 | |
Vítor Santos Costa | 4cea2839e4 | |
Vítor Santos Costa | 54d7d52b09 | |
Vítor Santos Costa | 5d5ac22834 | |
Vítor Santos Costa | 120d6ff19a | |
Vítor Santos Costa | bc54d4458a | |
Vítor Santos Costa | f17fae43e3 | |
Vitor Santos Costa | bfc67e5e35 | |
Vitor Santos Costa | 3437f9e04b | |
Vítor Santos Costa | 67c8253135 | |
Vítor Santos Costa | 832599d220 | |
Vítor Santos Costa | e4f5264ded | |
Vítor Santos Costa | a91796e4c8 | |
Vítor Santos Costa | 504268d5b3 | |
Vitor Santos Costa | 51d0612f59 | |
Vítor Santos Costa | 2b5f5c3d0a | |
Vítor Santos Costa | f822bc8077 | |
Vítor Santos Costa | 85fe3399b4 | |
Vítor Santos Costa | 2466db7ff5 | |
Vítor Santos Costa | edd5c007c8 | |
Vítor Santos Costa | 0b982a72fe | |
Vítor Santos Costa | e4bcc5e8a2 | |
Vítor Santos Costa | adf3ed0311 | |
Vítor Santos Costa | 7468de4553 | |
Vítor Santos Costa | a3c09d66be | |
Vitor Santos Costa | cddb8191c8 | |
Vitor Santos Costa | 3aeebed2cf | |
Vitor Santos Costa | af67ebf5da | |
Vitor Santos Costa | e6b6e7c593 | |
Vitor Santos Costa | 5314a47b14 | |
Vitor Santos Costa | ef0673aa2b | |
Vítor Santos Costa | 5035f4efe6 | |
Vítor Santos Costa | 759ff81e39 | |
Vítor Santos Costa | 4b74421a36 | |
Vítor Santos Costa | e400857810 | |
Vítor Santos Costa | 9f3e3baf2b | |
Vítor Santos Costa | 03c79a89ef | |
Vítor Santos Costa | 2d330f3bee | |
Vítor Santos Costa | 6975c60645 | |
Vítor Santos Costa | 1d66c45fc2 | |
Vítor Santos Costa | a8b51a1ada | |
Vítor Santos Costa | ca81e5d8ea | |
Vítor Santos Costa | 50c04116c8 | |
Vítor Santos Costa | d66db4cf70 | |
Vítor Santos Costa | c450a712d0 | |
Vítor Santos Costa | 5205921541 | |
Vítor Santos Costa | e9debf4d83 | |
Vítor Santos Costa | f8b5ca8291 | |
Vítor Santos Costa | 44dc6f06d7 | |
Vítor Santos Costa | aa2fb8f0c5 | |
Vítor Santos Costa | 5f58216315 | |
Vítor Santos Costa | df273f549a | |
Vítor Santos Costa | c1ca214932 | |
Vítor Santos Costa | 5f76e105b1 | |
Vítor Santos Costa | 4354083208 | |
Vítor Santos Costa | e04dd14bed | |
Vítor Santos Costa | 4cbeb6df39 | |
Vítor Santos Costa | 4dfcdd4e87 | |
Vítor Santos Costa | e162ec9ef9 | |
Vítor Santos Costa | 9ed0389186 | |
Vítor Santos Costa | f9b19af0ea | |
Vítor Santos Costa | 148a5f3acd | |
Vítor Santos Costa | 35bebd3a56 | |
Vítor Santos Costa | b7f16997df | |
Vítor Santos Costa | e2cac6279c | |
Vítor Santos Costa | f8fc35a548 | |
Vítor Santos Costa | 9ffe2ddddc | |
Vítor Santos Costa | ed4b76ddc6 | |
Vítor Santos Costa | 27bfbdc1be | |
Vítor Santos Costa | 14250cfff6 | |
Vítor Santos Costa | 53927de579 | |
Vítor Santos Costa | b84262238d | |
Vítor Santos Costa | 83fdeab85f | |
Vítor Santos Costa | 99ee24ba69 | |
Vítor Santos Costa | 5278affb0e | |
Vítor Santos Costa | 5db391b60a | |
Vítor Santos Costa | b4f1a40b4b | |
Vítor Santos Costa | 91d1cf2c52 | |
Vítor Santos Costa | f8eb163a1d | |
Vítor Santos Costa | e4bfb263a0 | |
Vítor Santos Costa | bb5a506864 | |
Vítor Santos Costa | 7be5d1374a | |
Vítor Santos Costa | b323d17369 | |
Vítor Santos Costa | e9ed130ffd | |
Vítor Santos Costa | ac48a263c4 | |
Vítor Santos Costa | bd6ffb5d41 | |
Vítor Santos Costa | 77d57b90d4 | |
Vítor Santos Costa | e3a56234e4 | |
Vítor Santos Costa | ad56cc07df | |
Vítor Santos Costa | b701e571b0 | |
Vítor Santos Costa | 8ac1e23450 | |
Vítor Santos Costa | 4224382be1 | |
Vítor Santos Costa | a26dbe0dfc | |
Vítor Santos Costa | 7034d7b307 | |
Vítor Santos Costa | f758ac2fe4 | |
Vítor Santos Costa | 67bb20cf0d | |
Vítor Santos Costa | cc13181741 | |
Vítor Santos Costa | cc632c08af | |
Vítor Santos Costa | 4a200c3601 | |
Vítor Santos Costa | 31246ccc0b | |
Vítor Santos Costa | ffd2ef113b | |
Vítor Santos Costa | 962130734e | |
Vítor Santos Costa | 98e8bf63e0 | |
Vítor Santos Costa | 0fec4766e5 | |
Vítor Santos Costa | 00245ff0fc | |
Vítor Santos Costa | 9db87d1da4 | |
Vítor Santos Costa | 7fd6167c50 | |
Vítor Santos Costa | 6cc1ed77ed | |
Vítor Santos Costa | 9ce6ba5186 | |
Vítor Santos Costa | b0f3cda2d7 | |
Vítor Santos Costa | df26a7a84a | |
Vítor Santos Costa | 3c4d6117e6 | |
Vítor Santos Costa | 1b2f2f0f93 | |
Vítor Santos Costa | f133ff279e | |
Vítor Santos Costa | bc8541666a | |
Vítor Santos Costa | 691f02816d | |
Vítor Santos Costa | 13aff4de32 | |
Vítor Santos Costa | ddfed40e00 | |
Vítor Santos Costa | 8fcceb9957 | |
Vítor Santos Costa | 9197b39393 | |
Vítor Santos Costa | 12dcbbc0f3 | |
Vítor Santos Costa | b9369e1e7d | |
Vítor Santos Costa | 4c0615bb54 | |
Vítor Santos Costa | 72252ed817 | |
Vítor Santos Costa | e1dcdf0728 | |
Vítor Santos Costa | 6e9e383914 | |
Vítor Santos Costa | b1ccb2e3ec | |
Vítor Santos Costa | 036876299f | |
Vítor Santos Costa | 48f5a824e0 | |
Vítor Santos Costa | 3f58566ac8 | |
Vítor Santos Costa | 4cb2e5c2fe | |
Vítor Santos Costa | 2047885bfa | |
Vítor Santos Costa | ce828f52c9 | |
Vítor Santos Costa | 64e6fd981f | |
Vítor Santos Costa | 9e0ce35d29 | |
Vítor Santos Costa | 759ce13bbf | |
Vítor Santos Costa | ad603a53ed | |
Vítor Santos Costa | f8836ec1b2 | |
Vítor Santos Costa | db8d44efdc | |
Vítor Santos Costa | a9fa343bad | |
Vítor Santos Costa | 9dd4a4a807 | |
Vítor Santos Costa | 442221604f | |
Vítor Santos Costa | b2b28a3dfe | |
Vítor Santos Costa | 37eae7b70a | |
Vítor Santos Costa | f1c9952c77 | |
Vítor Santos Costa | aaa9aa2b7b | |
Vítor Santos Costa | 2d1c11c42f | |
Vítor Santos Costa | 17e216c01b | |
Vítor Santos Costa | d70def0012 | |
Vítor Santos Costa | 03850291c0 | |
Vítor Santos Costa | 352ea085b7 | |
Vítor Santos Costa | 8cd22a0c18 | |
Vítor Santos Costa | 42e2543ab7 | |
Vítor Santos Costa | b2369175e5 | |
Vítor Santos Costa | 3f2dbba042 | |
Vítor Santos Costa | f1be0f94d0 | |
Vítor Santos Costa | 098be4aba0 | |
Vítor Santos Costa | bcdfdeb65d | |
Vítor Santos Costa | d6148eb8ad | |
Vítor Santos Costa | 7f8ebe18d0 | |
Vítor Santos Costa | cc6949681b | |
Vítor Santos Costa | c26e5afaf0 | |
Vitor Santos Costa | 318b2e8df2 | |
Vitor Santos Costa | 20c87f1ab6 | |
Vitor Santos Costa | cba4fdfe95 | |
Vitor Santos Costa | e2363ca0d0 | |
Vitor Santos Costa | b95efeff90 | |
Vitor Santos Costa | 7a70280940 | |
Vitor Santos Costa | 885fc51225 | |
Vitor Santos Costa | 6a068a6e94 | |
Vitor Santos Costa | b76be19b61 | |
Vitor Santos Costa | aedc686ede | |
Vitor Santos Costa | 2b5bddb690 | |
Vitor Santos Costa | d48772c24d | |
Vitor Santos Costa | b7c3cf5484 | |
Vitor Santos Costa | 438cd7dce5 | |
Vitor Santos Costa | 1d10b9c709 | |
Vitor Santos Costa | 390e9e0557 | |
Vitor Santos Costa | 495fdca699 | |
Vítor Santos Costa | 468913e38c | |
Vítor Santos Costa | 98127b7102 | |
Vítor Santos Costa | d4dde8699d | |
Vítor Santos Costa | 1c727bbe45 | |
Vítor Santos Costa | 684e733c8b | |
Vítor Santos Costa | f4eee4782e | |
Vítor Santos Costa | 9fb7325f19 | |
Vítor Santos Costa | 5762aa846c | |
Vítor Santos Costa | 8f7c43997e | |
Vitor Santos Costa | 3c3eb0c398 | |
Vitor Santos Costa | 9c21463133 | |
Vítor Santos Costa | 72c34cdb8f | |
Vítor Santos Costa | c4aae66f3e | |
Vítor Santos Costa | 1a5ba98950 | |
Vítor Santos Costa | 25c3010de6 | |
Vítor Santos Costa | 9b33c9d8ba | |
Vítor Santos Costa | d47f59be09 | |
Vítor Santos Costa | b6130b0e7d | |
Vítor Santos Costa | ec1e35192f | |
Vítor Santos Costa | 3368c84696 | |
Vítor Santos Costa | 30be57ed71 | |
Vítor Santos Costa | 66020422a8 | |
Vítor Santos Costa | f56c80675b | |
Vítor Santos Costa | 8dcae6ca47 | |
Vítor Santos Costa | 1408237215 | |
Vítor Santos Costa | aaca416b93 | |
Vítor Santos Costa | 68c29b3ab0 | |
Vítor Santos Costa | ddbba89d16 | |
Vítor Santos Costa | 9595bb4e6e | |
Vítor Santos Costa | a66f5f0531 | |
Vítor Santos Costa | f10a329f9f | |
Vítor Santos Costa | 66372f256a | |
Vítor Santos Costa | 1f3b2509f1 | |
Vítor Santos Costa | bc2dabbca5 | |
Vítor Santos Costa | d5c21324a4 | |
Vítor Santos Costa | b654c8fe00 | |
Vítor Santos Costa | fa738894a4 | |
Vítor Santos Costa | d94ffe2126 | |
Vítor Santos Costa | 1bbb761aec | |
Vítor Santos Costa | 699dcfe6eb | |
Vítor Santos Costa | 555d146dc5 | |
Vítor Santos Costa | e1f7333e2e | |
Vítor Santos Costa | 6169bbb3ad | |
Vítor Santos Costa | d88c6199c2 | |
Vítor Santos Costa | b3cc23ce64 | |
Vítor Santos Costa | b788dc131d | |
Vítor Santos Costa | 4e60e9b0f9 | |
Vítor Santos Costa | d1c4db3c4b | |
Vítor Santos Costa | e8ed525e3b | |
Vítor Santos Costa | 3192e094af | |
Vítor Santos Costa | 5bf02425d2 | |
Vítor Santos Costa | 6ec543c5f6 | |
Vítor Santos Costa | 91c366d0d1 | |
Vítor Santos Costa | 0985a10078 | |
Vítor Santos Costa | 59f6e89def | |
Vítor Santos Costa | 5ed065f92d | |
Vítor Santos Costa | c1b977b901 | |
Vítor Santos Costa | 4d132d278c | |
Vítor Santos Costa | 4cbf3387e1 | |
Vítor Santos Costa | 166d4892f9 | |
Vítor Santos Costa | e5fc818c37 | |
Vítor Santos Costa | 263fdf330d | |
Vítor Santos Costa | e9e34e086f | |
Vítor Santos Costa | 9075eb84d2 | |
Vítor Santos Costa | 784a058b04 | |
Vítor Santos Costa | 9a962805ca | |
Vítor Santos Costa | 544eeea97f | |
Vítor Santos Costa | c56276233a | |
Vítor Santos Costa | 7885433ab5 | |
Vítor Santos Costa | a95b3e4fcd | |
Vítor Santos Costa | 4ed6e4fae9 | |
Vítor Santos Costa | c8ea14057c | |
Vítor Santos Costa | 1ef7eeabdf | |
Vítor Santos Costa | f81f31a5f7 | |
Vítor Santos Costa | e8bf2d4349 | |
Vítor Santos Costa | c61e721e73 | |
Vítor Santos Costa | 9326b2ea62 | |
Vítor Santos Costa | 34fe3e6ded | |
Vítor Santos Costa | 4c368a59d3 | |
Vítor Santos Costa | db2cf949b4 | |
Vítor Santos Costa | 7347edd5e0 | |
Vítor Santos Costa | a613f5428e | |
Vítor Santos Costa | 58f34f7a5f | |
Vítor Santos Costa | cd7d654cca | |
Vítor Santos Costa | b3a262910f | |
Vítor Santos Costa | 04a2c10ebe | |
Vítor Santos Costa | 5c05b3be45 | |
Vítor Santos Costa | 059e38d8f0 | |
Vítor Santos Costa | 2ac59d36aa | |
Vítor Santos Costa | 8208a181d3 | |
Vítor Santos Costa | fa586f8769 | |
Vítor Santos Costa | b871f6676e | |
Vítor Santos Costa | 4336b2ba88 | |
Vítor Santos Costa | 880a9989c3 | |
Vítor Santos Costa | f41a8c19ef | |
Vítor Santos Costa | 08733b815c | |
Vítor Santos Costa | 72776e3b14 | |
Vítor Santos Costa | 4cd70e68ce | |
Vítor Santos Costa | 59f038386b | |
Vítor Santos Costa | b47ffd2f64 | |
Vítor Santos Costa | 338a4bb733 | |
Vítor Santos Costa | 80036958a1 | |
Vítor Santos Costa | c33a345429 | |
Vítor Santos Costa | c97cd1fcae | |
Vítor Santos Costa | 8cc38c3377 | |
Vítor Santos Costa | 668f5f1503 | |
Vítor Santos Costa | 4ccb8cf210 | |
Vítor Santos Costa | 89b0279ca6 | |
Vítor Santos Costa | bb68d19d39 | |
Vítor Santos Costa | ca25eaa450 | |
Vítor Santos Costa | 7c0ce9ee7e | |
Vítor Santos Costa | b7a1e464ef | |
Vítor Santos Costa | 4e76d86083 | |
Vítor Santos Costa | 2266bb9826 | |
Vítor Santos Costa | 56a3fc5651 | |
Vítor Santos Costa | 6274a0662e | |
Vítor Santos Costa | b164f53191 | |
Vítor Santos Costa | dbdae6a930 | |
Vítor Santos Costa | 36058116f5 | |
Vítor Santos Costa | 3761252735 | |
Vítor Santos Costa | 0ea8fb8d34 | |
Vítor Santos Costa | 3f55904bfe | |
Vítor Santos Costa | d4f49a20ba | |
Vítor Santos Costa | f3b84af062 | |
Vítor Santos Costa | 91d6faabc1 | |
Vítor Santos Costa | 78ed4c9e5e | |
Vítor Santos Costa | 019ca45bdb | |
Vítor Santos Costa | 0e1335d7ff | |
Vítor Santos Costa | 6d507ff49f | |
Vítor Santos Costa | 01a720389e | |
Vítor Santos Costa | 6ae0c450b3 | |
Vítor Santos Costa | 99948c5acc | |
Vítor Santos Costa | 69344f26d1 | |
Vítor Santos Costa | 1c6a138ce2 | |
Vítor Santos Costa | 8dec7f6478 | |
Vítor Santos Costa | 520ce938fd | |
Vítor Santos Costa | 2a20217c46 | |
Vítor Santos Costa | 98d7b2d7f8 | |
Vítor Santos Costa | 78ef33c463 | |
Vítor Santos Costa | e1597dd022 | |
Vítor Santos Costa | 4eaf848e87 | |
Vítor Santos Costa | a902b9bc79 | |
Vítor Santos Costa | 1d6f9981e1 | |
Vítor Santos Costa | 33de6766a5 | |
Vítor Santos Costa | 705a6e9b7f | |
Vítor Santos Costa | 03d9fdd45a | |
Vítor Santos Costa | 94092be293 | |
Vítor Santos Costa | 84afde2d56 | |
Vítor Santos Costa | a97754623f | |
Vítor Santos Costa | 9a638d1312 | |
Vítor Santos Costa | 421dee6881 | |
Vítor Santos Costa | 2cf9902dfe | |
Vítor Santos Costa | 3a00568489 | |
Vítor Santos Costa | 4c56769210 | |
Vítor Santos Costa | f5b50a4179 | |
Vítor Santos Costa | 1c06bfdc05 | |
Vítor Santos Costa | 59de30d606 | |
Vítor Santos Costa | 84b5fcce77 | |
Vítor Santos Costa | edbd2654e8 | |
Vítor Santos Costa | 5f71b15c03 | |
Vítor Santos Costa | de3a6c5637 | |
Vítor Santos Costa | 9ad02e3f9a | |
Vítor Santos Costa | 1b8cd91618 | |
Vítor Santos Costa | 63c2fa3c6b | |
Vítor Santos Costa | 8f90705e26 | |
Vítor Santos Costa | 497cc27003 | |
Vítor Santos Costa | 0552edce2c | |
Vítor Santos Costa | 0889596e8b | |
Vítor Santos Costa | b93f10fe07 | |
Vítor Santos Costa | c3487d0fc0 | |
Vítor Santos Costa | e8e33e405a | |
Vítor Santos Costa | 5746edafaf | |
Vítor Santos Costa | 3b42554a68 | |
Vítor Santos Costa | 0b68aea31e | |
Vítor Santos Costa | 720f9e5242 | |
Vítor Santos Costa | e77b9bd32d | |
Vítor Santos Costa | aef6cf35d6 | |
Vítor Santos Costa | 17049ce8ec | |
Vítor Santos Costa | e2fc835cfd | |
Vítor Santos Costa | 3e14ec4cb6 | |
Vítor Santos Costa | 2f96a24a1f | |
Vítor Santos Costa | 95a47702be | |
Vítor Santos Costa | c0bb14416b | |
Vítor Santos Costa | 86b11f5536 | |
Vítor Santos Costa | 1471d27d12 | |
Vítor Santos Costa | 209ad287f8 | |
Vítor Santos Costa | d18c59f7eb | |
Vítor Santos Costa | 6bc1833d2f | |
Vítor Santos Costa | c46345a0f0 | |
Vítor Santos Costa | d602d3d9ea | |
Vítor Santos Costa | e60f1f2c3d | |
Vítor Santos Costa | 42b79d7ee7 | |
Vítor Santos Costa | 144eb6ab47 | |
Vítor Santos Costa | 29f87ccca6 | |
Vítor Santos Costa | b13f742f02 | |
Vítor Santos Costa | 524a9ec738 | |
Vítor Santos Costa | df52ba811a | |
Vítor Santos Costa | 91d29112b0 | |
Vítor Santos Costa | e970df6dae | |
Vítor Santos Costa | 315a882e8f | |
Vítor Santos Costa | fec94d9cde | |
Vítor Santos Costa | d7d2e320a8 | |
Vítor Santos Costa | 6812940b8b | |
Vítor Santos Costa | 51564ec7bc | |
Vítor Santos Costa | 429ebe5b27 | |
Vítor Santos Costa | 2370a39b09 | |
Vítor Santos Costa | 60861649a0 | |
Vítor Santos Costa | 8fc4dc2219 | |
Vítor Santos Costa | c755a6d4e5 | |
Vítor Santos Costa | c652f79f26 | |
Vítor Santos Costa | eabf145052 | |
Vítor Santos Costa | 4f8b6929b9 | |
Vítor Santos Costa | ef75c89c51 | |
Vítor Santos Costa | 8fb4f2a146 | |
Vítor Santos Costa | a9abd9ea6a | |
Vítor Santos Costa | b4e0cabb77 | |
Vítor Santos Costa | a721aa5a3c | |
Vítor Santos Costa | f4e4220130 | |
Vítor Santos Costa | 3c0987ef55 | |
Vítor Santos Costa | d5e85663d9 | |
Vítor Santos Costa | 3d6a8ddc77 | |
Vítor Santos Costa | 1b975a7a78 | |
Vítor Santos Costa | aa29b88e70 | |
Vítor Santos Costa | 14330244df | |
Vítor Santos Costa | 204f81876a | |
Vítor Santos Costa | 9c1a3cc3b1 | |
Vítor Santos Costa | bd572cbb59 | |
Vítor Santos Costa | 8ec89c5bef | |
Vítor Santos Costa | b2e102faa9 | |
Vítor Santos Costa | cd41137cbc | |
Vítor Santos Costa | 47c3f64eae | |
Vítor Santos Costa | e535e16ae3 | |
Vítor Santos Costa | 5829e326b7 | |
Vítor Santos Costa | e9a8e93474 | |
Vítor Santos Costa | afa8d52e50 | |
Vítor Santos Costa | 30af67b3ca | |
Vítor Santos Costa | 0e002f8ca0 | |
Vítor Santos Costa | adb8ff064d | |
Vítor Santos Costa | ff9051349b | |
Vítor Santos Costa | d474437edc | |
Vítor Santos Costa | 7fda0bf07f | |
Vítor Santos Costa | 254e63fc8c | |
Vítor Santos Costa | 4e09c0faf1 | |
Vítor Santos Costa | e989419605 | |
Vítor Santos Costa | 6815d4b878 | |
Vítor Santos Costa | 52c8b478e5 | |
Vítor Santos Costa | 48ed9083d9 | |
Vítor Santos Costa | 102015785a | |
Vítor Santos Costa | c26b5f3175 | |
Vítor Santos Costa | 4132854fbe | |
Vítor Santos Costa | d8fa0ac8f6 | |
Vítor Santos Costa | 0ed3ee4fc4 | |
Vítor Santos Costa | d5ce9a1376 | |
Vítor Santos Costa | 18fee4eee1 | |
Vítor Santos Costa | db6074f839 | |
Vítor Santos Costa | 3b4226bda1 | |
Vítor Santos Costa | e043e7595e | |
Vítor Santos Costa | 742c299672 | |
Vítor Santos Costa | 660800af67 | |
Vítor Santos Costa | 94e2d3cf22 | |
Vítor Santos Costa | 9b0c606de3 | |
Vítor Santos Costa | d1ec94c4c0 | |
Vítor Santos Costa | e963c59649 | |
Vítor Santos Costa | 76cd423784 | |
Vítor Santos Costa | e710319c0e | |
Vítor Santos Costa | 4489616b19 | |
Vitor Santos Costa | 81909565bc | |
Vítor Santos Costa | 9fca32c7ac | |
Vítor Santos Costa | bfc5b4e3b1 | |
Vitor Santos Costa | 800289f7bb | |
Vítor Santos Costa | b97fa48cd2 | |
Vítor Santos Costa | bf8beba466 | |
Vítor Santos Costa | b14dc43bc9 | |
Vítor Santos Costa | 3c73a2e6d6 | |
Vítor Santos Costa | ecd980c491 | |
Vítor Santos Costa | ec7ddf0dba | |
Vítor Santos Costa | ef586e264e | |
Vítor Santos Costa | d1a230eb56 | |
Vítor Santos Costa | 00c58f5572 | |
Paulo Moura | b91c535ea3 | |
Vitor Santos Costa | 756a79995b | |
Vitor Santos Costa | cd45c04514 | |
Vitor Santos Costa | 206d6cebcf | |
Vitor Santos Costa | a8b51d80ab | |
Vitor Santos Costa | b3c0708240 | |
Vitor Santos Costa | bd829946ed | |
Vitor Santos Costa | d6e648a7ff | |
Vitor Santos Costa | 9709c590bf | |
Vitor Santos Costa | 666b68c1fb | |
Vitor Santos Costa | 6c9c410283 | |
Vítor Santos Costa | c7f700627d | |
Vítor Santos Costa | 5f7101a9e3 | |
Vítor Santos Costa | 5d27ad0243 | |
Vítor Santos Costa | 16c8d54f0e | |
Vítor Santos Costa | 4eeacd8b7b | |
Vítor Santos Costa | c9aa53350a | |
Vítor Santos Costa | 5150dcae3d | |
Vítor Santos Costa | 2b2e21ae64 | |
Vítor Santos Costa | 272d28ae5f | |
Vítor Santos Costa | 55bd75b8d8 | |
Vítor Santos Costa | 7cceb655b3 | |
Vítor Santos Costa | 04ff7f3f2d | |
Vítor Santos Costa | 82d4716339 | |
Vitor Santos Costa | 6a0b6fad8b | |
Vitor Santos Costa | 580bc9eb27 | |
Vitor Santos Costa | 252a2b7868 | |
Vítor Santos Costa | 26b3cb5bb7 | |
Vítor Santos Costa | a40c205d5f | |
Vítor Santos Costa | 0f2d1e8429 | |
Vítor Santos Costa | 65c97e7072 | |
Vítor Santos Costa | 5b19e9546a | |
Vítor Santos Costa | 9b6bcdde16 | |
Vítor Santos Costa | 5ea3fcd08f | |
Vítor Santos Costa | 48c87bd775 | |
Vítor Santos Costa | 4386c42d02 | |
Vítor Santos Costa | 3d9006db32 | |
Vítor Santos Costa | 8ea17007f0 | |
Vítor Santos Costa | dbfe42b360 | |
Vítor Santos Costa | da83ad447c | |
Vítor Santos Costa | a9acacd1c5 | |
Vítor Santos Costa | 8a4257d80a | |
Vítor Santos Costa | 0839baf638 | |
Vítor Santos Costa | 0b90870185 | |
Vítor Santos Costa | 9d48f3c3c0 | |
Vítor Santos Costa | 2ebf6a5f0e | |
Vítor Santos Costa | e4b0b8c0df | |
Vítor Santos Costa | 291ec26d65 | |
Vítor Santos Costa | d805a474a4 | |
Vítor Santos Costa | a24c90334f | |
Vítor Santos Costa | 9895ec63d0 | |
Vitor Santos Costa | 1e57a2e978 | |
Vitor Santos Costa | 3d6c0e7933 | |
Vitor Santos Costa | 0d955797fe | |
Vitor Santos Costa | 9fe1ec7e3e | |
Vitor Santos Costa | 2d20db7e6d | |
Vitor Santos Costa | 29ffb152e5 | |
Vitor Santos Costa | 63416fdc48 | |
Vitor Santos Costa | ada2ad44de | |
Vítor Santos Costa | 071bb36f0e | |
Vítor Santos Costa | bfa9578d5e | |
Vítor Santos Costa | d606a2820b | |
Vítor Santos Costa | 71c9cb21b7 | |
Vítor Santos Costa | 68abafd024 | |
Vítor Santos Costa | 102c8a1dc1 | |
Vítor Santos Costa | 3bcde55a77 | |
Vitor Santos Costa | dd22039a59 | |
Vitor Santos Costa | 61625ca7ad | |
Vitor Santos Costa | eef8bc8629 | |
Vítor Santos Costa | 2d919a4a09 | |
Vítor Santos Costa | 9743c81f05 | |
Vítor Santos Costa | ab41d5411e | |
Vítor Santos Costa | 081b2a464e | |
Vítor Santos Costa | 350caa388b | |
Vitor Santos Costa | afd8c9b9c4 | |
Vitor Santos Costa | 888a58b715 | |
Vitor Santos Costa | 41baec9f6e | |
Vitor Santos Costa | cd1d347cb0 | |
Vitor Santos Costa | e2cd49f408 | |
Vitor Santos Costa | 9e24724f0b | |
Vitor Santos Costa | f983c99313 | |
Vitor Santos Costa | 5a7602dfff | |
Vitor Santos Costa | 2ca29d208f | |
Vitor Santos Costa | d2769d975a | |
Vitor Santos Costa | a7ae565a75 | |
Vítor Santos Costa | 1f1aa72e4a | |
Vítor Santos Costa | 8dcdb6ce09 | |
Vitor Santos Costa | 2db0b9d6a6 | |
Vitor Santos Costa | 886777f1e6 | |
Vítor Santos Costa | 88e3d637ec | |
Vítor Santos Costa | a8a63a31ca | |
Vítor Santos Costa | bdcd06cf04 | |
Vítor Santos Costa | 4dd8ee803f | |
Vítor Santos Costa | ba978d8275 | |
Vítor Santos Costa | 42d7b305c0 | |
Vítor Santos Costa | 7b4cd0d256 | |
Vítor Santos Costa | bae7b716e2 | |
Vítor Santos Costa | c802669cf4 | |
Vítor Santos Costa | e29b7afa1b | |
Vítor Santos Costa | cc1702d4b5 | |
Vítor Santos Costa | 1f3245243c | |
Vítor Santos Costa | 409a79d93a | |
Vítor Santos Costa | 34eb3bd62b | |
Vítor Santos Costa | 3f8074ede9 | |
Vítor Santos Costa | 5e1b92019b | |
Vítor Santos Costa | 30664a5344 | |
Vítor Santos Costa | 916f010504 | |
Vítor Santos Costa | 2f621e5b47 | |
Vítor Santos Costa | 5a668febd9 | |
Vítor Santos Costa | bf215e68a2 | |
Vítor Santos Costa | 65bcdc541c | |
Vitor Santos Costa | 4526350113 | |
Vitor Santos Costa | 36e4cbf98b | |
Theo | 75985b8fff | |
Vítor Santos Costa | 9f945c152d | |
Vitor Santos Costa | 4a5a3d833a | |
Vitor Santos Costa | 1eeb17f6f1 | |
Vitor Santos Costa | d9357d3f49 | |
Vitor Santos Costa | d023e2e493 | |
Vitor Santos Costa | 461caf22b4 | |
Vítor Santos Costa | a8b1872396 | |
Vitor Santos Costa | 2c3a8390fe | |
Vítor Santos Costa | 4076d24022 | |
Vitor Santos Costa | 4ad31b6593 | |
Vítor Santos Costa | 9bc20918c9 | |
Vitor Santos Costa | 865945317c | |
Vítor Santos Costa | 61a47b2874 | |
Vítor Santos Costa | bc1e70758e | |
Vítor Santos Costa | 9d4b59f7d6 | |
Vítor Santos Costa | 70806f1841 | |
Vítor Santos Costa | bece9d05d8 | |
Vítor Santos Costa | 61d6015d76 | |
Vítor Santos Costa | 3acf4b3fea | |
Vítor Santos Costa | 9fff6e7226 | |
Vítor Santos Costa | 24a36002cc | |
Vítor Santos Costa | 8f1699a343 | |
Vítor Santos Costa | 771610ffb6 | |
Vítor Santos Costa | d8fd232d78 | |
Vítor Santos Costa | 7ede2cde5e | |
Vítor Santos Costa | 5c261da4f6 | |
Vítor Santos Costa | 67609ed1ce | |
Vitor Santos Costa | 64da0b138f | |
Vitor Santos Costa | ce84e60d08 | |
Vitor Santos Costa | e40c248c16 | |
Vitor Santos Costa | ec0aa5ed0a | |
Vitor Santos Costa | 21be46b123 | |
Vitor Santos Costa | 9623f70d3a | |
Vitor Santos Costa | 9dcfb6a745 | |
Vitor Santos Costa | eeffeea9aa | |
Vitor Santos Costa | 0c88265943 | |
Vitor Santos Costa | b494cce5dc | |
Vitor Santos Costa | e69c9fc056 | |
Vitor Santos Costa | 45e3711ca2 | |
Vitor Santos Costa | f835ff153d | |
Vitor Santos Costa | 7a8f57eb63 | |
Vitor Santos Costa | 58357b1af4 | |
Vitor Santos Costa | c081e9774d | |
Vitor Santos Costa | 9b18f6aee4 | |
Vitor Santos Costa | 242844d12f | |
Vitor Santos Costa | 408333f0d4 | |
Vitor Santos Costa | 0cca59b36f | |
Vitor Santos Costa | 62a2c14c12 | |
Vitor Santos Costa | 4052f9b910 | |
Theo | a2cd68f1ca | |
Vitor Santos Costa | 32ce8318a1 | |
Vitor Santos Costa | 530764e196 | |
Vitor Santos Costa | 8c605a65fe | |
Vitor Santos Costa | 415d139ad7 | |
Vitor Santos Costa | 504d67375b | |
Vitor Santos Costa | befedf8db2 | |
Vitor Santos Costa | 326771d17b | |
Vitor Santos Costa | 3122d323b5 | |
Vitor Santos Costa | 0d5fff0f16 | |
Vítor Santos Costa | 832b2258c8 | |
Vítor Santos Costa | ac9070f120 | |
Vítor Santos Costa | 797dd6452d | |
Vítor Santos Costa | dbd2aa64aa | |
Vitor Santos Costa | b3754795a2 | |
Vitor Santos Costa | d3412c4d97 | |
Vitor Santos Costa | f22f337f67 | |
Vitor Santos Costa | de9a1d7429 | |
Vítor Santos Costa | 746740421d | |
Vítor Santos Costa | f121a4a1bd | |
Vitor Santos Costa | f42f2ff57d | |
Vitor Santos Costa | fcf0f41312 | |
Vitor Santos Costa | 5053cfb571 | |
Vítor Santos Costa | 77c2d53445 | |
Vítor Santos Costa | 326a4de147 | |
Vítor Santos Costa | c0476daa53 | |
Vítor Santos Costa | 3164ed2d61 | |
Vítor Santos Costa | a87f1040ac | |
Vítor Santos Costa | 0722644f99 | |
Vítor Santos Costa | 53877ad426 | |
Vítor Santos Costa | bc6bf8cdfd | |
Vítor Santos Costa | 37c6b9975b | |
Vitor Santos Costa | ad2df06d2b | |
Vítor Santos Costa | 21d379bfb6 | |
Vitor Santos Costa | 247371c095 | |
Vitor Santos Costa | 8e3eed1fe1 | |
Vitor Santos Costa | 66b8498e4b | |
Vítor Santos Costa | 5df70e13f7 | |
Vitor Santos Costa | f4a3c27ae9 | |
Vítor Santos Costa | 535135b21c | |
Vitor Santos Costa | 7bdcf2cde6 | |
Vítor Santos Costa | 58ece4fa43 | |
Vitor Santos Costa | 3ecbd3aa65 | |
Vitor Santos Costa | 1591bfd00d | |
Vítor Santos Costa | 83d80943b9 | |
Vítor Santos Costa | c2ea3b1cd2 | |
Vítor Santos Costa | bad29b415d | |
Vítor Santos Costa | 93c8dd75e2 | |
Vítor Santos Costa | 374eb86c8a | |
Vítor Santos Costa | 72915ff622 | |
Vítor Santos Costa | 0200f39661 | |
Vitor Santos Costa | 656e27f5e0 | |
Vítor Santos Costa | 90feb7f9f8 | |
Vítor Santos Costa | 289a36a0a1 | |
Vítor Santos Costa | 0ae8785de5 | |
Vítor Santos Costa | 5da1be61cb | |
Vítor Santos Costa | f5ef30563b | |
Vítor Santos Costa | bed14749f8 | |
Vítor Santos Costa | 15c79d8ecf | |
Vítor Santos Costa | 80363e359e | |
Vítor Santos Costa | 4ed4e776e6 | |
Vítor Santos Costa | 7acb2110d2 | |
Vitor Santos Costa | ff977fbad8 | |
Vítor Santos Costa | 7ea6d84300 | |
Vítor Santos Costa | 2c5fa4a65e | |
Vítor Santos Costa | 7038ea1958 | |
Vítor Santos Costa | 0f560abc92 | |
Vítor Santos Costa | 5b37c15742 | |
Vítor Santos Costa | 9f28f7e836 | |
Vítor Santos Costa | 0cebf08bfe | |
Vítor Santos Costa | 4117333f60 | |
Vítor Santos Costa | 197a943cd3 | |
Vítor Santos Costa | 84e4162435 | |
Vítor Santos Costa | 635d5166ce | |
Vítor Santos Costa | 097db1b0b6 | |
Vítor Santos Costa | d44beea3aa | |
Vítor Santos Costa | 3e0764edcf | |
Vítor Santos Costa | c071e145a7 | |
Vítor Santos Costa | 0b3fd61088 | |
Vítor Santos Costa | 22acc44b4b | |
Vítor Santos Costa | 7bca484b63 | |
Vítor Santos Costa | d526545bc9 | |
Vítor Santos Costa | 70060bf627 | |
Vítor Santos Costa | 650f6eb827 | |
Vítor Santos Costa | a83ff038f4 | |
Vítor Santos Costa | c9c2d7233c | |
Vítor Santos Costa | 570513f8f9 | |
Vítor Santos Costa | 6d82d4816a | |
Vítor Santos Costa | dc21270454 | |
Vitor Santos Costa | 624183b78e | |
Vitor Santos Costa | afc6c5d04e | |
Vitor Santos Costa | 804504201d | |
Vitor Santos Costa | f79458bac2 | |
Vitor Santos Costa | 2be225c17a | |
Vitor Santos Costa | 50659967ed | |
Vítor Santos Costa | 1ca062f558 | |
Vítor Santos Costa | bb8ea9a27d | |
Theo | cd4b9602ae | |
Vitor Santos Costa | ff6184863f | |
Vitor Santos Costa | addb8cbce3 | |
Theo | ddb8e2dd3f | |
Vítor Santos Costa | cfafc26b68 | |
vscosta | fa9ea6fd51 | |
vscosta | 6a6b3db0c6 | |
vscosta | a8a535afa4 | |
vscosta | f1cbffae6f | |
vscosta | c695e5e068 | |
vscosta | 04b87d2414 | |
vscosta | 7094d604fb | |
vscosta | 135e9127b1 | |
vscosta | 1650b12267 | |
Vitor Santos Costa | 24920a230f | |
Vitor Santos Costa | e7fcc5d9a1 | |
vscosta | 9868abab6c | |
vscosta | 9c2fd881f7 | |
vscosta | 2870395627 | |
vscosta | d8c4ea4364 | |
vscosta | 6958f4ce6d | |
Vitor Santos Costa | 5dfb438abb | |
Vitor Santos Costa | ac85c0741d | |
Vitor Santos Costa | e351402ed9 | |
vscosta | 10e1080ddd | |
vscosta | ff761c4196 | |
vscosta | 8f448c0284 | |
vscosta | c633eac236 | |
vscosta | 605dd2abc1 | |
Theo | 7e6ab7b0d2 | |
vscosta | fdadf7d477 | |
vscosta | 58734fe2e7 | |
Vítor Santos Costa | 83a34ad849 | |
Vítor Santos Costa | 2036ec3137 | |
Vítor Santos Costa | 9d615f3c24 | |
vscosta | c7a3836b2c | |
Vítor Santos Costa | ef0d7b77fb | |
Vítor Santos Costa | c440ab239b | |
Vitor Santos Costa | 9975ab9b94 | |
Vítor Santos Costa | dce3e7a1bc | |
Vitor Santos Costa | 1c8eb25ece | |
vscosta | 84c763b4b4 | |
Vítor Santos Costa | 8af742e449 | |
vscosta | 0f87d6a5f0 | |
vscosta | 091f9dda33 | |
vscosta | 93bad76d18 | |
vscosta | e0da1a2ae0 | |
vscosta | 1bde3ae13a | |
vscosta | f993421ac8 | |
vscosta | 7870416c1e | |
vscosta | 604c28f8c1 | |
Vítor Santos Costa | 546af97345 | |
Vítor Santos Costa | 6b93b8ee5a | |
Vítor Santos Costa | 2053c44054 | |
Vítor Santos Costa | 9cd2975532 | |
Vítor Santos Costa | fca75670bc | |
Vítor Santos Costa | 86a79e2cab | |
Vitor Santos Costa | 6c76a5f827 | |
Vitor Santos Costa | 8f0ce4bb94 | |
Vitor Santos Costa | 9483572213 | |
Vítor Santos Costa | e7067559a0 | |
Vítor Santos Costa | b5a43ae9ff | |
Vitor Santos Costa | f7fe32a03c | |
Vitor Santos Costa | 461dae09f7 | |
Vitor Santos Costa | 1ba8656e73 | |
Vitor Santos Costa | 130d28ceb3 | |
Vitor Santos Costa | 4844e43704 | |
Vitor Santos Costa | 2f34be261e | |
Vitor Santos Costa | e25e7dab7b | |
Vitor Santos Costa | d2984b6548 | |
Vitor Santos Costa | 126e498c35 | |
Vitor Santos Costa | dab3a4a4f6 | |
Vítor Santos Costa | 749ba13d3d | |
Vítor Santos Costa | 6c021e7899 | |
Vítor Santos Costa | 171dca1c8c | |
Vítor Santos Costa | 0367f52840 | |
Vítor Santos Costa | 92ffbe5a2e | |
Vítor Santos Costa | 93270c125a | |
Vítor Santos Costa | 1c3c0c6301 | |
Vítor Santos Costa | 61f5baf7a4 | |
Vitor Santos Costa | c13bf88377 | |
Vitor Santos Costa | b2caf2da77 | |
Vitor Santos Costa | 57f928c621 | |
Vitor Santos Costa | 799b4c0346 | |
Vítor Santos Costa | ffb97269a0 | |
Vitor Santos Costa | a4081673e5 | |
Vitor Santos Costa | 98ee3fd078 | |
Vitor Santos Costa | 75c1e87470 | |
Vitor Santos Costa | 67de7e422d | |
Vitor Santos Costa | 7f4b478572 | |
Vítor Santos Costa | d40b9d1426 | |
Vítor Santos Costa | bf0844a2a0 | |
Vítor Santos Costa | a837a303d4 | |
Vítor Santos Costa | 6a32efe51a | |
Vítor Santos Costa | 0cd0ece207 | |
Vítor Santos Costa | 47d1bd5ecc | |
Vitor Santos Costa | 13421d0cd7 | |
Vítor Santos Costa | 4a2d6b9137 | |
Vítor Santos Costa | 53a8a8f7c9 | |
Vítor Santos Costa | a351e1f38f | |
Vítor Santos Costa | c7d2973c1e | |
Vítor Santos Costa | 69d8b57776 | |
Vítor Santos Costa | e668908a6f | |
Vítor Santos Costa | 18506025c3 | |
Vítor Santos Costa | 827be2f8d0 | |
Vítor Santos Costa | 438c09b5d0 | |
Vítor Santos Costa | 71c587bec1 | |
Vítor Santos Costa | ba03f1da65 | |
Vítor Santos Costa | 168f0c6c0c | |
Theo | f5b48e3f82 | |
Fabrizio Riguzzi | fa24b214af | |
Fabrizio Riguzzi | 3ee50baf11 | |
Fabrizio Riguzzi | 089bd928cf | |
Vitor Santos Costa | 45e4384b6d | |
Vitor Santos Costa | 1bb12cbc35 | |
Fabrizio Riguzzi | 7227bc62f4 | |
Fabrizio Riguzzi | 3c07f66cac | |
Theo | 44d38d3018 | |
Theo | b9236fa5fa | |
Fabrizio Riguzzi | ce12c424f3 | |
Fabrizio Riguzzi | b25c9e5b61 | |
Fabrizio Riguzzi | 1d98481ac3 | |
Vitor Santos Costa | 46e1ce96b4 | |
Vitor Santos Costa | 8014110080 | |
Vítor Santos Costa | 8576e67d84 | |
Vítor Santos Costa | a5d0b41f3b | |
Vitor Santos Costa | 49ccb545f8 | |
Vitor Santos Costa | aa80579684 | |
Vitor Santos Costa | 1983df00db | |
Vítor Santos Costa | 186adc2053 | |
Vítor Santos Costa | 90289b7188 | |
Vítor Santos Costa | d76c2a0039 | |
Vítor Santos Costa | c95045e14c | |
Vítor Santos Costa | 3c7779ec78 | |
Vítor Santos Costa | 7cbcd17993 | |
Vítor Santos Costa | ce390d987e | |
Vítor Santos Costa | f2038e9e36 | |
Vítor Santos Costa | c0b723ca14 | |
Vítor Santos Costa | d7bc8f80ce | |
Vítor Santos Costa | a64c6772fc | |
Vítor Santos Costa | 1a56819658 | |
Vítor Santos Costa | 0c461c538b | |
Vítor Santos Costa | b40a5a7837 | |
Vítor Santos Costa | e3e1bcaca8 | |
Vítor Santos Costa | 5312086b60 | |
Vítor Santos Costa | cf7dccdcdf | |
Vítor Santos Costa | 1461f44184 | |
Vítor Santos Costa | b2cd81f79a | |
Vítor Santos Costa | 84527a8c77 | |
Vítor Santos Costa | 5bf44d2378 | |
Vitor Santos Costa | 18aadaecd8 | |
Vitor Santos Costa | 4d3bb0143f | |
Vitor Santos Costa | 96149d991f | |
Vitor Santos Costa | 946f6cebf3 | |
Vitor Santos Costa | f6bcb22b7c | |
Vitor Santos Costa | b108380cfc | |
Vitor Santos Costa | 1896237ed3 | |
Vitor Santos Costa | fcd959a2cb | |
Vitor Santos Costa | e18f083da6 | |
Vitor Santos Costa | 48053694c7 | |
Vitor Santos Costa | ed6f7f8573 | |
Vitor Santos Costa | 716f80d4c8 | |
Vitor Santos Costa | 6ec4d99d86 | |
Vitor Santos Costa | cbc579310a | |
Vitor Santos Costa | 5d84ce03ca | |
Vítor Santos Costa | bd35580713 | |
Vítor Santos Costa | bcc8fea458 | |
Vítor Santos Costa | ad82a2619d | |
Vítor Santos Costa | ef73a788d9 | |
Vítor Santos Costa | 46a81e8d2b | |
Vítor Santos Costa | cff80914e4 | |
Vítor Santos Costa | 1fff999e5e | |
Vítor Santos Costa | da61f1c31f | |
Vítor Santos Costa | b25b6db772 | |
Vítor Santos Costa | a54af395cf | |
Vítor Santos Costa | 0ba024a7b0 | |
Vítor Santos Costa | e9cc545f68 | |
Vítor Santos Costa | 092303f837 | |
Vítor Santos Costa | 0c4f846c0e | |
Vítor Santos Costa | 8c87eabb22 | |
Vítor Santos Costa | 800a019a16 | |
Vítor Santos Costa | 028c036757 | |
Vítor Santos Costa | 3b5a093983 | |
Vítor Santos Costa | 733bb5ddc4 | |
Vítor Santos Costa | 427c3ecf54 | |
Vítor Santos Costa | 9f00389e52 | |
Vítor Santos Costa | 64e7e7e663 | |
Vítor Santos Costa | a7b4667e6c | |
Vitor Santos Costa | 821bde8603 | |
Vítor Santos Costa | d1242028d2 | |
Vítor Santos Costa | 98a471b9d7 | |
Vítor Santos Costa | b30d0bbdaf | |
Vítor Santos Costa | 8345bf3e24 | |
Vítor Santos Costa | 11b957f5fe | |
Vítor Santos Costa | d29fb0fd57 | |
Vitor Santos Costa | af180958b6 | |
Vítor Santos Costa | ad2ee8225d | |
Vítor Santos Costa | 510c7cdeee | |
Vítor Santos Costa | dddc9fbb85 | |
Vitor Santos Costa | d2527528fa | |
Vitor Santos Costa | 2c599d99f8 | |
Vitor Santos Costa | 56a1e11656 | |
Vitor Santos Costa | 70fa990223 | |
Vítor Santos Costa | 80faee6824 | |
Vítor Santos Costa | ef479f00dc | |
Vítor Santos Costa | a306d0b0ee | |
Vítor Santos Costa | 1cbc0705c6 | |
Vítor Santos Costa | 2e43165a68 | |
Vítor Santos Costa | 5a40f834f1 | |
Vítor Santos Costa | fe0e12b030 | |
Vítor Santos Costa | 5bae8321d7 | |
Vítor Santos Costa | b1a6f092fd | |
Vítor Santos Costa | b793ffb71a | |
Vítor Santos Costa | b8f1ee4a75 | |
Vítor Santos Costa | 2960f81e04 | |
Vítor Santos Costa | 48b1cf5d45 | |
Vítor Santos Costa | 4f77281827 | |
Vítor Santos Costa | a1022f8237 | |
Vítor Santos Costa | 74c136b986 | |
Vítor Santos Costa | 3ab27ad588 | |
Vítor Santos Costa | 61ffaf5720 | |
Vítor Santos Costa | 2d5f8f136d | |
Vítor Santos Costa | 4fdd501bbb | |
Vítor Santos Costa | 17617e8d20 | |
Vítor Santos Costa | 28c10dbefc | |
Vítor Santos Costa | e22b2febf4 | |
Vítor Santos Costa | 81440607f1 | |
Vítor Santos Costa | 37a49f2135 | |
Vítor Santos Costa | f415e16b79 | |
Vítor Santos Costa | e4306ba28e | |
Vítor Santos Costa | 52cf634e33 | |
Vítor Santos Costa | 95245932f8 | |
Vítor Santos Costa | dc4748147e | |
Vítor Santos Costa | 5bd42984b9 | |
Vítor Santos Costa | 077570314d | |
Vítor Santos Costa | e4603ffe22 | |
Vítor Santos Costa | 7f952c8b74 | |
Vítor Santos Costa | 1783528ea8 | |
Vítor Santos Costa | 78967d6eb2 | |
Vítor Santos Costa | 7c32ac6080 | |
Vitor Santos Costa | 66a95e96c0 | |
Vitor Santos Costa | 2bc55d868d | |
Vitor Santos Costa | ed3f0a8b74 | |
Vitor Santos Costa | 429e87404f | |
Vitor Santos Costa | fcc0c51ce7 | |
Vitor Santos Costa | 9101de3014 | |
Vítor Santos Costa | 3e255ec4a1 | |
Vítor Santos Costa | f29e017c63 | |
Vítor Santos Costa | 5cfe70420f | |
Vítor Santos Costa | 9254103f45 | |
Vítor Santos Costa | 7a577a72ff | |
Vítor Santos Costa | 349f2898df | |
Vítor Santos Costa | 9929946de2 | |
Vitor Santos Costa | e06bcd659e | |
Vitor Santos Costa | 1caf68972f | |
Vitor Santos Costa | 04eb38ff10 | |
Vitor Santos Costa | 6b0d99e2fe | |
Vitor Santos Costa | 00d87ca661 | |
Vitor Santos Costa | 8461026303 | |
Vitor Santos Costa | 0ad92137a9 | |
Vítor Santos Costa | dbec254586 | |
Vítor Santos Costa | 797e0c6be7 | |
Vítor Santos Costa | 3168b2cfc8 | |
Vítor Santos Costa | 91946626b0 | |
Vítor Santos Costa | df0ec5bc96 | |
Vítor Santos Costa | 6453ca395c | |
Vítor Santos Costa | 637ca503cc | |
Vítor Santos Costa | 0a353815a3 | |
Vítor Santos Costa | aeb54ebc61 | |
Vítor Santos Costa | d5fc0a1920 | |
Vítor Santos Costa | 7e1c6a6f5f | |
Vítor Santos Costa | 8eec3113be | |
Vítor Santos Costa | 582efcf6eb | |
Vítor Santos Costa | 050ce4fce6 | |
Vítor Santos Costa | 3bcf9a3f85 | |
Vitor Santos Costa | 4f294140ce | |
Vitor Santos Costa | cf0f8d2447 | |
Vitor Santos Costa | b7ae9cb45e | |
Vítor Santos Costa | 882eaca30c | |
Vítor Santos Costa | 57ecd61b95 | |
Vítor Santos Costa | 3009987985 | |
Vítor Santos Costa | 19c247accd | |
Vítor Santos Costa | 4745401b2a | |
Vítor Santos Costa | 0ed6fe43b2 | |
Vítor Santos Costa | 9e7257978c | |
Vítor Santos Costa | 87e36bcfe2 | |
Vítor Santos Costa | b26b5b1b7d | |
Vítor Santos Costa | 3fd07064da | |
Vítor Santos Costa | 1dd3ff800e | |
Vítor Santos Costa | 3c0a65218b | |
Vítor Santos Costa | 9b5c4ea710 | |
Vítor Santos Costa | 0f239213d1 | |
Vítor Santos Costa | 62d4624080 | |
Vítor Santos Costa | d29f876ae6 | |
Vítor Santos Costa | 14e4f1d9f2 | |
Vítor Santos Costa | 92e620abf2 | |
Vítor Santos Costa | df1e161e6c | |
Vítor Santos Costa | cd8dd56b9e | |
Vítor Santos Costa | 53a49bb3c3 | |
Vítor Santos Costa | f9438806ee | |
Vítor Santos Costa | 337839b8ea | |
Vítor Santos Costa | d39423c1f0 | |
Vítor Santos Costa | 0a64e9f062 | |
Vítor Santos Costa | 87a0a7af74 | |
Vítor Santos Costa | aa82206330 | |
Vítor Santos Costa | f291c37dfc | |
Vítor Santos Costa | b942c1ef13 | |
Vítor Santos Costa | 99713d81a6 | |
Vítor Santos Costa | 863a4c53fc | |
Vítor Santos Costa | 19d0f56f2d | |
Vítor Santos Costa | 495ab155f9 | |
Vítor Santos Costa | f68b32770b | |
Vítor Santos Costa | 109597ab91 | |
Vítor Santos Costa | 0f1b47f860 | |
Vítor Santos Costa | 69d2cc3e49 | |
Vítor Santos Costa | 3b5cd95d22 | |
Vítor Santos Costa | 5721ce5e7d | |
Vítor Santos Costa | 8a4590f3ce | |
Vítor Santos Costa | 86a363d3bd | |
Vítor Santos Costa | 373d488974 | |
Vítor Santos Costa | 6efb3176f7 | |
Vítor Santos Costa | be6947d74c | |
Vítor Santos Costa | 5aad8e380b | |
Vítor Santos Costa | b7d97bf4f6 | |
Vítor Santos Costa | 4573afa70b | |
Vítor Santos Costa | 6f88083d38 | |
Vítor Santos Costa | 55910b4610 | |
Vítor Santos Costa | ffda6c291e | |
Vítor Santos Costa | 952986ef1c | |
Vítor Santos Costa | ca4e9c39cb | |
Vítor Santos Costa | f9a7741781 | |
Vitor Santos Costa | 7f3dc7e5ab | |
Vitor Santos Costa | 9902364ea2 | |
Vítor Santos Costa | f09e115106 | |
Vitor Santos Costa | 3d0f7e2582 | |
Vitor Santos Costa | 2aa8ad0fd3 | |
Vítor Santos Costa | ef3a5754e6 | |
Vítor Santos Costa | 125e676b64 | |
Vítor Santos Costa | ed608db282 | |
Vítor Santos Costa | d9d4cdca79 | |
Vítor Santos Costa | e431aa14fc | |
Vítor Santos Costa | 45c0671fa2 | |
Vítor Santos Costa | 01bd6fa446 | |
Vítor Santos Costa | f59e1f92cd | |
Vítor Santos Costa | cc1f9dbf67 | |
Vítor Santos Costa | 60aeb34457 | |
Vítor Santos Costa | f8784fb658 | |
Vitor Santos Costa | 070c976868 | |
Vitor Santos Costa | 5e73c6cd84 | |
Vitor Santos Costa | 7f6ecc3f9a | |
Vítor Santos Costa | 706784a61d | |
Vitor Santos Costa | c6652c0ef6 | |
Vitor Santos Costa | 63d2f0f57e | |
Vitor Santos Costa | a8e301c486 | |
Vitor Santos Costa | 7a01daf8dd | |
Vítor Santos Costa | bc16bf83ec | |
Vítor Santos Costa | a70da52e1f | |
Vítor Santos Costa | 823175f50a | |
Vitor Santos Costa | 5c9468983f | |
Vitor Santos Costa | f0f4fcbc94 | |
Vitor Santos Costa | 9684352f1d | |
Vitor Santos Costa | db029a478d | |
Vitor Santos Costa | 0ef90c9b6a | |
Vitor Santos Costa | 9179e4780b | |
Vítor Santos Costa | 325c819f79 | |
Paulo Moura | 4183cd3d10 | |
Vítor Santos Costa | ce8a4b6958 | |
Vítor Santos Costa | dbff20343a | |
Vítor Santos Costa | 2becb15578 | |
Vítor Santos Costa | f37806d7cc | |
Vítor Santos Costa | 1b57bdc2eb | |
Vítor Santos Costa | e918226918 | |
Vítor Santos Costa | 369c64d3d3 | |
Vítor Santos Costa | 3268920dc8 | |
Vítor Santos Costa | 4d7b270ce4 | |
Vítor Santos Costa | 6ba88f8cc0 | |
Vítor Santos Costa | e1fc397cc1 | |
Vítor Santos Costa | e6775d497c | |
Vítor Santos Costa | a1ea514c65 | |
Vítor Santos Costa | 0e79c53d1e | |
Vitor Santos Costa | 0be1e7def1 | |
Vitor Santos Costa | da985b999b | |
Vitor Santos Costa | 38355b5240 | |
Vitor Santos Costa | e929db7543 | |
Vitor Santos Costa | f960c404aa | |
Vítor Santos Costa | 0738fe0bd2 | |
Vítor Santos Costa | 95bbdc8a17 | |
Vítor Santos Costa | d8ecd6a202 | |
Vítor Santos Costa | 6c7a84a942 | |
Vítor Santos Costa | 04092424bf | |
Vitor Santos Costa | 1097ee9b8d | |
Vitor Santos Costa | f9b948f4c3 | |
Vítor Santos Costa | 7fb9da901a | |
Vitor Santos Costa | c9abfc28d7 | |
Vítor Santos Costa | e167cdfa4c | |
Vítor Santos Costa | fcf5309653 | |
Vítor Santos Costa | 4decf015c5 | |
Vítor Santos Costa | 219c07ed27 | |
Vítor Santos Costa | 93f9753c3d | |
Vítor Santos Costa | 8ad0cba7fe | |
Vítor Santos Costa | 77c51f476f | |
Vítor Santos Costa | 2405ab23a5 | |
Vítor Santos Costa | 597f5e93f7 | |
Vítor Santos Costa | 58038a199e | |
Vítor Santos Costa | db2d6a0ebd | |
Vítor Santos Costa | 5b19ccf6a8 | |
Vitor Santos Costa | 1f301ded89 | |
Vítor Santos Costa | 8994abfada | |
Vítor Santos Costa | d894bf23d0 | |
Vítor Santos Costa | 74a65633d8 | |
Vítor Santos Costa | d0f2f50a8e | |
Vítor Santos Costa | 5d4cc16789 | |
Vítor Santos Costa | d4bffbaefd | |
Vítor Santos Costa | b111ed13f8 | |
Vítor Santos Costa | 10a1a00b78 | |
Vítor Santos Costa | b88c8e6b82 | |
Vítor Santos Costa | 6a9e496bde | |
Vítor Santos Costa | 32a4ea3a94 | |
Vítor Santos Costa | 7463a9d31d | |
Vítor Santos Costa | 50dea76186 | |
Vitor Santos Costa | af2194b21d | |
Vitor Santos Costa | 410b2c6c28 | |
Vítor Santos Costa | fea65ba68d | |
Vítor Santos Costa | 80af72f2e6 | |
Vitor Santos Costa | 87d7c90171 | |
Vitor Santos Costa | 92f0a91f85 | |
Vitor Santos Costa | e8f2c37000 | |
Vitor Santos Costa | e1e095d033 | |
Vítor Santos Costa | 6ba0d44a01 | |
Vítor Santos Costa | ff2a7a364f | |
Vítor Santos Costa | 0a1b7de414 | |
Vítor Santos Costa | ef59cdc50c | |
Vítor Santos Costa | 07c9aa5bca | |
Vítor Santos Costa | 0b569a374e | |
Vítor Santos Costa | 8da6fb70e1 | |
Vítor Santos Costa | f00a6d5a40 | |
Vítor Santos Costa | 6286de06be | |
Vítor Santos Costa | ed04954b3f | |
Vítor Santos Costa | 8f5c9e1681 | |
Vítor Santos Costa | aefb7b3668 | |
Vítor Santos Costa | 3929fc9009 | |
Vítor Santos Costa | daae1df152 | |
Vítor Santos Costa | ba6d46578b | |
Vítor Santos Costa | d73793de63 | |
Vitor Santos Costa | 489bb27a7e | |
Vitor Santos Costa | ec881b8e13 | |
Vítor Santos Costa | 059884bc03 | |
Vítor Santos Costa | 6de73e6469 | |
Vítor Santos Costa | aef189ece2 | |
Vítor Santos Costa | 2d2eb70842 | |
Vítor Santos Costa | ab06b04a09 | |
Vítor Santos Costa | 0241151599 | |
Vítor Santos Costa | 2455a1d83c | |
Vítor Santos Costa | 71b40e0438 | |
Vítor Santos Costa | 3087d51b18 | |
Vítor Santos Costa | a76b6d23dc | |
Vítor Santos Costa | e3674e1223 | |
Vítor Santos Costa | 37e8fcc353 | |
Vítor Santos Costa | 21fe137d27 | |
Vítor Santos Costa | 2400911db9 | |
Vítor Santos Costa | cb8b05d516 | |
Andreas Becker | dc37d76e8b | |
Andreas Becker | 3339d9cfa5 | |
Andreas Becker | f01de36c23 | |
Andreas Becker | daaaf52338 | |
Andreas Becker | d5358ab932 | |
Andreas Becker | c3fd689865 | |
Andreas Becker | 72b9ec59b7 | |
Andreas Becker | 4ff9b80846 | |
Vitor Santos Costa | e7e9dab151 | |
Vítor Santos Costa | 800ddd23a6 | |
Vítor Santos Costa | f9c6be85c7 | |
Vítor Santos Costa | 3c0f910906 | |
Vítor Santos Costa | 1e08a7ce05 | |
Vítor Santos Costa | fa75599e7f | |
Vítor Santos Costa | 41606bdc44 | |
Vítor Santos Costa | edb4c3fbec | |
Vítor Santos Costa | fa27e045a3 | |
Vítor Santos Costa | 0d52c2d730 | |
Vítor Santos Costa | 042b3e4343 | |
Vítor Santos Costa | 0b2dff96d3 | |
Vitor Santos Costa | 3a21922e37 | |
Vítor Santos Costa | b2d34d016f | |
Vítor Santos Costa | 5f72d8c332 | |
Vítor Santos Costa | ec2e1c21b0 | |
Vítor Santos Costa | 2c7e62ad71 | |
Vítor Santos Costa | eaef6aba9a | |
Vítor Santos Costa | dee3774bbc | |
Vítor Santos Costa | 99ab3fb748 | |
Vítor Santos Costa | 0ebea4ec26 | |
Vítor Santos Costa | ba40cc3b39 | |
Vítor Santos Costa | 692e2358b1 | |
Vítor Santos Costa | 4172f4efd5 | |
Vítor Santos Costa | 6b409a55a6 | |
Vítor Santos Costa | a719c19d03 | |
Vítor Santos Costa | 279a057d80 | |
Vítor Santos Costa | 8e798db830 | |
Vítor Santos Costa | b7c05b49e2 | |
Vítor Santos Costa | 3310a904c4 | |
Vítor Santos Costa | 791702e4ec | |
Vítor Santos Costa | e0c3c2d444 | |
Vitor Santos Costa | 0aa91d7c00 | |
Vitor Santos Costa | 7c8e2bbd16 | |
Vítor Santos Costa | 13bc66f89c | |
Vitor Santos Costa | b532fbd0b9 | |
Vitor Santos Costa | e0d0543e52 | |
Vitor Santos Costa | e90fda2d5f | |
Vitor Santos Costa | 94032de135 | |
Vítor Santos Costa | 596768a56b | |
Vítor Santos Costa | 503b2b93f9 | |
Vítor Santos Costa | 24b90ae6bd | |
Vitor Santos Costa | a35521b52c | |
Vitor Santos Costa | 5ebb0d2d74 | |
Vitor Santos Costa | da48f3a877 | |
Vitor Santos Costa | eb8f4cebcc | |
Vitor Santos Costa | ee2d1f1332 | |
Vítor Santos Costa | aaed6ded8d | |
Vítor Santos Costa | 323386e34b | |
Vítor Santos Costa | cd5f44f762 | |
Vítor Santos Costa | 4f1a0d985c | |
Vítor Santos Costa | 0acfbceab2 | |
Vítor Santos Costa | a54a101fb0 | |
Vítor Santos Costa | 98daf1ebdd | |
Vítor Santos Costa | 06e29a4978 | |
Vítor Santos Costa | 410efd577c | |
Vítor Santos Costa | 5e701460f2 | |
Vítor Santos Costa | f2ee773f55 | |
Vítor Santos Costa | f0d17d0210 | |
Vítor Santos Costa | 2dc4d66bb9 | |
Vitor Santos Costa | b370404432 | |
Vitor Santos Costa | 73ff8676ca | |
Vitor Santos Costa | 4ebe56aad9 | |
Vitor Santos Costa | df1dfc821a | |
Vitor Santos Costa | d6aa3ed8f0 | |
Vitor Santos Costa | 2ec6d6588d | |
Vitor Santos Costa | e981973d56 | |
Vítor Santos Costa | 451a37d708 | |
Vítor Santos Costa | e9672e9820 | |
Vitor Santos Costa | 549b4dd834 | |
Vitor Santos Costa | f1b88583e4 | |
Vitor Santos Costa | 426d952894 | |
Vítor Santos Costa | bbad94e5dd | |
Vítor Santos Costa | 7393dd1405 | |
Vítor Santos Costa | 462bb216f7 | |
Vítor Santos Costa | 3c99f0b055 | |
Vítor Santos Costa | bda0c4694a | |
Vítor Santos Costa | bf357212af | |
Vítor Santos Costa | ba523a7910 | |
Vítor Santos Costa | a2e141482c | |
Vítor Santos Costa | 53bb9928eb | |
Vítor Santos Costa | f8ab2d093e | |
Vítor Santos Costa | 6738682c26 | |
Vítor Santos Costa | cf39051162 | |
Vitor Santos Costa | df7425922a | |
Vitor Santos Costa | 156501d27d | |
Vitor Santos Costa | 8c6aa05b17 | |
Vitor Santos Costa | fa31fb1468 | |
Vitor Santos Costa | d58dcdc3e6 | |
Vitor Santos Costa | 4b3e9691ef | |
Vitor Santos Costa | 592ad902a0 | |
Vítor Santos Costa | 23561d086b | |
Vítor Santos Costa | 3efe5df28e | |
Vítor Santos Costa | 785e404de4 | |
Vítor Santos Costa | 6bcda04a52 | |
Vítor Santos Costa | 2f852223ec | |
Vitor Santos Costa | ed0910fe94 | |
Vitor Santos Costa | 58336add23 | |
Vitor Santos Costa | 4867563b09 | |
Vitor Santos Costa | 05ac1dc920 | |
Vítor Santos Costa | 1db83cc30d | |
Vítor Santos Costa | d8f4a77f47 | |
Vitor Santos Costa | 6591b5429c | |
Vitor Santos Costa | aba5f3d88b | |
Vítor Santos Costa | f1951777b7 | |
Vítor Santos Costa | 605e68c80d | |
Vítor Santos Costa | 0625f1d7ad | |
Vítor Santos Costa | 137f69ed22 | |
Vitor Santos Costa | 83ec7d9072 | |
Vítor Santos Costa | 295be2d5be | |
Vitor Santos Costa | d199c64de6 | |
Vítor Santos Costa | ca0c646793 | |
Vítor Santos Costa | 250099cfe8 | |
Vítor Santos Costa | 3396c1ca18 | |
Vítor Santos Costa | c629ae9283 | |
Vítor Santos Costa | a8c77d2609 | |
Vitor Santos Costa | 8b9da05d66 | |
Vitor Santos Costa | f39ed68fe8 | |
Vitor Santos Costa | cc84cd8cb5 | |
Vítor Santos Costa | a6c115b248 | |
Vítor Santos Costa | f7283f6b70 | |
Vítor Santos Costa | 683b5989ae | |
Vítor Santos Costa | 3b2944511e | |
Vitor Santos Costa | ce0715e75a | |
Vitor Santos Costa | 141b8ac4cb | |
Vitor Santos Costa | 37c018d4b5 | |
Vitor Santos Costa | ace56c730b | |
Vitor Santos Costa | 506ac57509 | |
Vitor Santos Costa | 41e1980f83 | |
Vitor Santos Costa | 8dd1ddbca3 | |
Vítor Santos Costa | 028f30850f | |
Vitor Santos Costa | e337d6aba0 | |
Vitor Santos Costa | e6fbba4030 | |
Vitor Santos Costa | 2c5d6ad488 | |
Vítor Santos Costa | f3597f3d02 | |
Vítor Santos Costa | f0d8ee91d0 | |
Vítor Santos Costa | 0e1b1dd4bc | |
Vítor Santos Costa | 39498868fb | |
Vítor Santos Costa | 875546e36a | |
Vitor Santos Costa | d3692b087f | |
Vitor Santos Costa | 5a83e7c7a6 | |
Vítor Santos Costa | a6cb6f6a25 | |
Vitor Santos Costa | 6462a09e59 | |
Vitor Santos Costa | b932008946 | |
Vítor Santos Costa | 79763e9ea1 | |
Vitor Santos Costa | 39d237de04 | |
Vitor Santos Costa | 5a73c525e9 | |
Vítor Santos Costa | 242f872b5d | |
Vítor Santos Costa | 5491abdeeb | |
Vítor Santos Costa | 9c008ac769 | |
Vítor Santos Costa | cd5423a8bf | |
Vítor Santos Costa | 4bc537a37b | |
Vítor Santos Costa | 801c4cb369 | |
Vítor Santos Costa | e9eb030bb6 | |
Vítor Santos Costa | 6d2e2597b1 | |
Vítor Santos Costa | e843d8f536 | |
Vitor Santos Costa | 228bc76a35 | |
Vítor Santos Costa | 4591e1baaf | |
Vítor Santos Costa | 242f585484 | |
Vítor Santos Costa | c3d0504a54 | |
Vitor Santos Costa | 0602031bd9 | |
Vitor Santos Costa | 2c82906714 | |
Vitor Santos Costa | d0adb0b910 | |
Vítor Santos Costa | b815e64740 | |
Vítor Santos Costa | 2812ad5704 | |
Vítor Santos Costa | 6bb4475182 | |
Vítor Santos Costa | 8cf9e44a57 | |
Vítor Santos Costa | 4160562e45 | |
Vitor Santos Costa | e97bac6548 | |
Vítor Santos Costa | 265bc20f90 | |
Vítor Santos Costa | 9408c8a866 | |
Vítor Santos Costa | f163ca8ea0 | |
Vítor Santos Costa | 6a75bc3a38 | |
Vitor Santos Costa | 3d0bb05ef0 | |
Vítor Santos Costa | 233c4ee903 | |
Vítor Santos Costa | 7e85bfd4a4 | |
Vítor Santos Costa | 06d99506cf | |
Vitor Santos Costa | f257efc2ef | |
Vitor Santos Costa | 47d436fc13 | |
Vitor Santos Costa | 386e15c425 | |
Vitor Santos Costa | e2c44e492f | |
Vitor Santos Costa | 0dc40370dc | |
Vitor Santos Costa | 2c89aadb11 | |
Vitor Santos Costa | 49d643d98f | |
Vitor Santos Costa | 23a7a52841 | |
Vitor Santos Costa | aba6d5741e | |
U-vsc-PC\vsc | b7fbd08f7a | |
U-vsc-PC\vsc | 77f3de2fbe | |
U-vsc-PC\vsc | ec8f12d38b | |
U-vsc-PC\vsc | f8f2376394 | |
Vitor Santos Costa | 0ab280ad25 | |
Vitor Santos Costa | e9fce51e92 | |
U-vsc-PC\vsc | eff7a5afcc | |
Vítor Santos Costa | fda1c534d4 | |
U-vsc-PC\vsc | 50eb140deb | |
U-vsc-PC\vsc | 93c84b4ace | |
U-vsc-PC\vsc | d4b6bc58d5 | |
U-vsc-PC\vsc | 77b50d9058 | |
U-vsc-PC\vsc | 4dbe41262a | |
U-vsc-PC\vsc | a289c05d3a | |
Vítor Santos Costa | 2d3d9441ef | |
Vitor Santos Costa | d9fce3935b | |
Vitor Santos Costa | 9464c9f85c | |
Vítor Santos Costa | 3da5cc5977 | |
Vítor Santos Costa | 87d6a6cc31 | |
Vítor Santos Costa | f21823ea00 | |
Vítor Santos Costa | f264859483 | |
Vítor Santos Costa | 178af282ab | |
Vítor Santos Costa | 4cd981c275 | |
Vitor Santos Costa | 42ec115e75 | |
Vítor Santos Costa | d3b3a45dde | |
Vítor Santos Costa | 2ba405389b | |
Vítor Santos Costa | 6bde2d2cd7 | |
Vitor Santos Costa | 964b15d107 | |
Vitor Santos Costa | b3f3a3e1bb | |
Vítor Santos Costa | 891420c367 | |
Vítor Santos Costa | 6522eb2e5a | |
Vítor Santos Costa | 6a1302221c | |
Vítor Santos Costa | 9214f50eb5 | |
Vítor Santos Costa | 362345d995 | |
Vítor Santos Costa | 786d6abeda | |
Vítor Santos Costa | e81f473802 | |
Vítor Santos Costa | 7b69d48afb | |
Vítor Santos Costa | 1bd528198a | |
Vítor Santos Costa | e52d8f7d7e | |
Vítor Santos Costa | 625c66015d | |
Vítor Santos Costa | 12364bb89a | |
Vitor Santos Costa | 294131b1b6 | |
Vitor Santos Costa | d0efa26d8b | |
João Santos | bb061f9db8 | |
Vítor Santos Costa | 2c24fb7a83 | |
Vítor Santos Costa | 4e5a2e3a20 | |
Vítor Santos Costa | 0953ecc5d7 | |
Vítor Santos Costa | d6f4707caf | |
Vítor Santos Costa | 2cdeb3f1c1 | |
Vítor Santos Costa | 1d27d22ef0 | |
Vítor Santos Costa | 0420169bd0 | |
Vítor Santos Costa | d28f065454 | |
Vitor Santos Costa | 0664e1f647 | |
Vitor Santos Costa | 984415b807 | |
Vítor Santos Costa | 89789d6828 | |
Vítor Santos Costa | 46179c4eca | |
Vítor Santos Costa | e2bd922f8b | |
Vítor Santos Costa | df0986eb45 | |
David Vaz | 3cad9c37b1 | |
Vitor Santos Costa | 1d7407ba4d | |
Vitor Santos Costa | 6110ecb95d | |
Vitor Santos Costa | 88c2839b36 | |
Vitor Santos Costa | 365dcd5bca | |
Vitor Santos Costa | 9b00f3700c | |
Vítor Santos Costa | 78596fe951 | |
Vítor Santos Costa | 17d1f11b5c | |
Vítor Santos Costa | ab40f20a2b | |
Vitor Santos Costa | 8d624cda6b | |
Vitor Santos Costa | bfc94cbbe5 | |
Vitor Santos Costa | bcde1666fb | |
Vitor Santos Costa | 9a46cdac9b | |
Vitor Santos Costa | 00f0d449ec | |
Vitor Santos Costa | 231290bad3 | |
Vitor Santos Costa | 89e2c86a0b | |
Vitor Santos Costa | 5bf0a5de61 | |
Vitor Santos Costa | 2bb21e9e1b | |
Theo | 260a29f4e7 | |
Vítor Santos Costa | 034878ab88 | |
Vitor Santos Costa | a012017635 | |
Vitor Santos Costa | e0642dbaa3 | |
Vitor Santos Costa | 93859706e3 | |
Vitor Santos Costa | 043c97157f | |
Vitor Santos Costa | ca0c43ba8d | |
Vitor Santos Costa | 8d8a4104b9 | |
Vitor Santos Costa | f26cb133b9 | |
Vitor Santos Costa | 2c12c7917b | |
Vitor Santos Costa | 72a8d49926 | |
Vitor Santos Costa | d85dc3fd5c | |
Vitor Santos Costa | f11b0518a8 | |
Vitor Santos Costa | b3aa3e37c6 | |
Vitor Santos Costa | 6c7e5e3cd2 | |
Vitor Santos Costa | ce6bc98f30 | |
Vitor Santos Costa | 91989ad13a | |
Vitor Santos Costa | 9dacb84c99 | |
Vitor Santos Costa | 819f7ab4a5 | |
Vitor Santos Costa | ed6524470a | |
Vitor Santos Costa | 1e88998375 | |
Vitor Santos Costa | 159613ab56 | |
Vítor Santos Costa | 9e2a2b75b9 | |
Vítor Santos Costa | ae0ab6fa86 | |
Vítor Santos Costa | 9d2795b62a | |
Vitor Santos Costa | 0dac1e9e7d | |
Vitor Santos Costa | b57867c983 | |
Vitor Santos Costa | 598267ca23 | |
Vitor Santos Costa | 327c1216e4 | |
Vitor Santos Costa | d648375412 | |
Vitor Santos Costa | a613099e1f | |
Vitor Santos Costa | 0391988788 | |
Vitor Santos Costa | fe6142ca69 | |
Vitor Santos Costa | 253735a293 | |
Vítor Santos Costa | 464d6cd125 | |
Vitor Santos Costa | 39a6b31f7b | |
Vitor Santos Costa | b47aeb461b | |
Vitor Santos Costa | a8eda03305 | |
Vítor Santos Costa | 7adad485de | |
Vitor Santos Costa | 6b2e1973ab | |
Vítor Santos Costa | e1201fc468 | |
Vítor Santos Costa | ccccf71ae1 | |
Vitor Santos Costa | 2c8fcc6698 | |
Vitor Santos Costa | bcc1757989 | |
Vitor Santos Costa | 26c80b0624 | |
Vitor Santos Costa | 411b7700e5 | |
Vitor Santos Costa | 52525a5319 | |
Vítor Santos Costa | f3e5639439 | |
Vítor Santos Costa | 233829ec52 | |
Theo | e105130a8b | |
Vítor Santos Costa | 7589b57e4b | |
Vítor Santos Costa | 4612a7cc57 | |
Theo | ffa0823e57 | |
Theo | fdd96e96cf | |
Theo | b4506cf793 | |
Theo | 1f0f9968df | |
Vitor Santos Costa | 493b591b66 | |
Vitor Santos Costa | c6351abe25 | |
Vitor Santos Costa | 30828eba98 | |
Vitor Santos Costa | 86a71e9232 | |
Vitor Santos Costa | fe2411b046 | |
Theofrastos Mantadelis | b0fdf9263c | |
Theo | 65eb3b8e4d | |
Theofrastos Mantadelis | 5a8017156a | |
Theofrastos Mantadelis | 35a332f23a | |
João Santos | bc99b42228 | |
João Santos | 2e3f99d89a | |
Vítor Santos Costa | 993a9272d1 | |
Vítor Santos Costa | 1aafb30360 | |
Vítor Santos Costa | 7a6d36ff16 | |
joao | da0f807abf | |
Vitor Santos Costa | 52b863eab4 | |
Vitor Santos Costa | 51535a86ce | |
Vitor Santos Costa | e4fbd39cab | |
Vitor Santos Costa | 83ae86dba3 | |
Vitor Santos Costa | a4b130ff1b | |
Vítor Santos Costa | 7d6d369e63 | |
Vítor Santos Costa | f204776107 | |
Vítor Santos Costa | a8e1b91fd5 | |
Vítor Santos Costa | e089563ce2 | |
Vítor Santos Costa | d73c88f307 | |
Vítor Santos Costa | 6402360691 | |
Vítor Santos Costa | b65dee6b3a | |
Vítor Santos Costa | b90685fe59 | |
Vitor Santos Costa | cc5b90aafc | |
Vitor Santos Costa | 2410cd3862 | |
Vitor Santos Costa | 44d28aa0c9 | |
Vítor Santos Costa | fba3c34e50 | |
Vítor Santos Costa | 88e188bece | |
Vítor Santos Costa | ba2c0ca2a0 | |
Vítor Santos Costa | 2f8c3d2d1b | |
Vítor Santos Costa | e768a7e7be | |
Vítor Santos Costa | 795f01d125 | |
Vítor Santos Costa | 05bfe8a15b | |
Vítor Santos Costa | a430a1c349 | |
Vítor Santos Costa | 29c0d55ad4 | |
Vítor Santos Costa | df6ddfb8b6 | |
Vítor Santos Costa | 09accc834c | |
Vítor Santos Costa | 61d624e416 | |
Vítor Santos Costa | a654907fe1 | |
Vítor Santos Costa | adea3bdb24 | |
Vitor Santos Costa | 62a6d96674 | |
Vitor Santos Costa | 863b796370 | |
Vitor Santos Costa | 342477f6e0 | |
Vítor Santos Costa | 35f6ecad66 | |
Vitor Santos Costa | 7e58cf7755 | |
Vitor Santos Costa | 5ada26eab3 | |
Vitor Santos Costa | c2e29efbc7 | |
Vítor Santos Costa | b3608c6a83 | |
Vítor Santos Costa | ba07371328 | |
Vitor Santos Costa | 2665f71112 | |
Vítor Santos Costa | 0d749059a4 | |
Vítor Santos Costa | d7397b43af | |
Vítor Santos Costa | 8b7fa9be36 | |
Vítor Santos Costa | 3edb01f5f7 | |
Vítor Santos Costa | 0ea61e8f1a | |
Vítor Santos Costa | ea99d42897 | |
Vítor Santos Costa | 67b23a2ae4 | |
Vítor Santos Costa | b46dd8d392 | |
Vítor Santos Costa | 86ce2f49b0 | |
Vítor Santos Costa | d0c7ef121b | |
Vítor Santos Costa | 82f4d71567 | |
Vítor Santos Costa | 2343494f1e | |
Vítor Santos Costa | fae3da8659 | |
Vítor Santos Costa | 7a3a4ab32b | |
Vítor Santos Costa | b3ee389d5e | |
Vítor Santos Costa | def97602e2 | |
Vítor Santos Costa | 99a5fa55de | |
Vítor Santos Costa | acea59a82a | |
Vítor Santos Costa | 42d3ca6459 | |
Vítor Santos Costa | cbd0fa14e8 | |
Vítor Santos Costa | ed2ecb29e7 | |
Vítor Santos Costa | 0b881c0569 | |
Vítor Santos Costa | af4e9b4bbc | |
Vítor Santos Costa | 4e7e9b0273 | |
Vítor Santos Costa | 5ecf7a79ff | |
Vítor Santos Costa | 75737f6d56 | |
Vítor Santos Costa | 3c16cd1627 | |
Vítor Santos Costa | 99469b9b1a | |
Paulo Moura | 20b0d7050d | |
Vítor Santos Costa | 80dc774a5f | |
Vítor Santos Costa | 03879aa778 | |
Vítor Santos Costa | fd58cf10b2 | |
Vítor Santos Costa | d447d80fdb | |
Vitor Santos Costa | 5013880fc5 | |
Vitor Santos Costa | f6f183c0f6 | |
Vitor Santos Costa | de606255bb | |
Vítor Santos Costa | cc03317bd0 | |
Vítor Santos Costa | 02526db2d1 | |
Vitor Santos Costa | 7c48eb8ff7 | |
Vitor Santos Costa | 23df104638 | |
Vitor Santos Costa | 9017f5131f | |
David Vaz | d1b634c9c3 | |
David Vaz | 638ef10c84 | |
Vitor Santos Costa | 3dce3c0156 | |
Vitor Santos Costa | c2219d0343 | |
Vítor Santos Costa | 90dd0229d7 | |
Vítor Santos Costa | f1f64bf25c | |
Vitor Santos Costa | 6d773a3189 | |
Vitor Santos Costa | d75e6b56e5 | |
Vitor Santos Costa | 61e78d9963 | |
Vitor Santos Costa | 5f3ff4fc73 | |
Vitor Santos Costa | 04f3fa4d9d | |
Vitor Santos Costa | 6ba13c7b88 | |
Vitor Santos Costa | ee179f316a | |
Vitor Santos Costa | 94f1b223f7 | |
Vitor Santos Costa | 48bec6b247 | |
Vítor Santos Costa | b76be1b33f | |
Vítor Santos Costa | b167e62bc7 | |
Vítor Santos Costa | cffef55b61 | |
Vítor Santos Costa | f67c7c184b | |
Vítor Santos Costa | 1f91ea2d02 | |
Vítor Santos Costa | 5dbaeedf08 | |
U-w7\vsc | 3aa994313b | |
Vitor Santos Costa | 1b5aa1a969 | |
Vitor Santos Costa | 1c51b61253 | |
Vitor Santos Costa | 2a5f6535ae | |
Vítor Santos Costa | 84bd55df0d | |
U-w7\vsc | 9c5d7af938 | |
Vitor Santos Costa | bb650629d9 | |
Vitor Santos Costa | 9eb07a8c8a | |
Vítor Santos Costa | 45f91c9d42 | |
Vítor Santos Costa | 3c7656b619 | |
Vitor Santos Costa | 6de15433aa | |
Vitor Santos Costa | 4e4f21e1dc | |
Vítor Santos Costa | 5b46b6bd1a | |
Vítor Santos Costa | 14747fd0bf | |
U-w7\vsc | 7f8f80fdbe | |
Vitor Santos Costa | 9a35d17861 | |
Vitor Santos Costa | 7930b4d648 | |
Vitor Santos Costa | 41c2d856a7 | |
Vitor Santos Costa | b1c2fbd6bb | |
Vitor Santos Costa | 9d34ac34ff | |
Vitor Santos Costa | 220970db6d | |
Vitor Santos Costa | 4fa9021a7b | |
Vítor Santos Costa | 0d45ff8d37 | |
Vítor Santos Costa | e813c75814 | |
Paulo Moura | 2314efdc6c | |
Paulo Moura | 16e3bda666 | |
Vítor Santos Costa | a2fc06df36 | |
Vítor Santos Costa | bf7fd9982b | |
Vítor Santos Costa | 85c0435f59 | |
Vítor Santos Costa | d6d437d12f | |
Vítor Santos Costa | 5c4cb1c43c | |
Vítor Santos Costa | 07bfa49691 | |
Vítor Santos Costa | 5a9b904fb4 | |
Vítor Santos Costa | 1efab018bd | |
Vítor Santos Costa | e92c3c6dbb | |
Vítor Santos Costa | 5ffbf8b1bb | |
Vítor Santos Costa | cab427537a | |
Vítor Santos Costa | 2c224666aa | |
Vítor Santos Costa | d98d888fd8 | |
U-vsc-PC\vsc | 953befcb7d | |
U-vsc-PC\vsc | eea8d78ec5 | |
U-vsc-PC\vsc | 30995ce506 | |
U-vsc-PC\vsc | 80315e1be3 | |
U-vsc-PC\vsc | 493f310b49 | |
U-vsc-PC\vsc | a811f56d14 | |
U-vsc-PC\vsc | 5e6cc55713 | |
Vitor Santos Costa | 7c716c4f2f | |
Vitor Santos Costa | dcc5a4041e | |
Vitor Santos Costa | 153794e14b | |
Vítor Santos Costa | bfee0cbea6 | |
Vítor Santos Costa | 0205a222d9 | |
Vítor Santos Costa | b5cc597ab8 | |
Vítor Santos Costa | bd5771eb59 | |
Vítor Santos Costa | f6f7f70b7f | |
Vítor Santos Costa | 318199a47b | |
Vitor Santos Costa | 64575e37ee | |
Vitor Santos Costa | f5284000a6 | |
Vitor Santos Costa | a69a2442c9 | |
Vitor Santos Costa | ec2e70fc39 | |
Vítor Santos Costa | 7065c4678e | |
Vítor Santos Costa | ea44e780b6 | |
Paulo Moura | b51af753aa | |
Vítor Santos Costa | 7150bc1ef8 | |
Vítor Santos Costa | 4085f268af | |
Paulo Moura | 746aee16f7 | |
Vitor Santos Costa | 7e0bf7fbe8 | |
Vítor Santos Costa | cbba7e93df | |
Vítor Santos Costa | 08e5dcfbd1 | |
Vítor Santos Costa | 2badc98c75 | |
Vítor Santos Costa | 810a7faf4e | |
Vítor Santos Costa | a3c9684714 | |
Vítor Santos Costa | 917d5ad75b | |
Vítor Santos Costa | e06b160da2 | |
Vítor Santos Costa | e5e71ee618 | |
Vítor Santos Costa | ddbed6f29b | |
Vítor Santos Costa | 8c66979817 | |
Vitor Santos Costa | b2fe6099a0 | |
Vitor Santos Costa | 519d22f5ad | |
Vitor Santos Costa | 1a8facffac | |
Vitor Santos Costa | 72bc04e63d | |
Vítor Santos Costa | ad8b101233 | |
Vítor Santos Costa | 4818d28b0b | |
Vítor Santos Costa | 98b4f64b40 | |
Vítor Santos Costa | 0788a6c857 | |
Vítor Santos Costa | 6793a1f83b | |
Vítor Santos Costa | 1a8b038b5b | |
U-w7\vsc | 029bf8359c | |
U-w7\vsc | f2b90a1bb0 | |
U-w7\vsc | a9b025e6a1 | |
Vitor Santos Costa | d2ed850643 | |
Vitor Santos Costa | dd6c66392a | |
Vitor Santos Costa | 04164487c7 | |
Vitor Santos Costa | 101a54e6ff | |
Vitor Santos Costa | 1d8f96fd74 | |
Vitor Santos Costa | e07a60887b | |
Vitor Santos Costa | f397cbe0b6 | |
Vitor Santos Costa | 52fcf2c7ab | |
Vitor Santos Costa | 415a6a3a71 | |
Vítor Santos Costa | f44c2b1488 | |
Vítor Santos Costa | a2842ef9ce | |
Vítor Santos Costa | 57760e3dc9 | |
Vítor Santos Costa | 6c9d7d120f | |
Vítor Santos Costa | a069d8b5f6 | |
Vítor Santos Costa | 48d51e460a | |
Vítor Santos Costa | c9780cb3ad | |
Vítor Santos Costa | e630d63d9e | |
Vítor Santos Costa | 1cd029197b | |
Vítor Santos Costa | 5090a08f5c | |
Vítor Santos Costa | 4ce1479da5 | |
Vítor Santos Costa | b7be50ee1f | |
Vítor Santos Costa | ad0ff98f1a | |
Vítor Santos Costa | 0f62de3744 | |
Vítor Santos Costa | d945f01f53 | |
Vítor Santos Costa | 5561b80796 | |
Vítor Santos Costa | 3977ceee60 | |
Vítor Santos Costa | 7be8130d05 | |
Vítor Santos Costa | 0d038e4528 | |
Vítor Santos Costa | c6b471d725 | |
Vítor Santos Costa | c1a3bfce42 | |
Vítor Santos Costa | b3a4666fc2 | |
Vítor Santos Costa | a86b79928d | |
Vítor Santos Costa | 1ede2112c6 | |
Vítor Santos Costa | 1967e0c434 | |
Vítor Santos Costa | e423fc28e5 | |
Vítor Santos Costa | e84540b4f0 | |
Vítor Santos Costa | 6f9b8bfca8 | |
Vitor Santos Costa | 8ea594c104 | |
Vítor Santos Costa | 4b64eafc3d | |
Vítor Santos Costa | 3bbc867611 | |
U-w7\vsc | 4260c37245 | |
Vitor Santos Costa | ab5c24cb87 | |
U-w7\vsc | 360e8a9269 | |
U-w7\vsc | 07504e79b3 | |
Vitor Santos Costa | 699edafa2c | |
Vitor Santos Costa | 27d92de39a | |
U-w7\vsc | f378b0aa64 | |
Vitor Santos Costa | 149ef50865 | |
U-w7\vsc | 013b21e527 | |
Vítor Santos Costa | d7c13b53d8 | |
Vítor Santos Costa | ddf624d351 | |
Vítor Santos Costa | 990dfbecbf | |
Vítor Santos Costa | d77de70868 | |
Vítor Santos Costa | 0f43a319c5 | |
Vítor Santos Costa | 7ebd169a62 | |
Vítor Santos Costa | 007a2aa87e | |
Vítor Santos Costa | bbd523a73a | |
U-w7\vsc | 1391dabd04 | |
Vitor Santos Costa | 65f5a3d364 | |
Vitor Santos Costa | fe154e87a5 | |
Vitor Santos Costa | 4dd7afa07d | |
Vitor Santos Costa | 1cbe82da1e | |
Vitor Santos Costa | 35b7f040d5 | |
Vitor Santos Costa | 96611027f3 | |
Vitor Santos Costa | ab9d2da775 | |
Vitor Santos Costa | 80cb87c41c | |
Vítor Santos Costa | 8921889002 | |
Vítor Santos Costa | 2669240c4f | |
Vítor Santos Costa | bd541bc57f | |
Vítor Santos Costa | 5ad10a1057 | |
Vítor Santos Costa | 94cb9b7563 | |
Vítor Santos Costa | b50305a100 | |
Vítor Santos Costa | 3fa1f856f6 | |
Vitor Santos Costa | 83695cc8c8 | |
Vítor Santos Costa | a01b319032 | |
Vitor Santos Costa | e19a910152 | |
Vítor Santos Costa | 8623131b31 | |
Vítor Santos Costa | 797c063785 | |
Vítor Santos Costa | 691e977a68 | |
Vítor Santos Costa | 0dc78f106b | |
Vítor Santos Costa | 36087849f0 | |
Paulo Moura | 0e2402b27e | |
Paulo Moura | c412f6de2f | |
Vítor Santos Costa | d02842c9ff | |
Vitor Santos Costa | e41851e9d9 | |
Vitor Santos Costa | e8b07224f4 | |
Vitor Santos Costa | 9229460310 | |
Vitor Santos Costa | 3648e98a17 | |
Vítor Santos Costa | a165d3e4c2 | |
Vitor Santos Costa | 23aaa8c792 | |
Vitor Santos Costa | 9531d2a359 | |
Vitor Santos Costa | b43cb37c9a | |
Vítor Santos Costa | ffd9bb7a19 | |
Vítor Santos Costa | f6bc5ab918 | |
Vítor Santos Costa | 6ec98fbcbd | |
Vítor Santos Costa | 70d864b13d | |
Vítor Santos Costa | c757e51cb0 | |
Vítor Santos Costa | 490b7cd40a | |
Vítor Santos Costa | fbf6648433 | |
Vítor Santos Costa | 1593ee4918 | |
Vítor Santos Costa | 9800753a1b | |
Vítor Santos Costa | ff2acca219 | |
Vítor Santos Costa | 726d7ca1cc | |
Vitor Santos Costa | fcaabd2c0b | |
Vitor Santos Costa | f3cefdf895 | |
Vitor Santos Costa | 30b567ae66 | |
Vitor Santos Costa | 74a6a79960 | |
Vitor Santos Costa | 43163a190f | |
Vitor Santos Costa | 860a5dcd02 | |
Vitor Santos Costa | d46276edbe | |
Vitor Santos Costa | 1c9167a6c5 | |
Vitor Santos Costa | 94619d2a32 | |
Vitor Santos Costa | 609f6fc440 | |
Vitor Santos Costa | 710915e001 | |
Vitor Santos Costa | bf77381744 | |
Vitor Santos Costa | 1ebd0f1a13 | |
Vitor Santos Costa | 448e2c88e1 | |
Vítor Santos Costa | bb6ae90019 | |
Vítor Santos Costa | 937077d51b | |
Vítor Santos Costa | 1ee58c5922 | |
Vítor Santos Costa | 7cf1b68c3a | |
Vítor Santos Costa | bef9cec46a | |
Vítor Santos Costa | 577b99367d | |
Vítor Santos Costa | 048c00a7a6 | |
Vítor Santos Costa | 72fe7e84c0 | |
Vítor Santos Costa | 5b6a3bffc1 | |
Vítor Santos Costa | e19b58cf53 | |
Vítor Santos Costa | b64965f22c | |
Vítor Santos Costa | 8c9025cdb4 | |
Vítor Santos Costa | 3d863b1058 | |
Vítor Santos Costa | dd17f5a3aa | |
Vítor Santos Costa | efddaab558 | |
Vítor Santos Costa | 6033eba372 | |
Vítor Santos Costa | e7477d9888 | |
Vítor Santos Costa | 0f45b3dc42 | |
Vitor Santos Costa | 28ff95f8de | |
Vítor Santos Costa | ab4a6c0ae3 | |
Vítor Santos Costa | 285c61b87f | |
Vítor Santos Costa | b2dcbe961c | |
Vitor Santos Costa | fc0a260b4e | |
Vitor Santos Costa | 448380c715 | |
Fabrizio Riguzzi | 3659f9036c | |
Fabrizio Riguzzi | b9d4868e37 | |
Fabrizio Riguzzi | faf7726452 | |
Vitor Santos Costa | ad9a973a26 | |
Vítor Santos Costa | 1eab4bc936 | |
Vítor Santos Costa | 5ea258f885 | |
Vitor Santos Costa | 2cfa0081ad | |
Vitor Santos Costa | e1208fc7ad | |
Vitor Santos Costa | 5cd9720593 | |
Vitor Santos Costa | 9d4c7a5c8c | |
Vitor Santos Costa | 23b860a977 | |
Vitor Santos Costa | b30f0eafdf | |
Vitor Santos Costa | 12d1e17dd3 | |
Vitor Santos Costa | 99ab8e541b | |
Vitor Santos Costa | 52c0d8a8de | |
Vitor Santos Costa | 46c3c4546f | |
Vítor Santos Costa | 77e1d9425b | |
Vitor Santos Costa | 8d14c15f3c | |
Vitor Santos Costa | eadfdbd646 | |
Vitor Santos Costa | cda2e3bffe | |
Vítor Santos Costa | a685b265b9 | |
Vítor Santos Costa | fde44acdf3 | |
Fabrizio Riguzzi | 50287c268b | |
Fabrizio Riguzzi | 700cd2d9dc | |
Vítor Santos Costa | 299816428c | |
Vítor Santos Costa | 8d92fa9369 | |
Vítor Santos Costa | 6966d23195 | |
Fabrizio Riguzzi | 52caac6548 | |
Fabrizio Riguzzi | 0eefb3c0b8 | |
Fabrizio Riguzzi | b00a5bf7fc | |
Fabrizio Riguzzi | cbf31fcd50 | |
Paulo Moura | 7da733d394 | |
Vítor Santos Costa | 4c148cc0d3 | |
Vítor Santos Costa | d1ff57b178 | |
Vítor Santos Costa | 11282b44d7 | |
Vítor Santos Costa | 2028730eac | |
Vítor Santos Costa | a1b5764527 | |
Vítor Santos Costa | 9932aff5c4 | |
Vítor Santos Costa | ef82f25594 | |
Fabrizio Riguzzi | b06e1f8bb0 | |
Fabrizio Riguzzi | c671d8aa29 | |
Fabrizio Riguzzi | 842b7f25ab | |
Fabrizio Riguzzi | 1f3f9bfb1f | |
Fabrizio Riguzzi | d53857db21 | |
Fabrizio Riguzzi | cb304e781c | |
Vítor Santos Costa | 90c70459be | |
Vítor Santos Costa | 614e7ab856 | |
vsc | c21b5bef3c | |
vsc | 6ab396ee85 | |
Vitor Santos Costa | 76ca8c31df | |
Vitor Santos Costa | 5022db1ca7 | |
Vítor Santos Costa | 3b29acea56 | |
Vítor Santos Costa | 0fd06d8cf1 | |
Vitor Santos Costa | d575ca8391 | |
Vitor Santos Costa | 2829696db7 | |
Vitor Santos Costa | 2c769767a4 | |
Vitor Santos Costa | 5f741122fa | |
Vitor Santos Costa | 24de22eeb5 | |
Vitor Santos Costa | bfb4cef8f9 | |
Vitor Santos Costa | 3bb50ce3af | |
Vitor Santos Costa | cc6e33bff0 | |
Vitor Santos Costa | 1c2e17f86a | |
Vitor Santos Costa | 38a804db1e | |
Vitor Santos Costa | 0639f86980 | |
Vitor Santos Costa | ab372b03af | |
Vitor Santos Costa | 45bf92fbed | |
Vitor Santos Costa | 08cfc527bb | |
Vitor Santos Costa | 7d67d6108e | |
Vitor Santos Costa | 5284a77bbf | |
Vitor Santos Costa | 07c2ca8324 | |
Vitor Santos Costa | 4245a04ed0 | |
Vitor Santos Costa | dde4830ceb | |
Vitor Santos Costa | 55a440cf0c | |
Fabrizio Riguzzi | a405ee4bb0 | |
Vítor Santos Costa | f79f93bccd | |
Vítor Santos Costa | 5e80c3ca86 | |
Vítor Santos Costa | bc992f552f | |
Fabrizio Riguzzi | 2e309201ab | |
Fabrizio Riguzzi | dff6925a66 | |
Fabrizio Riguzzi | d87bb830cd | |
Fabrizio Riguzzi | 69b1f51a4e | |
Vitor Santos Costa | 1f47d33579 | |
Vítor Santos Costa | 493161f6d8 | |
Vítor Santos Costa | c5554a343d | |
Vitor Santos Costa | 459ab89d7d | |
Vitor Santos Costa | ec5f7ebb28 | |
Vitor Santos Costa | a1632ff3e7 | |
Vitor Santos Costa | b257218ece | |
Vitor Santos Costa | e50f62ba3f | |
Vitor Santos Costa | 44ac5c6eac | |
Vitor Santos Costa | b2fda6c653 | |
Vitor Santos Costa | 4f8fad43df | |
Vitor Santos Costa | 84c1803102 | |
Vitor Santos Costa | ddee3df5f8 | |
Vitor Santos Costa | 1a0532f178 | |
Vitor Santos Costa | 5c870c11f7 | |
Vítor Santos Costa | 44dccc00bb | |
Vítor Santos Costa | 0726597812 | |
Vítor Santos Costa | 5a57611749 | |
Vitor Santos Costa | cc73f426d9 | |
Vitor Santos Costa | 24714dbd01 | |
Vítor Santos Costa | f4ef6702e1 | |
Vitor Santos Costa | 7e1f3009e6 | |
Vitor Santos Costa | f1cbc7f3be | |
Vitor Santos Costa | c60e1046a7 | |
Vítor Santos Costa | fef0538157 | |
Vítor Santos Costa | 5b4f355ee0 | |
Vítor Santos Costa | 5303f2f479 | |
Vítor Santos Costa | b6b44c655f | |
Vitor Santos Costa | 23a787bcb3 | |
Vitor Santos Costa | 6b31d08633 | |
Vitor Santos Costa | e96750b476 | |
Vitor Santos Costa | 4826d92709 | |
Vítor Santos Costa | dce491ef95 | |
Vitor Santos Costa | 889279cd81 | |
Vitor Santos Costa | dd43ee5e27 | |
Vitor Santos Costa | 8245bae2e4 | |
Vitor Santos Costa | b6b6b12c6f | |
Vitor Santos Costa | 933ee11985 | |
Vitor Santos Costa | 639247b4c3 | |
Vitor Santos Costa | 3b2b4b03c8 | |
Vitor Santos Costa | cb48d1c47e | |
Vítor Santos Costa | 6af394a35e | |
Vítor Santos Costa | 17cd9ab3c1 | |
Vitor Santos Costa | 75d607aaec | |
Vitor Santos Costa | 34bf9bb311 | |
Vitor Santos Costa | d644ea494d | |
Vitor Santos Costa | 923be33404 | |
Vitor Santos Costa | 64a61e2479 | |
Vitor Santos Costa | c04f04d078 | |
Vitor Santos Costa | 72cc5bc317 | |
Vitor Santos Costa | edbc21dcb0 | |
Vitor Santos Costa | 6480f75b23 | |
Vitor Santos Costa | f0bc4fb458 | |
Vitor Santos Costa | 743c9c69fb | |
Vitor Santos Costa | 24a75525c0 | |
Vítor Santos Costa | 2c49edb975 | |
Vitor Santos Costa | 52253e3e9e | |
Vitor Santos Costa | fba909cf46 | |
Vítor Santos Costa | 210dacfe5a | |
Vítor Santos Costa | ea3f25c378 | |
Vitor Santos Costa | 90abff4f2f | |
Vitor Santos Costa | bd9e840e8b | |
Vitor Santos Costa | cb08a542e2 | |
Vitor Santos Costa | 1c9cc469d5 | |
Vitor Santos Costa | 9b4b33bb3c | |
Tiago Gomes | 9e57b32431 | |
Vitor Santos Costa | 6d16dcf991 | |
Vitor Santos Costa | 8e33cebd4d | |
Vitor Santos Costa | cf7e904e9e | |
Vítor Santos Costa | e5d5352268 | |
Vitor Santos Costa | 78410ade1a | |
Vitor Santos Costa | eeb53aef71 | |
Vitor Santos Costa | a5095a921a | |
Tiago Gomes | 9e9ad24c90 | |
Tiago Gomes | 761406fa46 | |
Tiago Gomes | 745a034d43 | |
Tiago Gomes | cb6715664b | |
Tiago Gomes | 3405a8895b | |
Tiago Gomes | fc2530fbe2 | |
Tiago Gomes | 7ecfb999d5 | |
Tiago Gomes | de6d7981fb | |
Vítor Santos Costa | d22ddc6e02 | |
Vitor Santos Costa | 66af6f7642 | |
Vitor Santos Costa | 439b7e293f | |
Vítor Santos Costa | 23d2f7b8e5 | |
Vítor Santos Costa | 4a95575fe1 | |
Vítor Santos Costa | 30cc02e4ee | |
Vítor Santos Costa | 4ab4f1cab1 | |
Vitor Santos Costa | c90f637852 | |
Vitor Santos Costa | 230debfb44 | |
Vitor Santos Costa | 12799589a8 | |
Vitor Santos Costa | 537efbc341 | |
Tiago Gomes | b13a8b73a1 | |
Vitor Santos Costa | 633a56647e | |
Vitor Santos Costa | f7980f941b | |
Vitor Santos Costa | d163cadda1 | |
Vitor Santos Costa | a599699f0c | |
Tiago Gomes | a2e54a235a | |
Tiago Gomes | 6da2580c8f | |
Tiago Gomes | e2ca97c8de | |
Tiago Gomes | 389daab83f | |
Vitor Santos Costa | bda5d56bdf | |
Vitor Santos Costa | c364fccda8 | |
Vitor Santos Costa | 0ea010f3b2 | |
Vitor Santos Costa | 6404c2d827 | |
Tiago Gomes | da88ffcc78 | |
Tiago Gomes | c550139c8b | |
Tiago Gomes | 4ca17b9e9b | |
Tiago Gomes | acf83dd0a1 | |
Tiago Gomes | 403695a7ba | |
Tiago Gomes | 07dba92406 | |
Vitor Santos Costa | 4dac867fb8 | |
Tiago Gomes | bc04d28092 | |
Tiago Gomes | 2ef1651c6a | |
Vitor Santos Costa | 3f68f424ce | |
Tiago Gomes | b5d72f751e | |
Tiago Gomes | d3663d9370 | |
Tiago Gomes | 23469e6f94 | |
Tiago Gomes | 5e5feb5674 | |
Vítor Santos Costa | b88dcb86ab | |
Vítor Santos Costa | 7f910c694d | |
Vitor Santos Costa | d0858c0d0c | |
Vitor Santos Costa | 6397cc9ff7 | |
Vitor Santos Costa | e7146c9a46 | |
Vitor Santos Costa | 7f758cf103 | |
Vitor Santos Costa | 46d447b385 | |
Vitor Santos Costa | 562372bb5a | |
Vitor Santos Costa | 504ad22f92 | |
Vitor Santos Costa | b0b74fd0f8 | |
Vitor Santos Costa | f62ea7686a | |
Tiago Gomes | 21c401c0dd | |
Tiago Gomes | 2da7249247 | |
Tiago Gomes | a300b27764 | |
Tiago Gomes | 95539226ea | |
Tiago Gomes | d563fce952 | |
Tiago Gomes | 532654baba | |
Vitor Santos Costa | 5568236479 | |
Vítor Santos Costa | 17709a9669 | |
Vitor Santos Costa | a5000dab32 | |
Vitor Santos Costa | 263a1a548c | |
Vitor Santos Costa | a64c6e523a | |
Vitor Santos Costa | d59afea65e | |
Tiago Gomes | 7193d2238d | |
Tiago Gomes | 063f3ff6e3 | |
Tiago Gomes | 93fa793683 | |
Vítor Santos Costa | e600a9c6aa | |
Vítor Santos Costa | ab01bb0124 | |
Tiago Gomes | 98efd54da7 | |
Vítor Santos Costa | 4fcba3691a | |
Vítor Santos Costa | 0a0b3cf6ac | |
Vítor Santos Costa | 874fc97970 | |
Vítor Santos Costa | 725617cedd | |
Vitor Santos Costa | 1c12d456ae | |
Vitor Santos Costa | acf565d91b | |
Tiago Gomes | 902624f557 | |
Vitor Santos Costa | b49e9b908b | |
Vitor Santos Costa | 59d97f83b4 | |
Vitor Santos Costa | dbd4c7f50f | |
Vitor Santos Costa | 6e7742ce8b | |
Vitor Santos Costa | ddb14f97aa | |
Tiago Gomes | c8b639f495 | |
Tiago Gomes | 0991a84793 | |
Tiago Gomes | 59c6f5c243 | |
Tiago Gomes | f0572e3cfb | |
Tiago Gomes | 6b0e125e3b | |
Tiago Gomes | ce8152d7a0 | |
Vítor Santos Costa | 6f6f578578 | |
Tiago Gomes | 1d54a78601 | |
Tiago Gomes | 9a68d95c18 | |
Tiago Gomes | 8ca379c74a | |
Tiago Gomes | 8de22f4f0b | |
Tiago Gomes | 8c2468c28b | |
Tiago Gomes | 77dfe50acb | |
Tiago Gomes | 7edfe44576 | |
Tiago Gomes | 74a9eda09d | |
Tiago Gomes | e3439af0a0 | |
Tiago Gomes | e434e87cc8 | |
Tiago Gomes | c9543514c5 | |
Vítor Santos Costa | 9e250c3d0a | |
Vítor Santos Costa | 638bee41cd | |
Vítor Santos Costa | f1273132b5 | |
Vítor Santos Costa | 8cadc14ed4 | |
Vítor Santos Costa | 4dc28bc48a | |
Tiago Gomes | b6ee7b4460 | |
Tiago Gomes | ea49b517e8 | |
Tiago Gomes | ba79d2e422 | |
Tiago Gomes | 0852c4fe22 | |
Tiago Gomes | d0f5d0f9ab | |
Tiago Gomes | be24ff5160 | |
Tiago Gomes | acb4bf610f | |
Vitor Santos Costa | 19c16176d4 | |
Vitor Santos Costa | e98be4f69d | |
Vítor Santos Costa | 918a973019 | |
Vítor Santos Costa | fdd05abd38 | |
Vítor Santos Costa | 9372231bcf | |
Vítor Santos Costa | e27ceac1aa | |
Vítor Santos Costa | e2acdf72cf | |
Tiago Gomes | bf1ba17855 | |
Tiago Gomes | 57f46e7c0d | |
Tiago Gomes | ab7f4c8113 | |
Tiago Gomes | ef4ebb4d7f | |
Tiago Gomes | afd26ed9b4 | |
Vítor Santos Costa | f431142ef4 | |
Vítor Santos Costa | ec7158eb99 | |
Tiago Gomes | bd70033c06 | |
Tiago Gomes | 2bc123d72c | |
Vitor Santos Costa | 60969b9601 | |
Vitor Santos Costa | 9fb63762dc | |
Vitor Santos Costa | 268bca2330 | |
Vitor Santos Costa | 8590ab8b8a | |
Costa Vitor | da79af201b | |
Vitor Santos Costa | a6f6226fdb | |
Vítor Santos Costa | 67208c8157 | |
Tiago Gomes | e178c1af04 | |
Tiago Gomes | 6a1a209ee3 | |
Vitor Santos Costa | 76f5696328 | |
Vitor Santos Costa | 19863f08f2 | |
Vítor Santos Costa | 046cb5f8d6 | |
Vítor Santos Costa | d18c67aa2a | |
Tiago Gomes | 264ef7a067 | |
Tiago Gomes | bff56c75ca | |
Tiago Gomes | 98842dca74 | |
Tiago Gomes | c41b6d80b6 | |
Tiago Gomes | cd8a25162e | |
Tiago Gomes | 206cf0a9c7 | |
Tiago Gomes | 973df43fe0 | |
Tiago Gomes | 6f83ceb6f5 | |
Tiago Gomes | 4267465f53 | |
Tiago Gomes | 3738d0b2c6 | |
Tiago Gomes | 2992f9e3cf | |
Tiago Gomes | 5c84a2f532 | |
Tiago Gomes | 544d0aa39e | |
Tiago Gomes | bb7a530da3 | |
Tiago Gomes | 7b60e88545 | |
Tiago Gomes | 80452bf75d | |
Tiago Gomes | 42a5bc493a | |
Vitor Santos Costa | 9f49512497 | |
Vitor Santos Costa | b34be4360b | |
Vitor Santos Costa | f873074961 | |
Vitor Santos Costa | 33da88be5b | |
Vitor Santos Costa | cf3c62f4b4 | |
Vítor Santos Costa | 2cb0f298a8 | |
Vitor Santos Costa | 798038ad38 | |
Vitor Santos Costa | 0e9641fe20 | |
Vitor Santos Costa | 9ce268915d | |
Vitor Santos Costa | 14d4386e5a | |
Vitor Santos Costa | deba351b87 | |
Vítor Santos Costa | 02a9709431 | |
Vítor Santos Costa | 5e243a6fbc | |
Vítor Santos Costa | 56a22473ea | |
Tiago Gomes | 0d9d59f5fe | |
Tiago Gomes | 31bff4dc84 | |
Tiago Gomes | bef65dac57 | |
Tiago Gomes | 9dfedafe98 | |
Vitor Santos Costa | 8e427074d8 | |
Vítor Santos Costa | bbaf1f13d4 | |
Vítor Santos Costa | c758d23ab4 | |
Vítor Santos Costa | ab302e985b | |
Vitor Santos Costa | 829c3ec8c4 | |
Vitor Santos Costa | 3d24a458fb | |
Vítor Santos Costa | 3c021a41cf | |
Vitor Santos Costa | 2de1a678e4 | |
Vitor Santos Costa | 8774fed9ff | |
Vitor Santos Costa | d2a47ca4c0 | |
Vitor Santos Costa | 504c2f3000 | |
Vitor Santos Costa | ff5bf53d38 | |
Vítor Santos Costa | 1abd5dce90 | |
Vítor Santos Costa | 0898c52e6f | |
Vítor Santos Costa | 9a71f20caa | |
Vítor Santos Costa | b9f1885f0a | |
Vítor Santos Costa | 0e89a9c2ff | |
Vítor Santos Costa | abe9f20a85 | |
Vítor Santos Costa | b24c91eeb3 | |
Vítor Santos Costa | 8971f37232 | |
Vítor Santos Costa | 0734b9fd33 | |
Vítor Santos Costa | 4c34528e90 | |
Vítor Santos Costa | 1bd2224377 | |
Vitor Santos Costa | 00c47e0ecc | |
Vitor Santos Costa | 0865235c48 | |
Vitor Santos Costa | 5880420db9 | |
Vítor Santos Costa | 014a0ec5bc | |
Vítor Santos Costa | eea91f782f | |
Vítor Santos Costa | 5023da7893 | |
Vítor Santos Costa | 290e58e262 | |
Vítor Santos Costa | b7c230217a | |
Vítor Santos Costa | a1e599ebe4 | |
Vitor Santos Costa | 05f9a935e1 | |
Vítor Santos Costa | 0e262df2ee | |
Vitor Santos Costa | c03b5095a3 | |
Vitor Santos Costa | b25e1fb7e8 | |
Vitor Santos Costa | 4791a18c5b | |
Vitor Santos Costa | 20398352e3 | |
Vitor Santos Costa | bd83674168 | |
Vitor Santos Costa | 4f5a3469d6 | |
Vitor Santos Costa | 85acf5c4ea | |
Vitor Santos Costa | 8758b6de5a | |
Vitor Santos Costa | 7e3db0f75c | |
Vitor Santos Costa | fa470556f2 | |
Vitor Santos Costa | 0f362ae77f | |
Vitor Santos Costa | e87a4f4f56 | |
Vitor Santos Costa | f98a2d5e01 | |
Vitor Santos Costa | e7da973009 | |
Vitor Santos Costa | 33714b14b9 | |
Vitor Santos Costa | 098608700c | |
Vítor Santos Costa | e22e3d74a0 | |
Vitor Santos Costa | 7407ecb60c | |
Vitor Santos Costa | 4b5ef10caf | |
Vitor Santos Costa | 7cf4e9442c | |
Vitor Santos Costa | 1bba29c646 | |
Vítor Santos Costa | b10d95393e | |
Vitor Santos Costa | 298fb62f0c | |
Vítor Santos Costa | abe6621495 | |
Tiago Gomes | 5683258187 | |
Vítor Santos Costa | 0eacb68907 | |
Vitor Santos Costa | 9550393e66 | |
Vitor Santos Costa | 5a6f6c09ce | |
Vitor Santos Costa | e85e76cd57 | |
Tiago Gomes | 6cad8969c6 | |
Vitor Santos Costa | 5ae2ccc416 | |
Vitor Santos Costa | 8c8392b5da | |
Vitor Santos Costa | 1207205493 | |
Vitor Santos Costa | a0cd8070c9 | |
Vitor Santos Costa | be5208f281 | |
Vitor Santos Costa | be668f1558 | |
Tiago Gomes | cac748d41a | |
Vítor Santos Costa | 0c9342466b | |
Vítor Santos Costa | 48ea1f5ec5 | |
Vítor Santos Costa | 798afc81c4 | |
Vítor Santos Costa | ec37045ca3 | |
Vítor Santos Costa | e054db052d | |
Vítor Santos Costa | 480e9aea69 | |
Tiago Gomes | 83ccb31665 | |
Tiago Gomes | 90614d3594 | |
Tiago Gomes | 3ecc65b816 | |
Tiago Gomes | 509491cd0f | |
Vítor Santos Costa | 8f2766cbf3 | |
Vitor Santos Costa | e9d04ef9f5 | |
Vitor Santos Costa | a913523d6a | |
Vitor Santos Costa | f83379648c | |
Tiago Gomes | 8c8e2b034f | |
Tiago Gomes | 8285b8e1e4 | |
Vítor Santos Costa | d078a2b2c4 | |
Tiago Gomes | 8f9b11cc7c | |
Tiago Gomes | 4aa4cb50b0 | |
Tiago Gomes | f3bd8ad414 | |
Tiago Gomes | f7fcfec8ce | |
Tiago Gomes | d3e2abd677 | |
Tiago Gomes | fdeca2852a | |
Tiago Gomes | e5e224d89b | |
Tiago Gomes | bd84949f09 | |
Tiago Gomes | 1bb1138b3a | |
Tiago Gomes | 29b2d4f3df | |
Tiago Gomes | 6060899773 | |
Vitor Santos Costa | b7ef6576a6 | |
Vitor Santos Costa | 033f33ad96 | |
Vitor Santos Costa | 6cee85bd60 | |
Vitor Santos Costa | 46fbc539bf | |
Vitor Santos Costa | 37243187ec | |
Vitor Santos Costa | ff953eb20a | |
tacgomes | 2feac46e54 | |
Vitor Santos Costa | 649fae4294 | |
tacgomes | 7f452d2397 | |
tagomes@fc.up.pt | 7fabfcf4c9 | |
Tiago Gomes | 91e8bcd4d7 | |
Vitor Santos Costa | 6cd778f70b | |
Vitor Santos Costa | e14703b990 | |
Tiago Gomes | 24271157ce | |
Tiago Gomes | 59ae52623c | |
Vitor Santos Costa | 1043d037e9 | |
Vitor Santos Costa | 8ce30976ce | |
Tiago Gomes | 6755e50525 | |
Tiago Gomes | ea054468bc | |
Tiago Gomes | dc536fabc2 | |
Tiago Gomes | 2738d83302 | |
Tiago Gomes | dfd7360291 | |
Tiago Gomes | dbd35a20a2 | |
Tiago Gomes | 9c8fd804df | |
Tiago Gomes | f94032d06c | |
David Vaz | c9a01455b5 | |
Tiago Gomes | 1b9c4e96e7 | |
Tiago Gomes | da0514a779 | |
Tiago Gomes | 4220069d90 | |
Tiago Gomes | 75b652b0c9 | |
Tiago Gomes | 6375d05a93 | |
Tiago Gomes | 182429252e | |
Vitor Santos Costa | f7adcf9b44 | |
Vitor Santos Costa | 2a44a0205b | |
Vitor Santos Costa | d98862f5ea | |
Tiago Gomes | c92b7c3e7e | |
Tiago Gomes | f598881cc5 | |
Tiago Gomes | 9bb43360a2 | |
Tiago Gomes | ba32ebc5f5 | |
Tiago Gomes | 82a4cc508b | |
David Vaz | 5c83be965a | |
David Vaz | 38fcc19d55 | |
Tiago Gomes | bafd7320a5 | |
Tiago Gomes | 91dbd60ad4 | |
Tiago Gomes | 96f4e7ea1b | |
Vítor Santos Costa | 8e8046db73 | |
Vítor Santos Costa | f063a2bd52 | |
David Vaz | cdc15e8cd8 | |
Tiago Gomes | ec2d9e0967 | |
Tiago Gomes | f0768e76f2 | |
Tiago Gomes | f55ccdef33 | |
Tiago Gomes | c5a390460d | |
Tiago Gomes | f2682374fb | |
Tiago Gomes | 3347f0e676 | |
Tiago Gomes | d4d11cd4b4 | |
Tiago Gomes | ea5dbe2bca | |
David Vaz | a9cacc7b33 | |
David Vaz | 58962f2595 | |
David Vaz | bae26c618b | |
Tiago Gomes | d293c5e5a9 | |
Tiago Gomes | 3363019c93 | |
Tiago Gomes | 7d9af75c35 | |
Tiago Gomes | d36b63ece3 | |
Tiago Gomes | c96496720b | |
Tiago Gomes | 485c3e34b2 | |
Tiago Gomes | 7b7f663ac6 | |
Tiago Gomes | b996436b24 | |
Tiago Gomes | de0a118ae5 | |
Tiago Gomes | cbea630fbf | |
David Vaz | e6c2fa30ee | |
Tiago Gomes | 8bdcb65907 | |
Tiago Gomes | 188f359496 | |
Tiago Gomes | d8c5725b2e | |
Tiago Gomes | 4b901d26d7 | |
Tiago Gomes | 01d8f8e178 | |
Vítor Santos Costa | 3565a01f1e | |
Vítor Santos Costa | 14b67dc76d | |
Tiago Gomes | 421d6f72ee | |
Vítor Santos Costa | 0ac9f6f436 | |
Vitor Santos Costa | ebb239b233 | |
Vitor Santos Costa | 4098b9b964 | |
Vitor Santos Costa | cb37e7714a | |
Vitor Santos Costa | a309f47794 | |
Vitor Santos Costa | fe4218be19 | |
Tiago Gomes | 57339760b9 | |
Tiago Gomes | b44ed7db39 | |
Tiago Gomes | 685f46dc27 | |
Tiago Gomes | 053fa31bb2 | |
David Vaz | 4efa594f0a | |
Tiago Gomes | 2ca31ca14a | |
Tiago Gomes | af8497af6e | |
David Vaz | a655c0bb51 | |
Tiago Gomes | 046af409ba | |
Tiago Gomes | c407594146 | |
Tiago Gomes | 60ff9daafd | |
Tiago Gomes | 48254ba7d7 | |
Vitor Santos Costa | a7307f3faa | |
U-vsc-PC\vsc | 4d9d22530f | |
Tiago Gomes | 2d1f5edc91 | |
Tiago Gomes | 691188d5c9 | |
Tiago Gomes | 0a661b0462 | |
David Vaz | 43e459b8f8 | |
Tiago Gomes | 4b0acbf8c1 | |
Tiago Gomes | c7a4adcefb | |
Tiago Gomes | 5fa5dda579 | |
Tiago Gomes | e1c862ebbe | |
Tiago Gomes | f1499f99f3 | |
Tiago Gomes | 40a72a0a63 | |
David Vaz | 8511e87e32 | |
David Vaz | bd25c61fbf | |
Tiago Gomes | 9861f4aadb | |
Tiago Gomes | 3eb6b76ddd | |
Tiago Gomes | 2f2f88e571 | |
Vitor Santos Costa | 06cf326885 | |
Vitor Santos Costa | f47a7bb999 | |
Tiago Gomes | 409a230826 | |
Tiago Gomes | 2738c0fb56 | |
Tiago Gomes | d03ea1509e | |
Tiago Gomes | e35cf51476 | |
Tiago Gomes | 9ff9be2f49 | |
Tiago Gomes | 81ac6f1913 | |
Tiago Gomes | ea931f2f93 | |
Vítor Santos Costa | 45b6263f85 | |
Tiago Gomes | 55292ab745 | |
Vitor Santos Costa | 6e94d6b37e | |
Tiago Gomes | 1174486576 | |
Tiago Gomes | 2996a0b8b3 | |
Tiago Gomes | e5479ff17c | |
Vítor Santos Costa | 7811a697b8 | |
Vítor Santos Costa | 4d35c1f70a | |
Vítor Santos Costa | 7c0c795518 | |
Vitor Santos Costa | f329b5f06b | |
Vitor Santos Costa | e648d197a8 | |
Vitor Santos Costa | a1db3dba0b | |
Vitor Santos Costa | 2e6360738c | |
Tiago Gomes | 6c95c50eb4 | |
Vitor Santos Costa | 84b0529060 | |
Tiago Gomes | 971b8b7487 | |
Vitor Santos Costa | 524edecdd3 | |
Tiago Gomes | d7ebdf1289 | |
Tiago Gomes | eea7ce2885 | |
Vitor Santos Costa | 9107af2e3d | |
Tiago Gomes | 0594d43539 | |
Tiago Gomes | 05e53eaf37 | |
Tiago Gomes | 6b8301d9c4 | |
Tiago Gomes | d78baa48a1 | |
Vitor Santos Costa | c4448d066a | |
Tiago Gomes | 8b996c5dc9 | |
Tiago Gomes | 48413deae7 | |
Tiago Gomes | dd8a92aaf3 | |
Tiago Gomes | 11e688ffd7 | |
Tiago Gomes | f2173d001e | |
Tiago Gomes | c7588c9361 | |
Tiago Gomes | 4683d30d8e | |
Tiago Gomes | 39bf95fe2b | |
Tiago Gomes | 8eb657aec2 | |
Tiago Gomes | 0f46c97481 | |
Tiago Gomes | e66ff6777c | |
Tiago Gomes | 66cd58655b | |
Tiago Gomes | 01dfc5e2be | |
Tiago Gomes | 108e310a0f | |
Tiago Gomes | f128b6de7a | |
Tiago Gomes | 27a235f65b | |
Tiago Gomes | 4310e42562 | |
Vitor Santos Costa | 547ba48f9f | |
Vitor Santos Costa | eb63cf748c | |
Vitor Santos Costa | 63a5daa295 | |
Vitor Santos Costa | e41f821d67 | |
Tiago Gomes | ccba2d4177 | |
Tiago Gomes | 1641d1fa30 | |
Tiago Gomes | 47bc8f22fc | |
Tiago Gomes | d8a7b7aad6 | |
Tiago Gomes | a59c152962 | |
Tiago Gomes | bb68afe91d | |
Tiago Gomes | 1d732594e2 | |
Tiago Gomes | 8371e395dd | |
Tiago Gomes | a25f4584c8 | |
Vitor Santos Costa | ac74c9e3de | |
Vitor Santos Costa | 87e811028c | |
Vitor Santos Costa | 7b579b810f | |
Vitor Santos Costa | b34c8b1b2c | |
Vitor Santos Costa | 9e63e83f1f | |
Vitor Santos Costa | 62aa6df644 | |
Tiago Gomes | 9c8827c309 | |
Tiago Gomes | 90736156ae | |
Tiago Gomes | e46d2177b7 | |
Tiago Gomes | 907144db32 | |
Tiago Gomes | 57a31c2c36 | |
Tiago Gomes | 59f653aabd | |
Tiago Gomes | 4edbcf86b8 | |
Vitor Santos Costa | ac62053c85 | |
Vítor Santos Costa | 354dbbf802 | |
Vitor Santos Costa | e05ee9670c | |
Vitor Santos Costa | f0b44b9b77 | |
Tiago Gomes | 73b3594c97 | |
Vitor Santos Costa | b98b09e7de | |
Vitor Santos Costa | 556937195d | |
Vitor Santos Costa | 7fe1f20200 | |
Vitor Santos Costa | c52d7a182c | |
Vitor Santos Costa | a813a13412 | |
Vitor Santos Costa | 36ae500118 | |
Vítor Santos Costa | d9d954abe1 | |
Vítor Santos Costa | 2cbf3439ac | |
Vitor Santos Costa | 3c0e16030c | |
Tiago Gomes | ee1b7dcd21 | |
Vitor Santos Costa | 683032432c | |
Vítor Santos Costa | e529e79582 | |
Vítor Santos Costa | 6e3f01e0b3 | |
Vítor Santos Costa | 3e2a1a9678 | |
Vitor Santos Costa | f1874ecec0 | |
Vitor Santos Costa | 46cec46fa8 | |
Tiago Gomes | 610e55a4a2 | |
Tiago Gomes | 1f1d194326 | |
Tiago Gomes | a2429a1eec | |
Vítor Santos Costa | 095cd68cac | |
Vítor Santos Costa | 57ac65c83b | |
Vítor Santos Costa | 99dded628f | |
Vítor Santos Costa | e470dfcdc7 | |
Vítor Santos Costa | 2607e59a16 | |
Vítor Santos Costa | feb70d0146 | |
Vitor Santos Costa | d5b97ac15e | |
Tiago Gomes | e09c25bd59 | |
Tiago Gomes | 4afe6c8161 | |
Tiago Gomes | 992d06656d | |
Vitor Santos Costa | 027632456a | |
Vitor Santos Costa | bb4d75f428 | |
Tiago Gomes | 85db763d9c | |
Tiago Gomes | 51eef45b2d | |
Tiago Gomes | 59fd21bf33 | |
Tiago Gomes | c2791748d2 | |
Vitor Santos Costa | 114a6732f0 | |
Tiago Gomes | 51fd48cd46 | |
Tiago Gomes | 4522850cd6 | |
Tiago Gomes | b673dfd462 | |
Tiago Gomes | 64a27847cc | |
Tiago Gomes | 6e7d0d1d0a | |
Tiago Gomes | cad22da9f5 | |
Tiago Gomes | d9e48e6290 | |
Vitor Santos Costa | 740dd0ce99 | |
Vitor Santos Costa | 416b407faa | |
Tiago Gomes | 9202e286f8 | |
Tiago Gomes | f5c85ffcc9 | |
Tiago Gomes | 4776817603 | |
Tiago Gomes | 07bcc89a76 | |
Tiago Gomes | 8ab622e0aa | |
Tiago Gomes | c53220aa61 | |
Vítor Santos Costa | a402001475 | |
Vítor Santos Costa | bd53531c5a | |
Tiago Gomes | 6a200760ca | |
Tiago Gomes | 0ed89d3eeb | |
Vitor Santos Costa | 72746bf6e4 | |
Vitor Santos Costa | 81a2420747 | |
Tiago Gomes | a8c4f4fc52 | |
Vítor Santos Costa | f371fca6c5 | |
Tiago Gomes | f7db522c6c | |
Tiago Gomes | 6db4d37684 | |
Tiago Gomes | d2ae171bb5 | |
Tiago Gomes | 278f8f77f5 | |
Tiago Gomes | 07c6509a79 | |
Vítor Santos Costa | f74164c642 | |
Tiago Gomes | 83c1e58674 | |
Tiago Gomes | b599b45bc6 | |
Tiago Gomes | 829f2248ee | |
Tiago Gomes | 06a59ad659 | |
Tiago Gomes | 1e38743462 | |
Tiago Gomes | 869d513c1a | |
Tiago Gomes | 5e1547ba78 | |
Tiago Gomes | ab334f82b2 | |
Vítor Santos Costa | 2a737fe22b | |
Vítor Santos Costa | 06b915d568 | |
Tiago Gomes | 4518a3db5d | |
Vítor Santos Costa | eb63f30ab2 | |
Vítor Santos Costa | bf956ca639 | |
Vítor Santos Costa | 37e4d242ad | |
Vítor Santos Costa | 3b44ed0660 | |
Tiago Gomes | b8cef8798a | |
Tiago Gomes | a1d0deb638 | |
Tiago Gomes | d4912ea219 | |
Vitor Santos Costa | afc0c4c5a2 | |
Tiago Gomes | bfa9648067 | |
Tiago Gomes | 6877be897e | |
Tiago Gomes | e762d6be22 | |
Tiago Gomes | 77ef7b87cd | |
Tiago Gomes | b31a047635 | |
Tiago Gomes | a75799b34f | |
Tiago Gomes | 864f764391 | |
Tiago Gomes | 8b77b93a3b | |
Tiago Gomes | b6df8a66b1 | |
Tiago Gomes | d07ea73050 | |
Tiago Gomes | 324ea1a96c | |
Tiago Gomes | c2b1434969 | |
Tiago Gomes | fbc44ba17d | |
Vitor Santos Costa | f7493e0de6 | |
Vitor Santos Costa | 68547e1abf | |
Vitor Santos Costa | eb79049bdb | |
Vitor Santos Costa | 06051f05fb | |
Tiago Gomes | d074ca9a8f | |
Vitor Santos Costa | f33fe61ada | |
Tiago Gomes | 68ef63207f | |
Vítor Santos Costa | ea3f2f13e9 | |
Tiago Gomes | eac6b954a8 | |
Tiago Gomes | 0cfc64d068 | |
Vitor Santos Costa | 3e696eb831 | |
Vitor Santos Costa | 8126381e8d | |
Vitor Santos Costa | 139b06115e | |
Vítor Santos Costa | d2da55463f | |
Vítor Santos Costa | 0caac30c11 | |
Vitor Santos Costa | 84a5f518bf | |
Vítor Santos Costa | b272205707 | |
Tiago Gomes | a8926fe38b | |
Vitor Santos Costa | f189784510 | |
Vitor Santos Costa | 0f8a3de8b6 | |
Vítor Santos Costa | 6bfd5bbe54 | |
Vítor Santos Costa | db39b48410 | |
Vítor Santos Costa | ad4b767661 | |
Vítor Santos Costa | 135027fe20 | |
Vitor Santos Costa | 32a01a5bf6 | |
Vitor Santos Costa | 43c3c89f30 | |
Vítor Santos Costa | 7fa7c8b92a | |
Vítor Santos Costa | 14796f5d90 | |
Vítor Santos Costa | 7f41b36378 | |
Vitor Santos Costa | 04bba4f1de | |
Vitor Santos Costa | e92b8791c5 | |
Vitor Santos Costa | 83480fe8a7 | |
Vitor Santos Costa | 88f2dc7730 | |
Vitor Santos Costa | 7d7a59ae28 | |
Vítor Santos Costa | 27737c31bd | |
Vítor Santos Costa | 140a19ba7c | |
Vitor Santos Costa | 2de3917e4a | |
Vitor Santos Costa | 4da6733194 | |
Vitor Santos Costa | e596cce6f5 | |
Vitor Santos Costa | 3917a19ab9 | |
Vitor Santos Costa | 474c088baf | |
Vítor Santos Costa | fb2a17addf | |
Vitor Santos Costa | f753bce4fe | |
Vitor Santos Costa | 4b35fd8271 | |
Vitor Santos Costa | 503bdcc8b3 | |
Vitor Santos Costa | 610ca06883 | |
Vitor Santos Costa | ba866a36e2 | |
Vitor Santos Costa | fcb59e5c74 | |
Vitor Santos Costa | bb71204a11 | |
Vítor Santos Costa | d6b3fc4325 | |
Vitor Santos Costa | 965b48f017 | |
Vitor Santos Costa | 474b7a19e7 | |
Vitor Santos Costa | 48f07ad338 | |
Vitor Santos Costa | 7c178d2644 | |
Vitor Santos Costa | 3f6e56eb82 | |
Vítor Santos Costa | ecf5ac655f | |
Vitor Santos Costa | c4da6a9c68 | |
Vitor Santos Costa | b0ddda1fde | |
Vitor Santos Costa | daf9f589b9 | |
Vitor Santos Costa | a4acb6a806 | |
Vitor Santos Costa | 26b5173a33 | |
Vítor Santos Costa | b24922fd38 | |
Vítor Santos Costa | 2d373a28a6 | |
Vítor Santos Costa | 1089aaf585 | |
Vitor Santos Costa | 4e43aff605 | |
Vitor Santos Costa | 93f13c9c8d | |
Vítor Santos Costa | ab14365a30 | |
Vitor Santos Costa | 01e1a14160 | |
Vítor Santos Costa | ce7adaa632 | |
Vítor Santos Costa | e60b485134 | |
Vítor Santos Costa | a3757ddbd7 | |
Vítor Santos Costa | 237976cf30 | |
Vítor Santos Costa | 4de83f5f52 | |
Vítor Santos Costa | 8eede3eb73 | |
Vítor Santos Costa | e6fb32d9ca | |
Vítor Santos Costa | 20080c0a24 | |
Vítor Santos Costa | 85e9da1332 | |
Vítor Santos Costa | c30e71fe68 | |
Vítor Santos Costa | c8468f6391 | |
Tiago Gomes | 559b3e3b54 | |
Vítor Santos Costa | 793907f710 | |
Tiago Gomes | fec0bd44b4 | |
Vítor Santos Costa | 78a08e1b87 | |
Vítor Santos Costa | 169339d5be | |
Vitor Santos Costa | d688ee0295 | |
Vítor Santos Costa | 76088ca8b3 | |
Vítor Santos Costa | 5249d02107 | |
Vítor Santos Costa | 74fd98832a | |
Vitor Santos Costa | 710be1a5e8 | |
Vitor Santos Costa | 55f28a75ab | |
Vitor Santos Costa | 20d31b8207 | |
Vitor Santos Costa | 01f8731f97 | |
Vitor Santos Costa | 7424a7376c | |
Vitor Santos Costa | 0e2055d359 | |
Vitor Santos Costa | 9597d1e75f | |
Vítor Santos Costa | 83c5c7e7af | |
Tiago Gomes | 265766277f | |
Vítor Santos Costa | 83418f8f27 | |
Vítor Santos Costa | ac863833ff | |
Vítor Santos Costa | 309dfaa813 | |
Vítor Santos Costa | 34dc03d43b | |
Vítor Santos Costa | 2603f18a10 | |
Vítor Santos Costa | d73b2ac673 | |
Vítor Santos Costa | 709843717f | |
Vítor Santos Costa | 2673c56982 | |
Vítor Santos Costa | a3435f5a7b | |
Vítor Santos Costa | 19e565a1c7 | |
Vítor Santos Costa | f38e80f659 | |
Vítor Santos Costa | d5bf100b71 | |
Vítor Santos Costa | ceb5785120 | |
Vítor Santos Costa | 419bd2b219 | |
VITOR SANTOS COSTA | 89030ce97d | |
Tiago Gomes | 10b15f606a | |
Tiago Gomes | 701911ef09 | |
Tiago Gomes | febb17d753 | |
Tiago Gomes | 86b57e961e | |
VITOR SANTOS COSTA | a6c91c99c7 | |
VITOR SANTOS COSTA | 2c0fd47e56 | |
VITOR SANTOS COSTA | c5bbbd9f93 | |
Vítor Santos Costa | 8d779f68ea | |
Vítor Santos Costa | fa2c5ee114 | |
Vítor Santos Costa | 9019a1a7b7 | |
Vitor Santos Costa | dcc5b57016 | |
Costa Vitor | f4e965c02f | |
Costa Vitor | 62ab5b3dcb | |
Costa Vitor | fcfc0e52d7 | |
Costa Vitor | 5a3cb76378 | |
Costa Vitor | 5c70b295bd | |
Costa Vitor | 38a2bee3ab | |
Costa Vitor | cb53d087b2 | |
Vítor Santos Costa | d871b8dd2a | |
Vitor Santos Costa | 495d852879 | |
Vitor Santos Costa | f85a2112c9 | |
Vitor Santos Costa | 198fc03bae | |
Vitor Santos Costa | 1be424fe57 | |
Vitor Santos Costa | 81743361a6 | |
Vitor Santos Costa | e2fb330575 | |
Vitor Santos Costa | 55267cac34 | |
Vítor Santos Costa | 475face871 | |
Vítor Santos Costa | 05d3266671 | |
Vitor Santos Costa | 9353d28c2e | |
Costa Vitor | a76f4f34d5 | |
Costa Vitor | 020692635b | |
Costa Vitor | 72c650cda0 | |
Costa Vitor | bf4d37eb0d | |
Vítor Santos Costa | 7e8cac9fb1 | |
Costa Vitor | 4756948967 | |
Costa Vitor | 652073caa4 | |
Vitor Santos Costa | ad609e39da | |
Vitor Santos Costa | d5ed379068 | |
Vitor Santos Costa | 15bcaf97fc | |
Vítor Santos Costa | 2b2cedc2b6 | |
Vítor Santos Costa | c159894c29 | |
Costa Vitor | 98f68edd34 | |
Costa Vitor | e2fa3a3b8a | |
Costa Vitor | 51b47d14da | |
Vítor Santos Costa | a4ae6acbb6 | |
Vitor Santos Costa | a8f0beb64b | |
Vítor Santos Costa | adef8d4737 | |
Vítor Santos Costa | d6773df815 | |
Vitor Santos Costa | 7458d8ee74 | |
Vítor Santos Costa | ccb67cec96 | |
Vítor Santos Costa | 21e7f359dc | |
Vítor Santos Costa | e7551b106a | |
Vítor Santos Costa | 9d48e0ed79 | |
Vítor Santos Costa | a69a509b11 | |
Vítor Santos Costa | 5e78479fb2 | |
Vítor Santos Costa | 2852f82b72 | |
Costa Vitor | 2019c218f1 | |
Costa Vitor | 53b694edd0 | |
Costa Vitor | c8ef4dbdb4 | |
Costa Vitor | efc857b3e1 | |
Costa Vitor | 82d6640fea | |
Costa Vitor | 8ba1de7250 | |
Vítor Santos Costa | a99412c48f | |
Vítor Santos Costa | 61439cdd12 | |
Vítor Santos Costa | 1fc641b7d1 | |
Vítor Santos Costa | ec0437664c | |
Vitor Santos Costa | d78a55ca83 | |
Vítor Santos Costa | bc8c9a423a | |
Vítor Santos Costa | 1e1d49e112 | |
Vítor Santos Costa | d9decfe003 | |
Vítor Santos Costa | 8a22258fdf | |
Vítor Santos Costa | 50a7acdae0 | |
Vítor Santos Costa | f166b8bfb6 | |
Vitor Santos Costa | c67edd877a | |
Vitor Santos Costa | b4b1e68c35 | |
Tiago Gomes | 4af5a90b8b | |
Vitor Santos Costa | 79b4c6cb25 | |
Vitor Santos Costa | 5fb55b2535 | |
Vitor Santos Costa | 51c8142cb1 | |
Miguel Areias | bc21735ff1 | |
Denys Duchier | 97163fa150 | |
Tiago Gomes | 7a3d39551b | |
Denys Duchier | a34b45bcc0 | |
Vítor Santos Costa | fab462b002 | |
Vítor Santos Costa | 70bde4d38f | |
Vítor Santos Costa | 20b60649e5 | |
Vítor Santos Costa | e938c17748 | |
Vítor Santos Costa | 0ed4e15925 | |
Vitor Santos Costa | e66cea25bc | |
Vitor Santos Costa | 5989af937b | |
Vitor Santos Costa | 2d71a96d54 | |
Vitor Santos Costa | 1a4c1a393b | |
Vitor Santos Costa | 19a3796978 | |
Vitor Santos Costa | ab9fd00096 | |
Vitor Santos Costa | 47d6cd795e | |
Denys Duchier | 3d28c7939e | |
Denys Duchier | 8b57ca1cef | |
Vítor Santos Costa | 4230515792 | |
Tiago Gomes | 5e2d9acc4f | |
Vitor Santos Costa | 051936ca50 | |
Vítor Santos Costa | 0228bfbb30 | |
Vitor Santos Costa | fe2f99e49d | |
Vitor Santos Costa | 87e0b67e76 | |
Vitor Santos Costa | 5fe052a3ef | |
Vitor Santos Costa | 637f5420aa | |
Vitor Santos Costa | 1ec498d720 | |
Vitor Santos Costa | 6eed0e30e3 | |
Vitor Santos Costa | a9d1bd788e | |
Vitor Santos Costa | b15c9f5655 | |
Vítor Santos Costa | 4d21a8c062 | |
Vitor Santos Costa | c64d22311d | |
Vitor Santos Costa | 71eeda081c | |
Vitor Santos Costa | 7b6239c73f | |
Vitor Santos Costa | 92f7c970b0 | |
Vitor Santos Costa | 0ee26c6df9 | |
Tiago Gomes | 3e56cf5e42 | |
Tiago Gomes | 25e87a5ddc | |
Tiago Gomes | 57edd6adb9 | |
Tiago Gomes | ee5b8e693a | |
Tiago Gomes | 9a8464d0f0 | |
Tiago Gomes | 942bc8041e | |
Tiago Gomes | 63739c6e31 | |
Tiago Gomes | b16b0b6a3f | |
Tiago Gomes | b4d2e7af20 | |
Vítor Santos Costa | 3ee64c50a2 | |
Vítor Santos Costa | 8d65561494 | |
Vitor Santos Costa | edb982cfff | |
Vitor Santos Costa | a1d8e46ee4 | |
Tiago Gomes | 05b3daf5bb | |
Tiago Gomes | 384c108e62 | |
Tiago Gomes | 0e83a75b60 | |
Tiago Gomes | b43e3316b3 | |
Tiago Gomes | 89725dffbb | |
Tiago Gomes | af11dbb445 | |
Tiago Gomes | d4f63b3942 | |
Vitor Santos Costa | a997f5647c | |
Vitor Santos Costa | 7db18d5ce2 | |
Vitor Santos Costa | 7ce65dcfa3 | |
Vitor Santos Costa | f6de18cb09 | |
Vítor Santos Costa | 34679fc774 | |
Vítor Santos Costa | 3458efd335 | |
Vitor Santos Costa | c6ececc21a | |
Tiago Gomes | 919116763f | |
Tiago Gomes | 4cc869a164 | |
Tiago Gomes | f8e714dcc3 | |
Tiago Gomes | 51c279d24c | |
Vítor Santos Costa | e55d143e8d | |
Vitor Santos Costa | 58c3445d82 | |
Vitor Santos Costa | 31b8cb6440 | |
Vitor Santos Costa | 6566445b06 | |
Vitor Santos Costa | ca9c748692 | |
Vitor Santos Costa | dba0a81b1c | |
Vitor Santos Costa | 71bd1d9d1f | |
Vitor Santos Costa | 2f434ff48b | |
U-WIN-UA9ACS5GS9N\vitor | 76d7a1d5e5 | |
Ricardo Rocha | f0c0913490 | |
Tiago Gomes | 5785260644 | |
Vítor Santos Costa | 3a212944fb | |
Tiago Gomes | 111de4c86a | |
Tiago Gomes | 568bb27a66 | |
Tiago Gomes | 6cd33f92c2 | |
Tiago Gomes | 2cf6a2a33d | |
Vítor Santos Costa | c4bd913e34 | |
Vítor Santos Costa | d1d01ddc2a | |
Vítor Santos Costa | 47a4b902e0 | |
Ricardo Rocha | 7e667c1038 | |
Ricardo Rocha | d540354c30 | |
Vitor Santos Costa | 67d52d3560 | |
Vitor Santos Costa | 3669cb894f | |
Tiago Gomes | 31fde92a36 | |
Tiago Gomes | eec4b1452b | |
Tiago Gomes | 8fa8fff9f1 | |
Tiago Gomes | 25ccfa2f54 | |
Vitor Santos Costa | 1fbd5c268b | |
Tiago Gomes | 4708685ed4 | |
Vitor Santos Costa | 71a62307f4 | |
Vitor Santos Costa | 39f392be9c | |
Tiago Gomes | ecde9649a8 | |
Tiago Gomes | b5369db214 | |
Tiago Gomes | f91e543d9d | |
Tiago Gomes | 3f0f41c8a9 | |
Tiago Gomes | e11ed1a226 | |
Tiago Gomes | 22d8876d33 | |
Tiago Gomes | 22780c4559 | |
Tiago Gomes | 7429a39b48 | |
Tiago Gomes | c2297c3f70 | |
Tiago Gomes | d00eb05624 | |
Tiago Gomes | 6668ee6381 | |
Tiago Gomes | 8d14593c3e | |
Tiago Gomes | ac38e9e6a6 | |
Tiago Gomes | 651051484b | |
Tiago Gomes | 02395daed3 | |
Tiago Gomes | 0315cd51a3 | |
Tiago Gomes | 6feb746412 | |
Tiago Gomes | 3ac854b2ff | |
Tiago Gomes | 54ae29ae02 | |
Tiago Gomes | f489a59194 | |
Vítor Santos Costa | 2def937080 | |
Tiago Gomes | 57e32267fe | |
Tiago Gomes | 62283f353c | |
Tiago Gomes | 64b53e8180 | |
Tiago Gomes | 004e6c0c5f | |
Tiago Gomes | 0cee50496e | |
Tiago Gomes | fb5edf6051 | |
Tiago Gomes | d5c2e6833d | |
Tiago Gomes | 978ad635b7 | |
Tiago Gomes | 0ad8f5fb4a | |
Tiago Gomes | 149f3dab26 | |
Tiago Gomes | 3ee176c65b | |
Tiago Gomes | f3ca7b2dfc | |
Tiago Gomes | 1352a526c3 | |
Tiago Gomes | 250d122fc8 | |
Tiago Gomes | a9c369aac1 | |
Tiago Gomes | 4a02997484 | |
Tiago Gomes | 3986012e56 | |
Tiago Gomes | 3290834dfe | |
Tiago Gomes | fb9bb5c8b5 | |
Tiago Gomes | 6034f7a264 | |
Tiago Gomes | 1239832c21 | |
Tiago Gomes | bc2da47804 | |
Tiago Gomes | 918666d7f6 | |
Tiago Gomes | c1bd230e61 | |
Tiago Gomes | 4b2ffee015 | |
Tiago Gomes | 2efca0c85a | |
Tiago Gomes | 5ff161b10f | |
Tiago Gomes | df8a3c5fdc | |
Tiago Gomes | a56bccf5e5 | |
Tiago Gomes | 18d4777d9a | |
Tiago Gomes | af6601837c | |
Tiago Gomes | 5124098b6c | |
Tiago Gomes | acc5ab056a | |
Tiago Gomes | 444eaacc63 | |
Tiago Gomes | 7426dfb056 | |
Tiago Gomes | 6cb718942a | |
Tiago Gomes | d91e91b97e | |
Tiago Gomes | 2b896aecb4 | |
Tiago Gomes | 9f236dccdd | |
Tiago Gomes | cf929b6f13 | |
Tiago Gomes | 2848ceb1f4 | |
Tiago Gomes | c04082dc2e | |
Tiago Gomes | 3890aafc1a | |
Tiago Gomes | bdef49bb20 | |
Tiago Gomes | efec94adff | |
Tiago Gomes | 584e363aa1 | |
Tiago Gomes | 5b38891c21 | |
Tiago Gomes | 6c77afb3ae | |
Tiago Gomes | 3388917aa5 | |
Tiago Gomes | a4d181eb97 | |
Tiago Gomes | 7c3e4ed3ab | |
Vítor Santos Costa | 01749939fa | |
Vítor Santos Costa | 95a33cd56d | |
Ricardo Rocha | 5b074e894a | |
Ricardo Rocha | 26e6281bb7 | |
Vitor Santos Costa | 5e915955e3 | |
Vitor Santos Costa | 9e3d16022a | |
Ricardo Rocha | 02447ac372 | |
Vitor Santos Costa | f261a3fd2f | |
Tiago Gomes | 16cb48fea4 | |
Vítor Santos Costa | d68ef3f5a1 | |
Tiago Gomes | cf9a7f1413 | |
Tiago Gomes | 5934d9efe9 | |
Tiago Gomes | 23b180b6f0 | |
Tiago Gomes | 354071c261 | |
Tiago Gomes | f7ba86d3ed | |
Tiago Gomes | db0d2c9772 | |
Tiago Gomes | f4bca3ceea | |
Tiago Gomes | 7ec4887e77 | |
Tiago Gomes | 346b70145f | |
Tiago Gomes | 90e139f8f3 | |
Tiago Gomes | 03f9df7dc3 | |
Tiago Gomes | 1380adcfb5 | |
Tiago Gomes | 2061eefda2 | |
Vitor Santos Costa | 06cd0c7414 | |
Vítor Santos Costa | 5c459a1201 | |
Vítor Santos Costa | 448bc7e7de | |
Ricardo Rocha | 1dcc8bd393 | |
Vitor Santos Costa | 10d5a38e92 | |
Vitor Santos Costa | f3f9c75cf7 | |
Vitor Santos Costa | 6c36a8ccd3 | |
Vitor Santos Costa | 682db0aad4 | |
Vitor Santos Costa | b36e607cb4 | |
Vítor Santos Costa | b985ea2fbc | |
Vitor Santos Costa | a05bad3bf0 | |
Vitor Santos Costa | 2423407b37 | |
Vitor Santos Costa | 916ca678ba | |
Vitor Santos Costa | 681d4e78a2 | |
Vitor Santos Costa | 7488ef0539 | |
Tiago Gomes | 4ade4945a0 | |
Tiago Gomes | aeb07d43a7 | |
Vítor Santos Costa | 63616b94a7 | |
Tiago Gomes | 9d5801ef7f | |
Tiago Gomes | 8e75ef3073 | |
Tiago Gomes | 660e15e2ac | |
Tiago Gomes | 0e01a51929 | |
Vitor Santos Costa | 4945e390f1 | |
Tiago Gomes | 35d0804f9a | |
Tiago Gomes | 10ac7720f7 | |
Tiago Gomes | 2bef3f6866 | |
Vítor Santos Costa | e1f6187395 | |
Vítor Santos Costa | c3e3b0b50f | |
Vítor Santos Costa | 9b0b6ec649 | |
Tiago Gomes | 92d8c7dcbe | |
Tiago Gomes | ad50166bd0 | |
Vítor Santos Costa | 0efe86f3ba | |
Tiago Gomes | 9971736a45 | |
Tiago Gomes | 7cf8c68e15 | |
Tiago Gomes | d6e11ca84d | |
Tiago Gomes | fa8ff6d5b6 | |
Tiago Gomes | 85fc4ae50a | |
Tiago Gomes | a90bfb7a86 | |
Tiago Gomes | 2fa06da3c9 | |
Tiago Gomes | 185cbe9c73 | |
Tiago Gomes | 56475cacbc | |
Tiago Gomes | d86e2c8386 | |
Tiago Gomes | 1173b4c25b | |
Tiago Gomes | 52f4aa0340 | |
Vítor Santos Costa | 2bfc88db98 | |
Vítor Santos Costa | 067d6d3f4f | |
Vítor Santos Costa | 5ee39c6f08 | |
Vítor Santos Costa | 9e36576951 | |
Vítor Santos Costa | 6bb4db125d | |
Vítor Santos Costa | 60184e230d | |
Vítor Santos Costa | ceb0c1f5ac | |
Vítor Santos Costa | 823066f9da | |
Vítor Santos Costa | fd4bf21ece | |
Tiago Gomes | 20fc2c8dd1 | |
Tiago Gomes | 9e1a649262 | |
Tiago Gomes | 7599ccd5a1 | |
Tiago Gomes | af063dcda8 | |
Tiago Gomes | 995a11be83 | |
Vítor Santos Costa | fd755f0b7e | |
Tiago Gomes | cc09e77707 | |
Tiago Gomes | 689244a0d8 | |
Tiago Gomes | ad24a360ce | |
Vítor Santos Costa | c3eb3db4ed | |
Vítor Santos Costa | 5b443bdc46 | |
Tiago Gomes | fc362fe123 | |
Tiago Gomes | 0ebd6d6e06 | |
Tiago Gomes | 3397f694fe | |
Ricardo Rocha | cd5e1211c5 | |
Ricardo Rocha | 42631bcc71 | |
Vítor Santos Costa | d7c7ef1c01 | |
Vítor Santos Costa | fe82747031 | |
Vítor Santos Costa | 24d09ffde5 | |
Ricardo Rocha | a6ff7528d1 | |
Vitor Santos Costa | f24bf2e2cd | |
Vitor Santos Costa | 32a905bc8b | |
Vitor Santos Costa | 040c1c7fa7 | |
Tiago Gomes | d90fcd532b | |
Tiago Gomes | 8c689665a0 | |
Vítor Santos Costa | a9434aed37 | |
Vitor Santos Costa | 3aee05ae9e | |
Vitor Santos Costa | 22f702f8e4 | |
Vitor Santos Costa | 220f7e6efc | |
Tiago Gomes | 085ebe1e96 | |
Tiago Gomes | 0ffa409a80 | |
Vitor Santos Costa | 178ad27db8 | |
Vítor Santos Costa | e11d8bbda1 | |
Vítor Santos Costa | 753170bf7c | |
Tiago Gomes | 09697b8461 | |
Tiago Gomes | 2b7da4bc23 | |
Tiago Gomes | 661ce08961 | |
Vitor Santos Costa | c3da25227f | |
Vitor Santos Costa | 49b936db67 | |
U-WIN-UA9ACS5GS9N\vitor | 19807d46f7 | |
Tiago Gomes | cd1e157019 | |
Tiago Gomes | 7c100c96bc | |
Tiago Gomes | 862e90a36b | |
Tiago Gomes | 61ee95d92a | |
Tiago Gomes | 406276b62b | |
Tiago Gomes | a7f57bea99 | |
Tiago Gomes | cd720497f8 | |
Tiago Gomes | bb5d02dbc0 | |
Tiago Gomes | dacf6b4e57 | |
Tiago Gomes | d22b5a97fd | |
Tiago Gomes | b7e9245f26 | |
Tiago Gomes | d8e757f9ab | |
Vítor Santos Costa | 81be229e22 | |
Vítor Santos Costa | fac8af303d | |
Tiago Gomes | cd8714460e | |
Tiago Gomes | f02d0fb798 | |
Vítor Santos Costa | b26d266ed6 | |
Vítor Santos Costa | 2cfb744b07 | |
Vítor Santos Costa | a660082b45 | |
Vítor Santos Costa | 40ce9feb76 | |
Tiago Gomes | 5e88510a7d | |
Tiago Gomes | 6ab5a4668b | |
Tiago Gomes | dd0ae564ef | |
Tiago Gomes | 779f4ea2ce | |
Tiago Gomes | 66353e67ec | |
Tiago Gomes | 0d5888e238 | |
Denys Duchier | c484053210 | |
Denys Duchier | 638bcfb242 | |
Denys Duchier | 82ced70a33 | |
Denys Duchier | 347b28f69d | |
Denys Duchier | b66b261972 | |
Tiago Gomes | b27500e93f | |
Vítor Santos Costa | 8894645017 | |
Tiago Gomes | 6f7d2af718 | |
Tiago Gomes | c32ad3de0a | |
Tiago Gomes | 5e7b660f44 | |
Vítor Santos Costa | c385dc13a8 | |
Vítor Santos Costa | cdd1af567e | |
Vítor Santos Costa | 34ccb95dd3 | |
Tiago Gomes | 62fedf014b | |
Tiago Gomes | f1d2889eaa | |
Tiago Gomes | 401ad145a5 | |
Tiago Gomes | f6e3bb4481 | |
Tiago Gomes | 24a5fe9c23 | |
Tiago Gomes | 05ef8610f4 | |
Tiago Gomes | 00faccd940 | |
Tiago Gomes | f3be68a552 | |
Vítor Santos Costa | 683377b520 | |
Vítor Santos Costa | af7510a67b | |
Tiago Gomes | 15c8f3abc6 | |
Tiago Gomes | 5348c4a989 | |
Vítor Santos Costa | 5a8cc421d2 | |
Vítor Santos Costa | c5f42cd7eb | |
Vítor Santos Costa | 8c2dd1f847 | |
Vítor Santos Costa | 28ce2da3dc | |
Tiago Gomes | 9def6c2b15 | |
Tiago Gomes | 564958ef8d | |
Vítor Santos Costa | 27dc66a5f4 | |
Vítor Santos Costa | c08178a57c | |
Tiago Gomes | 03013960d3 | |
Tiago Gomes | f2fbbf29d8 | |
Tiago Gomes | 8697fcd2b4 | |
Tiago Gomes | 78e86a6330 | |
Tiago Gomes | 46e6a10625 | |
Tiago Gomes | b52dc99914 | |
Tiago Gomes | aa1b2e40ea | |
Tiago Gomes | 6986e8c0d7 | |
Tiago Gomes | f1d52c0389 | |
Tiago Gomes | d1b25f0864 | |
Vítor Santos Costa | 7085008193 | |
Tiago Gomes | b28ee8fb3a | |
Tiago Gomes | abb0410d07 | |
Tiago Gomes | 0d23591058 | |
Vítor Santos Costa | bc2364c5dc | |
Tiago Gomes | 6c3add2ebd | |
Vítor Santos Costa | 2bdec8f725 | |
Vítor Santos Costa | 9ab7ab0a5e | |
Vítor Santos Costa | 14d142aa10 | |
Vítor Santos Costa | 65e0c3b2a2 | |
Vítor Santos Costa | 6ccd458ea5 | |
Vítor Santos Costa | 44cb6abcb6 | |
Vítor Santos Costa | e130c26c6d | |
Vítor Santos Costa | 3d216cf9db | |
Tiago Gomes | 911b241ad6 | |
Tiago Gomes | fd8980642b | |
tgomes | c6128c51e8 | |
Tiago Gomes | e9cc1a8be2 | |
Tiago Gomes | 313f9a036a | |
Vítor Santos Costa | 88411f4b40 | |
Vítor Santos Costa | 3563dcbf03 | |
Vítor Santos Costa | edfb13c5e9 | |
Vítor Santos Costa | f8972365f8 | |
tgomes | 24b466db4e | |
Vítor Santos Costa | 32167b5465 | |
Vítor Santos Costa | 7d3d9bcf41 | |
Vítor Santos Costa | 0a9076bf4a | |
Vítor Santos Costa | d149d041a3 | |
Vítor Santos Costa | d3fd980474 | |
Vítor Santos Costa | 9c685e71a7 | |
Vítor Santos Costa | 9ff1399482 | |
Vítor Santos Costa | 295cf24f5c | |
Vítor Santos Costa | cd45c64dcc | |
Vítor Santos Costa | 49b9c8ea50 | |
Vítor Santos Costa | 04e9a3a8ed | |
Vítor Santos Costa | 3cb9ca11ca | |
Vítor Santos Costa | a223c33e0b | |
Vítor Santos Costa | dc43d26c8a | |
Vítor Santos Costa | 52e5fdb6aa | |
Vítor Santos Costa | 7d6b2435e0 | |
Vítor Santos Costa | a38177207d | |
Vítor Santos Costa | b6d5b79789 | |
Vítor Santos Costa | 7d6461a527 | |
Vítor Santos Costa | 9c42dfa26c | |
Vítor Santos Costa | 52f06f5f60 | |
Vítor Santos Costa | bdb855a57b | |
Vítor Santos Costa | 07335ce047 | |
Vítor Santos Costa | 372f3d795e | |
Vítor Santos Costa | 6b1574757e | |
Vítor Santos Costa | caf9b757f3 | |
Vítor Santos Costa | f5f13541c6 | |
Vítor Santos Costa | 4c1602b74b | |
Vítor Santos Costa | 573c11e8b2 | |
Vítor Santos Costa | 65e61cfefd | |
Vítor Santos Costa | 1e2abadd78 | |
Vítor Santos Costa | 4d5c70b64b | |
Vítor Santos Costa | 756bba9bc5 | |
Vítor Santos Costa | b1ee4dfb0d | |
Vítor Santos Costa | 857ff4b895 | |
Vítor Santos Costa | e6b48be445 | |
Vítor Santos Costa | 1698bb3c91 | |
Vítor Santos Costa | 01b86d78cc | |
Vítor Santos Costa | a0d2e6f285 | |
Vítor Santos Costa | 4484dec044 | |
Vítor Santos Costa | 7b78832aa7 | |
Vítor Santos Costa | 8c6b68278c | |
Vítor Santos Costa | 6ad2c9b3a9 | |
Denys Duchier | 05bd59a2fb | |
Vítor Santos Costa | a338b95d3f | |
Vítor Santos Costa | 7d4f83ca40 | |
Vítor Santos Costa | 172f59cee5 | |
Denys Duchier | 8b16734e1c | |
Denys Duchier | 48cb3d6543 | |
Vítor Santos Costa | 7b84608e5e | |
Vitor Santos Costa | c85e76f20f | |
Vitor Santos Costa | 6191dd210b | |
Vitor Santos Costa | 21d317b223 | |
Vitor Santos Costa | 6e36498cac | |
Vítor Santos Costa | 3443fa1932 | |
Vítor Santos Costa | 0b8c998ae1 | |
Vítor Santos Costa | 3cb8b99852 | |
Vítor Santos Costa | 5c6c034ec9 | |
Vítor Santos Costa | 06242879c0 | |
Vítor Santos Costa | 919fa40464 | |
Vítor Santos Costa | 0c1eb1d642 | |
Vítor Santos Costa | f2782cc274 | |
Vítor Santos Costa | cc8521c9d5 | |
Vítor Santos Costa | 74d7ad2704 | |
Vítor Santos Costa | 0f374aaff1 | |
Vítor Santos Costa | b01261eed5 | |
Vítor Santos Costa | 36acb5f897 | |
Vítor Santos Costa | 44737a5d0f | |
Vítor Santos Costa | a95666c977 | |
Vítor Santos Costa | 89183a143a | |
Vítor Santos Costa | 3e4a2c6767 | |
Vítor Santos Costa | 020323d633 | |
Vítor Santos Costa | 9a57a51f40 | |
Vítor Santos Costa | fd0cf6ee14 | |
Vítor Santos Costa | 6075bde029 | |
Vítor Santos Costa | bf15197e49 | |
Vítor Santos Costa | bb4b7b6d0e | |
Vítor Santos Costa | b02d34e400 | |
Vítor Santos Costa | fbe846e74a | |
Vítor Santos Costa | 5a472616e7 | |
Vítor Santos Costa | 0f10f4332e | |
Vítor Santos Costa | 45baf800dd | |
Vítor Santos Costa | 67cd8b303e | |
João Santos | 78fb13e651 | |
João Santos | 430147f310 | |
João Santos | 553fbc505f | |
Vítor Santos Costa | 04ef859158 | |
Vítor Santos Costa | ddcf1f003b | |
Vítor Santos Costa | e38c850361 | |
Vítor Santos Costa | 665d426e13 | |
Vítor Santos Costa | 5d65c49292 | |
Vítor Santos Costa | 1531002f26 | |
Vítor Santos Costa | d777ff863a | |
Vitor Santos Costa | 4135553063 | |
Vitor Santos Costa | fd88bae93d | |
Vítor Santos Costa | 8ba0bee7ab | |
Vítor Santos Costa | d8452fd3b1 | |
Vítor Santos Costa | c602140953 | |
Vítor Santos Costa | 48cbed8b20 | |
Vítor Santos Costa | b2378bf34f | |
Miguel Areias | 1de3affa99 | |
Miguel Areias | 952ef65a2e | |
Vítor Santos Costa | 8c556f21ba | |
Vítor Santos Costa | 6c16f4e953 | |
Vítor Santos Costa | 935fd0d647 | |
Vitor Santos Costa | 6403b4793a | |
Vitor Santos Costa | 8d9c5617eb | |
Vitor Santos Costa | b454383e30 | |
Vitor Santos Costa | 98b2cf70c2 | |
Vitor Santos Costa | 247aa54046 | |
Vítor Santos Costa | fc4edc3ad1 | |
Vítor Santos Costa | 70b41fbdb7 | |
Vítor Santos Costa | fb04195314 | |
Vítor Santos Costa | 9dc5992109 | |
Vítor Santos Costa | 8a5413c2fb | |
Vítor Santos Costa | dd762fe664 | |
Vítor Santos Costa | 32d953809e | |
Vítor Santos Costa | 8af7ad47bf | |
Vítor Santos Costa | 7c2ba414a3 | |
Vítor Santos Costa | 64319f622f | |
Vítor Santos Costa | d5bfd78b64 | |
Vítor Santos Costa | db35eb4b3c | |
Vítor Santos Costa | a128d1d78d | |
Vítor Santos Costa | 88cc8a0bdb | |
Vítor Santos Costa | b6ca945ef0 | |
Vítor Santos Costa | 12bd3d6a5b | |
Vítor Santos Costa | f583bb93ee | |
Vítor Santos Costa | c63709f310 | |
Vítor Santos Costa | c8787a29f2 | |
Vítor Santos Costa | 67b4b6126c | |
Vítor Santos Costa | 795a958090 | |
Vítor Santos Costa | ea18699602 | |
João Santos | 21522ce151 | |
Vitor Santos Costa | 3648c562fa | |
Vitor Santos Costa | e032d5faf7 |
|
@ -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
|
|
@ -0,0 +1,2 @@
|
|||
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee#define GIT_SHA1 "@GIT_SHA1@"
|
||||
const char g_GIT_SHA1[] = GIT_SHA1;
|
|
@ -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"
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
@ -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/pldoc"]
|
||||
path = packages/pldoc
|
||||
url = git://yap.git.sourceforge.net/gitroot/yap/pldoc
|
||||
[submodule "packages/real"]
|
||||
path = packages/real
|
||||
url = git://www.swi-prolog.org/home/pl/git/packages/real.git
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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,'%');
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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"
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -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,25 +328,27 @@ 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);
|
||||
Opaque_CallOnGCMark f;
|
||||
Opaque_CallOnGCRelocate f2;
|
||||
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(OUT_OF_HEAP_ERROR,TermNil,"not enough space for slot internal variables in agc");
|
||||
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;
|
||||
|
@ -349,7 +360,7 @@ mark_global_cell(CELL *pt)
|
|||
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(OUT_OF_HEAP_ERROR,TermNil,"bad restore of slot internal variables in agc");
|
||||
Yap_Error(RESOURCE_ERROR_HEAP,TermNil,"bad restore of slot internal variables in agc");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -376,7 +387,7 @@ mark_global(USES_REGS1)
|
|||
* the code
|
||||
*/
|
||||
pt = H0;
|
||||
while (pt < H) {
|
||||
while (pt < HR) {
|
||||
pt = mark_global_cell(pt);
|
||||
}
|
||||
}
|
||||
|
@ -405,7 +416,7 @@ clean_atom_list(AtomHashEntry *HashPtr)
|
|||
} else {
|
||||
NOfAtoms--;
|
||||
if (IsBlob(atm)) {
|
||||
BlobPropEntry *b = RepBlobProp(at->PropsOfAE);
|
||||
YAP_BlobPropEntry *b = RepBlobProp(at->PropsOfAE);
|
||||
if (b->NextOfPE != NIL) {
|
||||
patm = &(at->NextOfAE);
|
||||
atm = at->NextOfAE;
|
||||
|
@ -414,18 +425,13 @@ clean_atom_list(AtomHashEntry *HashPtr)
|
|||
NOfAtoms++;
|
||||
NOfBlobs--;
|
||||
Yap_FreeCodeSpace((char *)b);
|
||||
GLOBAL_agc_collected += sizeof(BlobPropEntry);
|
||||
GLOBAL_agc_collected += sizeof(YAP_BlobPropEntry);
|
||||
GLOBAL_agc_collected += sizeof(AtomEntry)+sizeof(size_t)+at->rep.blob->length;
|
||||
} else 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 {
|
||||
} 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);
|
||||
|
@ -448,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);
|
||||
}
|
||||
}
|
||||
|
@ -464,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 */
|
||||
|
@ -497,11 +499,11 @@ atom_gc(USES_REGS1)
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -533,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);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
39
C/analyst.c
39
C/analyst.c
|
@ -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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
172
C/arith0.c
172
C/arith0.c
|
@ -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
1138
C/arith1.c
File diff suppressed because it is too large
Load Diff
366
C/arith2.c
366
C/arith2.c
|
@ -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)) {
|
||||
|
@ -179,19 +275,14 @@ p_rem(Term t1, Term t2) {
|
|||
Int i2 = IntegerOfTerm(t2);
|
||||
|
||||
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);
|
||||
}
|
||||
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);
|
||||
|
@ -201,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();
|
||||
}
|
||||
|
@ -225,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:
|
||||
|
@ -239,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:
|
||||
|
@ -253,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();
|
||||
}
|
||||
|
@ -276,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:
|
||||
|
@ -348,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);
|
||||
|
@ -368,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)) {
|
||||
|
@ -377,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();
|
||||
}
|
||||
|
@ -392,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:
|
||||
|
@ -471,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:
|
||||
|
@ -552,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>
|
||||
*/
|
||||
|
@ -563,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) {
|
||||
|
@ -587,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:
|
||||
|
@ -596,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)) {
|
||||
|
@ -679,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;
|
||||
|
@ -729,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:
|
||||
|
@ -741,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);
|
||||
|
@ -754,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)) {
|
||||
|
@ -763,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();
|
||||
}
|
||||
|
@ -967,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[] = {
|
||||
|
@ -1049,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)) {
|
||||
|
@ -1183,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);
|
||||
}
|
||||
|
@ -1192,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)
|
||||
|
@ -1202,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);
|
||||
|
@ -1236,4 +1333,3 @@ Yap_ReInitBinaryExps(void)
|
|||
{
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
|
2570
C/arrays.c
2570
C/arrays.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
877
C/attvar.c
877
C/attvar.c
File diff suppressed because it is too large
Load Diff
76
C/bb.c
76
C/bb.c
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
|
605
C/bignum.c
605
C/bignum.c
|
@ -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,19 +37,18 @@ 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)) {
|
||||
|
@ -49,306 +59,375 @@ Yap_MkBigIntTerm(MP_INT *big)
|
|||
// 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) {
|
||||
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 = nlimbs*(CellSize/sizeof(mp_limb_t));
|
||||
memmove((void *)(dst+1), (const void *)(big->_mp_d), bytes);
|
||||
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;
|
||||
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;
|
||||
blob_info = blob_tag;
|
||||
if (!GLOBAL_OpaqueHandlers) {
|
||||
return NULL;
|
||||
}
|
||||
return GLOBAL_OpaqueHandlers[blob_info].write_handler;
|
||||
}
|
||||
|
||||
Opaque_CallOnGCMark
|
||||
Yap_blob_gc_mark_handler(Term t)
|
||||
{
|
||||
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) {
|
||||
if (blob_tag < USER_BLOB_START || blob_tag >= USER_BLOB_END) {
|
||||
return NULL;
|
||||
}
|
||||
blob_info = blob_tag - USER_BLOB_START;
|
||||
blob_info = blob_tag;
|
||||
if (!GLOBAL_OpaqueHandlers)
|
||||
return NULL;
|
||||
return GLOBAL_OpaqueHandlers[blob_info].gc_mark_handler;
|
||||
return GLOBAL_OpaqueHandlers[blob_info].mark_handler;
|
||||
}
|
||||
|
||||
Opaque_CallOnGCRelocate
|
||||
Yap_blob_gc_relocate_handler(Term t)
|
||||
{
|
||||
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, 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 NULL;
|
||||
return GLOBAL_OpaqueHandlers[blob_info].gc_relocate_handler;
|
||||
return GLOBAL_OpaqueHandlers[blob_info].relocate_handler;
|
||||
}
|
||||
|
||||
extern Int Yap_blob_tag_from_slot(Int slot)
|
||||
{
|
||||
CACHE_REGS
|
||||
Term t = Yap_GetFromSlot(slot PASS_REGS);
|
||||
extern Int Yap_blob_tag(Term t) {
|
||||
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
|
||||
return pt[1];
|
||||
}
|
||||
|
||||
void *
|
||||
Yap_blob_info_from_slot(Int slot)
|
||||
{
|
||||
CACHE_REGS
|
||||
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
|
||||
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
|
||||
|
@ -356,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;
|
||||
|
@ -373,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;
|
||||
|
@ -400,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);
|
||||
}
|
||||
|
|
|
@ -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) {}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
File diff suppressed because it is too large
Load Diff
140
C/clause_list.c
140
C/clause_list.c
|
@ -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; }
|
||||
|
|
964
C/cmppreds.c
964
C/cmppreds.c
File diff suppressed because it is too large
Load Diff
3042
C/compiler.c
3042
C/compiler.c
File diff suppressed because it is too large
Load Diff
450
C/computils.c
450
C/computils.c
|
@ -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)
|
||||
{
|
||||
|
@ -432,6 +537,8 @@ write_functor(Functor f)
|
|||
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)));
|
||||
|
@ -440,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 == '%')
|
||||
|
@ -461,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);
|
||||
|
@ -474,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];
|
||||
|
@ -495,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;
|
||||
|
@ -510,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;
|
||||
|
@ -561,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++;
|
||||
|
@ -583,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)));
|
||||
|
@ -600,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++);
|
||||
|
@ -655,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 */
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
430
C/corout.c
430
C/corout.c
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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*/
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
517
C/eval.c
517
C/eval.c
|
@ -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,44 +50,45 @@ 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)
|
||||
{
|
||||
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);
|
||||
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;
|
||||
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;
|
||||
return FALSE;
|
||||
}
|
||||
indx = IntegerOfTerm(indxt);
|
||||
if (!IsApplTerm(t1)) {
|
||||
Yap_ArithError(TYPE_ERROR_EVALUABLE, t1, "X is Y^[A]");
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
} else {
|
||||
Functor f = FunctorOfTerm(t1);
|
||||
if (ArityOfFunctor(f) < indx) {
|
||||
Yap_ArithError(TYPE_ERROR_EVALUABLE, t1, "X is Y^[A]");
|
||||
return FALSE;
|
||||
Yap_ArithError(TYPE_ERROR_EVALUABLE, t1, "X is Y^[A]");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
t1 = ArgOfTerm(indx, t1);
|
||||
|
@ -83,153 +101,452 @@ get_matrix_element(Term t1, Term t2 USES_REGS)
|
|||
return Eval(t1 PASS_REGS);
|
||||
}
|
||||
|
||||
static Term
|
||||
Eval(Term t USES_REGS)
|
||||
{
|
||||
static Term Eval(Term t USES_REGS) {
|
||||
eval_context_t ctx;
|
||||
ctx.p = LOCAL_ctx;
|
||||
|
||||
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);
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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;
|
||||
}
|
|
@ -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);
|
||||
}
|
|
@ -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 */
|
|
@ -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();
|
2728
C/globals.c
2728
C/globals.c
File diff suppressed because it is too large
Load Diff
194
C/gmp_support.c
194
C/gmp_support.c
|
@ -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);
|
||||
|
||||
|
@ -384,7 +393,8 @@ Yap_gmp_sll_big_int(Term t, Int i)
|
|||
} else {
|
||||
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_fdiv_q_2exp(&new, b, -i);
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
|
File diff suppressed because it is too large
Load Diff
1045
C/heapgc.c
1045
C/heapgc.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -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();
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
511
C/inlines.c
511
C/inlines.c
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
// @}
|
||||
|
|
1111
C/iopreds.c
1111
C/iopreds.c
File diff suppressed because it is too large
Load Diff
|
@ -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()
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,205 +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);
|
||||
|
||||
int
|
||||
Yap_CallFunctionByName(const char *thing_string)
|
||||
{
|
||||
void * handle = dlopen(NULL, RTLD_LAZY | RTLD_NOLOAD);
|
||||
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, ARG1, "Dynamic linking on main module : %s\n", dlerror());
|
||||
Yap_Error(SYSTEM_ERROR_INTERNAL, ARG1,
|
||||
"Dynamic linking on main module : %s\n", dlerror());
|
||||
}
|
||||
prismf * addr = (prismf *)dlsym(handle, thing_string);
|
||||
fprintf(stderr, "%s is at %p\n", thing_string, addr);
|
||||
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 for %s: %s\n", file, 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,
|
||||
|
@ -208,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
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
226
C/load_foreign.c
226
C/load_foreign.c
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
108
C/mavar.c
|
@ -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
|
||||
}
|
||||
|
||||
/**
|
||||
@}
|
||||
*/
|
||||
|
|
|
@ -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();
|
||||
}
|
669
C/modules.c
669
C/modules.c
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
46
C/other.c
46
C/other.c
|
@ -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);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
1272
C/pl-yap.c
1272
C/pl-yap.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -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;
|
||||
}
|
|
@ -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) && !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">"@(#)realpath.c 8.1 (Berkeley) 2/16/94"</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">"$FreeBSD: /repoman/r/ncvs/src/lib/libc/stdlib/realpath.c,v 1.6.2.1 2003/08/03 23:47:39 nectar Exp $"</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"><sys/param.h></font></strong></font>
|
||||
<font color="0000ff"><strong>#include <font color="#008000"><sys/stat.h></font></strong></font>
|
||||
|
||||
<font color="0000ff"><strong>#include <font color="#008000"><errno.h></font></strong></font>
|
||||
<font color="0000ff"><strong>#include <font color="#008000"><fcntl.h></font></strong></font>
|
||||
<font color="0000ff"><strong>#include <font color="#008000"><stdlib.h></font></strong></font>
|
||||
<font color="0000ff"><strong>#include <font color="#008000"><string.h></font></strong></font>
|
||||
<font color="0000ff"><strong>#include <font color="#008000"><unistd.h></font></strong></font>
|
||||
|
||||
<font color="#444444">/*
|
||||
* char *realpath(const char *path, char resolved_path[MAXPATHLEN]);
|
||||
*
|
||||
* Find the real name of path, by removing all ".", ".." 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">"."</font>, <font color="#2040a0">O_RDONLY</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>
|
||||
<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">"."</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">"/"</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">></font> <font color="#2040a0">resolved</font> <font color="4444FF">&</font><font color="4444FF">&</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"><</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">&</font><font color="4444FF">&</font> <font color="#2040a0">lstat</font><font color="4444FF">(</font><font color="#2040a0">p</font>, <font color="4444FF">&</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">></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"><</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"><</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">""</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">&</font><font color="4444FF">&</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">></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">"/"</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"><</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>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -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;
|
||||
}
|
48
C/sort.c
48
C/sort.c
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
3395
C/sysbits.c
3395
C/sysbits.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1399
C/threads.c
1399
C/threads.c
File diff suppressed because it is too large
Load Diff
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
Reference in New Issue