uncle(Person, Uncle) :-
parent(Person, Parent),
brother(Parent, Uncle).
def uncle(Person, Uncle):
Parent = Variable()
for l1 in parent(Person, Parent):
for l2 in brother(Parent, Uncle):
yield False
IEnumerable<bool> uncle(object Person, object Uncle) {Javascript
Variable Parent = new Variable();
foreach (bool l1 in parent(Person, Parent)) {
foreach (bool l2 in brother(Parent, Uncle))
yield return false;
}
}
function* uncle(Person, Uncle) {
var Parent = new Variable();
for (let l1 of parent(Person, Parent)) {
for (let l2 of brother(Parent, Uncle))
yield false;
}
}
Yield Prolog is made possible by the yield keyword, which automatically creates iterators that you can nest, combined with Yield Prolog's Variable class which can unify a variable with other values (just like in Prolog). There is no "API" standing between your code and Yield Prolog, because you just use the yield keyword to make "iterator functions" wherever you need them. Yield Prolog is part of your code, which can mix Prolog-style predicates directly with ordinary arrays, file I/O, GUI calls and all your own classes. Because it lets you mix these, Yield Prolog unifies the declarative and procedural programming models.
1. Tested with C# .NET 2008+ and Mono 2.0+.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3