potassco / clorm

🗃️ A Python ORM-like interface for the Clingo Answer Set Programming (ASP) reasoner
https://clorm.readthedocs.io
MIT License
52 stars 5 forks source link

Make FactBase.asp_str(sorted=True) ordering match clingo.Symbol ordering #74

Closed daveraja closed 2 years ago

daveraja commented 2 years ago

Deleting this issue as I no longer think this is a good idea. Firstly, it can never be exactly the same (if you want to first order by Predicate subclsses) because of the different ways you can define the Predicate subclasses. And even if you could the clingo.Symbol ordering is first based on the arity of a Function object and then its name. For more intuitive clorm output, ordering by name first gives something closer to a lexicographic ordering.