Created
May 8, 2011 16:23
-
-
Save robsimmons/961475 to your computer and use it in GitHub Desktop.
Example of interacting with L10 EdgePath1 program.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
structure Edge:> sig | |
(* Asserts some number of less-than relationships between identifiers *) | |
val addRelationships: (string * string) list -> unit | |
(* Returns true if two identifiers are related *) | |
val related: string * string -> bool | |
end = struct | |
open Symbol | |
fun addRelationships comps = | |
let | |
fun assert1 (s1, s2) = EdgeTables.assertEdge(symbol s1, symbol s2) | |
in | |
app assert1 comps | |
; ignore (EdgeSearch.saturateW1 EdgeTerms.MapWorld.empty) | |
end | |
fun related (s1, s2) = | |
let val arg = (symbol s1, symbol s2) in | |
case EdgeTables.path_0_lookup (!EdgeTables.path_0, arg) of | |
[] => false | |
| _ => true | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment