Open clbarnes opened 8 years ago
Types must be explicitly defined, e.g.
type Match;
type Person;
in this example.
Obviously, this needs adding to the tutorial.
There are further issues with the first example: adding the lines from the next few pages
random Boolean team1win(Match m) ~
sum([pulling_power(p, m) for Person p in team1(m)])
> sum([pulling_power(p, m) for Person p in team2(m)]) ;
obs team1(M0) = {James, David};
obs team2(M0) = {Brian, John};
obs team1win(M0) = true;
obs team1(M1) = {James, David};
obs team2(M1) = {Bob, Andrew};
query strength(James) > strength(Brian);
returns
Using fixed random seed for repeatability.
tst.blog::12.40: syntax error at Symbol: in (tst.blog:12/40(320) - tst.blog:12/42(322))
tst.blog::12.6: error in body of function call
tst.blog::13.42: syntax error at Symbol: in (tst.blog:13/42(375) - tst.blog:13/44(377))
tst.blog::13.8: error in body of function call
Hi @clbarnes, the slides use a simplified syntax for demonstration purpose during the course. It just shows how generally a BLOG program looks like. For the full version, you can check out https://github.com/BayesianLogic/blog/blob/master/example/tugwar.blog
I will update the slides to emphasize this.
Right. What is the recommended trajectory for someone learning the language from scratch? The user manual is clearly intended as a manual for usage of the blog binary, rather than the language (and even then, isn't as concise or rich as a man page), and the 'comprehensive tutorial about BLOG motivation, syntax, semantics, and examples' contains non-functional examples, only explaining them 50 pages later. The language reference is a single PDF. I appreciate the variety of examples in the examples directory but it's not like they have rich comments to make them approachable to a beginner, or a clear reading order.
e.g. first example
gives output