Stream: Elpi users & devs

Topic: ✔ Reducing integers


view this post on Zulip Gregory Malecha (Dec 20 2022 at 14:57):

I'm trying to figure out how to reduce integers. Here's a simple program

    pred check-refl i:int i:int.
    check-refl X X.
    check-refl X Y :- coq.say "bad " X Y.

    main [trm Arg] :-
      check-refl 1 (1 + 0).

This prints bad 1 1 + 0 rather than nothing (which is what I would expect). What am I missing? I should say that I have not read everything in the manual.

view this post on Zulip Gregory Malecha (Dec 20 2022 at 15:03):

I'm missing a calc!

view this post on Zulip Notification Bot (Dec 20 2022 at 15:03):

Gregory Malecha has marked this topic as resolved.

view this post on Zulip Enrico Tassi (Dec 20 2022 at 20:44):

Yup, this is a "surprising" thing from Prolog (or Lisp)... There is a section about "common pitfalls", suggestions welcome.


Last updated: Jun 23 2024 at 01:02 UTC