Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ls4: init at 1.0 #65619

Closed
wants to merge 10 commits into from
Closed

ls4: init at 1.0 #65619

wants to merge 10 commits into from

Conversation

changlinli
Copy link
Contributor

Motivation for this change

Adds the ls4 solver.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

@mmahut
Copy link
Member

mmahut commented Jul 31, 2019

@GrahamcOfBorg build ls4

@mmahut
Copy link
Member

mmahut commented Jul 31, 2019

Please investigate the build failure on ls4 on aarch64-linux .

@changlinli
Copy link
Contributor Author

@mmahut I was overly ambitious packaging this for unix since it requires FPU flags that glibc only has for x86. I've changed the platform.

@changlinli
Copy link
Contributor Author

@mmahut Just wanted to ping again on this; I can't send instructions to the build bot unfortunately.

@mmahut
Copy link
Member

mmahut commented Aug 9, 2019

@GrahamcOfBorg build ls4

@changlinli
Copy link
Contributor Author

@mmahut Argh sorry it looks like on Mac gcc needs to be an explicit dependency whereas this is not the case on Linux. Can you run build ls4 one more time? I don't have a Mac handy to test it unfortunately.

@mmahut
Copy link
Member

mmahut commented Aug 13, 2019

@GrahamcOfBorg build ls4

1 similar comment
@mmahut
Copy link
Member

mmahut commented Aug 16, 2019

@GrahamcOfBorg build ls4

@changlinli
Copy link
Contributor Author

@mmahut It looks like everything finally built!

@changlinli
Copy link
Contributor Author

@mmahut Just wanted to ping on this to see if this could be merged.

# These object files were committed into the git repo, perhaps accidentally
rm -f aiger.o
rm -f aiger.o_32
gcc -g -O3 -c aiger.c
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use make as per documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an error in the upstream source repo. The Makefile it includes doesn't actually re-build these object files and just expects them to exist, but the pre-existing object files aren't built correctly for all architectures.

I'm guessing it's because of convenience; the rest of the Makefile just has to call the g++ compiler instead of the gcc compiler here.

@changlinli
Copy link
Contributor Author

Fixed up indentation.

@changlinli
Copy link
Contributor Author

@mmahut Let me know if there's anything else you want me to fix up.

This uses a standard library function instead of a custom override
@changlinli
Copy link
Contributor Author

@mmahut or @Ekleog it'd be great if either of you could take another look at this

@Ekleog
Copy link
Member

Ekleog commented Sep 18, 2019

@mmahut Will let you review if you can, as you already looked at the code, but overall it LGTM, with the exception that I wasn't able to easily confirm ls4 actually in general knowledge refers to this github repo -- ls4 does appear to be mentioned from the TLA+ github repo (as identified by the already-in-nixpkgs url), but without any link to this repo.

@changlinli
Copy link
Contributor Author

Yeah it was a bit tricky to ascertain whether this is the "real" ls4. I see the following as evidence for its authenticity:

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jan 18, 2021
@changlinli
Copy link
Contributor Author

Hey @SuperSandro2000, I'd be happy to make those changes if those are what's blocking this PR. Do you think that's all it takes for this PR to get merged?

@SuperSandro2000
Copy link
Member

Hey @SuperSandro2000, I'd be happy to make those changes if those are what's blocking this PR. Do you think that's all it takes for this PR to get merged?

Yeah, basically.

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 65619 run on x86_64-darwin 1

1 package failed to build and are new build failure:

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review which is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).
If you have any questions or problems please reach out to SuperSandro2000 on IRC.

Result of nixpkgs-review pr 65619 run on x86_64-linux 1

1 package failed to build and are new build failure:

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
homepage = "https://github.com/quickbeam123/ls4";
license = licenses.mit;
platforms = platforms.x86;
maintainers = with maintainers; [changlinli];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
maintainers = with maintainers; [changlinli];
maintainers = with maintainers; [ changlinli ];

};

