src/Tools/Metis/src/Problem.sml
changeset 39443 e330437cd22a
parent 39353 7f11d833d65b
child 39444 beabb8443ee4
equal deleted inserted replaced
39434:844a9ec44858 39443:e330437cd22a
     1 (* ========================================================================= *)
     1 (* ========================================================================= *)
     2 (* CNF PROBLEMS                                                              *)
     2 (* CNF PROBLEMS                                                              *)
     3 (* Copyright (c) 2001-2008 Joe Hurd, distributed under the BSD License       *)
     3 (* Copyright (c) 2001 Joe Hurd, distributed under the MIT license            *)
     4 (* ========================================================================= *)
     4 (* ========================================================================= *)
     5 
     5 
     6 structure Problem :> Problem =
     6 structure Problem :> Problem =
     7 struct
     7 struct
     8 
     8 
    27       fun typedSyms (cl,n) = n + LiteralSet.typedSymbols cl
    27       fun typedSyms (cl,n) = n + LiteralSet.typedSymbols cl
    28 
    28 
    29       val cls = toClauses prob
    29       val cls = toClauses prob
    30     in
    30     in
    31       {clauses = length cls,
    31       {clauses = length cls,
    32        literals = foldl lits 0 cls,
    32        literals = List.foldl lits 0 cls,
    33        symbols = foldl syms 0 cls,
    33        symbols = List.foldl syms 0 cls,
    34        typedSymbols = foldl typedSyms 0 cls}
    34        typedSymbols = List.foldl typedSyms 0 cls}
    35     end;
    35     end;
    36 
    36 
    37 fun freeVars {axioms,conjecture} =
    37 fun freeVars {axioms,conjecture} =
    38     NameSet.union
    38     NameSet.union
    39       (LiteralSet.freeVarsList axioms)
    39       (LiteralSet.freeVarsList axioms)