Prolog 人工智能语言中文论坛---打造优质Prolog学习交流园地
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Prolog 人工智能语言中文论坛---打造优质Prolog学习交流园地

一个供Prolog爱好者学习与交流的地方


您没有登录。 请登录注册

关于事件演算(Event Calculus)

2 posters

向下  留言 [第1页/共1页]

1关于事件演算(Event Calculus) Empty 关于事件演算(Event Calculus) 周一 十二月 10, 2012 2:09 pm

ponder2



请问如何在Prolog中实现事件演算,也就是增加时间点属性?谢谢了

2关于事件演算(Event Calculus) Empty 回复: 关于事件演算(Event Calculus) 周一 十二月 10, 2012 4:05 pm

yauhsien



ponder2 写道:请问如何在Prolog中实现事件演算,也就是增加时间点属性?谢谢了
貌似在英文维基百科有公式,照着写应该可以用。

http://yauhsien.wordpress.com

3关于事件演算(Event Calculus) Empty 回复: 关于事件演算(Event Calculus) 周五 十二月 14, 2012 6:06 pm

yauhsien



看了像 http://www.doc.ic.ac.uk/~mpsha/ECExplained.pdf 这介绍,我觉得至少要定义三项:动作、状态、时间。以论文中提到的 initiates(A, B, T) 。 A 就是一个可以呼叫的谓词。 B 代表状态,大概是用原子代表即可。 T 是时间。

时间要定义先後大小,才可以表达 T1 < T2 这句述语。像如果用 1976/8/16 这样表示日期,那麽表达二个日期先後,就要自己定义
代码:
 date_before(Y/M/D, Y1/M1/D1) :- ...

若是我写起来,大概走这个方向
代码:
date_before(Y/M/D, Y1/M1/D1) :- is_date(Y/M/D),
    is_date(Y1/M1/D1),
    (Y < Y1; Y =:= Y1, M < M1; Y =:= Y1, M =:= M1, D < D1).
initiates(Action, _Fluent/Status, _Time) :- call(Action),
    Status = on.
terminates(Action, _Fluent/Status, _Time) :- call(Action),
    Status = off.
initiallyp(_Fluent/Status) :- Status = off.
holdsAt(Fluent/Status, _Time) :- initiallyp(Fluent/Status),
    not(clipped(0, Fluent/Status, Time)).

不过这可能不够,还需要用解释器方式写
代码:
process(holdsAt(F,T), Result) :-
    process(initiallyp(F), Result1),
    process(not(clipped(0, F, T)), Result2),
    append(Result1, Result2, Result).
process(initiallyp(F), [[[[], F1, 0]], true]) :- Fluent/_Status = F,
    F1 = Fluent/on.
process(not(G), [Result, Output]) :- process(G, [Result1, Output1]),
    (Output1 -> Result = []; not(Output1) -> Result = Result1).



http://yauhsien.wordpress.com

返回页首  留言 [第1页/共1页]

您在这个论坛的权限:
不能在这个论坛回复主题