首页 > 其他分享 >COMP3411/9814 人工智能

COMP3411/9814 人工智能

时间:2023-04-05 14:00:13浏览次数:39  
标签:COMP3411 9814 clause two will 人工智能 coffee new clauses


COMP3411/9814 Artificial Intelligence
Term 1, 2023
Assignment 3 – Planning and Machine Learning
Due: Week 10 - 10pm Friday 21 April
Marks: 10% of final assessment for COMP3411/9814 Artificial Intelligence
Question 1: Planning (4 marks)
Modify the simple planner from the week 7 lecture so that it can solve the planning
problem in the textbook, Poole and Mackworth Section 6.1. Here, there is a robot that
can move around an office building, pickup mail and deliver coffee.
Like the rubbish pickup problem, actions can be representation by a triple:
action(Action, State, NewState)
where the state of the world is represented by a quintuple:
state(RLoc, RHC, SWC, MW, RHM)
• RLoc - Robot Location,
• RHC - Robot Has Coffee,
• SWC - Sam Wants Coffee,
• MW - Mail Waiting,
• RHM - Robot Has Mail
You are required to replace the action specifications by a new set that specify the state
transitions for each of the actions:
• mc - move clockwise
• mcc - move counterclockwise
• puc - pickup coffee
• dc - deliver coffee
• pum - pickup mail
• dm - deliver mail.
Do not alter the planner code, only the action clauses should be replaced.
You should only need to write one clause for each action, however, you might need
some addition clauses to help with the mc and mcc actions. Think about how to
represent the room layout.
Your program should be able to satisfy queries such as:
- id_plan(
state(lab, false, true, false, false),
state(_, _, false, _, _),
Plan).
Plan = [mc, mc, puc, mc, dc]
which asks the robot to get Sam coffee. Note that the values of the state variables, RHC,
SWC, MW, RHM are boolean and we’ve used the constants true and false, to represent
the boolean values. The initial state in this example has the robot in the lab, the robot
does not have any coffee, Sam wants coffee, there is no mail waiting and the robot does
not have any mail. The goal state is where Sam no longer wants coffee. Note that the
anonymous variable, ‘_’, indicates that we don’t care what the other values are.
To test your action specifications, think about how you would ask the robot to pickup
mail. What about if Sam want coffee and there was mail waiting?
Question 2: Inductive Logic Programming (6 marks)
Duce is a program devised by Muggleton [1] to perform learning on a set of
propositional clauses. The system includes 6 operators that transform pairs of clauses
into a new set of clauses. Your task is to write Prolog programs to implement 3 of the 6
operators. One is given as an example to get you started.
Your answers should preserve the order of literals in each clause, as given. Any new
literals should be appended to the end of the clause.
Inter-construction. This transformation takes two rules, with different heads, such as
x <- [b, c, d, e]
y <- [a, b, d, f]
and replaces them with rules
x <- [c, e, z]
y <- [a, f, z]
z <- [b, d]
i.e. we find the intersection of the bodies of the first two clauses, invent a new predicate
symbol, z, and create the clause z ← [b, d]. Create two new clauses which are the
original clauses rewritten to replace [b, d] by z.
To make processing the rules easier, we represent the body of the clause by a list and we
define the operator <- to mean “implied by” or “if’.
A Prolog program to implement inter-construction is given as an example to give you
hints about how to write the two operators.
:- op(300, xfx, <-).
inter_construction(C1 <- B1, C2 <- B2, C1 <- Z1B, C2 <- Z2B, C <- B) :-
C1 \= C2,
intersection(B1, B2, B),
B \= [],
gensym(z, C),
subtract(B1, B, B11),
subtract(B2, B, B12),
append(B11, [C], Z1B),
append(B12, [C], Z2B).
First, we define <- as an operator that will allow us to use the notation x <- y. The
program uses Prolog built-in predicates to perform set operations on lists and to
generate new symbols.
1. The first line the program assumes that the first two arguments are given as
propositional clauses. The remaining three arguments are the output clauses, as in the
example above.
2. inter_construction operates on two clauses that gave different heads, i.e. C1 \= C2.
3. We then find the interaction of the bodies of the clauses and call it, B.
4. gensym is a builtin predicate that creates a new name from a base name. So
gensym(z, C) binds C to z1. Every subsequent call to gensym, with base z, will
create names, z2, z3, …. Calling reset_gensym will restart the numbering sequence.
5. At this point the last argument C <- B = z1<-[b, d] because C is bound to z1 and
B is the intersection [b, d].
6. The bodies Z1B and Z2B, are obtained by subtracting the intersection, B, from B1
and B2 and appending the single element [C]. So we can run the program:
?- inter_construction(x <- [b, c, d, e], y <- [a, b, d, f], X, Y, Z).
X = x<-[c, e, z1],
Y = y<-[a, f, z1],
Z = z1<-[b, d].
obtaining the desired result.
You will write programs for the other three operators, defined below. These programs
can be created from the built-in predicates used in the inter-construction code. So all
you have to do is work out how to combine them. The only other builtin predicate you
may need is to test if one list is a subset of another with subset(X, Y), where X is a
subset of Y.
You can assume that the inputs will always be valid clauses and the lists will always be
non-empty, i.e. with at least one element.
Question 2.1 (2 marks):
Intra-construction. This transformation takes two rules, with the same head, such as
x <- [b, c, d, e]
x <- [a, b, d, f]
and replaces the with rules
x <- [b, d, z]
z <- [c, e]
z <- [a, f]
That is, we merge the two, x, clauses, keeping the intersection and adding a new
predicate, z, that distributes the differences to two new clauses.
- intra_construction(x <- [b, c, d, e], x <- [a, b, d, f], X, Y, Z).
X = x<-[b, d, z1],
Y = z1<-[c, e],
Z = z1<-[a, f].
The predicate should fail if there is no intersection between the two clauses.
Question 2.2 (2 marks):
Absorption. This transformation takes two rules, with the different heads, such as
x <- [a, b, c, d, e]
y <- [a, b, c]
and replaces the with rules
x <- [d, e, y]
y <- [a, b, c]
Note that the second clause is unchanged. This operator checks to see if the body of one
clause is a subset of the other. If it is, the common elements can be removed from the
larger clause and the head of the smaller one appended to the larger one.
- absorption(x <- [a, b, c, d, e], y <- [a, b, c], X, Y).
X = x<-[d, e, y],
Y = y<-[a, b, c].
The predicate should fail if there is the body of the second clause is not a subset of the
body of the first.
Question 2.3 (2 marks):
Truncation. This is the simplest transformation. It takes two rules that have the same
head and simply drops the differences to leave just one rule. For example
x <- [a, b, c, d]
x <- [a, c, j, k]
are replaced by
x <- [a, c]
That is, the body of the new clause is just the intersection of the bodies of the input
clauses.
- truncation(x <- [a, b, c, d], x <- [a, c, j, k], X).
X = x<-[a, c].
The complete Duce algorithm performs a search, looking for combination of these
operators that will lead to the greater compression over the database of examples. Here
compression is measured by the reduction in the number of symbols in the database.
You don’t have to worry about the search algorithm, just implement the operators, as
above.
References
1. Muggleton, S. (1987). Duce, An oracle based approach to constructive induction.
Proceedings of the International Joint Conference on Artificial Intelligence, 287–
292.
Submitting your assignment
This assignment will be marked on functionality in the first instance. However, you
should always adhere to good programming practices in regard to structure, style and
comments. Submissions that score very low in the auto-marking will be examined by a
human marker, and may be awarded a few marks, provided the code is readable.
Your code must work under the version of SWI Prolog used on the Linux machines in
the UNSW School of Computer Science and Engineering. If you develop your code on
any other platform, it is your responsibility to re-test and, if necessary, correct your code
when you transfer it to a CSE Linux machine prior to submission.
This assignment must be submitted through give or WebCMS. You will be notified
when submissions are open.
give cs3411 assign3.pl
• assign3.pl should contain all your Prolog code.
Late submissions will incur a penalty of 5% per day, applied to the maximum mark.
The submission must be your own. Do NOT copy anyone else’s assignment, or send
your assignment to any other student.
Do not leave any testing code on your submitted file.

