ProbLog a probabilistic Prolog and its application in link discovery
Personalized Popular Blog Recommender Service for Mobile Applications
Personalized Popular Blog Recommender Service forMobile ApplicationsPei-Yun Tsai and Duen-Ren LiuInstitute of Information ManagementNational Chiao Tung University, Taiwanhalohowau@, dliu@.twAbstract. Weblogs have emerged as a new communication and publicationmedium on the Internet for diffusing the latest useful information. Providingvalue-added mobile services such as blog articles is increasingly important toattract mobile users to mobile commerce. There are, however, a tremendousnumber of blog articles, and mobile users generally have difficulty in browsingweblogs. Accordingly, providing mobile users with blog articles that suit theirinterests is an important issue. Very little research, however, focuses on this is-sue. In this work, we propose a Customized Content Service on a mobile device(m-CCS) to filter and push blog articles to mobile users. The m-CCS can pre-dict the latest popular blog topics by forecasting the trend of time-sensitivepopularity of weblogs. Furthermore, to meet the diversified interest of mobileusers, m-CCS further analyzes users’ browsing logs to derive their interests,which are then used to recommend their preferred popular blog topics and arti-cles. The prototype system of m-CCS demonstrates that the system can effec-tively recommend mobile users desirable blog articles with respect to bothpopularity and personal interests.Keywords: Mobile Service, Blog, Recommender System, Time-SensitiveTopic.1 IntroductionWeblogs have emerged as a new communication and publication medium on the Internet for diffusing the latest useful information. Blog articles represent the opinions of the population and react to current events (e.g., news) on the Internet [1]. Most people read blogs because it is a new source of news [2]. Looking for what is the latest popular issue discussed by blogs and attracting readers’ attention is an interest-ing subject. Moreover, providing value-added mobile services such as blog articles is increasingly important to attract mobile users to mobile commerce, to benefit from the proliferation and convenience of using mobile devices to receive information anytime and anywhere. There are, however, a tremendous number of blog articles, and mobile users generally have difficulty in browsing weblogs owing to the limitations of mobile devices such as small screens, short usage time and poor input mechanisms. Accordingly, providing mobile users with blog articles that suit their interests is an important issue. Very little research, however, focuses on this issue.T. Di Noia and F. Buccafurri (Eds.): EC-Web 2009, LNCS 5692, pp. 2–13, 2009.© Springer-Verlag Berlin Heidelberg 2009Personalized Popular Blog Recommender Service for Mobile Applications 3 There are three stems of research regarding blogs. The first type of research fo-cuses on analyzing the link structure between blogs to form a community [3, 4]. The research on the weblog community proposes a way to discover bursty evolution of blogspace. Through the hyperlinks between blogs, people can communicate across blogs by publishing content relating to other blogs. Nakajima et al. [5] proposed a method to identify the important bloggers in the conversations based on their roles in preceding blog threads, and identify “hot” conversation. The second type of research focuses on analyzing blog content. Gruhl et al. [6, 7] modeled the information praop-gation of topics among blogs based on blog text. In addition, blog text analysis fo-cuses on eliciting useful information from blog entry collections, and determining certain trends in the blogosphere [8]. Mei et al. [9] proposed a probabilistic method for modeling the most salient themes from a text collection, and discovering the dis-tributions and evolution patterns over time and space. With analysis of tracking topic and user drift, Hayes et al. [1] examine the relationship between blogs over time without considering the popularity degree of topics within blogs. The last type is about user modeling in blog space. A variety of methods has been proposed to model the blogger’s interest, such as classifying articles into predefined categories to iden-tify the author’s preference [10].The preceding studies, whether focused on the analyses of hyperlinks or blog texts, were all observed from the viewpoints of bloggers. They examined the interests of bloggers and discussed which topics were widely discussed by the bloggers. The majority of previous studies ignore the roles played by the reader mass, who take browsing actions on the blog articles. Blog readers are often interested in browsing emerging and popular blog topics, from which the popularity of blogs can be inferred according to the accumulated click times on blogs. Popularity based solely on click times, however, cannot truly reflect the trend of popularity. For example, a new event may trigger emerging discussions such that the number of related blog articles and browsing actions is small at the beginning and rapidly increases as time goes on. Thus, it is important to analyze the trend of time-sensitive popularity of blogs to pre-dict the emerging blog topics. In addition, blog readers may have different interests in the emerging popular blog topics. Nevertheless, very few researches have addressed such issues.In this work, we propose a Customized Content Service on a mobile device (m-CCS) to recommend blog articles to mobile users. The m-CCS can predict the trend of time-sensitive popularity of blogs. First, we analyze blog contents retrieved by co-RSS to derive topic clusters, i.e., blog topics. We define a topic as a set of significant terms that are clustered together based on similarity. By examining the clusters, we can extract the features of topics from the viewpoints of the authors. Moreover, we analyze the click times the readers give to articles. For each topic cluster, from the variation in trends of click times we can predict the popularity degree of the topics from the readers’ perspectives.Second, mobile users may have different interests in the latest popular blog topics. Thus, the m-CCS further analyzes mobile users’ browsing logs to derive their inter-ests, which are then used to infer their preferred popular blog topics and articles. We scrutinize the browsing behaviors and dissect the interests of the mobile users, then modify the ranking of topic clusters according to their preferences. The filtered arti-cles are then sent to the individual’s mobile device immediately via a WAP Push4 P.-Y. Tsai and D.-R. Liuservice. This allows the user to receive personalized and relevant articles and satisfies the demand for instant information. The prototype system of m-CCS demonstrates that the system can effectively recommend desirable blog articles to mobile users that satisfy popularity and personal interests.2 System Process OverviewBecause of their dramatic growth during recent years, blogs have become a dominant medium on the Internet. In order to provide blog contents to mobile users immedi-ately, we propose a Customized Content Service on mobile (m-CCS) to combine two sources, time-sensitive popular topics and personal preference pattern. This is based on the idea of social navigation [11] , i.e., everyone is interested in realizing what others like. Some research [12] has considered that observing the behavior of other users could create value for individuals, and it has already been applied extensively to large-scale websites.In Fig. 1, the first step of our system is to get some blog articles from the Internet. The RSS mechanism is a useful way to capture the latest articles automatically with-out visiting each site. There is a shortage of information caused by insufficient RSS feeds subscribed to individuals, so we propose co-RSS method to solve this problem. The co-RSS process is similar to the concept of Web 2.0; anyone on the Internet can subscribe to RSS feeds. By gathering all feeds from users, RSS flocks called crows-RSS are formed to enrich information sources. After this preliminary procedure, the system can automatically collect attractive contents from diverse resources.Fig. 1. System overview for m-CCSPersonalized Popular Blog Recommender Service for Mobile Applications 5 We use the information retrieval technology [13]to pre-process articles which are crawled everyday from blog websites according to crows-RSS feeds. After extracting features of blog articles by the process of time-sensitive popularity tracking (TPT), m-CCS groups articles into topic clusters and automatically traces the trend of popu-larity. Then, m-CCS can rapidly respond to the topics that most readers may be inter-ested in.Since the viewable content on mobile phone screens is limited, it is particularly desirable to design a personalized service for filtering articles. The m-CCS can in-stantly monitor daily service transfer rates and log user viewing records to infer im-plicit preference of mobile users. The browsing records of users are analyzed to find behavior patterns and then the personal preferences are deducted through personal favorite analysis (PFA).Finally, the system pushes the blog articles to the mobile users by integrating the above message sources, including the popular topics from the discussions of all blog articles, and the preference of readers. The m-CCS sorts out the most popular topics of the day and filters related articles based on users’ implicit preference. The filtered articles are then sent to the user’s mobile device via a WAP Push service. This allows users to receive personalized and relevant blog articles in real time.3 Time-Sensitive Popularity Tracking ModuleWe identify the blog topic clusters and their popularity according to the viewpoints of writers and readers, and then trace the trend of popularity with time. Therefore, we can forecast the popularity degree for each topic cluster. In the following subsections, we will illustrate the details of the tracking process in Fig.2.Fig. 2. Time-sensitive popularity tracking process6 P.-Y. Tsai and D.-R. Liu3.1 Forming Topic Clusters of Blog ArticlesArticles in blogs are free and usually contain different opinions so that it is difficult to categorize articles into their appropriate categories which are defined by bloggers. That is to say, the existing category in a blog website is insufficient to represent the blog. In our research, we use article features derived from the pre-processing process to deal with blog articles which are published within a given time window on the Internet. The size of the time window is set as seven days. That is, all the articles posted in the past seven days will be categorized and recommended to individual users.A hierarchical agglomerative algorithm with group-average clustering approach[14] is applied to implement the clustering step. It treats each article as a cluster first and then successively merges pairs of clusters. During the process, we calculate each cluster quality to decide whether we should stop merging or not. In this process, simi-larities between two articles can be calculated by means of the cosine similarity measure, as shown in Eq.1.3.2 Constructing the Trend Path between Clusters Belonging to Adjacent Days To reveal the path of the trend which predicts the popularity degree of current clus-ters, we measure the similarity between the target cluster r and all the clusters pr belonging to the preceding period, and then select the one with max values to con-struct the link with one of the preceding clusters.As blog articles are usually composed of unstructured words, to obtain similarity between two clusters which belong to two days, we average the value of cosine simi-larity between documents crossing clusters. Then we can identify the differences between two clusters clearly.The similarity between two clusters (r , pr ) in adjacent days is calculated by Eq. 2., where d i / d j is a blog article belonging to the set of blog articles S r / S pr in cluster r/pr ; | S r |/| S pr | is the number of blog articles of S r / S pr and Sim(d i ,d j ) denotes the cosine similarity between the articles d i and d j , as mentioned in section 3.1.After the establishment of linkages, the trend of each current cluster can be derived from the preceding related cluster.3.3 Acquisition of Actual Popularity Degree for Each Preceding ClusterTo help predict the popularity degree of a current cluster, we consider the click times in proportion to the attention from readers who make a topic rising and flourishing. After clustering blog articles to form topic group and constructing the trend path, the actual popularity degree for each preceding cluster can be acquired from the times the articles have been clicked in previous period. For each preceding cluster pr , we obtain ()(),cos ,m n m n m n m n d d Sim d d d d d d •==⋅v v v v v v (1)()(),,i r j pr i j d S d S r pr Sim d d similarity r pr S S ∈∈=∑∑(2)Personalized Popular Blog Recommender Service for Mobile Applications 7 the total click times of the articles, CT t (S pr ), on the Internet within preceding time period, as defined in Eq.3.where, S pr denotes the set of blog articles d i in cluster pr , and the actual click times for blog article d i in time t can be represented by ClickTimes t (d i ). Then, the click times can be transferred to actual popularity degree, APD pr (t), which is a normalized value based on the maximum ClickTimes over all S i in the preceding period, as follows.3.4 Predicting Popularity Degree of Current ClusterThe time series is a set of serial observation values by time order as in Fig 3. Fore-casting mainly uses the history to respond to the development trend in the future. A standard exponential smoothing method [15] assigns exponentially decreasing weights to the previous observations. In other words, recent observations are given relatively more weight in forecasting than the older observations. Unlike traditional predictive models, it can estimate time series with a small amount of data. We modi-fied the double exponential smoothing method [16] to forecast the degree of popular trend for each cluster of blog topic.Here are the two equations associated with double exponential smoothing . For each cluster r , we use the weighted average method that combines the actual popularity degree (APD) and predicted popularity degree (PPD) of preceding period to predict the popularity degree of current cluster on the assumption that the effect of popularity degree decays as days pass, as defined in Eq.5..where we use cluster pr at preceding time t to predict the initial popularity degree of cluster r at time t +1 which is denoted by ()1r PPD t ′+. For preceding cluster pr at time t , APD pr (t) is the actual popularity degree as mentioned above; PPD pr (t) denotes the predictive popularity degree of cluster pr at time t . The b pr (t) represents the trend effect for previous period. Note that the value of initial predictive popularity degree for current cluster, ()1r PPD t ′+, is between zero to one.Fig. 3. The time series of popularity trend()()i pr t pr t i d S CT S ClickTimes d ∈=∑ (3)()()(){}100%t r pr t i CT S APD t Max ClickTimes S =× (4)()()()()()11r pr pr pr PPD t APD t PPD t b t αα′⎡⎤+=×+−×+⎣⎦ (5)8 P.-Y. Tsai and D.-R. LiuWe combine the difference of the predictive popularity degrees at time t and at time t-1 and the trend effect at time t-1 to calculate the trend effect at time t using the weighted average.Note that the cluster pr is the preceding cluster of r , while the cluster ppr is the pre-ceding cluster of pr . The PPD ppr (t -1) and b ppr (t -1) are the predictive popularity degree and trend effect of cluster ppr at time t -1 respectively. The parameters α and δ in Eq.5 and Eq.6 respectively are both smoothing constants between zero to one which can be decided by experts .In the prediction model, we adopt a double exponential smoothing approach to predict the topic popularity. The double exponential smoothing approach is usually applied to analyze time series data; however, it does not consider the relation between topic clusters belonging to adjacent time periods. In our research, we concentrate on topic clusters in different time periods and construct the topic linkage from the pre-ceding time to the current as a topic trend path with a popularity degree. Therefore, to make a link between topic clusters, the maximal similarity between adjacent clusters, i.e., current cluster r and preceding cluster pr , as described in Section 3.2, is selected to adjust the predictive popularity degree of cluster r . Notably, the smaller similarity leads to the lower reliability of the prediction path between two clusters.4 Personal Favorite Analysis ModuleModeling user preference is useful for many personalized services, such as recom-mender system [17]. In this paper, we propose a novel scheme to model the interests of users who browse blog articles in mobile device.In our research, we extract a set of keywords to represent blog articles; then a clus-ter of documents which contain keyword sets is regarded as a topic. In addition, a blog article is regarded as a preference unit.Because of the limited features of mobile devices, it is inconvenient to give explicit relevance ratings of blog documents for mobile users. We analyze browsing behavior to get individuals’ favorites and thus do not require any extra user effort. First, we analyze the browsing pattern of each user to calculate user preference scores for blog articles which have been read by mobile users.4.1 Analysis of User Browsing BehaviorWe model browsing patterns within session time by analyzing the log data of mobile users. A user’s browsing pattern is derived by calculating his/her average reading time per word for browsing blog articles within session time. The system records the browsing time of blog articles requested by mobile users to derive the session interval and browsing time for each document. A timeout mechanism is used to terminate a session automatically when a user does not give any request in a time period. ()()()()()111pr pr ppr ppr b t PPD t PPD t b t δδ⎡⎤=×−−+−×−⎣⎦ (6)()()11(,)r r PPD t PPD t similarity r pr ′+=+× (7)Personalized Popular Blog Recommender Service for Mobile Applications 9 Calculating the time interval between user requests within each session could estimate the user’s stick time of the article.In order to acquire the browsing pattern for the user u , we analyze the browsing speed, H u,s , to get the average reading time per word in this session s , as shown in Eq.8.where d i is a article i that the user had browsed within session s ; D u,s is a set of artcles browsed by user u in session s ; and |D u,s | denotes the number of articles in D u,s . Doc-Size(d i ) identifies the size number of words of the article; Time u (d i ) denotes the browsing time for the user u in blog article d i .After obtaining a user’s current browsing behavior, H u,s , which is viewed as the user’s recent pattern within one session, we use a weighted approach to predict a user’s future browsing pattern by an incremental approach, which incrementally modifies the former browsing pattern using the user’s current browsing behavior. The parameters β can be adjusted in order to set one as more important than the other. We believe that recent browsing behavior has greater effect upon the future behavior of the mobile user, so we set the parameter β to give recent pattern more weight. The predicted browsing pattern is calculated by using Eq.9, where ,u s H ′ denotesformer browsing pattern which has been accumulated till session s for mobile user u . Then we can use the new browsing pattern at session s , i.e., H u,s , to predict the future behavior at new session s+1.4.2 Inferring User Preference for ArticlesIn this step, we infer user preferences for articles based on their browsing behavior that is considered as implicit feedback information. By analyzing a user reading time on a article, we can infer how much the user has interested in the article and its corre-sponding preference score. If the stick time is longer than usual, we can estimate that the user has high preference level of the article. That is, the user is addicted to the article and is willing to spend more time on it.According to the user’s reading behavior in usual time, we use the user’s browsing pattern mentioned in section 4.1 to estimate the browsing time for article and calcu-late the Predict Browsing Time, PBT u (d i ), to compare with Actual Browsing Time, ABT u (d i ), of the user. The predict browsing time PBT u (d i ) is denoted by()(),1u i i us PBT d DocSize d H +′=×, where DocSize(d i ) is the size of blog document d i ; H’u,s+1 means the browsing pattern for user u as mentioned in Section 4.1. Then, we calculate the preference score (PS) for target user u on blog article d i as following,()(),,,1i u s u i u s d D i u s Time d H DocSize d D ∈=×∑ (8)(),1,,1u s u s u s H H H ββ+′′=×+−× (9)()()()11u i u i u i PS d PBT d ABT d =+(10)10 P.-Y. Tsai and D.-R. LiuWe can observe that the value of this function is in the range (0, 1), and the higher value of preference score means that user has more interest in the article.5 Integrated Process and Recommendation ModuleIn the process of time-sensitive popularity tracking (TPT), we apply modified exponen-tial smoothing method to provide equal ranking score of topic cluster for every mobile user. Next, we consider each user’s preference in a personal favorite analysis (PFA) step to modify the order of topic cluster and derive the personal ranking cluster.The different topic clusters belonging to successive days may be covered by the same articles. Once a mobile user has read one article, his/her preference score is inferred from browsing behavior and can be applied to modify the ranking score of the topic cluster in which the article is included. Therefore, cluster ranking can be modified using a user’s preference scores for a certain article belonging to this cluster. We calculate the Customized predictive popularity degree (CPPD) as follows:In the formula above, we use the average preference score (PS) of user u for those documents that have been read and contained in the target cluster r to modify the predictive popularity degree, PPD r . D u,r denotes the set of documents which user u has browsed in cluster r . We adjust the value of ω to weight PPD r and the average preference score.As regards those mobile users who have expressed their own preferences signifi-cantly in our system, the ranking of theme clusters provided by m-CCS would be more customized. On the other hand, if a user has very few behavior records to be analyzed, the degree of modification of topic clusters is smaller. That is, the less the browsing history of users, the less the personal ranking of clusters. The system will first recommend the more general and popular theme clusters.Fig. 4. m-CCS interface to display recommended contents on mobile device()(),,,1r u r u r d D u r r u r PS d CPPD PPD D ωω∈=×+−×∑ (11)Personalized Popular Blog Recommender Service for Mobile Applications 11 Finally, the article with high attention degree will be recommended to mobile users from the personalized ranking of theme clusters. Attention degree shows the click counter of the article on the Internet, and it also presents that readers have highly trust on the article.After the processing above, the picked articles are transformed into XHTML for mobiles and then pushed to handsets via WAP. Because the resolution of handsets allows only scroll browsing and user time is short compared with that of PC users, the system will only push the titles of no more than ten articles (see Fig.4 ). Then users can click the title in which they are interested to view full contents.6 System ArchitectureWe are implementing a prototype m-CCS system of the proposed mobile service based on the CHT mobile customer database stored in the MySQL database; it is developed using the Python programming language. The operating web GUI uses a Django Web Framework (see Fig.5).This research is conducted in collaboration with CAMEO InfoTech Inc., provider of the WAP Push service for mobile phones. Currently, there are 200 000 users of Chunghwa Telecom (CHT), the biggest telecom company in Taiwan, with more than 4000 users officially subscribing to the service and paying a regular fee. Taking ad-vantage of m-CCS, we look forward to improving customers’ satisfaction by provid-ing customized blog contents.A T OM 1.0R S S1.0R S S2.0F irewallMobile phone 1Mobile phone 2Mobile phone 3WAPgatewayS MS centerMobile carrier s item-C C S Django webframeworkP C s erversMyS QLdatabas eP ythonruntime ArchitectureFig. 5. The system architecture of m-CCS12 P.-Y. Tsai and D.-R. Liu7 Conclusion and Future WorkOur study suggests a new value-added service for mobile phone applications. Dis-patches of customized blog contents not only enable mobile phone users to enjoy reading blog articles without time and venue limitations but also provide a proactive channel to deliver the blog articles instead of passive browses from the users.Owing to their dramatic growth in recent years, blogs have become a dominant medium on the Internet. Although RSS feed is a common solution to receive the latest contents automatically, there are still some problems, including lack of subscriptions and overloaded information. For that reason, filtering the articles so they are suitable for each user is an important issue. In the past, studies about blogs centered on blog-gers (the authors) but ignored the views of mass readers. Our study applies the co-RSS method based on the notion under Web 2.0. Our proposed m-CCS can predict the trend of time-sensitive popularity of blogs. The m-CCS is grounded on the topic clusters of the blog articles which represent the perspectives of the authors. The m-CSS also considers the aspects of the readers’ click rates to trace the popularity trends of the theme clusters from the affluent blog contents. Moreover, as regards mobile phone users, the m-CCS will analyze their browsing behaviors and personal prefer-ences to recommend their preferred popular blog topics and articles.Our future work is to show that, with sufficiently large samples and by executing the methods proposed in this research, we can effectively increase the population of people who use their mobile phones to read blog articles, and also increase the num-ber of blog entry views.AcknowledgementThis work was done in cooperation with CAMEO InfoTech Inc. The research was supported in part by the National Science Council of Taiwan under the grant NSC 96-2416-H-009-007-MY3.References1.Hayes, C., Avesani, P., Veeramachaneni, S.: An analysis of bloggers and topics for a blogrecommender system. In: Proceedings of the Workshop on Web Mining, 7th European Conference on Machine Learning and the 10th European Conference on Principles and Practice of Knowledge Discovery in Databases (ECML/PKDD), Berlin, Germany, vol. 7, pp. 18–22 (2006)sica, J.D.: Weblogs: A new source of information. In: Rodzvilla, J. (ed.) We’ve gotblog: How weblogs are changing our culture. Perseus Publishing, Cambridge (2002)3.Kumar, R., Novak, J., Raghavan, P., Tomkins, A.: On the bursty evolution of blogspace.In: Proceedings of the 12th International Conference on World Wide Web, pp. 568–576 (2003)4.Kumar, R., Novak, J., Raghavan, P., Tomkins, A.: Structure and evolution of blogspace.Communications of the ACM 47, 35–39 (2004)。
pros and cons
pros and consPros and ConsIntroduction:In this document, we will examine the advantages and disadvantages of various aspects of life, ranging from technology to education, and examine the effects they have on individuals and society as a whole. By thoroughly analyzing the pros and cons of these different topics, we can gain a better understanding of the potential benefits and drawbacks they bring to our lives.Pros and Cons of Technology:Technology has transformed the world in countless ways, but it is not without its drawbacks. On the positive side, technological advancements have made our lives more convenient and efficient. Tasks that were once time-consuming can now be done in a matter of seconds with the help of computers and smartphones. Additionally, technology has enabled us to connect with people from all over the world, fostering communication and collaboration. However, reliance on technology can also lead to various disadvantages. For instance, excessive screen time can have negative effects on physical and mental health. Furthermore, technologicaladvancements have also raised concerns about privacy and security breaches.Pros and Cons of Social Media:Social media has become an integral part of our lives, connecting us with friends, families, and even strangers from around the globe. The benefits of social media are evident, as it allows us to stay connected, share important moments, and even build professional networks. Additionally, it has empowered individuals to share their voices and raise awareness about social and political issues. However, there are also downsides to social media. The constant exposure to carefully curated lives of others can lead to feelings of inadequacy and reduced self-esteem. Moreover, the addictive nature of social media can have detrimental effects on productivity and mental wellbeing.Pros and Cons of Education:Education is a cornerstone of personal and societal development. It equips individuals with knowledge and skills necessary for success in various aspects of life. The advantages of education are numerous, including increased employment opportunities, higher wages, and improved critical thinking abilities. Additionally, education fosters personal growth, self-awareness, and social mobility. However, education is not without its disadvantages. Risingcosts of education have created financial burdens on individuals and families. Additionally, the traditional education system may not cater to the diverse learning styles and interests of every student, potentially hindering their full potential.Pros and Cons of Globalization:Globalization has significantly influenced every aspect of our lives. On the positive side, it has opened up opportunities for trade, economic growth, and cultural exchange. Globalization has brought about increased access to goods and services from all around the world, fostering cultural diversity and enriching our lives. Furthermore, it has facilitated the spread of knowledge, creating a more interconnected and informed world. However, globalization also has its drawbacks. The increased interdependence among nations has made them vulnerable to economic crises and global conflicts. Additionally, it has led to environmental concerns, as the pursuit of economic growth often comes at the cost of sustainability and ecological balance.Conclusion:Examining the pros and cons of various aspects of life provides us with a comprehensive view of the impact they have on individuals and society. By understanding both the benefits and disadvantages, we can make informed decisionsand take actions that maximize the advantages while minimizing the drawbacks. It is essential to weigh the pros and cons before embracing new technologies, engaging in social media, pursuing education, or participating in the globalized world.。
a moden introductio to probability and statistics
a moden introductio to probability andstatistics“A Modern Introduction to Probability and Statistics” is a comprehensive textbook that provides a broad overview of the principles and techniques of probability and statistics. It is an excellent resource for anyone who wants to gain a deep understanding of the subject matter.Step 1: IntroductionThe book begins with an introduction that outlines the principles of probability and statistics. It provides a clear understanding of what these two fields are all about and how they are used in various applications. The authors also introduce the key concepts that will be covered in the restof the book.Step 2: ProbabilityThe next section of the book focuses on probability. It covers the basics of probability theory and explains how to calculate probabilities of events. The authors also introduce different probability distributions, such as the normal distribution and the binomial distribution.Step 3: StatisticsThe third section of the book covers statistics. It explains how to gather and analyze data using various statistical techniques. These include descriptive statistics, inferential statistics, and hypothesis testing. The authors also cover regression analysis and the methods used to analyze time series data.Step 4: ApplicationsThe final section of the book provides a range of applications of probability and statistics. These include applications in finance, engineering, and the social sciences. The authors use real-world examples to demonstrate how these concepts are applied in practice.Step 5: ExercisesThroughout the book, there are numerous exercises that can be used to test your knowledge and understanding of the concepts covered. These exercises range from simple calculations to more complex applications. There are also detailed solutions provided at the back of the book.Conclusion:“A Modern Introduction to Probability and Statistics”is an excellent textbook that provides a comprehensive overview of the subject matter. The authors use clear and concise language throughout the book, making it accessible to beginners, while also providing in-depth coverage of the principles and techniques involved. The exercises andsolutions provided also make it an excellent resource for anyone who wants to test their knowledge and understanding of the material. Overall, this book is a must-read for anyonewho is serious about learning probability and statistics, and its applications to real-world problems.。
人工智能南阳理工学院计科系人工智能考试复习总结
1.人工智能定义:答:从学科来说,人工智能是指计算机科学中涉及研究、设计和应用智能机器的一个分支。
它的近期主要目标在于研究用机器来模仿和执行人脑的某些智力功能,并开发相关理论和技术。
从能力来说,人工智能是指智能机器所执行的通常与人类智能有关的智能行为,如判断、推理、证明、识别、感知、理解、通信、设计、思考、规划、学习和问题求解等思维活动。
2.界定机器智能的方法:图灵测试和中文屋子。
3.脑智能和群智能概念。
答:脑智能:人脑的职能及其过程都是发生在其心理层面上的,即以某种心理过程和思维过程表现的,脑(主要指人脑)的这种宏观心理层次的智能表现一般称为脑智能4.答:,5.答:6.7.8.9.10.11.12.13答:PROLOG是一种逻辑型智能程序设计语言,PROLOG只有三种语句,分别是事实、规则和问题。
事实(fact):功能是一般表示对象的性质或关系。
规则(rule):格式 <谓词名>(<项表>):--<谓词名>(<项表>){,<谓词名>(<项表>)} 功能是一般表示对象间的因果关系、蕴含关系或对应关系。
问题(question):功能是表示用户的询问,他就是程序运行的目标。
14.PROLOG语言的书写要求:①事实、规则和问题都分行书写。
②规则和事实可连续排列在一起, 其顺序可随意安排,③同一谓词名的事实或规则必须集中排列在一起。
④问题不能与规则及事实排在一起15.同过程性语言相比,一个PROBLOG程序,其问题就相当于主程序,其规则就相当于子程序,而事实相当于数据。
16.一个Turbo PROLOG程序一般应包括哪几部分?答:一个完整的Turbo PPOLOG程序一般包括常量段(constants)、领域段(domains)、数据库段(database)、谓词段(predicates)、目标段(goal)和子句段(clauses)等六个部分。
第四章prolog语言
a
b
c
d
e
若采用path(X,Y)表示X和Y之间有一通路,则用PROLOG规
则可描述为: • • path (X,Y) :- connected (X,Y). path (X,Y) :- connected (X,Z),path (Z,Y).
• 符号 “:-”表示“如果”,或者可以理解为一种蕴含→; • “,”表示并且(and)。
3、询问解释 针对上面关于两点间的通路的事实和规则一旦在计算机上 建立,就可做如下提问: a b • ?-path (a,b). a到b有通路吗? Yes 有 c d e • ?-path (b,a). b到a有通路吗? No 没有 • ?-path (d,Y). d到哪一点有通路 y=e d到e点有通路 • ?-path (b,X), path (c,X). 是否存在一点X,使得b 和c有通路到达点X? x=d • ?-connected (a,d). a到d有一条有向边吗? No 没有
一、PROLOG语言特点(续3)
• 4. prolog程序实际上是一个智能数据库 prolog的原理就是关系数据库,它是建立在关系 数据库的基础上的。 • 它和SQL数据库查询语言有很多相似之处。使用 prolog可以很方便的处理数据。 • 5. 递归功能 递归是prolog和lisp语言的重要特点,这一特点使得 一个大数据结构能够用一个小的程序来处理。
它是在1960年作为定义数学函数的一种记法来介绍的但因其具有较强的符号处理功能和较灵活的控制结构特别适合于人工智能的研究最大的特点就是适合于处理表格利用表格的递归性进行推理从而很快受到了人工智能工作者的青睐在很长的一个时期内lisp语言一直被用作人工智能系统的主要设计语言
第四章 Prologe 程序语言设计
prolog 逻辑程序设计语言Prolog教程
为了缩小人类自然语言与计算机程序设计语言之间
的差距,人们开发了新型程序设计语言,较典型的
有函数程序设计语言、逻辑程序设计语言以及面向
对象的程序设计语言。
Prolog语言是一种典型的逻辑程序设计语言。利 用Prolog语言进行程序设计只需要程序员写出与 问题有关的事实、规则以及要求解的具体问题。
5.2.0 逻辑程序定义
例如,对于下面两个Horn子句: ① W(X,Y):-P(X), Q(Y). ② ?-R(X,Y),Q(Y). 在①中W(X,Y)为头,P(X),Q(Y)为体。在② 中R(X,Y),Q(Y)为体,头为空子句。事实上, ②表示一个询问,R(X,Y),Q(Y)是否为真, 或者X和Y取什么值的时候,R(X,Y),Q(Y)为 真。
5.2.1 数据结构
结构 在Prolog语言中,常用的结构形式有: (1)函子(分量1,分量2,……,分量n)。如上例Mary的住 所。 (2)表。表是Prolog语言中最常用的数据结构,它由一些有 序分量组成,其长度可任意。有序即表示表中的分量次序是 有意义的。同样,表的分量可以是原子、结构等,当然也可 以是表。 例如含有3个分量[a,b,c]的表可写成 [a,b,c]如用函 数的方式可写成 · · (a (b · (c[ ])))。其中符号“· ” 是表的函子.也就是说,表是以“· ”为函子的特殊结构。
“做什么”,而不是像普通程序设计语言那样告 诉计算机“如何做”。
5.1.2 Prolog语言的特点 The characteristics of Prolog language
Probabilistic model checking of an anonymity system
Probabilistic Model Checking ofan Anonymity SystemVitaly ShmatikovSRI International333Ravenswood AvenueMenlo Park,CA94025U.S.A.shmat@AbstractWe use the probabilistic model checker PRISM to analyze the Crowds system for anonymous Web browsing.This case study demonstrates howprobabilistic model checking techniques can be used to formally analyze se-curity properties of a peer-to-peer group communication system based onrandom message routing among members.The behavior of group mem-bers and the adversary is modeled as a discrete-time Markov chain,and thedesired security properties are expressed as PCTL formulas.The PRISMmodel checker is used to perform automated analysis of the system and ver-ify anonymity guarantees it provides.Our main result is a demonstration ofhow certain forms of probabilistic anonymity degrade when group size in-creases or random routing paths are rebuilt,assuming that the corrupt groupmembers are able to identify and/or correlate multiple routing paths originat-ing from the same sender.1IntroductionFormal analysis of security protocols is a well-establishedfield.Model checking and theorem proving techniques[Low96,MMS97,Pau98,CJM00]have been ex-tensively used to analyze secrecy,authentication and other security properties ofprotocols and systems that employ cryptographic primitives such as public-key en-cryption,digital signatures,etc.Typically,the protocol is modeled at a highly ab-stract level and the underlying cryptographic primitives are treated as secure“black boxes”to simplify the model.This approach discovers attacks that would succeed even if all cryptographic functions were perfectly secure.Conventional formal analysis of security is mainly concerned with security against the so called Dolev-Yao attacks,following[DY83].A Dolev-Yao attacker is a non-deterministic process that has complete control over the communication net-work and can perform any combination of a given set of attacker operations,such as intercepting any message,splitting messages into parts,decrypting if it knows the correct decryption key,assembling fragments of messages into new messages and replaying them out of context,etc.Many proposed systems for anonymous communication aim to provide strong, non-probabilistic anonymity guarantees.This includes proxy-based approaches to anonymity such as the Anonymizer[Ano],which hide the sender’s identity for each message by forwarding all communication through a special server,and MIX-based anonymity systems[Cha81]that blend communication between dif-ferent senders and recipients,thus preventing a global eavesdropper from linking sender-recipient pairs.Non-probabilistic anonymity systems are amenable to for-mal analysis in the same non-deterministic Dolev-Yao model as used for verifica-tion of secrecy and authentication protocols.Existing techniques for the formal analysis of anonymity in the non-deterministic model include traditional process formalisms such as CSP[SS96]and a special-purpose logic of knowledge[SS99].In this paper,we use probabilistic model checking to analyze anonymity prop-erties of a gossip-based system.Such systems fundamentally rely on probabilistic message routing to guarantee anonymity.The main representative of this class of anonymity systems is Crowds[RR98].Instead of protecting the user’s identity against a global eavesdropper,Crowds provides protection against collaborating local eavesdroppers.All communication is routed randomly through a group of peers,so that even if some of the group members collaborate and share collected lo-cal information with the adversary,the latter is not likely to distinguish true senders of the observed messages from randomly selected forwarders.Conventional formal analysis techniques that assume a non-deterministic at-tacker in full control of the communication channels are not applicable in this case. Security properties of gossip-based systems depend solely on the probabilistic be-havior of protocol participants,and can be formally expressed only in terms of relative probabilities of certain observations by the adversary.The system must be modeled as a probabilistic process in order to capture its properties faithfully.Using the analysis technique developed in this paper—namely,formalization of the system as a discrete-time Markov chain and probabilistic model checking of2this chain with PRISM—we uncovered two subtle properties of Crowds that causedegradation of the level of anonymity provided by the system to the users.First,if corrupt group members are able to detect that messages along different routingpaths originate from the same(unknown)sender,the probability of identifyingthat sender increases as the number of observed paths grows(the number of pathsmust grow with time since paths are rebuilt when crowd membership changes).Second,the confidence of the corrupt members that they detected the correct senderincreases with the size of the group.Thefirstflaw was reported independently byMalkhi[Mal01]and Wright et al.[W ALS02],while the second,to the best ofour knowledge,was reported for thefirst time in the conference version of thispaper[Shm02].In contrast to the analysis by Wright et al.that relies on manualprobability calculations,we discovered both potential vulnerabilities of Crowds byautomated probabilistic model checking.Previous research on probabilistic formal models for security focused on(i)probabilistic characterization of non-interference[Gra92,SG95,VS98],and(ii)process formalisms that aim to faithfully model probabilistic properties of crypto-graphic primitives[LMMS99,Can00].This paper attempts to directly model andanalyze security properties based on discrete probabilities,as opposed to asymp-totic probabilities in the conventional cryptographic sense.Our analysis methodis applicable to other probabilistic anonymity systems such as Freenet[CSWH01]and onion routing[SGR97].Note that the potential vulnerabilities we discovered inthe formal model of Crowds may not manifest themselves in the implementationsof Crowds or other,similar systems that take measures to prevent corrupt routersfrom correlating multiple paths originating from the same sender.2Markov Chain Model CheckingWe model the probabilistic behavior of a peer-to-peer communication system as adiscrete-time Markov chain(DTMC),which is a standard approach in probabilisticverification[LS82,HS84,Var85,HJ94].Formally,a Markov chain can be definedas consisting in afinite set of states,the initial state,the transition relation such that,and a labeling functionfrom states to afinite set of propositions.In our model,the states of the Markov chain will represent different stages ofrouting path construction.As usual,a state is defined by the values of all systemvariables.For each state,the corresponding row of the transition matrix de-fines the probability distributions which govern the behavior of group members once the system reaches that state.32.1Overview of PCTLWe use the temporal probabilistic logic PCTL[HJ94]to formally specify properties of the system to be checked.PCTL can express properties of the form“under any scheduling of processes,the probability that event occurs is at least.”First,define state formulas inductively as follows:where atomic propositions are predicates over state variables.State formulas of the form are explained below.Define path formulas as follows:Unlike state formulas,which are simplyfirst-order propositions over a single state,path formulas represent properties of a chain of states(here path refers to a sequence of state space transitions rather than a routing path in the Crowds speci-fication).In particular,is true iff is true for every state in the chain;is true iff is true for all states in the chain until becomes true,and is true for all subsequent states;is true iff and there are no more than states before becomes true.For any state and path formula,is a state formula which is true iff state space paths starting from satisfy path formula with probability greater than.For the purposes of this paper,we will be interested in formulas of the form ,evaluated in the initial state.Here specifies a system con-figuration of interest,typically representing a particular observation by the adver-sary that satisfies the definition of a successful attack on the protocol.Property is a liveness property:it holds in iff will eventually hold with greater than probability.For instance,if is a state variable represent-ing the number of times one of the corrupt members received a message from the honest member no.,then holds in iff the prob-ability of corrupt members eventually observing member no.twice or more is greater than.Expressing properties of the system in PCTL allows us to reason formally about the probability of corrupt group members collecting enough evidence to success-fully attack anonymity.We use model checking techniques developed for verifica-tion of discrete-time Markov chains to compute this probability automatically.42.2PRISM model checkerThe automated analyses described in this paper were performed using PRISM,aprobabilistic model checker developed by Kwiatkowska et al.[KNP01].The toolsupports both discrete-and continuous-time Markov chains,and Markov decisionprocesses.As described in section4,we model probabilistic peer-to-peer com-munication systems such as Crowds simply as discrete-time Markov chains,andformalize their properties in PCTL.The behavior of the system processes is specified using a simple module-basedlanguage inspired by Reactive Modules[AH96].State variables are declared in thestandard way.For example,the following declarationdeliver:bool init false;declares a boolean state variable deliver,initialized to false,while the followingdeclarationconst TotalRuns=4;...observe1:[0..TotalRuns]init0;declares a constant TotalRuns equal to,and then an integer array of size,indexed from to TotalRuns,with all elements initialized to.State transition rules are specified using guarded commands of the form[]<guard>-><command>;where<guard>is a predicate over system variables,and<command>is the tran-sition executed by the system if the guard condition evaluates to mandoften has the form<expression>...<expression>, which means that in the next state(i.e.,that obtained after the transition has beenexecuted),state variable is assigned the result of evaluating arithmetic expres-sion<expression>If the transition must be chosen probabilistically,the discrete probability dis-tribution is specified as[]<guard>-><prob1>:<command1>+...+<probN>:<commandN>;Transition represented by command is executed with probability prob,and prob.Security properties to be checked are stated as PCTL formulas (see section2.1).5Given a formal system specification,PRISM constructs the Markov chain and determines the set of reachable states,using MTBDDs and BDDs,respectively. Model checking a PCTL formula reduces to a combination of reachability-based computation and solving a system of linear equations to determine the probability of satisfying the formula in each reachable state.The model checking algorithms employed by PRISM include[BdA95,BK98,Bai98].More details about the im-plementation and operation of PRISM can be found at http://www.cs.bham. /˜dxp/prism/and in[KNP01].Since PRISM only supports model checking offinite DTMC,in our case study of Crowds we only analyze anonymity properties offinite instances of the system. By changing parameters of the model,we demonstrate how anonymity properties evolve with changes in the system configuration.Wright et al.[W ALS02]investi-gated related properties of the Crowds system in the general case,but they do not rely on tool support and their analyses are manual rather than automated.3Crowds Anonymity SystemProviding an anonymous communication service on the Internet is a challenging task.While conventional security mechanisms such as encryption can be used to protect the content of messages and transactions,eavesdroppers can still observe the IP addresses of communicating computers,timing and frequency of communi-cation,etc.A Web server can trace the source of the incoming connection,further compromising anonymity.The Crowds system was developed by Reiter and Ru-bin[RR98]for protecting users’anonymity on the Web.The main idea behind gossip-based approaches to anonymity such as Crowds is to hide each user’s communications by routing them randomly within a crowd of similar users.Even if an eavesdropper observes a message being sent by a particular user,it can never be sure whether the user is the actual sender,or is simply routing another user’s message.3.1Path setup protocolA crowd is a collection of users,each of whom is running a special process called a jondo which acts as the user’s proxy.Some of the jondos may be corrupt and/or controlled by the adversary.Corrupt jondos may collaborate and share their obser-vations in an attempt to compromise the honest users’anonymity.Note,however, that all observations by corrupt group members are local.Each corrupt member may observe messages sent to it,but not messages transmitted on the links be-tween honest jondos.An honest crowd member has no way of determining whether6a particular jondo is honest or corrupt.The parameters of the system are the total number of members,the number of corrupt members,and the forwarding probability which is explained below.To participate in communication,all jondos must register with a special server which maintains membership information.Therefore,every member of the crowd knows identities of all other members.As part of the join procedure,the members establish pairwise encryption keys which are used to encrypt pairwise communi-cation,so the contents of the messages are secret from an external eavesdropper.Anonymity guarantees provided by Crowds are based on the path setup pro-tocol,which is described in the rest of this section.The path setup protocol is executed each time one of the crowd members wants to establish an anonymous connection to a Web server.Once a routing path through the crowd is established, all subsequent communication between the member and the Web server is routed along it.We will call one run of the path setup protocol a session.When crowd membership changes,the existing paths must be scrapped and a new protocol ses-sion must be executed in order to create a new random routing path through the crowd to the destination.Therefore,we’ll use terms path reformulation and proto-col session interchangeably.When a user wants to establish a connection with a Web server,its browser sends a request to the jondo running locally on her computer(we will call this jondo the initiator).Each request contains information about the intended desti-nation.Since the objective of Crowds is to protect the sender’s identity,it is not problematic that a corrupt router can learn the recipient’s identity.The initiator starts the process of creating a random path to the destination as follows: The initiator selects a crowd member at random(possibly itself),and for-wards the request to it,encrypted by the corresponding pairwise key.We’ll call the selected member the forwarder.The forwarderflips a biased coin.With probability,it delivers the request directly to the destination.With probability,it selects a crowd member at random(possibly itself)as the next forwarder in the path,and forwards the request to it,re-encrypted with the appropriate pairwise key.The next forwarder then repeats this step.Each forwarder maintains an identifier for the created path.If the same jondo appears in different positions on the same path,identifiers are different to avoid infinite loops.Each subsequent message from the initiator to the destination is routed along this path,i.e.,the paths are static—once established,they are not altered often.This is necessary to hinder corrupt members from linking multiple7paths originating from the same initiator,and using this information to compromise the initiator’s anonymity as described in section3.2.3.3.2Anonymity properties of CrowdsThe Crowds paper[RR98]describes several degrees of anonymity that may be provided by a communication system.Without using anonymizing techniques, none of the following properties are guaranteed on the Web since browser requests contain information about their source and destination in the clear.Beyond suspicion Even if the adversary can see evidence of a sent message,the real sender appears to be no more likely to have originated it than any other potential sender in the system.Probable innocence The real sender appears no more likely to be the originator of the message than to not be the originator,i.e.,the probability that the adversary observes the real sender as the source of the message is less thanupper bound on the probability of detection.If the sender is observed by the adversary,she can then plausibly argue that she has been routing someone else’s messages.The Crowds paper focuses on providing anonymity against local,possibly co-operating eavesdroppers,who can share their observations of communication in which they are involved as forwarders,but cannot observe communication involv-ing only honest members.We also limit our analysis to this case.3.2.1Anonymity for a single routeIt is proved in[RR98]that,for any given routing path,the path initiator in a crowd of members with forwarding probability has probable innocence against collaborating crowd members if the following inequality holds:(1)More formally,let be the event that at least one of the corrupt crowd members is selected for the path,and be the event that the path initiator appears in8the path immediately before a corrupt crowd member(i.e.,the adversary observes the real sender as the source of the messages routed along the path).Condition 1guarantees thatproving that,given multiple linked paths,the initiator appears more often as a sus-pect than a random crowd member.The automated analysis described in section6.1 confirms and quantifies this result.(The technical results of[Shm02]on which this paper is based had been developed independently of[Mal01]and[W ALS02],be-fore the latter was published).In general,[Mal01]and[W ALS02]conjecture that there can be no reliable anonymity method for peer-to-peer communication if in order to start a new communication session,the initiator must originate thefirst connection before any processing of the session commences.This implies that anonymity is impossible in a gossip-based system with corrupt routers in the ab-sence of decoy traffic.In section6.3,we show that,for any given number of observed paths,the adversary’s confidence in its observations increases with the size of the crowd.This result contradicts the intuitive notion that bigger crowds provide better anonymity guarantees.It was discovered by automated analysis.4Formal Model of CrowdsIn this section,we describe our probabilistic formal model of the Crowds system. Since there is no non-determinism in the protocol specification(see section3.1), the model is a simple discrete-time Markov chain as opposed to a Markov deci-sion process.In addition to modeling the behavior of the honest crowd members, we also formalize the adversary.The protocol does not aim to provide anonymity against global eavesdroppers.Therefore,it is sufficient to model the adversary as a coalition of corrupt crowd members who only have access to local communication channels,i.e.,they can only make observations about a path if one of them is se-lected as a forwarder.By the same token,it is not necessary to model cryptographic functions,since corrupt members know the keys used to encrypt peer-to-peer links in which they are one of the endpoints,and have no access to links that involve only honest members.The modeling technique presented in this section is applicable with minor mod-ifications to any probabilistic routing system.In each state of routing path construc-tion,the discrete probability distribution given by the protocol specification is used directly to define the probabilistic transition rule for choosing the next forwarder on the path,if any.If the protocol prescribes an upper bound on the length of the path(e.g.,Freenet[CSWH01]),the bound can be introduced as a system parameter as described in section4.2.3,with the corresponding increase in the size of the state space but no conceptual problems.Probabilistic model checking can then be used to check the validity of PCTL formulas representing properties of the system.In the general case,forwarder selection may be governed by non-deterministic10runCount goodbad lastSeen observelaunchnewstartrundeliver recordLast badObserve4.2Model of honest members4.2.1InitiationPath construction is initiated as follows(syntax of PRISM is described in section 2.2):[]launch->runCount’=TotalRuns&new’=true&launch’=false;[]new&(runCount>0)->(runCount’=runCount-1)&new’=false&start’=true;[]start->lastSeen’=0&deliver’=false&run’=true&start’=false;4.2.2Forwarder selectionThe initiator(i.e.,thefirst crowd member on the path,the one whose identity must be protected)randomly chooses thefirst forwarder from among all group mem-bers.We assume that all group members have an equal probability of being chosen, but the technique can support any discrete probability distribution for choosing for-warders.Forwarder selection is a single step of the protocol,but we model it as two probabilistic state transitions.Thefirst determines whether the selected forwarder is honest or corrupt,the second determines the forwarder’s identity.The randomly selected forwarder is corrupt with probability badCbe next on the path.Any of the honest crowd members can be selected as the forwarder with equal probability.To illustrate,for a crowd with10honest members,the following transition models the second step of forwarder selection: []recordLast&CrowdSize=10->0.1:lastSeen’=0&run’=true&recordLast’=false+0.1:lastSeen’=1&run’=true&recordLast’=false+...0.1:lastSeen’=9&run’=true&recordLast’=false;According to the protocol,each honest crowd member must decide whether to continue building the path byflipping a biased coin.With probability,the forwarder selection transition is enabled again and path construction continues, and with probability the path is terminated at the current forwarder,and all requests arriving from the initiator along the path will be delivered directly to the recipient.[](good&!deliver&run)->//Continue path constructionPF:good’=false+//Terminate path constructionnotPF:deliver’=true;The specification of the Crowds system imposes no upper bound on the length of the path.Moreover,the forwarders are not permitted to know their relative position on the path.Note,however,that the amount of information about the initiator that can be extracted by the adversary from any path,or anyfinite number of paths,isfinite(see sections4.3and4.5).In systems such as Freenet[CSWH01],requests have a hops-to-live counter to prevent infinite paths,except with very small probability.To model this counter,we may introduce an additional state variable pIndex that keeps track of the length of the path constructed so far.The path construction transition is then coded as follows://Example with Hops-To-Live//(NOT CROWDS)////Forward with prob.PF,else deliver13[](good&!deliver&run&pIndex<MaxPath)->PF:good’=false&pIndex’=pIndex+1+notPF:deliver’=true;//Terminate if reached MaxPath,//but sometimes not//(to confuse adversary)[](good&!deliver&run&pIndex=MaxPath)->smallP:good’=false+largeP:deliver’=true;Introduction of pIndex obviously results in exponential state space explosion, decreasing the maximum system size for which model checking is feasible.4.2.4Transition matrix for honest membersTo summarize the state space of the discrete-time Markov chain representing cor-rect behavior of protocol participants(i.e.,the state space induced by the abovetransitions),let be the state in which links of the th routing path from the initiator have already been constructed,and assume that are the honestforwarders selected for the path.Let be the state in which path constructionhas terminated with as thefinal path,and let be an auxiliary state. Then,given the set of honest crowd members s.t.,the transi-tion matrix is such that,,(see section4.2.2),i.e.,the probability of selecting the adversary is equal to the cumulative probability of selecting some corrupt member.14This abstraction does not limit the class of attacks that can be discovered using the approach proposed in this paper.Any attack found in the model where indi-vidual corrupt members are kept separate will be found in the model where their capabilities are combined in a single worst-case adversary.The reason for this is that every observation made by one of the corrupt members in the model with separate corrupt members will be made by the adversary in the model where their capabilities are combined.The amount of information available to the worst-case adversary and,consequently,the inferences that can be made from it are at least as large as those available to any individual corrupt member or a subset thereof.In the adversary model of[RR98],each corrupt member can only observe its local network.Therefore,it only learns the identity of the crowd member imme-diately preceding it on the path.We model this by having the corrupt member read the value of the lastSeen variable,and record its observations.This cor-responds to reading the source IP address of the messages arriving along the path. For example,for a crowd of size10,the transition is as follows:[]lastSeen=0&badObserve->observe0’=observe0+1&deliver’=true&run’=true&badObserve’=false;...[]lastSeen=9&badObserve->observe9’=observe9+1&deliver’=true&run’=true&badObserve’=false;The counters observe are persistent,i.e.,they are not reset for each session of the path setup protocol.This allows the adversary to accumulate observations over several path reformulations.We assume that the adversary can detect when two paths originate from the same member whose identity is unknown(see sec-tion3.2.2).The adversary is only interested in learning the identity of thefirst crowd mem-ber in the path.Continuing path construction after one of the corrupt members has been selected as a forwarder does not provide the adversary with any new infor-mation.This is a very important property since it helps keep the model of the adversaryfinite.Even though there is no bound on the length of the path,at most one observation per path is useful to the adversary.To simplify the model,we as-sume that the path terminates as soon as it reaches a corrupt member(modeled by deliver’=true in the transition above).This is done to shorten the average path length without decreasing the power of the adversary.15Each forwarder is supposed toflip a biased coin to decide whether to terminate the path,but the coinflips are local to the forwarder and cannot be observed by other members.Therefore,honest members cannot detect without cooperation that corrupt members always terminate paths.In any case,corrupt members can make their observable behavior indistinguishable from that of the honest members by continuing the path with probability as described in section4.2.3,even though this yields no additional information to the adversary.4.4Multiple pathsThe discrete-time Markov chain defined in sections4.2and4.3models construc-tion of a single path through the crowd.As explained in section3.2.2,paths have to be reformulated periodically.The decision to rebuild the path is typically made according to a pre-determined schedule,e.g.,hourly,daily,or once enough new members have asked to join the crowd.For the purposes of our analysis,we sim-ply assume that paths are reformulated somefinite number of times(determined by the system parameter=TotalRuns).We analyze anonymity properties provided by Crowds after successive path reformulations by considering the state space produced by successive execu-tions of the path construction protocol described in section4.2.As explained in section4.3,the adversary is permitted to combine its observations of some or all of the paths that have been constructed(the adversary only observes the paths for which some corrupt member was selected as one of the forwarders).The adversary may then use this information to infer the path initiator’s identity.Because for-warder selection is probabilistic,the adversary’s ability to collect enough informa-tion to successfully identify the initiator can only be characterized probabilistically, as explained in section5.4.5Finiteness of the adversary’s state spaceThe state space of the honest members defined by the transition matrix of sec-tion4.2.4is infinite since there is no a priori upper bound on the length of each path.Corrupt members,however,even if they collaborate,can make at most one observation per path,as explained in section4.3.As long as the number of path reformulations is bounded(see section4.4),only afinite number of paths will be constructed and the adversary will be able to make only afinite number of observa-tions.Therefore,the adversary only needsfinite memory and the adversary’s state space isfinite.In general,anonymity is violated if the adversary has a high probability of making a certain observation(see section5).Tofind out whether Crowds satisfies16。
PROLOG语言入门
PROLOG语言入门简介PROLOG语言是一个非常有趣的计算机语言。
它完全不同于我们已经很熟悉的其它计算机语言、例如BASIC、FORTRAN、C等。
主要由于现在的计算机硬件能力的限制,使得PROLOG语言没有得到更广泛的流行。
但是未来随着计算机硬件技术的发展,PROLOG语言将会发挥更大的作用。
尤其是通过PROLOG语言的学习,我们对计算机语言的本质会有更多的了解。
虽然对许多人来说,PROLOG语言比较陌生。
但是PROLOG语言很容易入门,人们很容易感受到它的魅力。
本书在多年从事相关教学的讲义的基础上形成。
本书没有试图写成PROLOG语言程序设计的指导书,而是着重在于于介绍PROLOG的有趣性,引导读者尽快进入PROLOG世界。
同时,尽量利用BASIC、FORTRAN、C等大家熟悉的语言的例子,说明PROLOG与这些语言的区别,以加深读者对PROLOG的理解。
因此,本书适合于PROLOG的初学者,而对于那些已有相当基础、希望利用PROLOG开发应用程序的读者,则可以选择其它更加全面的书籍,例如本书末尾所推荐的那些书籍。
目录1引言2为什么有PROLOG3什么是PROLOG ?4最简单的PROLOG程序5PROKOG运行方式6关于Visual PROLOG ?7Visual PROLOG的运行方式8PROKOG入门9规则与事实10递归11表12引言首先,介绍一种常见的扑克牌游戏。
该游戏方法为:“随意抽出4张扑克牌。
然后利用加、减、乘、除方法,对这个4张扑克牌所代表的4个数进行四则运算。
要求最后的运算结果为24。
注意,每个数只能在运算中出现1次,且必须出现1次。
”例如,如果所抽取的4张牌所代表的4个数分别为:2,4,7,9。
则可以采用如下运算方法:2 * 4 + 9 + 7 = 24有时,同一数字组合,可能存在好几种四则运算方法。
游戏时,可以规定先找到相应的四则运算方法的人获胜。
有些数字组合比较容易计算,例如6,6,6,6。
波普尔把科学发现归结为从错误到对错英语作文
全文分为作者个人简介和正文两个部分:作者个人简介:Hello everyone, I am an author dedicated to creating and sharing high-quality document templates. In this era of information overload, accurate and efficient communication has become especially important. I firmly believe that good communication can build bridges between people, playing an indispensable role in academia, career, and daily life. Therefore, I decided to invest my knowledge and skills into creating valuable documents to help people find inspiration and direction when needed.正文:波普尔把科学发现归结为从错误到对错英语作文全文共3篇示例,供读者参考篇1Popper's Falsification and the Path of ScienceWhen I first learned about Sir Karl Popper's views on the philosophy of science, I have to admit I was a bit perplexed. Popper argued that the way science advances is by scientistscontinuously putting forth bold theories and then trying their hardest to falsify or refute those theories through stringent testing. If the theories withstand serious attempts at falsification, they are provisionally retained. But if they are falsified by observable evidence, they must be rejected or revised.This seemed backwards to me at first. Isn't the goal of science to ultimately arrive at profound truths about the universe through empirical investigation? Why would Popper claim that science doesn't deal in ultimate truths at all, but merely erecting theoretical structures that have so far withstood our efforts to knock them down? Asserting that science progresses "from error to error" seems like an awfully pessimistic view.However, the more I studied Popper's critical rationalism, the more I came to see the wisdom and importance of his ideas. Popper was reacting against the rigid empiricism and verificationism of the logical positivists who demanded that scientific knowledge be proven with certainty through pure observation and inductive reasoning. Popper rightly pointed out that this is an unrealistic and unattainable standard. No matter how many observations seem to confirm a theory, it can never be proven with total certainty because there is always the possibility of a future observation that contradicts and falsifies it.Instead, Popper argued that scientific theories can only ever be provisionally retained as being the best explanations we have so far until contradictory evidence emerges. This forces scientists to hold even their most cherished theories tentatively and be willing to modify or abandon them if the observable evidence demands it. As Popper put it, "The old scientific ideal of episteme – of absolutely certain, demonstrable knowledge – has proved to be an idol. The demand for scientific objectivity makes it inevitable that every scientific statement must remain tentative for ever."What I really grew to appreciate about Popper's philosophy is that it encourages a mindset of constant critical scrutiny, skepticism of dogma, and willingness to change one's views in the face of new evidence. This is the essence of the true scientific temperament – to never cling stubbornly to ideas just because we want them to be true, but to always follow the path of reason and observable reality wherever it leads.Popper used the vivid metaphor of scientists as unwitting "randy plank-builders" who devise bold theoretical planks to cross the ocean of the unknown. They build their plank as far out as they dare, secured only by the flimsiest anchor of tested knowledge, constantly extending it outwards to explore newdomains. But they must always be ready to demolish or modify their plank if it doesn't hold up to rigorous testing.To Popper, science advances by this constant process of conjectures and refutations. We put forth daring conjectures or hypotheses that attempt to explain aspects of reality. We then expose these conjectures to the most strenuous attempts at refutation that we can devise through precise observation and experimentation. Those theories that do get falsified are discarded as errors, while the survivors are retained – but only tentatively until contradicted. In this way, science progresses not by proving absolute truths, but by discarding error after error in favor of better approximations of the truth.The history of science is replete with examples of dominant theories that were later overturned or modified through bold conjectures and rigorous refutation. The geocentric model of the universe reigned for centuries until it was falsified by the heliocentric model of Copernicus, Galileo and Kepler. Newton's classical physics stood as the paramount theory until it was superseded in certain domains by Einstein's theories of relativity. The idea of the immutable gene was eventually overturned by our understanding of genetic mutation, horizontal gene transfer, and epigenetic expression.Each new scientific revolution involved daring scientists putting forth bold conjectures that contradicted and ultimately falsified the old paradigms through painstaking empirical scrutiny. As Popper said, "Whenever a theory appears to you as the only possible one, take this as a sign that you have neither understood the theory nor the problem which it was intended to solve."So in this light, science doesn't progress linearly towards final truths, but in fitful bursts, zigs and zags as old errors are discarded for newer and more empirically adequate conjectures. Popper likened it to a Socratic discussion where we continually uncover problems and revise our theories through the provocation of new arguments and careful refutation.There is undoubtedly a sense of provisionality and humility in Popper's view – we can never attain perfect, certain truth, only contingent approximations subject to revision. But I've come to see this as a strength rather than a weakness of science. It means our scientific knowledge remains flexible, open to change, and deeply rooted in observable reality rather than rigid doctrine. As Popper said, "The autonomy of science, guaranteed by incessant criticism and forever undergoing risk to survive, provides the firmest security system for science."So after studying Popper at length, I've come to embrace his perspective of science as boldly conjecturing solutions and then striving indefatigably to criticize and refute those solutions. By eliminating errors one by one, and revising our theories to account for contradictory evidence, science advances step by step towards fuller and more empirically robust explanations of the observable world. We may never attain ultimate truth, but we can progressively shed error after error in its pursuit.篇2Scientific Discovery: Popper's View of Progressing from Error to TruthAs students of science, we are taught from an early age that the scientific method is the path to uncovering objective truths about the natural world. We dutifully memorize the steps - make an observation, form a hypothesis, design an experiment to test the hypothesis, analyze the results, and draw a conclusion. If our results support the hypothesis, we consider it to be a valid theory that explains the phenomenon we investigated.However, the renowned philosopher of science Karl Popper held a radically different view of how scientific knowledge advances. In his seminal work "The Logic of Scientific Discovery,"Popper argued that the classical scientific method is fundamentally flawed because it is impossible to prove a theory is true through observations or experiments, no matter how much data we collect supporting it. Instead, Popper proposed that science progresses by continually attempting to falsify or disprove accepted theories through rigorous testing.Popper's core premise is that no number of confirming observations or experiments can establish a scientific theory as true with absolute certainty. This is because it is always possible that a future observation or test could arise that contradicts the theory. For example, physicists once considered Newtonian mechanics to be an unassailable truth based on centuries of observations that aligned with its principles. However, this theory was later shown to be incomplete and only an approximation through experiments that revealed the bizarre nature of physics at the quantum scale.Instead of naively seeking to prove theories true, Popper advocated for scientists to approach theories as permanent sources of potential error or falsehoods that must be ruthlessly scrutinized. A theory can only be considered scientifically valuable if it is inherently falsifiable - meaning it generatestestable predictions or premises that could reveal the theory to be false if contradictory evidence emerges.Through this process of "surviving" strenuous attempts at falsification, Popper believed that theories could provisionally be accepted as closer approximations of the truth, but never proven to be perfect or complete representations of reality. Each failed attempt to falsify strengthens a theory's credibility and explanatory power, but it is always subject to being revised or discarded if future observations reveal flaws.For example, Einstein's theory of relativity made very precise, quantifiable predictions about phenomena like the bending of light by gravitational fields. When astronomers observed stars positioned precisely where Einstein's equations predicted during a solar eclipse, it was considered a falsification of Newton's established laws. However, rather than taking this as final proof, scientists have continued rigorously testing relativity for over a century through experiments probing the theory's limits in more extreme scenarios. The theory remains unchallenged, but open to being potentially superseded.From Popper's perspective, science self-corrects and progresses through a Darwinian competition amongst theories to survive increasingly stringent tests. The fittest theories live on,being further refined by new evidence, while flawed or limited theories are culled from the body of accepted scientific knowledge.By adopting this critical mindset of potential falsification, Popper felt science could avoid falling into dogmatism and blind allegiance to potentially flawed axioms or doctrines, as he believed had occurred in fields like Freudian psychoanalysis and Marxist economic theory. Instead, an enduring culture of scrutiny and openness to revising even our most fundamental beliefs in light of new evidence is vital for expanding the frontiers of human knowledge.Popper used the example of Einstein's revolutionary theory of relativity displacing long-held notions of absolute space and time to illustrate how truly transformative scientific breakthroughs often originate from admitting the flaws in existing paradigms. He argued that if Einstein had merely sought confirmations of Newton's teachings, he would never have conceived such a radically different perspective.Of course, not all students may find Popper's philosophy of science intuitive or appealing. Critics argue that his emphasis on seeking falsifications rather than verifications is an unnecessary constraint that could actually impede scientific progress. If weare overly preoccupied with finding reasons why theories might be wrong, we may fail to thoroughly explore and expand upon their useful applications and predictive power.Additionally, some contend that Popper's falsification principle sets an unrealistic standard, as it is effectively impossible to definitively rule out any theory with 100% certainty through a finite set of observations or experiments. There will always be some possibility that future evidence could revive a theory previously considered falsified.Nonetheless, Popper's overarching emphasis on maintaining a critical, skeptical attitude and willingness to challenge even our most deeply held assumptions resonates with many scholars. His philosophy reminds us that no scientific theory, no matter how comprehensive or well-established, should be blindly accepted as infallible truth. There must always be space for new evidence and ideas to emerge that could revolutionize our understanding, or even expose folly in long-accepted tenets.As students, we would be wise to embrace Popper's humble perspective that all scientific knowledge is inherently provisional, incomplete, and open to revision through a process of continual error-correction. Each theory we learn represents the culmination of accumulated scrutiny withstanding arduousattempts at falsification by generations of inquisitive minds. However, these theories should not be dogmas etched in stone, but subjected to the same critical evaluation that allowed them to displace previous flawed models.Ultimately, Popper viewed science not as a linear pursuit of proving universal truths, but as an evolutionary process of discarding errors and developing ever-closer approximations of how the natural world operates. By treating even our most compelling theories as potential sources of error to scrutinize, we open the doors for superior explanations to emerge and our collective understanding to progress. Science advances not through perfection, but by paradoxically admitting the permanence of imperfection in our theories, and seeking to identify and correct those flaws.篇3From Error to Truth: Karl Popper's Revolutionary View on Scientific DiscoveryAs students of science, we are often taught that the scientific method is a logical and systematic process of formulating hypotheses, conducting experiments, and using empirical evidence to accept or reject those hypotheses. However, therenowned philosopher Karl Popper challenged this conventional view, proposing a radically different perspective on how scientific discoveries are made. In his seminal work, "The Logic of Scientific Discovery," Popper argued that scientific progress is not a linear accumulation of knowledge but rather a continuous process of trial and error, where theories are constantly subjected to rigorous testing and potential falsification.At the heart of Popper's philosophy lies the principle of falsifiability. According to Popper, a theory or hypothesis is scientific only if it is formulated in such a way that it can be empirically tested and potentially proven false. This criterion distinguishes science from pseudoscience, which often relies on unfalsifiable claims or explanations that are immune to refutation. Popper believed that the true essence of science lies not in the process of verifying theories but in the earnest attempt to falsify them through rigorous experimentation and observation.Popper's revolutionary idea challenged the widely accepted inductivist approach, which held that scientific knowledge is built upon repeated observations and the gradual accumulation of evidence supporting a theory. Instead, he proposed a deductive approach, where scientists start with bold conjectures orhypotheses and then subject them to the most stringent tests possible in an attempt to find flaws or counterexamples. If a theory withstands these tests, it is provisionally accepted, but it is always open to further scrutiny and potential falsification by new evidence.One of the key implications of Popper's philosophy is that scientific progress is driven by a continuous cycle of proposing theories, subjecting them to critical tests, and refining or replacing them with better explanations when they are falsified. This process is often referred to as the "trial and error" method, where scientists learn from their mistakes and use them as stepping stones to advance their understanding of the world.Popper's ideas have had a profound impact on the philosophy of science and have influenced generations of scientists across various disciplines. His emphasis on falsifiability has encouraged researchers to formulate precise and testable hypotheses, rather than vague or unfalsifiable claims. It has also fostered a culture of critical thinking and skepticism, where theories are constantly challenged and scrutinized, rather than accepted dogmatically.Moreover, Popper's philosophy has shed light on the inherent fallibility of scientific knowledge. Unlike the traditionalview of science as a steady accumulation of proven facts, Popper recognized that all scientific theories are provisional and subject to revision or replacement in light of new evidence or better explanations. This acknowledgment of the provisional nature of scientific knowledge has encouraged humility andopen-mindedness among scientists, as well as a willingness to adapt and embrace new paradigms when warranted.Critics of Popper's philosophy have argued that the strict application of falsifiability can lead to the premature rejection of promising theories or the inability to falsify certain theories due to practical limitations. Additionally, some have pointed out that the process of theory formulation and testing is not as clear-cut as Popper suggested, and that various psychological, social, and historical factors can influence the development of scientific knowledge.Despite these criticisms, Popper's ideas remain influential and have inspired a rich tradition of critical rationalism in science. His emphasis on the fallibility of human knowledge and the importance of subjecting theories to rigorous testing has contributed to the self-correcting nature of science and its ability to overcome dogmatism and stagnation.As students of science, we can learn valuable lessons from Popper's philosophy. First, we must embrace a spirit of critical inquiry and be willing to challenge our own preconceptions and biases. Secondly, we should strive to formulate precise and falsifiable hypotheses, recognizing that the true progress of science lies in the potential for our theories to be refuted and replaced by better explanations. Thirdly, we should cultivate a sense of humility and acknowledge that our current understanding of the world is always provisional and subject to revision in the face of new evidence or insights.By embracing Popper's revolutionary perspective, we can appreciate the dynamic and self-correcting nature of science, where discoveries emerge not from the gradual accumulation of facts but from the continuous cycle of proposing bold conjectures, subjecting them to rigorous testing, and learning from our errors. It is through this process of trial and error that we can advance our understanding of the world and move ever closer to the elusive goal of truth.。
用于人工智能的Prolog语言
在示例程序中,添加有关性别的信息: Predicates
parent(symbol)
clauses parent(pam,bo
b). parent(tom,bo
b).
male(tom). male(bob). male( jim).
(3)关系的对象可以是常量 (如:tom,ann) ,也可以是变量(如:X,Y)。
(4)向系统提出问题,可由一个或多个目标组成。
(5)一个Prolog 程序由一些子句(clauses)组成。每个子句用句号结束。
(6)对一个问题的回答是肯定的或者是否定的,取决于相应的目标是否满足。 在肯定回答的情况下,说相应的目标是可满足的,而且这个目标成功了。 否则,说目标不可满足,目标失败了。
parent(Z,X), parent(Z,Y), female(X).
sister(X,pat).
改进的sister规则:
predicates
parent(symbol,symbol)
sister(symbol,symbol)
female(symbol)
male(symbol)
different(symbol,sym
R("zhsan").
4.2 家庭关系程序示例
下图是一个表示家庭关系的实例:
用Prolog 语句表示为:
Pam
Tom
).
Bob
Liz
).
Ann
Pat
Jim
parent(pam,bob
parent(tom,bob
parent(tom,liz). parent(bob,ann). parent(bob,pat).
Prolog Programming for Artificial Intelligence
Questions:
Is Bob a parent of Pat? ?- parent( bob, pat). ?- parent( liz, pat). ?- parent( tom, ben). Who is Liz‟s parent? ?- parent( X, liz). Who are Bob‟s children? ?- parent( bob, X).
Chapter 1 Introduction to Prolog
5
1.1 Defining relations by facts
Given a whole family tree
pam tom
The tree defined by the Prolog program: parent( pam, bob).
/compilers/prolog.shtml (Free Prolog Compilers and Interpreters ) / (The GNU Prolog web site) /documentation/onlineprolog.sht ml (Online Prolog Tutorials)
10
1.2 Defining relations by rules
Facts:
female( pam). female( liz). female( ann). female( pat). male( tom). male( bob). male( jim).
% Pam is female
Example:
offspring( Y, X) :- parent( X, Y). The rule is general in the sense that it is applicable to any objects X and Y. A special case of the general rule:
Prolog基础
Prolog的一些内建谓词
Prolog提供了一些有用的内建谓词(Builtin Predicates).内建谓词和用户定义谓词 使用方式是类似的,最重要的区别在于: 内建谓词不能出现在事实的主函数符或规 则的规则头部的位置上(因为出现在这个 位置上实际上意味着修改内建谓词的定义)
Prolog的一些内建谓词(续)
Prolog-算术表达式-is操作符
is操作符有两个参数,第二个参数必须是 一个合法的算术表达式,其中所有的变量 都必须是实例化的,第一个参数或者是一 个数字或者是表示数字的变量。
Prolog-运算符-优先级
运算符(Operators)具有优先级 (Precedence)和结合性(Associativity)两 个属性.这两个属性决定一个表达式应该 如何解释。 在Prolog中每个运算符都关联有一个整数 值(SWI-Prolog中取值范围是0~1200)表 示它的优先级。整数值越低优先级越高。
Prolog-目标的执行(续)
如果目标同某条规则的规则头部相匹配,那 么相应的变量实例化被应用在规则体中,规 则体变成了新的需要满足的目标。 规则的头部被认为是可以证明为真(provably true), true),如果它的规则体的所有谓词的合取 (conjunction,逻辑与)是可以证明为真的。 如果目标同程序中的一个事实相匹配,那么 目标的证明就完成了,匹配过程中所做的变 量实例化被返回给用户。 程序中事实和规则的出现顺序是很重要的, Prolog总是试着将当前目标与找到的第一个 可能的事实或规则头部相匹配。
is_bigger(horse,X), f(g(X, _), 7), ‘My Functor’(dog)
在函数符和参数列表的左括号之间不能有任何空 格符 组合项和原子构成了Prolog的谓词(Predicate)
PROLOG程序设计
适合的领域 专家系统、规划和其他AI相关问题的求解, AI相关问题的求解 专家系统、规划和其他AI相关问题的求解, 是智能程序设计语言中具有代表性且应用较多 的一种语言。 的一种语言。 自然语言理解、机器定理证明等方面。 自然语言理解、机器定理证明等方面。 和其它语言一样, 和其它语言一样,可以轻松地开发出各种 应用,包括数据库和WEB应用。 应用,包括数据库和WEB应用。 WEB应用
2、规则:从给出的事件推断出的凭据
规则由几个互相有依赖性的简单句(谓词)组成, 规则由几个互相有依赖性的简单句(谓词)组成, 用来描述事实之间的依赖关系。从形式上看, 用来描述事实之间的依赖关系。从形式上看,规则 由左边表示结论的后件谓词和右边表示条件的前提 谓词组成。 谓词组成。 例如,规则 例如, bird(X):bird(X):-animal(X),has(X,feather). 表示凡是动物并且有羽毛,那么它就是鸟。 表示凡是动物并且有羽毛,那么它就是鸟。 travels(liying,X):travels(liying,X):- travels(zhangming,X). 表示张明到哪里旅行,李英就到那里旅行。 表示张明到哪里旅行,李英就到那里旅行。
逻辑型程序设计语言PROLOG详细教程
逻辑型程序设计语言PROLOG教程2.3. 1逻辑型程序设计语言PROLOGPROLOG的语句PROLOG语言只有三种语句,分别称为事实、规则和问题。
1.事实(fact)格式: <谓词名>(<项表>).功能一般表示对象的性质或关系。
其中谓词名是以小写英文字母打头的字母、数字、下划线等组成的字符串,项表是以逗号隔开的项序列。
例如:student(john).like( mary ,music).表示“约翰是学生”和“玛丽喜欢音乐”。
2. 规则(rule)格式:<谓词名>(<项表>):-<谓词名>(<项表>){,<谓词名>(<项表>)}.功能: 一般表示对象间的因果关系、蕴含关系或对应关系。
其中“:-”号表示“if”(也可以直接写为if),其左部的谓词是规则的结论(亦称为头),右部的谓词是规则的前提(亦称为体),{}表示零次或多次重复,逗号表示and(逻辑与),即规则的形式是一个逻辑蕴含式。
例如:bird(X):-animal(X),has(X,feather).grandfather(X,Y):-father(X,Z),father(Z,Y).第一条规则表示“如果X是动物,并且X有羽毛,则X是鸟”;第二条规则就表示“X 是Y的祖父,如果存在Z,X是Z的父亲并且Z又是Y的父亲”。
3.问题(question)格式: ?-<谓词名>(<项表>){,<谓词名>(<项表>)}.功能表示用户的询问,它就是程序运行的目标。
例如:?-student(john).?-like(mary,X).2.3. 2 PROLOG程序PROLOG程序一般由一组事实、规则和问题组成。
问题是程序执行的起点,称为程序的目标。
例如下面就是一个PROLOG程序。
likes(bell,sports).likes(mary,music).likes(mary,sports).likes(jane ,smith).friend(john,X):-likes(X,reading),likes(X,music).friend(john,X):-likes(X,sports),likes(X,music).?-friend(john,Y).可以看出,这个程序中有四条事实、两条规则和一个问题。
Prolog Lecture 2
first([H|_],H). last([H],H). last([_|T],H) :- last(T,H).
Make sure that you (eventually) understand what this shows you about Prolog's list representation:
11
Arithmetic Expressions
(AKA “Why Prolog is a bit special/different/surprising”) What happens if you ask Prolog: ?- A = 1+2.
12
Arithmetic equality is not the same as Unification
write_canonical([1,2,3]).
8
Question
பைடு நூலகம்
last([H],H). last([_|T],H):last(T,H).
What happens if we ask: last([],X). ?
a) pattern-match exception b) Prolog says no c) Prolog says yes, X = [] d) Prolog says yes, X = ???
?- A is 1+2. A = 3 Yes ?- A is money+power. ERROR: is/2: Arithmetic: `money/0' is not a function
Ensure that you can explain what will happen here: ?- 3 is 1+2 ?- 1+2 is 3
《人工智能》课后习题答案
《人工智能》课后习题答案第一章绪论1.1答:人工智能确实是让机器完成那些假如由人来做则需要智能的情况的科学。
人工智能是相关于人的自然智能而言,即用人工的方法和技术,研制智能机器或智能系统来仿照延伸和扩展人的智能,实现智能行为和“机器思维”,解决需要人类专家才能处理的问题。
1.2答:“智能”一词源于拉丁“Legere”,意思是收集、聚拢,智能通常用来表示从中进行选择、明白得和感受。
所谓自然智能确实是人类和一些动物所具有的智力和行为能力。
智力是针对具体情形的,依照不同的情形有不同的含义。
“智力”是指学会某种技能的能力,而不是指技能本身。
1.3答:专家系统是一个智能的运算机程序,他运用知识和推理步骤来解决只有专家才能解决的复杂问题。
即任何解题能力达到了同领域人类专家水平的运算机程序度能够称为专家系统。
1.4答:自然语言处理—语言翻译系统,金山词霸系列机器人—足球机器人模式识别—Microsoft Cartoon Maker博弈—围棋和跳棋第二章知识表达技术2.1解答:(1)状态空间(State Space)是利用状态变量和操作符号,表示系统或问题的有关知识的符号体系,状态空间是一个四元组(S,O,S0,G):S—状态集合;O—操作算子集合;S0—初始状态,S0⊂S;G—目的状态,G⊂S,(G可若干具体状态,也可满足某些性质的路径信息描述)从S0结点到G结点的路径被称为求解路径。
状态空间一解是一有限操作算子序列,它使初始状态转换为目标状态:O1 O2 O3 OkS0→−−−S1→−−−S2→−−−……→−−−G其中O1,…,Ok即为状态空间的一个解(解往往不是唯独的)(2)谓词逻辑是命题逻辑的扩充和进展,它将原子命题分解成客体和谓词两个部分。
与命题逻辑中命题公式相对应,谓词逻辑中也有谓词(命题函数)公式、原子谓词公式、复合谓词公式等概念。
一阶谓词逻辑是谓词逻辑中最直观的一种逻辑。
(3)语义网络是一种采纳网络形式表示人类知识的方法。
二分法的英文解释
二分法的英文解释The binary search algorithm is a fundamental concept in computer science and mathematics. It is a powerful and efficient technique used to locate a specific item within a sorted collection of data. In this article, we will delve into the details of the binary search algorithm, exploring its mechanics, applications, and complexities.At its core, the binary search algorithm operates by repeatedly dividing the search interval in half. It begins by comparing the target value with the middle element of the array. If the target value matches the middle element, the search is complete, and the index of the element is returned. If the target value is less than the middle element, the search continues in the lower half of the array. Conversely, if the target value is greater than the middle element, the search proceeds in the upper half of the array. This process is repeated until the target value is found or until the search interval is empty.One of the key requirements for the binary search algorithm to work is that the data collection must be sorted in ascending order. This prerequisite enables the algorithm to exploit the properties of the sorted array, significantly reducing the search space with each iteration. By systematically eliminating half of the remaining elements at each step, binary search achieves a logarithmic time complexity of O(log n), where n is the number of elements in the array. This efficiency makes binary search particularly suitable for large datasets where linear search algorithms would be impractical.The binary search algorithm finds its applications in various domains, including but not limited to:1. Searching: Binary search is commonly used to quickly locate elements in sorted arrays or lists. Its efficiency makes it indispensable for tasks such as searching phone directories, dictionaries, or databases.2. Sorting: While binary search itself is not a sorting algorithm, it can be combined with sorting algorithms like merge sort or quicksort to efficiently search for elements in sorted arrays.3. Computer Science: Binary search serves as a foundational concept in computer science education, providing students with a fundamental understanding of algorithm design and analysis.4. Game Development: Binary search is utilized in game development for tasks such as collision detection, pathfinding, and AI decision-making.Despite its efficiency and versatility, binary search does have certain limitations. One significant constraint is that the data collection must be sorted beforehand, which can incur additional preprocessing overhead. Additionally, binary search is not well-suited for dynamic datasets that frequently change, as maintaining the sorted order becomes non-trivial.In conclusion, the binary search algorithm is a powerful tool for efficiently locating elements within sorted arrays. Its logarithmic time complexity and widespread applications make it a fundamental concept in computer science and mathematics. By dividing the search space in half with each iteration, binary search demonstrates the elegance and efficiency of algorithmic design. Whether used in searching, sorting, or other computational tasks, the binary search algorithm remains a cornerstone of algorithmic problem-solving.。
The Pros and Cons of Globalization
The Pros and Cons of Globalization Globalization is a complex phenomenon that has both positive and negative impacts on various aspects of society. On one hand, globalization has led to increased interconnectedness and interdependence among countries, facilitating the exchange of goods, services, and ideas on a global scale. This has resulted in economic growth, technological advancements, and cultural exchange, ultimately leading to a more interconnected and diverse world. However, globalization has also been criticized for exacerbating income inequality, eroding local cultures, and contributing to environmental degradation. In this essay, I will explore the pros and cons of globalization from multiple perspectives. One of the keybenefits of globalization is the economic growth it has spurred in many countries. Globalization has opened up new markets for businesses, allowing them to reach a wider customer base and increase their profits. This has led to increased investment, job creation, and overall economic development in many parts of the world. Additionally, globalization has facilitated the transfer of technology and knowledge across borders, enabling countries to improve their productivity and competitiveness in the global market. As a result, many developing countries have been able to lift millions of people out of poverty and improve their standards of living. Furthermore, globalization has promoted cultural exchange and diversity by breaking down barriers between countries and enabling people to connect and communicate with individuals from different backgrounds. This has led to the spread of ideas, values, and traditions, enriching the cultural landscape of societies around the world. People are now able to access information and entertainment from different cultures, broadening their perspectives and fostering a greater sense of global citizenship. In this way, globalization has contributed to a more interconnected and tolerant world where diversity is celebrated and respected. However, globalization has also had negative consequences,particularly in terms of income inequality and exploitation. As businesses expand their operations globally, they often seek to minimize costs by outsourcing labor to countries with lower wages and fewer labor protections. This has led to the exploitation of workers in developing countries, who are often subjected to poor working conditions, low pay, and long hours. Additionally, globalization haswidened the gap between the rich and the poor within countries, as those with the resources to take advantage of global markets have seen their wealth increase, while those without such resources have been left behind. Moreover, globalization has been criticized for its impact on the environment, as increased trade and consumption have led to greater resource extraction, pollution, and deforestation. The pursuit of economic growth and profit has often come at the expense of the planet, leading to climate change, loss of biodiversity, and other environmental crises. As countries strive to compete in the global market, they may prioritize short-term economic gains over long-term sustainability, further exacerbating environmental degradation. In this way, globalization has contributed to the deterioration of the natural world, threatening the well-being of future generations. In conclusion, globalization is a double-edged sword that has both benefits and drawbacks. While it has promoted economic growth, cultural exchange, and technological advancement, it has also exacerbated income inequality, eroded local cultures, and contributed to environmental degradation. As we navigate the complexities of globalization, it is important to consider the impact of our actions on people, communities, and the planet. By promoting fair trade, sustainable development, and cultural diversity, we can work towards a more equitable and sustainable global society.。
关于逻辑与悖论的英语作文
关于逻辑与悖论的英语作文Logic is a fundamental concept in philosophy and mathematics, guiding our reasoning and decision-making processes. It provides us with a set of principles to determine what is true and what is false, allowing us to make sense of the world around us. However, despite its importance, logic can sometimes lead to paradoxes and contradictions that challenge our understanding of reality and truth.逻辑是哲学和数学中的一个基本概念,指导我们的推理和决策过程。
它为我们提供了一套原则,以确定什么是真实的,什么是虚假的,从而使我们能够理解周围的世界。
然而,尽管它的重要性,逻辑有时会导致悖论和矛盾,挑战我们对现实和真理的理解。
One of the most famous paradoxes in logic is the Liar Paradox, which involves a statement that says "This statement is false." If the statement is true, then it must be false, but if it is false, then it must be true. This paradox highlights the inherent self-referential nature of language and logic, questioning the very foundations of our understanding of truth and reality.逻辑中最著名的悖论之一是谎言悖论,它涉及一个说“这个声明是虚假的”的陈述。
prolog详解
Artificial Intelligence = to perceive, reason and act
– LISP/Prolog concerned mostly with reasoning – Symbolic manipulation of (model of) world
– an atom does not have a value – only one atom with any given name (no local scope, only global)
Named atoms start with lower-case letter lower– may contain letters (UPPER and lower case), numbers & underscores
Syntax of Prolog Facts
Consist of functor…
– A name of the predicate
parent mark, alex
…and arguments Arguments in (parentheses)…
– Right up against the functor
Some Predicates to Start With
?- help. ?- help(help). ?- apropos(help). ?- consult(‘family_1.pl’). ?- [‘family_1.pl’]. ?- edit(‘family_1.pl’). ?- [user]. ?- halt. % general help % help on … % help available ... % load a file % ditto % edit/reload file % enter facts interactively % exit Prolog
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
ProbLog:A Probabilistic Prolog and its
Application in Link Discovery∗
Luc De Raedt,Katholieke Universiteit Leuven
Angelika Kimmig,PhD Student at University of Freiburg
Hannu Toivonen,University of Helsinki
Motivated by the real-life application of mining large biological networks where edges are labeled with probabilities,we introduce ProbLog,a probabilistic extension of Prolog.A ProbLog program defines a distribution over logic programs by specifying for each clause the probability that it belongs to a randomly sampled program,and these probabilities are mutually independent.The semantics of ProbLog is then defined by the success probability of a query,which corresponds to the probability that the query succeeds in a randomly sampled program.
ProbLog is closely related to other probabilistic logics which have been developed over the past two decades to face the general need of combining deductive abilities with reasoning about uncertainty.Prominent examples include e.g.PHA[3],PRISM[5], SLPs[2],MLNs[4]and probabilistic Datalog(pD)[1].All those frameworks attach probabilities to logical formulae,most often definite clauses(or some variant thereof). In addition,they often impose various constraints on probabilities which facilitate the computation of the probability of queries by essentially excluding the possibility that certain combinations of facts are simultaneously true.On the other hand,it seems that there are–despite a great potential–still only few real-life applications of these representations.We believe that one reason for this might well be that the assumptions are too strong and sometimes hard to manage by the user.ProbLog therefore assumes that all probabilities are mutually independent,which holds for many applications as e.g.link discovery in network structures with probabilistic edges.
Given a ProbLog program and a query,the inference task is to compute the success probability of the query,i.e.the probability that the query succeeds in a randomly sampled non-probabilistic subprogram of the ProbLog program.We show that the success probability can be computed as the probability of a monotone DNF formula of binary random variables.Motivated by the recent advances in using binary decision diagrams(BDDs)for dealing with Boolean functions,we develop a BDD approach that can effectively solve reasonably complex queries.Furthermore,we introduce an approximation algorithm for computing the success probability.To demonstrate the practical usefulness of the approach,we report on experiments using this algorithm in networks of biological concepts(genes,proteins,phenotypes,etc.)extracted from large public databases.Obviously,it is straightforward to transfer ProbLog to other link and network mining domains.
∗To appear at IJCAI2007
References
[1]Norbert Fuhr.Probabilistic datalog:Implementing logical information retrieval for
advanced applications.Journal of the American Society of Information Science, 51(2):95–110,2000.
[2]S.H Muggleton.Stochastic logic programs.In L.De Raedt,editor,Advances in
Inductive Logic Programming.IOS Press,1996.
[3]D.Poole.Probabilistic Horn abduction and Bayesian networks.Artificial Intelli-
gence,64:81–129,1993.
[4]M.Richardson and P.Domingos.Markov logic networks.Machine Learning,
62:107–136,2006.
[5]T.Sato and Y.Kameya.Parameter learning of logic programs for symbolic-
statistical modeling.Journal of Artificial Intelligence Research,15:391–454,2001.
2。