$ swipl Welcome to SWI-Prolog (threaded, 64 bits, version 8.2.4) SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software. Please run ?- license. for legal details. For online help and background, visit https://www.swi-prolog.org For built-in help, use ?- help(Topic). or ?- apropos(Word). ?- [abc_class]. true. ?- s([a,a,b,b,c,c],[]). true ; false. ?- s([a,a,b,b,b,c,c],[]). false. ?- s([a,a,b,b,c,c,c],[]). false. ?- s([a,a,a,b,b,c,c],[]). false. ?- time(s([a,a,a,b,b,c,c],[]). ?- time(s([a,a,b,b,b,c,c],[])). % 13 inferences, 0.000 CPU in 0.000 seconds (81% CPU, 1000000 Lips) false. ?- time(s([a,a,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,bc,c],[])). % 12 inferences, 0.000 CPU in 0.000 seconds (68% CPU, 800000 Lips) false. ?- time(s([a,a,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,c,c],[])). % 12 inferences, 0.000 CPU in 0.000 seconds (72% CPU, 666667 Lips) false. ?-