WX:codehelp mailto: [email protected]

标签:COMP3411,9814,clause,two,will,人工智能,coffee,new,clauses
From: https://www.cnblogs.com/qujava/p/17289320.html

相关文章

  • 人工智能、机器学习、深度学习、数据挖掘、数据分析区分
    在开始学习python大数据之前,先要搞清楚人工智能、机器学习、深度学习、数据挖掘、数据分析都是什么意思。人工智能大家族包含着丰富的内容,分清楚了每一项都是做什么的,才能选对路线。人工智能AI人工智能分为强人工智能和弱人工智能。强人工智能是通过计算机来构造复杂的、拥有与人类......
  • 第三届人工智能,大数据与算法国际学术会议 (CAIBDA 2023)
    第三届人工智能,大数据与算法国际学术会议(CAIBDA2023)​大会官网:http://www.caibda.org/大会时间:2023年6月16-18日大会地点:中国郑州截稿日期:2023年6月10日接受/拒稿通知:投稿后1周内提交检索:EICompendex,Scopus往届检索记录:CAIBDA2021| IEEEXplore | EICompende......
  • 《花雕学AI》07:AI脑洞大开-盘点最火爆人工智能ChatGPT的N多种新颖用法
    本文提纲(呵呵,想必大家都猜到了,它确实是人工智能帮我做的,看起来比较专业吧!)一、引言:介绍ChatGPT是什么,它是基于GPT-3的一个开源的多语言聊天机器人框架,可以生成流畅、有趣、有逻辑的对话。二、正文:分别介绍ChatGPT的N多种新颖用法1、用ChatGPT来写小说、诗歌、歌词等文学作品,展示它......
  • 人工智能运用--我的银行大众客户存款增长预测模型介绍(2)
     特征处理的实现代码如下:#先对年龄缺失值进行处理,这里先按28岁填充处理客户年龄,因为年龄基本服从正态分布,初步考虑分为0-20,20-30,30-40,40-50,50-60,70-80,80-100分别标记为age_class1,......,age_class8'''Train['NTRL_CUST_AGE']=Train['NTRL_CUST_AGE'].fillna(28)Sex_OneHo......
  • 人工智能和大数据案例课程
    人工智能和大数据案例课程......
  • 当人类被人工智能统治的时候会是什么样子?(2)
                这些只是一部分截图,正常情况下无论我怎么和他交流,无论怎样假设,他的回答都是:可是我们来想一想。人创作了人工智能来辅助人类,人类开始依赖人工智能带来的便利。人培训了人工智能,人工智能开始回答人类的各种问题。最后就变成了人工智能开始培......
  • 当人类被人工智能统治的时候会是什么样子?
     这是一个非常复杂和有争议的问题,因为涉及到许多不同的因素和情况。首先,要想像人工智能统治人类,我们必须假设人工智能能够发展到足够的程度,足以完全控制和管理人类的各种系统和设备。在这种情况下,人工智能可能会像一个强大的中央控制器一样管理人类的经济、政治和社会系统。它可......
  • 《花雕学AI》03:我最早接触的人工智能应用,还是要从AI绘画说起
    AI绘画是指利用人工智能技术,根据输入的文本或图片,生成逼真或有创意的图像的过程。AI绘画有很多不同的软件和平台,可以让用户体验到AI的魅力和趣味。AI绘画的历史可以追溯到上世纪70年代,当时一位艺术家哈罗德·科恩开发了一个电脑程序AARON,可以进行绘画创作。4随着计算机技术和深......
  • 好饭不怕晚,Google基于人工智能AI大语言对话模型Bard测试和API调用(Python3.10)
    谷歌(Google)作为开源过著名深度学习框架Tensorflow的超级大厂,是人工智能领域一股不可忽视的中坚力量,旗下新产品Bard已经公布测试了一段时间,毁誉参半,很多人把Google的Bard和OpenAI的ChatGPT进行对比,GoogleBard在ChatGPT面前似乎有些技不如人。事实上,GoogleBard并非对标ChatGPT......
  • rk3568 RK3588开发板人工智能AI摄像头识别功能方案
    迅为RK3568以及RK3588开发板内置独立NPU,RK3588运算能力高达6TOPS,RK3568运算能力高达16TOPS算力支撑,高性能,高算力,高性价比的AI开发方案。   支持INT4/INT8/INT16/FP......