meta = with lib; {
description = "A solver for temporal logic, in particular a PLTL-prover based on labelled superposition with partial model guidance. Based off of minisat";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description = "A solver for temporal logic, in particular a PLTL-prover based on labelled superposition with partial model guidance. Based off of minisat";
description = "A solver for temporal logic, in particular a PLTL-prover based on labelled superposition";
longDescription = ''
A solver for temporal logic, in particular a PLTL-prover based on labelled superposition with partial model guidance. Based off of minisat.
'';

@@ -0,0 +1,40 @@
{ zlib, gcc, fetchFromGitHub, gccStdenv }:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ zlib, gcc, fetchFromGitHub, gccStdenv }:
{ lib, zlib, gcc, fetchFromGitHub, gccStdenv }:

@SuperSandro2000
Copy link
Member

Fails to build with:

Compiling: /build/source/core/Aiger2Spec.o
In file included from ../core/Aiger2Spec.h:25,
                 from /build/source/core/Aiger2Spec.cc:42:
../core/SolverTypes.h:50:16: error: friend declaration of 'Minisat::Lit mkLit(Minisat::Var, bool)' specifies default arguments and isn't a definition [-fpermissive]
   50 |     friend Lit mkLit(Var var, bool sign = false);
      |                ^~~~~
../core/SolverTypes.h:58:14: error: friend declaration of 'Minisat::Lit Minisat::mkLit(Minisat::Var, bool)' specifies default arguments and isn't the only declaration [-fpermissive]
   58 | inline  Lit  mkLit     (Var var, bool sign) { Lit p; p.x = var + var + (int)sign; return p; }
      |              ^~~~~
../core/SolverTypes.h:50:16: note: previous declaration of 'Minisat::Lit Minisat::mkLit(Minisat::Var, bool)'
   50 |     friend Lit mkLit(Var var, bool sign = false);
      |                ^~~~~
/build/source/core/Aiger2Spec.cc: In function 'void aiger_LoadSpec(const char*, int, int, int, int, int, int, int&, Clauses&, Clauses&, Clauses&, Clauses&)':
/build/source/core/Aiger2Spec.cc:605:5: warning: this 'else' clause does not guard... [-Wmisleading-indentation]
  605 |     else ; // undefined = no constraint
      |     ^~~~
/build/source/core/Aiger2Spec.cc:608:4: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'else'
  608 |    if (refs[lit])
      |    ^~
In file included from ../core/Aiger2Spec.h:24,
                 from /build/source/core/Aiger2Spec.cc:42:
../mtl/Vec.h: In instantiation of 'void Minisat::vec<T>::capacity(int) [with T = Minisat::vec<Minisat::Lit>]':
../mtl/Vec.h:128:13:   required from 'void Minisat::vec<T>::growTo(int) [with T = Minisat::vec<Minisat::Lit>]'
../mtl/Vec.h:86:48:   required from 'void Minisat::vec<T>::push(const T&) [with T = Minisat::vec<Minisat::Lit>]'
/build/source/core/Aiger2Spec.cc:135:32:   required from here
../mtl/Vec.h:112:54: warning: 'void* realloc(void*, size_t)' moving an object of non-trivially copyable type 'class Minisat::vec<Minisat::Lit>'; use 'new' and 'delete' instead [-Wclass-memaccess]
  112 |     if (add > INT_MAX - cap || ((data = (T*)::realloc(data, (cap += add) * sizeof(T))) == NULL) && errno == ENOMEM)
      |                                             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../core/Aiger2Spec.h:24,
                 from /build/source/core/Aiger2Spec.cc:42:
../mtl/Vec.h:44:7: note: 'class Minisat::vec<Minisat::Lit>' declared here
   44 | class vec {
      |       ^~~
make: *** [../mtl/template.mk:72: /build/source/core/Aiger2Spec.o] Error 1

@stale
Copy link

stale bot commented Jul 23, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jul 23, 2021
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Apr 1, 2022
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 1, 2022
@Artturin Artturin closed this Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants