using Nemerle.Profiling set namespace Fx7 public class Literal public atom : Atom public is_neg : bool public mutable bg_asserted : bool public IsNeg : bool get { is_neg } public IsPos : bool get { ! is_neg } public this (atom : Atom, is_neg : bool) this.atom = atom this.is_neg = is_neg assert (atom.GetLiteral (is_neg) == null) public override ToString () : string if (is_neg) $ "(not $atom)" else atom.ToString () public ToSimplString () : string if (is_neg) $ "(NOT $(atom.ToSimplString()))" else atom.ToSimplString () public ToTerm (c : Core) : Term def a = atom.ToTerm (c) if (is_neg) c.TermPool.Get ("not", [a]) else a public static @~ (n : Literal) : Literal n.atom.GetLiteral (! n.is_neg) public override GetHashCode () : int unchecked atom.GetHashCode () ^ if (is_neg) 92873 else 0 [Nemerle.OverrideObjectEquals] \ public Equals (that : Literal) : bool is_neg == that.is_neg && atom.Equals (that.atom)