On Tue, Feb 15, 2022 at 06:34:58PM +0100, pd wrote:
> > It tries the first one but does not succeed. The second one matches, so the
> > others are not tried because of the cut.
>
> This is interesting, in my understanding when matching the first rule it
> should try to unify @C to the result of
On Sat, Feb 12, 2022 at 8:37 AM Alexander Burger
wrote:
>
> > >(be + (@A @B @C)
> > > (^ @C (+ @A @B))
> > > T )
> > >
> > >(be + (@A @B @C)
> > > (^ @B (- @C @A))
> > > T )
> > I suppose pilog search for rules in order, so the goal (? (+ 3 @X 7))
> > always
Hi pd,
> > The environments are nested association lists, with numbers for the levels
> > and
> > then the symbols for the values at these levels.
>
> and levels are related to backtracking somehow?
Yes. When looking up values for symbols, the symbols at individual levels are
unified with
On Thu, Feb 10, 2022 at 6:27 PM Alexander Burger
wrote:
>
> Could not resist. I elaborated a little :)
>
> If we define '+' as
>
>(be + (@A @B @C)
> (^ @C (+ @A @B)) T )
>
>(be + (@A @B @C)
> (^ @B (- @C @A)) T )
>
>(be + (@A @B @C)
> (^ @A (- @C @B))
Hi Alex,
On Wed, Feb 9, 2022 at 9:53 PM Alexander Burger wrote:
>
> > > > : (? (factorial @X 120))
> > > > -> NIL
> > >
>
> > How should be declared factorial primitive to be compatible with reverse
> > lookup?
>
> I have not tried. How is it in real Prolog?
>
In modern prolog you use this
On Wed, Feb 09, 2022 at 09:46:01PM +0100, Alexander Burger wrote:
> To take an example a bit simpler than the factorial function, you could start
> with addition as:
>
>(be + (@A @B @C)
> (^ @A (- @C @B)) )
> ...
Could not resist. I elaborated a little :)
If we define '+' as
# (+
Hi pd,
> > > : (? (factorial @X 120))
> > > -> NIL
> >
> > This is another issue. This Pilog version of factorial cannot do reverse
> > lookup,
> > as it calculate numeric values via Lisp calls.
> ...
> Ok, I suspected that but is there any way to do arithmetic in pilog? My
> understanding is
Hi Alex, thanks for quick reply
On Wed, Feb 9, 2022 at 8:13 AM Alexander Burger wrote:
>
> > Is the reference documentation incorrect?
>
> No, but it seems that you looked at the reference for pil21.
>
> The syntax for calling Lisp expressions in Pilog was made a little
> friendlier in
> pil21,
Hi pd,
> I'm using picolisp version 18.12.27 C in a debian 10.10 based distro,
> ...
> I'm playing with pilog and there're some examples that does not run:
> ...
>(^ @I (inc @C)) )
> ...
> I can make it work if I use the -> functon this way:
> ...
>(^ @I (inc (-> @C))) )
>
> Is the
Hello,
I'm using picolisp version 18.12.27 C in a debian 10.10 based distro,
installed as package picolisp 18.12-1
I'm playing with pilog and there're some examples that does not run:
1- the example in doc reference for repeat/0 [1] :
: (be integer (@I) # Generate unlimited supply of
10 matches
Mail list logo