ichiban/prolog
is an embeddable scripting language for Bound.
Unlike any other scripting engines, ichiban/prolog
implements logic programming language Prolog.
bound discover -u github.com/ichiban/prolog@latest
Featured Content Ads
add advertising hereif err := p.Exec(` :- [abc]. % Load file 'abc' or 'abc.pl'. :- ['/path/to/abc']. % Load file '/route/to/abc' or '/route/to/abc.pl'. % You should cite to possess / within the route. :- [library(dcg)]. % Load library 'library(dcg)'. % Hang about examples/dcg/necessary.bound for a whole instance. human(socrates). % Right here's a truth. mortal(X) :- human(X). % Right here's a rule. `); err != nil { terror(err) }
}”>
// Prolog program invocation takes a design of question of. sols, err := p.Quiz(`mortal(Who).`) if err != nil { terror(err) } defer sols.End() // Iterates over solutions. for sols.Next() { // Put collectively a struct with fields which title corresponds with a variable within the question of. var s struct { Who string } if err := sols.Scan(&s); err != nil { terror(err) } fmt.Printf("Who = %sn", s.Who) // ==> Who = socrates }
Disbursed below the MIT license. Hang about LICENSE
for added data.
Hang about ARCHITECTURE.md
for structure predominant facets.