fork download
  1. % Input predicates, which represent the state of the system at one point:
  2. %
  3. % installed(Package, Root) - package Package is physically present in root Root.
  4. % d_HDEPEND(Package, DependPackage) - Package has a HDEPEND on DependPackage
  5. % d_RDEPEND(Package, DependPackage) - ... has RDEPEND ...
  6. % d_DEPEND(Package, DependPackage)
  7. % d_PDEPEND(Package, DependPackage)
  8. % d_BADEPEND(Package, DependPackage)
  9. % d_IDEPEND(Package, DependPackage)
  10.  
  11. % package Package is installed in root Root and has RDEPENDs satisfied
  12. installed_correctly(Package, Root) :-
  13. % must be physically installed
  14. installed(Package, Root),
  15. % all RDEPENDs must be installed correctly
  16. forall(d_RDEPEND(Package, RunDependPackage),
  17. installed_correctly(RunDependPackage, Root)).
  18.  
  19. % package Package is installed correctly and all PDEPENDs are satisfied
  20. installed_completely(Package, Root) :-
  21. % must be physically installed
  22. installed(Package, Root),
  23. % all RDEPENDs must be installed completely
  24. forall(d_RDEPEND(Package, RunDependPackage),
  25. installed_completely(RunDependPackage, Root)),
  26. % all PDEPENDs must be installed completely
  27. forall(d_PDEPEND(Package, PostDependPackage),
  28. installed_completely(PostDependPackage, Root)).
  29.  
  30. % package Package for root Root can be built right now
  31. can_be_built(Package, Root) :-
  32. % all HDEPENDs are satisfied
  33. forall(d_HDEPEND(Package, HostDependPackage),
  34. installed_correctly(HostDependPackage, '/')), % should this be installed_completely()?
  35. % all DEPENDs are satisfied
  36. forall(d_DEPEND(Package, DependPackage),
  37. can_be_built_against(DependPackage, Root)).
  38.  
  39. % package Package in root Root can be built against, i.e. successfully used
  40. % within a DEPEND.
  41. can_be_built_against(Package, Root) :-
  42. % must be installed correctly
  43. installed_correctly(Package, Root),
  44. % all its BADEPENDs must be able to be built against
  45. forall(d_BADEPEND(Package, BuildAgainstPackage),
  46. can_be_built_against(BuildAgainstPackage, Root)).
  47.  
  48. % package Package has install dependencies satisfied for
  49. % installing or removing from root Root
  50. install_deps_satisfied(Package, Root) :-
  51. forall(d_IDEPEND(Package, InstallDependPackage),
  52. installed_correctly(InstallDependPackage, '/')). % should this be installed_completely()?
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.pl:50-52: warning: singleton variables [Root] for install_deps_satisfied/2
/home/wXPf6v/gplcWAInmb.o: In function `predicate(installed_correctly/2)':
(.text+0x4b): undefined reference to `predicate(installed/2)'
/home/wXPf6v/gplcWAInmb.o: In function `predicate(installed_correctly/2)':
(.text+0xb1): undefined reference to `predicate(forall/2)'
/home/wXPf6v/gplcWAInmb.o: In function `predicate(installed_completely/2)':
(.text+0xfb): undefined reference to `predicate(installed/2)'
/home/wXPf6v/gplcWAInmb.o: In function `predicate(installed_completely/2)':
(.text+0x16a): undefined reference to `predicate(forall/2)'
/home/wXPf6v/gplcWAInmb.o: In function `predicate(installed_completely/2)':
(.text+0x1d4): undefined reference to `predicate(forall/2)'
/home/wXPf6v/gplcWAInmb.o: In function `predicate(can_be_built/2)':
(.text+0x267): undefined reference to `predicate(forall/2)'
/home/wXPf6v/gplcWAInmb.o: In function `predicate(can_be_built/2)':
(.text+0x2d1): undefined reference to `predicate(forall/2)'
/home/wXPf6v/gplcWAInmb.o: In function `predicate(can_be_built_against/2)':
(.text+0x385): undefined reference to `predicate(forall/2)'
/home/wXPf6v/gplcWAInmb.o:(.text+0x3f9): more undefined references to `predicate(forall/2)' follow
collect2: ld returned 1 exit status
compilation failed
stdout
Standard output is empty