Attached: swipl.png (170x140, 18K)
What is this mindfuck of a language???
Kayden Scott
Nicholas Kelly
Programming for people who aren't complete brainlets.
retard(user).
Jordan Perry
it's called logic. unfortunately it's something they don't teach in our public school system so it's understandable that you don't get it. just read some fucking books.
Lincoln Green
father(X,Y). % Define Predicates%
mother(X,Y).
married(X,Y).
male(X).
female(X).
parent(X,Y).
diff(X,Y).
male_cousin(X,Y).
brother_in_law(X,Y).
mother_in_law(X,Y).
cousin_three(X,Y).
cousin(X,Y).
sib(X,Y).
%Define Facts%
male(terah). male(abram). male(nahor). male(haran). male(isaac).
male(lot). male(moab). male(ben_ami). male(bethuel). male(laban).
male(esau). male(jacob). male(reuben).
female(sarah). female(milcah). female(lot_daughter_1). female(lot_daughter_2).
female(rebekah). female(leah). female(dinah).
father(terah,abram). father(terah,nahor). father(terah,haran).
father(abram,isaac). father(haran,lot). father(nahor,bethuel).
father(bethuel,laban). father(laban,leah). father(isaac,jacob).
father(isaac,esau).
father(jacob,reuben).
mother(sarah,isaac). mother(milcah, bethuel). mother(rebekah,jacob).
mother(rebekah,esau). mother(leah,reuben).
mother(lot_daughter_1,moab). mother(lot_daughter_2,ben_ami).
married(abram,sarah). married(nahor,milcah).
married(isaac,rebekah). married(jacob,leah).
married(sarah,abram). married(milcah,nahor).
married(rebekah,isaac). married(leah,jacob).
%Define complicated predicates%
parent(X,Y) :- father(X,Y).
parent(X,Y) :- mother(X,Y).
diff(X,Y) :- not(X=Y).
sib(X,Y):- parent(Z,X), parent(Z,Y), diff(X,Y). %define sibling %
mother_in_law(X,Y):- female(X),mother(X,Z),married(Z,Y). %question 1%
male_cousin(X,Y):- male(X),father(W,X),parent(Z,Y),sib(W,Z). %question 2%
cousin(X,Y):- parent(Z,X), parent(W,Y), sib(W,Z). %question 3%
cousin_three(X,Y):- parent(Z,X),parent(G,Z),parent(H,Y),parent(K,H),cousin(G,K).
brother_in_law(X,Y):- male(X),married(X,Z),sib(Y,Z). %question 5-X is married to Y's sibling%
brother_in_law(X,Y):- male(X),sib(X,Z),married(Y,Z). %X's sibling is married to Y%
brother_in_law(X,Y):- male(X),married(X,W),married(Y,Z),sib(W,Z). % Y is married to the sibling of X's spouse%
brother_in_law(jacob,X).
Juan Perez
Not that complicated imo.
Jayden Lopez
Propositional logic can be learnt in 5 minutes.
Easton Nguyen
Programming is modern math, math is ancient programming.
Angel Edwards
Jeremiah Flores
I don't want "logic" I want money, I want to program turing machines.
Prolog is a slow ass language ofr people too stupid to understand design patterns, cache coherence, multi level pointers ,etc
Julian Campbell
FFFUUUUCK THIIIIS LANGUAAAAAGE
Ryan Hill
James Allen
You're not supposed to use Prolog as a general purpose programming language. It shines as an embedded DSL (for example, in Lisp).
Isaac Hughes
what the fuck is a lisp, dude people use C for embedded
Julian Rogers
>C
Rank amateurs, maybe. Real men use Forth.
Landon Murphy
What he means is you embe... wait, I'm just getting trolled.
/thread
Wyatt Ward
I will literally bust a vein what the fuck am I doing wrong wit this language
Jaxson Jenkins
Blake Williams
lol have fun reinventing the wheel.
logic is where it's at my dude. that is the key to AI. once you have a machine that is able to fully verify all forms of logic, you have consciousness.
meanwhile you will be choking on dust wondering why you stopped getting paid to stamp letters all day.
Nicholas Perry
This is the best language to write old-school text-based DnD style games in. I’ve been adding to mine for like 3 years.
Juan Butler
>once you have a machine that is able to fully verify all forms of logic, you have consciousness.
Not him but this isn't true at all. Once you have a machine that is able to fully verify all forms of logic, you have something better than consciousness and capable of replacing it, but you still don't have consciousness. Logic isn't the key to AI, it's the key to a viable alternative to AI. A perfectly logical machine can do many things an intelligence can do, and many things an intelligence can't do, but it's not an intelligence. For one thing, true intelligence is probabilistic and not deductive. Logic can be considered to generally follow a parenthetical structure where there are no probabilistic outcomes. By contrast, AI follows a breadth-first path through a geometry not unlike a Markov chain.
Aaron Collins
>true intelligence is probabilistic and not deductive
this doesn't mean anything. once a machine can reason the way humans can, they will be able to fully interpret the english language just the way we can, and reproduce grammatical logical structures. I don't know what makes you think "intelligence is probabilistic" whatever the fuck you think that means, which is the most bullshit thing I've ever heard.
Robert Myers
(cont.) unless you mean inductive reasoning. which is a logic
Nicholas Wood
>muuh AI
It's a fucking meme that has no proven results
Aaron Ward
Actually when I say "intelligence is probabilistic," I'm referring to neural networks. As a general data structure, including both the artificial and biological implementations.
Parker Walker
L...link?
Lincoln Rivera
This branch of AI mostly died out in the 80s when it became obvious that many types of problems were intractable with predicate logic.
Many real problems are too complicated to define with any set of explicit rules, which is why current efforts use Neural Networks to implicitly learn the rules and use optimization rather than bfs to find their solution.
Brayden Gray
>This branch of AI mostly died out in the 80s
still best branch
Thomas Rodriguez
Hahhahaha what kinda surname is Bratko like thtats the most eastern european name ever
Liam Reyes
Bratko means brother here.
Julian Martinez
>I don't want "logic" I want money, I want to program turing machines.
what the fuck are you on about?