$ git checkout main
Already on 'main'
Your branch is up to date with 'origin/main'.
$ go install github.com/ichiban/prolog/cmd/1pl
$ $(go env GOPATH)/bin/1pl
Top level for ichiban/prolog (devel)
This is for testing purposes only!
See https://github.com/ichiban/prolog for more details.
Type Ctrl-C or 'halt.' to exit.
?- length([_|L],0).
false.
Consider to use an implementation similar to Scryer which is based on an internal built-in '$skip_max_list'/4 using Brent’s cycle detection algorithm which is perfect for term representations based on a directed graph. Many systems use this approach. SICStus, YAP, SWI, Scryer, Trealla.
@UWN I fixed conflicts and now
length/2
is in the main branch! It passes the test cases 1~28 from http://www.complang.tuwien.ac.at/ulrich/iso-prolog/length on my end.Consider to use an implementation similar to Scryer which is based on an internal built-in
'$skip_max_list'/4
using Brent’s cycle detection algorithm which is perfect for term representations based on a directed graph. Many systems use this approach. SICStus, YAP, SWI, Scryer, Trealla.Test cases.