所以我创建了这个简单的AI代码,我想在我的代码中添加一个简单的乘法数学,这样就完成了
domains
bonus = integer
predicates
crew_db(string, integer, string) - nondeterm (o,o,o)
absensi_crew(string, symbol) - nondeterm (o,o), (i,i)
posisi_terdaftar(string, symbol) - nondeterm (o,o), (i,i)
terima_gaji(string) - nondeterm (o,i,i,o)
tambah_bonus(bonus,bonus,bonus) - procedure (i,i,o)
clauses
crew_db("Muhammad", 18, "Bantaeng, 28 November 1998").
crew_db("Irvan", 20, "Bantaeng, 28 November 1998").
crew_db("Jaya", 21, "Bantaeng, 28 November 1998").
absensi_crew("Muhammad",aman).
absensi_crew("Irvan",aman).
absensi_crew("Jaya",tidak).
posisi_terdaftar("Muhammad",aktif).
posisi_terdaftar("Irvan",aktif).
posisi_terdaftar("Jaya",tidak).
terima_gaji(TesBebasTernyata):-
crew_db(TesBebasTernyata,_,_),
absensi_crew(TesBebasTernyata,aman),
posisi_terdaftar(TesBebasTernyata,aktif).
tambah_bonus(A,B,Bonus):-
Bonus=A*B.
goal
terima_gaji(Crew_Yang_Di_Gaji_Bulan_Ini),tambah_bonus(45000,2,Bonus).
当我检查Prolog的目标时,它失败并在流模式中指出错误的参数数量
答案 0 :(得分:0)
在条款
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.2.1/js/bootstrap.min.js"></script>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Praesentium, corporis consectetur odit fuga incidunt nostrum soluta qui voluptatem iusto illo aperiam ex voluptatum, dolores reprehenderit temporibus repellendus voluptates velit corrupti!l</p>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalLong">
Launch demo modal
</button>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Praesentium, corporis consectetur odit fuga incidunt nostrum soluta qui voluptatem iusto illo aperiam ex voluptatum, dolores reprehenderit temporibus repellendus voluptates velit corrupti!l</p>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Praesentium, corporis consectetur odit fuga incidunt nostrum soluta qui voluptatem iusto illo aperiam ex voluptatum, dolores reprehenderit temporibus repellendus voluptates velit corrupti!l</p>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Praesentium, corporis consectetur odit fuga incidunt nostrum soluta qui voluptatem iusto illo aperiam ex voluptatum, dolores reprehenderit temporibus repellendus voluptates velit corrupti!l</p>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Praesentium, corporis consectetur odit fuga incidunt nostrum soluta qui voluptatem iusto illo aperiam ex voluptatum, dolores reprehenderit temporibus repellendus voluptates velit corrupti!l</p>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Praesentium, corporis consectetur odit fuga incidunt nostrum soluta qui voluptatem iusto illo aperiam ex voluptatum, dolores reprehenderit temporibus repellendus voluptates velit corrupti!l</p>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Praesentium, corporis consectetur odit fuga incidunt nostrum soluta qui voluptatem iusto illo aperiam ex voluptatum, dolores reprehenderit temporibus repellendus voluptates velit corrupti!l</p>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Praesentium, corporis consectetur odit fuga incidunt nostrum soluta qui voluptatem iusto illo aperiam ex voluptatum, dolores reprehenderit temporibus repellendus voluptates velit corrupti!l</p>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Praesentium, corporis consectetur odit fuga incidunt nostrum soluta qui voluptatem iusto illo aperiam ex voluptatum, dolores reprehenderit temporibus repellendus voluptates velit corrupti!l</p>
<p>Lorem ipsum dolor sit, amet consectetur adipisicing elit. Praesentium, corporis consectetur odit fuga incidunt nostrum soluta qui voluptatem iusto illo aperiam ex voluptatum, dolores reprehenderit temporibus repellendus voluptates velit corrupti!l</p>
<div class="modal fade" id="exampleModalLong" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">CUSTOM LINK MAKER</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form>
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputEmail4">Email</label>
<input type="email" class="form-control" id="inputEmail4" placeholder="Email">
</div>
<div class="form-group col-md-6">
<label for="inputPassword4">Password</label>
<input type="password" class="form-control" id="inputPassword4" placeholder="Password">
</div>
</div>
<div class="form-group">
<label for="inputAddress">Address</label>
<input type="text" class="form-control" id="inputAddress" placeholder="1234 Main St">
</div>
<div class="form-group">
<label for="inputAddress2">Address 2</label>
<input type="text" class="form-control" id="inputAddress2" placeholder="Apartment, studio, or floor">
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputCity">City</label>
<input type="text" class="form-control" id="inputCity">
</div>
<div class="form-group col-md-4">
<label for="inputState">State</label>
<select id="inputState" class="form-control">
<option selected>Choose...</option>
<option>...</option>
</select>
</div>
<div class="form-group col-md-2">
<label for="inputZip">Zip</label>
<input type="text" class="form-control" id="inputZip">
</div>
</div>
<div class="form-group">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="gridCheck">
<label class="form-check-label" for="gridCheck">
Check me out
</label>
</div>
</div>
<button type="submit" class="btn btn-primary">Sign in</button>
</form>
</div>
</div>
</div>
</div>
你有
terima_gaji(TesBebasTernyata):-
crew_db(TesBebasTernyata,_,_),
absensi_crew(TesBebasTernyata,aman),
posisi_terdaftar(TesBebasTernyata,aktif).
但是你的事实是
crew_db(TesBebasTernyata,_,_)
请注意,这些子句的论点位置为三个,而事实为四个。
更改
crew_db("Muhammad", 18, "Bantaeng, 28 November 1998").
crew_db("Irvan", 20, "Bantaeng, 28 November 1998").
crew_db("Jaya", 21, "Bantaeng, 28 November 1998").
到
crew_db(TesBebasTernyata,_,_)
由于我没有Visual Prolog,因此无法使用Visual Prolog测试此答案。