Skip to content

Instantly share code, notes, and snippets.

@robsimmons
Created May 8, 2011 16:23
Show Gist options
  • Save robsimmons/961475 to your computer and use it in GitHub Desktop.
Save robsimmons/961475 to your computer and use it in GitHub Desktop.
Example of interacting with L10 EdgePath1 program.
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