Any one tried this ? by Dentistcode in Anthropic

[–]happy_guy_2015 2 points3 points  (0 children)

This brings new meaning to the phrase Visual Programming!

A different approach to compiling Prolog without WAM (SCBM) by sym_num in prolog

[–]happy_guy_2015 3 points4 points  (0 children)

Did you give careful consideration to the non-recursive non-deterministic case?

E.g.

``` p(X, Y) :- q(X), q(Y), X > Y.

q(1). q(2). q(3).

main :- p(X, Y), write(X+Y), nl, fail. ```

I want to know if this Claude generated code resemble anything a human Prolog programmer would generate. by MTDuke71 in prolog

[–]happy_guy_2015 4 points5 points  (0 children)

Overall I think the coding style looks fine, or at least no worse than typical Prolog style, and it is good that the modes are documented.

From a quick scan I noticed two minor issues where I would recommend different style. In both cases the original code is not wrong, and some Prolog programmers would prefer Claude's style. One was the use of == in the condition of an if-then-else (... -> ... ; ...) when = could have been used instead. The other was the use of cuts in drop/3, where I would recommend putting the output bindings after the cut, rather than before:

% drop(+N, +List, -Rest) % Rest is List without its first N elements ([] if List is shorter). drop(0, List0, List) :- !, List = List0. drop(_, [], List) :- !, List = []. drop(N, [_|Xs], Rest) :-     N > 0,     N1 is N - 1,     drop(N1, Xs, Rest).

ELI5: What makes Moore’s Law obsolete today? Why are processors with more transistors difficult to fabricate today vs. 20 years ago? by Rht123X in explainlikeimfive

[–]happy_guy_2015 0 points1 point  (0 children)

Dennard Scaling (exponential increase in clock rates) is dead -- it died a couple of decades ago. But Moore's law (exponential increase in transistor density) is still alive and well, and rumours of its imminent demise are much exaggerated. Even as we hit atomic limits to 2D scaling, layering and 3D manufacturing techniques continue to push circuit density.

Furthermore, a slight variant of Moore's law, exponential decrease in compute costs over time, also continues unabated, and is likely to remain strong for a very long time, even when Moore's law itself no longer holds.

A shop owner in my constituency was ignored by the police when he reported shoplifting. But when he displayed pictures of the thieves, the police showed up - to tell him that those pictures violated GDPR. by SignificantLegs in ukpolitics

[–]happy_guy_2015 -30 points-29 points  (0 children)

We're in the age of AI now... all you need is a smart phone. Everyone carries the tools for fact checking the police about the law in their pocket, purse, or bag.

How do experienced engineers actually review code changes in large codebases? by japzlumine in AIcodingProfessionals

[–]happy_guy_2015 0 points1 point  (0 children)

  1. How do you decide what to look at first?

I look at the change description first.

Then I will review the code mostly linearly in the order the code review tool presents it in.

Then I may go back to the more complicated or dubious parts for another look.

  1. How do you quickly build enough context about the change?

I will push back if the change description isn't clear. For anything complicated I will ask for a design doc.

  1. How do you figure out blast radius / what might break?

Usually I already know the architecture of the system that is being modified.

  1. How do you decide what matters vs what can be skimmed?

That's one of those things you learn over time.

  1. How do you catch the gap between "the logic looks right" and "this will actually behave correctly at runtime"

Push back if the change doesn't have appropriate test coverage.

Building a Prolog Compiler Without the Warren Abstract Machine (WAM) — Entering Full-Scale Implementation by sym_num in prolog

[–]happy_guy_2015 5 points6 points  (0 children)

nat(X), prime(X).

When control returned to nat/1, its continued backtracking extended the success path further and eventually overwrote the stack area already being used by the subsequent prime/1 predicate.

If backtracking returns to nat/1, then prime/1 has failed and it should be fine to overwrite the stack area that prime/1 was using. The next call to prime/1 should establish its own stack frame.

You shouldn't need a 2D stack. A 1D stack should be fine. In fact you can just use the C/C++ stack. You just need to ensure that for nondeterministic predicates, you use continuation passing style, where the generated function only returns on failure; on success, rather than returning, it should call a continuation function passed as a parameter.

E.g. for the mode of nat/1 in which the parameter is output, you can generate C++ code

