
Hi All, I am stuck in converting the transition semantics in Haskell. Please let me know how to define memory data types in Haskell( like we define pointer in C). Prompt help would be greatly appreciated. Sincerely, Akshay _________________________________________________________________ Get back to school stuff for them and cashback for you. http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1

On Sun, Sep 6, 2009 at 11:22 PM, Akshay Dave
Hi All, I am stuck in converting the transition semantics in Haskell. Please let me know how to define memory data types in Haskell( like we define pointer in C). Prompt help would be greatly appreciated.
I'm sorry, but I can't understand your question. Do you want to interface with C or another language using the FFI interface? Or are you asking about a feature of pure Haskell code? If you're asking about pure Haskell, I'm going to guess the answer is "you can't", or use eg. IORef, MArray, for impure types. (But I discourage their use) If you give us more information about what problem you are trying to solve, we can be of more help. Luke

Hi, Thanks for your prompt reply. Actually I am trying to convert the following transitive semantics to Haskell: (Memory maps I to Z) lookup m i = <current value of i> ( meaning lookup for I in memory m) evB b m = true/(while b do c od;m) -> (c; while b do c od;m) I have written the boolean expression and statement part but I am not able to write the memory representation in Haskell. Hope above explanation helps. Cheers! Akshay
Date: Sun, 6 Sep 2009 23:29:27 -0600 Subject: Re: [Haskell-cafe] How to Create Data Type of memory From: lrpalmer@gmail.com To: akshay.v.dave@hotmail.com CC: haskell-cafe@haskell.org
On Sun, Sep 6, 2009 at 11:22 PM, Akshay Dave
wrote: Hi All, I am stuck in converting the transition semantics in Haskell. Please let me know how to define memory data types in Haskell( like we define pointer in C). Prompt help would be greatly appreciated.
I'm sorry, but I can't understand your question. Do you want to interface with C or another language using the FFI interface? Or are you asking about a feature of pure Haskell code? If you're asking about pure Haskell, I'm going to guess the answer is "you can't", or use eg. IORef, MArray, for impure types. (But I discourage their use)
If you give us more information about what problem you are trying to solve, we can be of more help.
Luke
_________________________________________________________________ Get back to school stuff for them and cashback for you. http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1

On Sun, Sep 6, 2009 at 11:45 PM, Akshay Dave
Hi, Thanks for your prompt reply. Actually I am trying to convert the following transitive semantics to Haskell:
(Memory maps I to Z) lookup m i = <current value of i> ( meaning lookup for I in memory m)
evB b m = true/(while b do c od;m) -> (c; while b do c od;m)
I have written the boolean expression and statement part but I am not able to write the memory representation in Haskell.
Ah, if you're trying to implement a semantics (emphasis on understandability and correctness), I suggest Data.Map. import qualified Data.Map as Map Map.lookup 2 (Map.insert 1 "x" (Map.insert 2 "y" Map.empty)) -- "y" Luke

Hi Luke, Thanks for your prompt response. I'll try to implement the same for my semantics! Cheers! Akshay
Date: Mon, 7 Sep 2009 00:12:14 -0600 Subject: Re: [Haskell-cafe] How to Create Data Type of memory From: lrpalmer@gmail.com To: akshay.v.dave@hotmail.com CC: haskell-cafe@haskell.org
On Sun, Sep 6, 2009 at 11:45 PM, Akshay Dave
wrote: Hi, Thanks for your prompt reply. Actually I am trying to convert the following transitive semantics to Haskell:
(Memory maps I to Z) lookup m i = <current value of i> ( meaning lookup for I in memory m)
evB b m = true/(while b do c od;m) -> (c; while b do c od;m)
I have written the boolean expression and statement part but I am not able to write the memory representation in Haskell.
Ah, if you're trying to implement a semantics (emphasis on understandability and correctness), I suggest Data.Map.
import qualified Data.Map as Map Map.lookup 2 (Map.insert 1 "x" (Map.insert 2 "y" Map.empty)) -- "y"
Luke
_________________________________________________________________ Hotmail® is up to 70% faster. Now good news travels really fast. http://windowslive.com/online/hotmail?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:W...
participants (2)
-
Akshay Dave
-
Luke Palmer