creep

Prolog findall infinite loop

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a predicate that asserts things. When I use a findall it goes into an infinite loop. assertarv([N|R]):- assert(veiculos_troncos(N)), assertarv(R). assertarv([]). When I use findall(A,veiculos_troncos(A),NTr) , after having used the above predicate to assert many points (coordenates). This is what I get(using findall): Exit: (22) veiculos_troncos((-7, 6)) ? creep Redo: (22) veiculos_troncos(_G6719) ? creep Exit: (22) veiculos_troncos((-6, 6)) ? creep Redo: (22) veiculos_troncos(_G6719) ? creep Exit: (22) veiculos_troncos((-4, 4)) ?

Definition of a path/trail/walk

匿名 (未验证) 提交于 2019-12-03 01:33:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Many predicates define some kind of an acyclic path built from edges defined via a binary relation, quite similarly to defining transitive closure . A generic definition is thus called for. Note that the notions defined in graph theory do not readily match what is commonly expected. Most notably, we are not interested in the edges' names. Worse, also graph theory has changed a bit, introducing the notion of walk , noting Traditionally, a path referred to what is now usually known as an open walk. Nowadays, when stated without any

JS的面向对象与原型

∥☆過路亽.° 提交于 2019-11-26 12:49:09
const yoshi = { skulk: true }; const hattori = { sneak: true }; const kuma = { creep: true }; ⇽--- 创建3个带有属性的对象 assert("skulk" in yoshi, "Yoshi can skulk"); assert(!("sneak" in yoshi)), "Yoshi cannot sneak"); assert(!("creep" in yoshi)), "Yoshi cannot creep"); ⇽--- yoshi对象只能访问自身的属性skulk Object.setPrototypeOf(yoshi, hattori); ⇽--- Object. setProto-typeOf方法, 将对象hattori设置为yoshi对象的原型 assert("sneak" in yoshi, "Yoshi can now sneak"); ⇽--- 通过将hattori对象设置为yoshi对象的原型, 现在yoshi可以访问hattori对象的属性 assert(!("creep" in hattori)), "Hattori cannot creep"); ⇽--- 目前hattori对象还不具有属性creep Object.setPrototypeOf(hattori