-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lucid Meets Prolog extension #2
Comments
Hi @v217, Thanks for the feedback, I will amend the README file to add happy as a dependency. I am not sure if this can be done by cabal itself. Now, I'll try to address your main question. THLP (Temporal Horn LP) can be implemented (at least for some examples presented in the blog post you cited) using plain first-order PROLOG. The idea is to use an extra argument for each time-varying predicates to explicitly represent time. For example, the time-varying predicate first fib (0).
first next fib(1).
next next fib(K) ← next fib(M), fib(N), K is M + N. will become a predicate fib(0,0).
fib(s(0), 1).
fib(s(s(T)), K) :- fib(s(T), M), fib(T, N), K is M + N. The aforementioned programs will correspond to a Lucid program that uses the fby(S1,S2)(0, X) :- S1(0,X).
fby(S1,S2)(s(T), X) :- S2(s(T), X). To conclude, in principle someone can implement some time-varying operators in HOPES, however, it is still open (and also interesting) whether the syntactic fragment of HOPES supports all operators of Lucid. |
Thank you! |
Hi, I've got time to play with the examples. It seems that some of the examples in the mini-prelude stopped working. |
Hi @v217, Do you mind open a separate issue with the non-working prelude definitions, so we can track them down? I much appreciate the feedback! Higher-order Datalog is an interesting subset so I think it is worth the effort to be studied separately. However, I think that transforming Higher-order Datalog into First-Order Datalog is not trivial. Actually, to the best of my knowledge, I am not aware of such a transformation with respect to the extensional semantics. Now, if you can live with first-order semantics, there is Hilog (part of the XSB compiler) that uses a higher-order syntax with a first-order semantics and thus it is straightforward to define for every Hilog program without function symbols an equivalent first-order Datalog program. More information in Hilog's paper. |
Thank you for the Hilog Links. I will start a separate issue. |
Hi,
I read Lucid Meets Prolog on Bill Wadge's Blog and thought this sounds very useful.
I am quite new to prolog, so maybe I am missing something. Can this extension be implemented in Hopes?
Thanks,
Vincent
PS:
In your build script, there is the dependency for the happy parser missing.
The text was updated successfully, but these errors were encountered: