Actualy问题说,所有,我只需要测试.因此,每天进行某种类型的演示或4-5次免费交易将会成功.
不寻找任何花哨的东西.
有什么免费的吗?
我必须在prolog中模拟家谱.我有对称谓词的问题. 事实:
parent(x,y).
male(x).
female(y).
age(x, number).
Run Code Online (Sandbox Code Playgroud)
规则:
blood_relation让我头痛.这就是我所做的:
blood_relation(X,Y):-ancestor(X,Y).
blood_relation(X,Y):-uncle(X,Y);brother(X,Y);sister(X,Y);(mother(Z,Y),sister(X,Z));(father(Z,Y),sister(X,Z));(father(Z,Y),brother(X,Z)).
blood_relation(X,Y):-uncle(X,Z),blood_relation(Z,Y).
Run Code Online (Sandbox Code Playgroud)
我得到了令人满意的结果(我有双版画 - 我可以解决这个问题),问题是我希望这种关系是对称的.现在不是.
blood_relation(johns_father, joh):yes
blood_relation(john,johns_father): no
Run Code Online (Sandbox Code Playgroud)
所以..有办法解决这个问题.我需要查询:所有不在blood_relation中的对..
第一个声明应该满足什么样的关系?blood_relation(X,Y): - blood_relation(X,Y).
抱歉..这是一个糟糕的复制/粘贴.. ..
blood_relation(X,Y):-ancestor(X,Y).
Run Code Online (Sandbox Code Playgroud)
现在修复上面.
这是其他规则:
father(X,Y):-parent(X,Y),male(X).
mother(X,Y):-parent(X,Y),female(X).
brother(X,Y):-parent(Z,X),parent(Z,Y),male(X).
sister(X,Y):-parent(Z,X),parent(Z,Y),female(X).
grandFather(X,Y):-parent(Z,Y),parent(X,Z),male(X).
grandMother(X,Y):-parent(Z,Y),parent(X,Z),female(X).
uncle(X,Y):-mother(Z,Y),brother(X,Z).
ancestor(X,Y):-ancestor(X,Y).
ancestor(X,Y):-parent(X,Z),ancestor(Z,Y).
Run Code Online (Sandbox Code Playgroud)
母亲的兄弟在叔叔的定义.这有点奇怪.我已经制定了需要实施的规则,除此之外我不知道如何实施规则.我只是困惑.
知道如何制作blood_relation对称吗?这not_blood_relation是一个新规则.我需要查询.这个真的让我很头疼.也许是因为关系被写成废话.
并没有更多的事实.就这样.所有规则和所有事实.
查询.. not(blood_relation(X,Y))不起作用,我真的不知道为什么.例如查询:
age(X,Y), Y>18,
not(parent(X,Z)),write(X),nl,fail.
Run Code Online (Sandbox Code Playgroud)
工作得很好
当我尝试使用GenerateSchema..i将映射表部署到数据库时获取异常:
NHibernate.HibernateException:无法从NHibernate.Driver.SQLiteDriver创建驱动程序.---> System.Reflection.TargetInvocationException:调用目标抛出了异常.---> NHibernate.HibernateException:找不到程序集SQLite.NET中的IDbCommand和IDbConnection实现.确保程序集SQLite.NET位于应用程序目录或全局程序集缓存中.如果程序集位于GAC中,请使用应用程序配置文件中的元素指定程序集的全名.
我尝试用NHibernate.Driver.SQLiteDriver解决这个问题 - > NHibernate.Driver.SQLite20Driver ..但没有工作..我添加了所有NHibernate,Sqlite..Linfu的引用...
谁有想法解决?
在分析域对象的生命周期时,聚合是对象分组的基本元素.我在C#中实现aggregetes时遇到问题.
一个简短的例子,有几个类,会非常有帮助.或者这个主题的任何链接.
c# ×2
aggregate ×1
credit-card ×1
database ×1
nhibernate ×1
payment ×1
predicate ×1
prolog ×1
sqlite ×1
symmetric ×1