sample-ghci-script revision 8fd7d86240056fe52b97c810b6beb0360c8ee16e
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim-- show all types
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon KimJust (ln,libenv)<-process "../Hets-lib/Basic/Numbers.casl" -- load CASL library
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimlet Just libNumbers = Map.lookup ln libenv -- get library Numbers
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimlet Just entryNat = Map.lookup (mkSimpleId "Nat") (globalEnv libNumbers) -- get entry for "Nat" in global environment
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimlet SpecEntry gensigNat = entryNat -- Nat is a specification...
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimlet (_,_,_,nodeSigNat) = gensigNat -- extract the nodeSig for the body
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimlet gSignNat = getSig nodeSigNat -- get the Grothendieck signature
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimlet Just sigNat = case gSignNat of (G_sign lid x _) -> coerceSign lid CASL "" x
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim-- coerce the Grothendieck signature to be a CASL signature
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimlet opsNat = opMap sigNat -- extract the operation symbols
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimlet Just zeroProfile = Map.lookup (stringToId "0") opsNat -- lookup the type of 0
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon KimzeroProfile -- and print it
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimlet nodeNat = getNode nodeSigNat -- get development graph node index for Nat
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimlet dgNodeLabNat = lab' $ contextDG libNumbers nodeNat -- get node label for Nat
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimlet gtheoryNat = dgn_theory dgNodeLabNat -- get G_theory for Nat
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimlet Just sensNat = case gtheoryNat of G_theory lid _ _ s _ -> coerceThSens lid CASL "" s
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kim-- extract CASL sentences from theory
ac88567a7a5bb7f01cf22cf366bc9d6203e24d7aHyon Kimlet Just power_Nat = Map.lookup "power_Nat" sensNat -- get formula named power_Nat