Declarative reasoning on explanations using constraint logic programming. ~ Laura State, Salvatore Ruggieri, Franco Turini. https://arxiv.org/abs/2309.00422 #XAI #CLP #Prolog #LogicProgramming
#logicprogramming #prolog #clp #xai
Monday fun day, because a new #ScryerProlog release is out! 0.9.2 features a more correct, faster, and more featureful #Prolog system. Also now on 32-bit systems.
I guess, now I have a reason to have a Prolog interpreter in my system :blobcatgiggle:
https://github.com/jan-Lope/Toki_Pona-Parser
> Toki Pona Parser - A tool for spelling, grammar check and ambiguity check of Toki Pona sentences
#lang_en #toki_pona #tokipona #prolog #languages #conlangs
Programmer Passport: Prolog by Bruce Tate @redrapids
Constraint-based logic programming is the engine powering some of the most powerful algorithms in the world. #Prolog has the tools you need.
https://www.pragprog.com/titles/passprol/programmer-passport-prolog?view_title
Look a t those nice examples.
I guess #Prolog is anticipating a triumphant return to the scenes.
New release of postgresql-prolog! Safer queries because the query template and the data are sent separately making #SQL injection attacks impossible. To help users with these templates, a new DSL has been done to use #Prolog syntax to build simple SQL queries.
#postgresql
Мои заметки про Prolog.
Так случилось, что Пролог мне не удалось освоить с наскока. Во второй раз, на второй попытке я прочитал книгу про программирование на Visual Prolog. И тоже после прочтения книги ничего не смог запрограммировать на Прологе.
В третий раз, в третий попытке, я вроде начал что-то понимать. И решил поделиться своими "пониманиями".
Если сравнивать с Си, то предикаты можно воспринимать как функции. Возвращают они, правда, только всегда true или false. А результат вычислений складывают в переменную-аргумент переданный при вызове. Если вообще передали. Если не передали, то только true или false. Если передали несколько, то несколько и заполняют.
Например, функция strstr('abcde', 'b') в Си вернёт номер позиции подстроки 'b' в строке 'abcde'. В Прологе можно эту функция записать как предикат с заголовком strstr('abcde', 'b', X). Когда Пролог встретит этот предикат, то попытается найти значение неизвестной переменной Х. Если это встроенный предикат, то он просто запустит соответствующий код, который сам вычислит соответствующее значение, положит его в X и потом вернёт true. Если не удалось вычислить, то вернёт false и оставит пустым X.
В прологе можно и другие аргументы заменить неизвестными переменными. И пролог попытается их вычислить. Если это встроенный предикат, то просто запустить соответствующий код, который сам вычислит значение неизвестных аргументов (если умеет). А если невстроенный предикат, то начнёт вычислять тело предиката. Если тела нет, то будет искать по правилам все варианты значений неизвестных переменных.
Например: strstr(X, 'b', 2) - должен вернуть даже не один, а все строки, где второй символ 'b'. Откуда он возьмёт эти строки - это его забота.
А strstr('abcde', X, 2) вернёт одно значение X равное 'b'.
А strstr('abcde', X, Y) вернёт все варианты подстрок и их позиций в 'abcde'.
Thanks to all who listened to my newbie impressions of #Prolog at #CCCamp23 ! I hope you learned something too. (The talk was recorded and will be available online.)
If you like the way I present, then see you at my #Rust #workshop on Friday :)
#prolog #cccamp23 #rust #workshop
This is awesome, a modern book about #Prolog! https://techhub.social/@pragprog/110588697193318358
New post: Will data served as language models overtake the role of semantic/linked data?
https://livingsystems.substack.com/p/will-data-served-as-language-models #linkeddata #llm #prolog
DeduccionNatural.pl: herramienta escrita en Prolog para el aprendizaje de la asignatura de Lógica. ~ Joaquín Arias, Iván Ramírez, Alessandra Gallinari. https://aenui.org/actas/pdf/JENUI_2023_016.pdf #Prolog #LogicProgramming #Logic
#logic #logicprogramming #prolog
Datalog. ~ Markus Triska. https://youtu.be/M5fwAkJqAVw #Prolog #LogicProgramming
@lispi314 @natty also #Prolog, where the program state can effectively be dealt with as "just" a cache of computations that gets refreshed on every program start.
That is ignoring the gnarly bits like external state that no environment has a chance of getting right.
Also #Erlang, the other extreme where you can design for not letting the system go down at all.
I tried something in #Prolog recently, I used a Stream to read from a list of character codes (i.e. a double quoted string in GNU Prolog, among others). I am not sure how commonly others might do this but this was not something I've had a need to do enough to remember if I've ever done it before.
This is a pretty simple, but illustrative, example of taking in a double quoted string and decomposing it into a list of atoms.
Hello! I'm Adrián Arroyo Calle and I just switched instance to castilla.social (instance I'm going to manage myself).
I live in Valladolid and I work as a developer for Telefónica.
My hobbies are:
💻 Programming (#prolog, #emacs, #kotlin, #rust)
🗺️ Maps
🚲 Bike routes
📕 History
🏎️ Motorsport
🎮 Videogames
🤿 Diving
I usually write larger things on my blog (Spanish, https://blog.adrianistan.eu), but for shorter stuff I really like Mastodon. See you!
#presentation #prolog #emacs #kotlin #rust
¡Hola! Soy Adrián Arroyo Calle y acabo de cambiar de nodo a castilla.social (nodo que voy a administrar yo).
Vivo en Valladolid y trabajo como desarrollador en Telefónica.
Mis aficiones son:
💻 Programación (#prolog, #emacs, #kotlin, #rust)
🗺️ Mapas
🚲 Salir en bici
📕 Historia
🏎️ Deportes de motor
🎮 Videojuegos
🤿 Buceo
Cuando escribo algo largo suelo ponerlo en mi blog, https://blog.adrianistan.eu pero para cosas cortas me encanta usar Mastodon. ¡Saludos!
#presentacion #prolog #emacs #kotlin #rust
Just found there's some #prolog folk on masto. I love that language so much. Hashtag subscribed!
I'm probably the only person to have a game on steam (partially) written in prolog. Even though I did that I still don't understand it. But it is perfect for murder mysteries.
Pretty amazing that a language 50 years old still has a few tricks up its sleeve.
Number four: #tcl #tcltk. Not as much hate as Perl gets, but a lot of misconceptions that I want to clear up for people who might hear about this for the first time:
Tcl != Tk. Although they’re released together nowadays, Tk is a standalone cross-platform widget toolkit. That’s where the Tk in Tkinter comes from. There are several bindings for Tk: Ada (TASH), Python (the aforementioned Tkinter), Perl (Tcl::Tk, Tkx and Perl/Tk if you want native Perl access to Tk structures), Lua (tclua and ltcltk), Haskell (HTk), Ruby, Scheme, Ksh (through dtksh), R (tcltk) and probably many others. The Python bindings even use Tcl as a bridge to Tk, same with Tcl::Tk and Tkx from Perl).
“Tk looks bad”. While it used to look like Motif on Unices, now it has (for quite some time) a native look and feel + theming support. Tkinter people sure don’t complain and probably neither do you realistically speaking.
“Tcl is a toy language”. On the contrary, it’s really powerful with the syntax it has (that and its syntax is defined by the Dekalogue, only 12 rules). In a way, it’s like Lisp and Forth (two of my crushes). I even tried a Forth-esque DSL in Tcl… and I could actually do it. I can implement if I wish try/catch, for..in, exceptions, classes, I can model it to my liking. This argument is genuinely more petty than even “Lisp has too many parentheses”. Additionally, it isn’t complex, which is a good thing (you can actually understand the whole language, implementation included). You can even redefine anything in Tcl using rename or have access to the Tcl interpreter using eval, uplevel and upvar for some metaprogramming if you so wish.
“Tcl has no types”. Yes, if you want to be strict about it, it only has strings (although that’s like saying that Lisp only has lists). You don’t need to perform conversions, however you aren’t likely to introduce bugs because the checks on the format of the strings are very strict. It’s a bit like Postel’s law: “be conservative in what you send, be liberal in what you accept”, but in reverse I think. Even better, you don’t need serialization because everything is a string already. You can even do stuff like sending a list through a TCP socket through puts $socket $mylist and on the other side set mylist [read $socket], it’s that easy. The central data structure is the list, not the string, and any Lisp programmers knows the implications of that.
“Tcl is slow”. This shares the same sentiment as in the Perl argument. Of course it isn’t gonna be a power house for sure in the runtime department, but it sure is quick to develop in. Heck, once you have some commands going on, you can start writing executable files that look like configuration (if you really tried, you could surely replicate #nginx syntax for example).
Besides that, there are a couple of other nice things about Tcl:
lmap i {1 2 3 4 5} { expr $i*$i} which prints 1 4 9 16 25.I stopped using TCL/wish in about 2004 - this was a BIG
mistake - I can now build GUIs in described by pure text.
Nothing is hidden it’s all text - I just need emacs and make.
Why oh why did I ever even click on a button to start Xcode”
The only people that are mad about Tcl/Tk at this point are RMS (because he’s still butthurt that #guile failed in face of Tcl and not even Emacs adopted, only Guix (Guile is good though), he even went so far as to call John Ousterhout a “parasite” (ironic coming from him, huh?)), MAYBE Larry Wall and people who didn’t bother checking up Tk (or looking at Tcl ever). And with that (for today, I think) I am done, although I could touch up on #forth, #php, #ada, #cobol, #smalltalk, #fortran… Even #ml #prolog. These languages deserve some love too, even though they aren’t particularly used. I truly believe that Tcl should become a more popular language, for me it was love at first sight (I like it so much that this is the language I chose to implement for my bachelor’s thesis on a Raspberry Pi Pico). Long live Tcl.
#tcl #guile #php #ada #cobol #smalltalk #tcltk #nginx #oop #functionalprogramming #fp #forth #fortran #ml #prolog