{{ message }}
Add Answer Set Programming and Linear Programming#7184
Merged
Conversation
Pulled from clingo (MIT) and from Draco (BSD 3 Clause)
Linear programs must have an objective
Exactly match the object line
tgamblin
added a commit
to spack/spack
that referenced
this pull request
Apr 16, 2025
This reverts a change made in #20639 to have GitHub recognize our ASP files as Prolog, the closest langauge supported by [Linguist](https://github.com/github-linguist/linguist) at the time. Linguist has since [added support for ASP](github-linguist/linguist#7184), so we no longer need to force Prolog detection -- our `.lp` files should be auto-detected as ASP. Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
tgamblin
added a commit
to spack/spack
that referenced
this pull request
Apr 16, 2025
This reverts a change made in #20639 to have GitHub recognize our ASP files as Prolog, the closest langauge supported by [Linguist](https://github.com/github-linguist/linguist) at the time. Linguist has since [added support for ASP](github-linguist/linguist#7184), so we no longer need to force Prolog detection -- our `.lp` files should be auto-detected as ASP. Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
becker33
pushed a commit
to spack/spack
that referenced
this pull request
Apr 16, 2025
This reverts a change made in #20639 to have GitHub recognize our ASP files as Prolog, the closest langauge supported by [Linguist](https://github.com/github-linguist/linguist) at the time. Linguist has since [added support for ASP](github-linguist/linguist#7184), so we no longer need to force Prolog detection -- our `.lp` files should be auto-detected as ASP. Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
Member
|
@tgamblin see the last sentence in the troubleshooting doc. |
climbfuji
pushed a commit
to climbfuji/spack
that referenced
this pull request
Apr 17, 2025
) This reverts a change made in spack#20639 to have GitHub recognize our ASP files as Prolog, the closest langauge supported by [Linguist](https://github.com/github-linguist/linguist) at the time. Linguist has since [added support for ASP](github-linguist/linguist#7184), so we no longer need to force Prolog detection -- our `.lp` files should be auto-detected as ASP. Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
teaguesterling
pushed a commit
to teaguesterling/spack
that referenced
this pull request
May 20, 2025
) This reverts a change made in spack#20639 to have GitHub recognize our ASP files as Prolog, the closest langauge supported by [Linguist](https://github.com/github-linguist/linguist) at the time. Linguist has since [added support for ASP](github-linguist/linguist#7184), so we no longer need to force Prolog detection -- our `.lp` files should be auto-detected as ASP. Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This PR adds language entries for the two types of programs that use the
.lpextension; answer set programs and linear programs. They're both common, and they shouldn't be added independently to avoid widespread misclassification.Description
Adding Answer Set Programming was first suggested in #3867, but it was difficult to assess popularity at the time because GitHub code search didn't support special characters. #3867 (comment) points out that
.lpisn't necessarily exclusive to ASP, but fortunately Prolog (the most similar commonly used logic programming language) has coalesced on.pl.#4860 discussed adding a language group for ASP (the language varies slightly across different solvers). The included grammar is quite generic, so I don't believe there's a need for specific sub-grammars/languages.
#4860 also points at the
.lpis also used for "linear programs" (common human-readable input format for LP solvers). These can be told apart by looking for the required objective statement. Gurobi docs:Answer Set Programming
Answer Set Programming is a logic programming paradigm which dates back to the 1990s. The
.lp(logic program) file extension has been used for ASP programs since at least 1998, when it was used by lparse and the smodels solver.Today, there are many ASP-focused repos on GitHub. Here are more than a hundred that opted into the
#answer-set-programmingtopic.Checklist:
.lpwith:-: https://github.com/search?type=code&q=NOT+is%3Afork+path%3A*.lp+%3A-#A9CC29Linear Programming
Linear programs are mathematical models of linearly related variables. The
lpfile format goes back at least 20 years as part of CPLEX.Checklist
.lpwithSubject Tohttps://github.com/search?type=code&q=NOT+is%3Afork+path%3A*.lp+%22Subject+To%22#DD2113