language: Prolog (gnu) (gprolog-1.3.1)
date: 246 days 23 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
% Input predicates, which represent the state of the system at one point:
%
% installed(Package, Root) - package Package is physically present in root Root.
% d_HDEPEND(Package, DependPackage) - Package has a HDEPEND on DependPackage
% d_RDEPEND(Package, DependPackage) - ... has RDEPEND ... 
% d_DEPEND(Package, DependPackage) 
% d_PDEPEND(Package, DependPackage)
% d_BADEPEND(Package, DependPackage)
% d_IDEPEND(Package, DependPackage) 
 
% package Package is installed in root Root and has RDEPENDs satisfied
installed_correctly(Package, Root) :-
    % must be physically installed
    installed(Package, Root),
    % all RDEPENDs must be installed correctly
    forall(d_RDEPEND(Package, RunDependPackage),
        installed_correctly(RunDependPackage, Root)).    
 
% package Package is installed correctly and all PDEPENDs are satisfied
installed_completely(Package, Root) :-
    % must be physically installed
    installed(Package, Root),
    % all RDEPENDs must be installed completely
    forall(d_RDEPEND(Package, RunDependPackage),
        installed_completely(RunDependPackage, Root)),
    % all PDEPENDs must be installed completely
    forall(d_PDEPEND(Package, PostDependPackage),
        installed_completely(PostDependPackage, Root)).
 
% package Package for root Root can be built right now
can_be_built(Package, Root) :-
    % all HDEPENDs are satisfied
    forall(d_HDEPEND(Package, HostDependPackage),
        installed_correctly(HostDependPackage, '/')), % should this be installed_completely()?
    % all DEPENDs are satisfied
    forall(d_DEPEND(Package, DependPackage),
        can_be_built_against(DependPackage, Root)).
 
% package Package in root Root can be built against, i.e. successfully used
% within a DEPEND.
can_be_built_against(Package, Root) :-
    % must be installed correctly
    installed_correctly(Package, Root),
    % all its BADEPENDs must be able to be built against
    forall(d_BADEPEND(Package, BuildAgainstPackage),
        can_be_built_against(BuildAgainstPackage, Root)).
 
% package Package has install dependencies satisfied for
% installing or removing from root Root
install_deps_satisfied(Package, Root) :-
    forall(d_IDEPEND(Package, InstallDependPackage),
        installed_correctly(InstallDependPackage, '/')). % should this be installed_completely()?
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