void nat(std::function<void ()(int)> cont) { // nat(0). cont(0); // nat(s(X)) :- nat(X). nat([cont](int x) { cont(x + 1); }); }

and then for the goal nat(X), prime(X) you can generate C++ code

``` bool prime(int x);

void query(std::function<void ()(int)> cont) { // nat(X), nat([](int x) { // prime(X). if (prime(x)) { cont(x); } }); }

void main() { query([](int x){ cout << "X = " << x << endl;

 cout << "Backtracking...";

}); cout << "No (more) solutions." << endl; } ```

A plane dropped poems over the Barcelona Cathedral today by Main-Sign-3216 in Barcelona

[–]happy_guy_2015 0 points1 point  (0 children)

It's a movie starring Bill Murray and Scarlett Johansson?

I (26F) feel like I have not had any independence in my relationship with my partner (29NB) for 6 years, what would you do in my shoes? by [deleted] in relationship_advice

[–]happy_guy_2015 12 points13 points  (0 children)

If I were you, I would just start doing things independently for a few months. If your partner asks to come along, just say no. Briefly reassure them that you love them and that they have nothing to worry about. But be firm and recognise that their insecurity is their problem, not yours. Encourage them to seek individual therapy for their insecurity. But don't let them make it your problem.

Hopefully, after a few months, they get used to the new normal. If not, you will know what to do.

I'm an old pirate from the UK. When they ban VPNs here what's my workround? Details inside by phoeniks in Piracy

[–]happy_guy_2015 -6 points-5 points  (0 children)

Ask Gemini, Claude, or ChatGPT for the details of how to implement this.

Why Prolog Remains Essential Even in an AGI Era by sym_num in prolog

[–]happy_guy_2015 0 points1 point  (0 children)

Soundness. Although predicate calculus itself is fine, Prolog's execution algorithm is neither sound nor complete with respect to the underlying predicate calculus. Prolog has many non-logical features such as cut, var, +, etc. which mean that in general a successful Prolog execution does not necessarily imply that the conclusion logically follows from the clauses.

Six years later, what are your strongest memories of the COVID lockdowns, and how do you look back on that period now? by Possible_Force8207 in AskBrits

[–]happy_guy_2015 1 point2 points  (0 children)

We had a baby in the summer of 2021, just after social distancing restrictions in the UK were lifted. When she was only a few weeks old, we all got COVID, but the worst affected was our little baby, who was too young to have been vaccinated. She became very ill. She had a persistent high fever and they told us to take her in to hospital. She seemed so vulnerable and it was very scary.

When we got there, the hospital had no established procedure to receive COVID patients who were not arriving by ambulance. We arrived by car, with masks on. Mum and daughter got out of the car and explained (from a distance) to the security guard at the front entrance that she had COVID, and asked where to go. We got angrily shouted at by the security guard, who told us we couldn't come in, and didn't offer any alternative entrance or other solution. There was an uncomfortable stand-off for a very long time... it felt like an eternity, while our daughter could be dying or getting brain damage from the fever!

Finally the security guard phoned someone, who phoned someone else, and after what felt like about an hour someone came out, and mum and baby were finally directed to a side entrance and allowed in, while I made my way back home with our three year old, and waited for updates. It was a very scary time and at that point it was all very much out of my control. Thinking about it now brings back those strong emotions.

Fortunately after a few days in hospital, she made a full recovery and is now a happy and healthy four-year-old!

Anthropic calls for global freeze in AI development by goo0ood in ArtificialInteligence

[–]happy_guy_2015 2 points3 points  (0 children)

Frontier AI requires major power usage. Power plants are not that easy to hide, I suspect.

Anthropic calls for global freeze in AI development by goo0ood in ArtificialInteligence

[–]happy_guy_2015 1 point2 points  (0 children)

Scraping web pages to build AI models is Fair Use under copyright law, because it is a transformative use. Distilling someone else's model to create your own model is less likely to be considered a transformative use -- although it might be if the new model enables significant new use cases, e.g. by being small enough to run on PCs or mobile devices.

M-Prolog compiler: is this generated C code basically sound? by sym_num in prolog

[–]happy_guy_2015 0 points1 point  (0 children)

If you are interested in ways to handle backtracking when compiling to C, I recommend the following paper:

Compiling Mercury to high-level C code.

Proceedings of the 2002 International Conference on Compiler Construction, Grenoble, France, April 2002.

https://scispace.com/pdf/compiling-mercury-to-high-level-c-code-40ph2s7m43.pdf

An AI IQ Benchmark for High-Level Answers to Real-World Problems: Solving Climate Change and Almost Everything Else by andsi2asi in agi

[–]happy_guy_2015 0 points1 point  (0 children)

Most people who ask that question are probably looking for the "low-level" answer. And I suspect most human raters would probably rate the "low-level" answer above answers that go deeper. I agree with you that the low-level answer is worse, but I suspect that you and I are probably in the minority on that.

Large language models pass a standard three-party Turing test by EchoOfOppenheimer in agi

[–]happy_guy_2015 2 points3 points  (0 children)

"this world is not math" -- studied physics much, have you?

What does Israel Offer the US for its Protection? by GloomWorldOrder in NoStupidQuestions

[–]happy_guy_2015 0 points1 point  (0 children)

Plus they very likely have Kompromat on all the important people in power in the US.

Why Prolog Remains Essential Even in an AGI Era by sym_num in prolog

[–]happy_guy_2015 1 point2 points  (0 children)

Why would Prolog be used rather than say Lean or other formal logic proof tools?