Skip to content

Commit

Permalink
Add greeting example.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronbembenek committed Aug 31, 2022
1 parent 4e46dc5 commit d803d8a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions examples/greeting.flg
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
(*-
* #%L
* Formulog
* %%
* Copyright (C) 2018 - 2019 President and Fellows of Harvard College
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*)

@edb rel entity(string)
entity("Alice").
entity("Bob").
entity("World").

rel greeting(string)
greeting(Y) :-
entity(X),
some(M) = get_model([`#y[string] #= str_concat("Hello, ", X)`], none),
some(Y) = query_model(#y[string], M).

0 comments on commit d803d8a

Please sign in to comment.